diff --git a/drivers/block/tegra_virt_storage/tegra_hv_vblk.c b/drivers/block/tegra_virt_storage/tegra_hv_vblk.c index fd24f836..fc83a988 100644 --- a/drivers/block/tegra_virt_storage/tegra_hv_vblk.c +++ b/drivers/block/tegra_virt_storage/tegra_hv_vblk.c @@ -1164,7 +1164,9 @@ static void setup_device(struct vblk_dev *vblkdev) vblkdev->max_requests = max_requests; vblkdev->max_ioctl_requests = max_ioctl_requests; +#if defined(NV_BLK_QUEUE_MAX_HW_SECTORS_PRESENT) /* Removed in Linux v6.10 */ blk_queue_max_hw_sectors(vblkdev->queue, max_io_bytes / SECTOR_SIZE); +#endif blk_queue_flag_set(QUEUE_FLAG_NONROT, vblkdev->queue); if ((vblkdev->config.blk_config.req_ops_supported & VS_BLK_SECURE_ERASE_OP_F) diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 3e8d04cd..d23b2251 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -93,6 +93,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_execute_rq_has_no_gendisk_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_disk_for_queue NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_queue NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_destroy_queue +NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_queue_max_hw_sectors NV_CONFTEST_FUNCTION_COMPILE_TESTS += block_device_operations_open_has_gendisk_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += block_device_operations_release_has_no_mode_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_remove_has_int_return_type diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 4a3d6183..e2107072 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6539,6 +6539,23 @@ compile_test() { compile_check_conftest "$CODE" "NV_BLK_MQ_DESTROY_QUEUE_PRESENT" "" "functions" ;; + blk_queue_max_hw_sectors) + # + # Determine whether function blk_queue_max_hw_sectors() is present. + # + # Commit ec84ca4025c0 ("scsi: block: Remove now unused queue limits + # helpers") removed the function blk_queue_max_hw_sectors() in Linux + # v6.10. + # + CODE=" + #include + void conftest_blk_queue_max_hw_sectors(void) { + blk_queue_max_hw_sectors(); + }" + + compile_check_conftest "$CODE" "NV_BLK_QUEUE_MAX_HW_SECTORS_PRESENT" "" "functions" + ;; + block_device_operations_open_has_gendisk_arg) # # Determine if the 'open' function pointer from the