Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
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>,
	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>,
	Bean Huo <beanhuo@micron.com>
Subject: [PATCH v2 2/3] scsi: ufs: Exynos: Fix the maximum segment size
Date: Thu, 12 Jan 2023 15:42:14 -0800	[thread overview]
Message-ID: <20230112234215.2630817-3-bvanassche@acm.org> (raw)
In-Reply-To: <20230112234215.2630817-1-bvanassche@acm.org>

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. Add this code
in exynos_ufs_hce_enable_notify() such that it happens after
scsi_host_alloc() and before __scsi_init_queue() is called by the
LUN scanning code.

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/host/ufs-exynos.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 3cdac89a28b8..7c985fc38db1 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -1300,6 +1300,14 @@ static int exynos_ufs_hce_enable_notify(struct ufs_hba *hba,
 
 	switch (status) {
 	case PRE_CHANGE:
+		/*
+		 * The maximum segment size must be set after scsi_host_alloc()
+		 * has been called and before LUN scanning starts
+		 * (ufshcd_async_scan()). Note: this callback may also be called
+		 * from other functions than ufshcd_init().
+		 */
+		hba->host->max_segment_size = 4096;
+
 		if (ufs->drv_data->pre_hce_enable) {
 			ret = ufs->drv_data->pre_hce_enable(ufs);
 			if (ret)

  parent reply	other threads:[~2023-01-12 23:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 23:42 [PATCH v2 0/3] Enable DMA clustering in the UFS driver Bart Van Assche
2023-01-12 23:42 ` [PATCH v2 1/3] scsi: ufs: Exynos: Fix DMA alignment for PAGE_SIZE != 4096 Bart Van Assche
2023-01-12 23:42 ` Bart Van Assche [this message]
2023-01-18 23:30   ` [PATCH v2 2/3] scsi: ufs: Exynos: Fix the maximum segment size Martin K. Petersen
2023-01-19 16:49   ` Alim Akhtar
2023-01-12 23:42 ` [PATCH v2 3/3] scsi: ufs: Enable DMA clustering Bart Van Assche
2023-01-19 16:51   ` Alim Akhtar
2023-01-24  2:39 ` [PATCH v2 0/3] Enable DMA clustering in the UFS driver Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230112234215.2630817-3-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=beanhuo@micron.com \
    --cc=chanho61.park@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox