diff --git a/drivers/block/tegra_virt_storage/tegra_hv_vblk.c b/drivers/block/tegra_virt_storage/tegra_hv_vblk.c index 7186b125..cb453e92 100644 --- a/drivers/block/tegra_virt_storage/tegra_hv_vblk.c +++ b/drivers/block/tegra_virt_storage/tegra_hv_vblk.c @@ -534,8 +534,12 @@ static bool submit_bio_req(struct vblk_dev *vblkdev) } sg_init_table(vsc_req->sg_lst, bio_req->nr_phys_segments); +#if defined(NV_BLK_RQ_MAP_SG_HAS_NO_QUEUE_ARG) /* Linux v6.15 */ + sg_cnt = blk_rq_map_sg(bio_req, vsc_req->sg_lst); +#else sg_cnt = blk_rq_map_sg(vblkdev->queue, bio_req, vsc_req->sg_lst); +#endif vsc_req->sg_num_ents = sg_nents(vsc_req->sg_lst); if (dma_map_sg(vblkdev->device, vsc_req->sg_lst, vsc_req->sg_num_ents, DMA_BIDIRECTIONAL) == 0) { diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 7db7577b..74e3e042 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -98,6 +98,7 @@ 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 += blk_rq_map_sg_has_no_queue_arg 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_match_has_const_drv_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index ca473c47..e1086486 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6708,6 +6708,25 @@ compile_test() { "NV_BLOCK_DEVICE_OPERATIONS_RELEASE_HAS_NO_MODE_ARG" "" "types" ;; + blk_rq_map_sg_has_no_queue_arg) + # + # Determine if blk_rq_map_sg() no longer takes a request_queue parameter. + # + # Commit 75618ac6e98f ("block: remove unused parameter 'q' parameter + # in __blk_rq_map_sg()") removed the 'request_queue' parameter from the + # function blk_rq_map_sg() in Linux v6.15. + # + CODE=" + #include + + int conftest_blk_rq_map_sg_has_no_queue_arg(struct request *rq, + struct scatterlist *sg) { + return blk_rq_map_sg(rq, sg); + }" + + compile_check_conftest "$CODE" "NV_BLK_RQ_MAP_SG_HAS_NO_QUEUE_ARG" "" "types" + ;; + bus_type_struct_match_has_const_drv_arg) # # Determine if the 'match' callback from the 'bus_type' structure