From: Gleb C. <lna...@ya...> - 2024-07-08 10:48:06
|
Commit: c3bd33a GitHub URL: https://github.com/SCST-project/scst/commit/c3bd33a34f88180af97069db496590760d8c5030 Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- qla2x00t-32gbit, scst_local: Port to Linux kernel v6.10 Support for the following scsi layer changes in the Linux kernel v6.10: - 5b7dfbeff92a ("scsi: core: Add a dma_alignment field to the host and host template") Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 7 +++++++ scst_local/scst_local.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 20742d2..d0d3bae 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -2002,8 +2002,10 @@ qla2xxx_slave_configure(struct scsi_device *sdev) scsi_qla_host_t *vha = shost_priv(sdev->host); struct req_que *req = vha->req; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (IS_T10_PI_CAPABLE(vha->hw)) blk_queue_update_dma_alignment(sdev->request_queue, 0x7); +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) scsi_adjust_queue_depth(sdev, 0, req->max_q_depth); @@ -3637,6 +3639,11 @@ skip_dpc: QLA_SG_ALL : 128; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + if (IS_T10_PI_CAPABLE(base_vha->hw)) + host->dma_alignment = 0x7; +#endif + ret = scsi_add_host(host, &pdev->dev); if (ret) goto probe_failed; diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index a8bf14b..6cd11f7 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1048,12 +1048,14 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) /* * vdisk_blockio requires that data buffers have block_size alignment * and supports block sizes from 512 up to 4096. See also * https://github.com/sahlberg/libiscsi/issues/302. */ - blk_queue_dma_alignment(q, 4095); + blk_queue_dma_alignment(q, (4096 - 1)); +#endif return 0; } @@ -1379,6 +1381,9 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + .dma_alignment = (4096 - 1), +#endif .slave_alloc = scst_local_slave_alloc, .slave_configure = scst_local_slave_configure, .eh_abort_handler = scst_local_abort, |