mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
block: virtual-storage: Allow build for Linux v6.10
The function blk_queue_max_hw_sectors() was removed in Linux v6.10 and so add a test to conftest to see if this function is present or not to allow the driver to build. The virtual-storage driver is currently broken for Linux v5.19+ kernel due to other incompatibilities with these newer kernels, but has been updated so that it still builds. Therefore, allow the driver to build for Linux v6.10 while the driver is fixed properly for these newer kernels. Bug 4311184 Bug 4593750 Change-Id: Ic4054c87acdf3c77f03ff94fbdde513d84fe229b Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142216 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
6255ffef44
commit
c73cf3c92a
@@ -1164,7 +1164,9 @@ static void setup_device(struct vblk_dev *vblkdev)
|
|||||||
|
|
||||||
vblkdev->max_requests = max_requests;
|
vblkdev->max_requests = max_requests;
|
||||||
vblkdev->max_ioctl_requests = max_ioctl_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);
|
blk_queue_max_hw_sectors(vblkdev->queue, max_io_bytes / SECTOR_SIZE);
|
||||||
|
#endif
|
||||||
blk_queue_flag_set(QUEUE_FLAG_NONROT, vblkdev->queue);
|
blk_queue_flag_set(QUEUE_FLAG_NONROT, vblkdev->queue);
|
||||||
|
|
||||||
if ((vblkdev->config.blk_config.req_ops_supported & VS_BLK_SECURE_ERASE_OP_F)
|
if ((vblkdev->config.blk_config.req_ops_supported & VS_BLK_SECURE_ERASE_OP_F)
|
||||||
|
|||||||
@@ -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_disk_for_queue
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_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_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_open_has_gendisk_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += block_device_operations_release_has_no_mode_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
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_remove_has_int_return_type
|
||||||
|
|||||||
@@ -6539,6 +6539,23 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_BLK_MQ_DESTROY_QUEUE_PRESENT" "" "functions"
|
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 <linux/blk-mq.h>
|
||||||
|
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)
|
block_device_operations_open_has_gendisk_arg)
|
||||||
#
|
#
|
||||||
# Determine if the 'open' function pointer from the
|
# Determine if the 'open' function pointer from the
|
||||||
|
|||||||
Reference in New Issue
Block a user