diff mbox series

[2/3] scsi: ufs: Exynos: Fix the maximum segment size

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

Commit Message

Bart Van Assche Jan. 6, 2023, 9:57 p.m. UTC
Prepare for enabling DMA clustering and also for supporting
PAGE_SIZE != 4096 by declaring explicitly that the maximum segment
size is 4096 bytes for Exynos UFS host controllers.

Cc: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/host/ufs-exynos.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Alim Akhtar Jan. 11, 2023, 6:21 a.m. UTC | #1
Hi Bart

>-----Original Message-----
>From: Bart Van Assche [mailto:bvanassche@acm.org]
>Sent: Saturday, January 7, 2023 3:28 AM
>To: Martin K . Petersen <martin.petersen@oracle.com>
>Cc: Jaegeuk Kim <jaegeuk@kernel.org>; Avri Altman
><avri.altman@wdc.com>; Adrian Hunter <adrian.hunter@intel.com>; linux-
>scsi@vger.kernel.org; Bart Van Assche <bvanassche@acm.org>; Kiwoong Kim
><kwmad.kim@samsung.com>; James E.J. Bottomley <jejb@linux.ibm.com>;
>Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>; Chanho Park
><chanho61.park@samsung.com>; Alim Akhtar <alim.akhtar@samsung.com>;
>Bean Huo <beanhuo@micron.com>
>Subject: [PATCH 2/3] scsi: ufs: Exynos: Fix the maximum segment size
>
>Prepare for enabling DMA clustering and also for supporting PAGE_SIZE !=
>4096 by declaring explicitly that the maximum segment size is 4096 bytes
for
>Exynos UFS host controllers.
>
>Cc: Kiwoong Kim <kwmad.kim@samsung.com>
>Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>---

Thanks!

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

Tested on platforms containing Exynos HCI, so feel free to add

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


For some reason, I didn't receive you patch-3/3 in my inbox.

> drivers/ufs/host/ufs-exynos.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
>index 3cdac89a28b8..821c000ca6b0 100644
>--- a/drivers/ufs/host/ufs-exynos.c
>+++ b/drivers/ufs/host/ufs-exynos.c
>@@ -1586,15 +1586,21 @@ static int exynos_ufs_probe(struct
>platform_device *pdev)
> 	const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops;
> 	const struct exynos_ufs_drv_data *drv_data =
> 		device_get_match_data(dev);
>+	struct ufs_hba *hba;
>
> 	if (drv_data && drv_data->vops)
> 		vops = drv_data->vops;
>
> 	err = ufshcd_pltfrm_init(pdev, vops);
>-	if (err)
>+	if (err) {
> 		dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err);
>+		return err;
>+	}
>+
>+	hba = dev_get_drvdata(dev);
>+	hba->host->max_segment_size = 4096;
>
>-	return err;
>+	return 0;
> }
>
> static int exynos_ufs_remove(struct platform_device *pdev)
Bart Van Assche Jan. 12, 2023, 10:37 p.m. UTC | #2
On 1/10/23 22:21, Alim Akhtar wrote:
> For some reason, I didn't receive you patch-3/3 in my inbox.

That's unfortunate. That's probably because I use a shell script to 
generate the Cc-list for UFS driver patches:

scripts/get_maintainer.pl --no-git --no-l --no-r --no-roles 
--no-rolestats "${1:-&STDIN}"

Anyway, patch 3/3 is available here: 
https://lore.kernel.org/linux-scsi/20230106215800.2249344-4-bvanassche@acm.org/

Bart.
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 3cdac89a28b8..821c000ca6b0 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -1586,15 +1586,21 @@  static int exynos_ufs_probe(struct platform_device *pdev)
 	const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops;
 	const struct exynos_ufs_drv_data *drv_data =
 		device_get_match_data(dev);
+	struct ufs_hba *hba;
 
 	if (drv_data && drv_data->vops)
 		vops = drv_data->vops;
 
 	err = ufshcd_pltfrm_init(pdev, vops);
-	if (err)
+	if (err) {
 		dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err);
+		return err;
+	}
+
+	hba = dev_get_drvdata(dev);
+	hba->host->max_segment_size = 4096;
 
-	return err;
+	return 0;
 }
 
 static int exynos_ufs_remove(struct platform_device *pdev)