mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
blk: vblk: Fix build for Linux v6.15
In Linux v6.15, the 'request_queue' parameter was removed from the function blk_rq_map_sg(). Add a conftest to check for this and update the Tegra HV VBLK driver accordingly. JIRA LINQPJ14-47 Change-Id: I140200fe7acbaebb383abd7939153178f0ca484a Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330664 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Gokul Vasan L J <gokull@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -591,8 +591,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) {
|
||||
|
||||
@@ -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 += queue_limits_struct_has_features
|
||||
|
||||
@@ -6733,6 +6733,25 @@ compile_test() {
|
||||
"NV_BLK_MQ_F_SHOULD_MERGE" "" "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 <linux/blk-mq.h>
|
||||
|
||||
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"
|
||||
;;
|
||||
|
||||
queue_limits_struct_has_features)
|
||||
#
|
||||
# Determine if the 'queue_limits' needs to use
|
||||
|
||||
Reference in New Issue
Block a user