diff mbox series

[v2,3/3] scsi: ufs: Enable DMA clustering

Message ID 20230112234215.2630817-4-bvanassche@acm.org
State New
Headers show
Series Enable DMA clustering in the UFS driver | expand

Commit Message

Bart Van Assche Jan. 12, 2023, 11:42 p.m. UTC
All UFS host controllers support DMA clustering. Hence enable DMA
clustering.

Notes:
- The max_segment_size parameter implements the 256 KiB limit for the
  PRDT. The dma_boundary parameter represents a boundary that must not
  be crossed by DMA scatter/gather lists. I'm not aware of any
  restrictions on DMA scatter/gather lists in the UFSHCI specification
  other than the 256 KiB limit for the PRDT and the 32-bit address
  restriction for controllers that only support 32-bits DMA. The latter
  restriction is already handled by ufshcd_set_dma_mask().
- Without patch "Exynos: Fix the maximum segment size", this patch
  breaks support for the Exynos controller.

The history of the dma_boundary parameter in the UFS driver is as
follows:
* The initial UFS driver did not set the dma_boundary parameter.
* Commit 4dd4130a722f ("scsi: make sure all drivers set the
  use_clustering flag") set the .use_clustering flag.
* Commit 4af14d113bcf ("scsi: remove the use_clustering flag") removed
  the use_clustering flag and set the dma_boundary parameter instead.

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Alim Akhtar Jan. 19, 2023, 4:51 p.m. UTC | #1
>-----Original Message-----
>From: Bart Van Assche [mailto:bvanassche@acm.org]
>Sent: Friday, January 13, 2023 5:12 AM
>To: Martin K . Petersen <martin.petersen@oracle.com>
>Cc: Jaegeuk Kim <jaegeuk@kernel.org>; linux-scsi@vger.kernel.org; Adrian
>Hunter <adrian.hunter@intel.com>; Alim Akhtar
><alim.akhtar@samsung.com>; Bart Van Assche <bvanassche@acm.org>; Avri
>Altman <avri.altman@wdc.com>; Kiwoong Kim <kwmad.kim@samsung.com>;
>James E.J. Bottomley <jejb@linux.ibm.com>; Bean Huo
><beanhuo@micron.com>; Stanley Chu <stanley.chu@mediatek.com>;
>Jinyoung Choi <j-young.choi@samsung.com>
>Subject: [PATCH v2 3/3] scsi: ufs: Enable DMA clustering
>
>All UFS host controllers support DMA clustering. Hence enable DMA
>clustering.
>
>Notes:
>- The max_segment_size parameter implements the 256 KiB limit for the
>  PRDT. The dma_boundary parameter represents a boundary that must not
>  be crossed by DMA scatter/gather lists. I'm not aware of any
>  restrictions on DMA scatter/gather lists in the UFSHCI specification
>  other than the 256 KiB limit for the PRDT and the 32-bit address
>  restriction for controllers that only support 32-bits DMA. The latter
>  restriction is already handled by ufshcd_set_dma_mask().
>- Without patch "Exynos: Fix the maximum segment size", this patch
>  breaks support for the Exynos controller.
>
>The history of the dma_boundary parameter in the UFS driver is as
>follows:
>* The initial UFS driver did not set the dma_boundary parameter.
>* Commit 4dd4130a722f ("scsi: make sure all drivers set the
>  use_clustering flag") set the .use_clustering flag.
>* Commit 4af14d113bcf ("scsi: remove the use_clustering flag") removed
>  the use_clustering flag and set the dma_boundary parameter instead.
>
>Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>Cc: Avri Altman <avri.altman@wdc.com>
>Cc: Alim Akhtar <alim.akhtar@samsung.com>
>Cc: Kiwoong Kim <kwmad.kim@samsung.com>
>Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>---

Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>


> drivers/ufs/core/ufshcd.c | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index
>5fdbc983ce2e..d28b44a1ffcf 100644
>--- a/drivers/ufs/core/ufshcd.c
>+++ b/drivers/ufs/core/ufshcd.c
>@@ -8460,7 +8460,6 @@ static struct scsi_host_template
>ufshcd_driver_template = {
> 	.max_host_blocked	= 1,
> 	.track_queue_depth	= 1,
> 	.sdev_groups		= ufshcd_driver_groups,
>-	.dma_boundary		= PAGE_SIZE - 1,
> 	.rpm_autosuspend_delay	= RPM_AUTOSUSPEND_DELAY_MS,
> };
>
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 5fdbc983ce2e..d28b44a1ffcf 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8460,7 +8460,6 @@  static struct scsi_host_template ufshcd_driver_template = {
 	.max_host_blocked	= 1,
 	.track_queue_depth	= 1,
 	.sdev_groups		= ufshcd_driver_groups,
-	.dma_boundary		= PAGE_SIZE - 1,
 	.rpm_autosuspend_delay	= RPM_AUTOSUSPEND_DELAY_MS,
 };