diff mbox series

[08/23] ufs-exynos: move setting the the dma alignment to the init method

Message ID 20240324235448.2039074-9-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/23] block: don't reject too large max_user_setors in blk_validate_limits | expand

Commit Message

Christoph Hellwig March 24, 2024, 11:54 p.m. UTC
Use the SCSI host's dma_alignment field and set it in ->init and remove
the now unused config_scsi_dev method.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/ufs/core/ufshcd.c     | 3 ---
 drivers/ufs/host/ufs-exynos.c | 8 ++------
 include/ufs/ufshcd.h          | 1 -
 3 files changed, 2 insertions(+), 10 deletions(-)

Comments

Damien Le Moal March 25, 2024, 7:31 a.m. UTC | #1
On 3/25/24 08:54, Christoph Hellwig wrote:
> Use the SCSI host's dma_alignment field and set it in ->init and remove
> the now unused config_scsi_dev method.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks OK to me.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Bart Van Assche March 25, 2024, 10:13 p.m. UTC | #2
On 3/24/24 16:54, Christoph Hellwig wrote:
> Use the SCSI host's dma_alignment field and set it in ->init and remove
> the now unused config_scsi_dev method.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Alim Akhtar March 26, 2024, 11:27 a.m. UTC | #3
Hi Christoph

> -----Original Message-----
> From: Christoph Hellwig <hch@lst.de>
> Sent: Monday, March 25, 2024 5:25 AM
> To: Jens Axboe <axboe@kernel.dk>; Martin K. Petersen
> <martin.petersen@oracle.com>
> Cc: Damien Le Moal <dlemoal@kernel.org>; Niklas Cassel
> <cassel@kernel.org>; Takashi Sakamoto <o-takashi@sakamocchi.jp>; Sathya
> Prakash <sathya.prakash@broadcom.com>; Sreekanth Reddy
> <sreekanth.reddy@broadcom.com>; Suganath Prabu Subramani <suganath-
> prabu.subramani@broadcom.com>; Juergen E. Fischer <fischer@norbit.de>;
> Xiang Chen <chenxiang66@hisilicon.com>; HighPoint Linux Team
> <linux@highpoint-tech.com>; Tyrel Datwyler <tyreld@linux.ibm.com>; Brian
> King <brking@us.ibm.com>; Lee Duncan <lduncan@suse.com>; Chris Leech
> <cleech@redhat.com>; Mike Christie <michael.christie@oracle.com>; John
> Garry <john.g.garry@oracle.com>; Jason Yan <yanaijie@huawei.com>;
> Kashyap Desai <kashyap.desai@broadcom.com>; Sumit Saxena
> <sumit.saxena@broadcom.com>; Shivasharan S
> <shivasharan.srikanteshwara@broadcom.com>; Chandrakanth patil
> <chandrakanth.patil@broadcom.com>; Jack Wang
> <jinpu.wang@cloud.ionos.com>; Nilesh Javali <njavali@marvell.com>; GR-
> QLogic-Storage-Upstream@marvell.com; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Alim Akhtar <alim.akhtar@samsung.com>;
> Avri Altman <avri.altman@wdc.com>; Bart Van Assche
> <bvanassche@acm.org>; Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org>; Alan Stern
> <stern@rowland.harvard.edu>; linux-block@vger.kernel.org; linux-
> ide@vger.kernel.org; linux1394-devel@lists.sourceforge.net; MPT-
> FusionLinux.pdl@broadcom.com; linux-scsi@vger.kernel.org; open-
> iscsi@googlegroups.com; megaraidlinux.pdl@broadcom.com; mpi3mr-
> linuxdrv.pdl@broadcom.com; linux-samsung-soc@vger.kernel.org; linux-
> usb@vger.kernel.org; usb-storage@lists.one-eyed-alien.net
> Subject: [PATCH 08/23] ufs-exynos: move setting the the dma alignment to
> the init method
> 
> Use the SCSI host's dma_alignment field and set it in ->init and remove
the
> now unused config_scsi_dev method.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>

>  drivers/ufs/core/ufshcd.c     | 3 ---
>  drivers/ufs/host/ufs-exynos.c | 8 ++------
>  include/ufs/ufshcd.h          | 1 -
>  3 files changed, 2 insertions(+), 10 deletions(-)
>
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index e30fd125988d7a..7d593395aeff25 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5262,9 +5262,6 @@  static int ufshcd_slave_configure(struct scsi_device *sdev)
 	 */
 	sdev->silence_suspend = 1;
 
-	if (hba->vops && hba->vops->config_scsi_dev)
-		hba->vops->config_scsi_dev(sdev);
-
 	ufshcd_crypto_register(hba, q);
 
 	return 0;
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 734d40f99e31e6..7ffc28e2278420 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -1187,6 +1187,8 @@  static int exynos_ufs_init(struct ufs_hba *hba)
 		goto out;
 	exynos_ufs_specify_phy_time_attr(ufs);
 	exynos_ufs_config_smu(ufs);
+
+	hba->host->dma_alignment = SZ_4K - 1;
 	return 0;
 
 out:
@@ -1510,11 +1512,6 @@  static int fsd_ufs_pre_link(struct exynos_ufs *ufs)
 	return 0;
 }
 
-static void exynos_ufs_config_scsi_dev(struct scsi_device *sdev)
-{
-	blk_queue_update_dma_alignment(sdev->request_queue, SZ_4K - 1);
-}
-
 static int fsd_ufs_post_link(struct exynos_ufs *ufs)
 {
 	int i;
@@ -1583,7 +1580,6 @@  static const struct ufs_hba_variant_ops ufs_hba_exynos_ops = {
 	.hibern8_notify			= exynos_ufs_hibern8_notify,
 	.suspend			= exynos_ufs_suspend,
 	.resume				= exynos_ufs_resume,
-	.config_scsi_dev		= exynos_ufs_config_scsi_dev,
 };
 
 static struct ufs_hba_variant_ops ufs_hba_exynosauto_vh_ops = {
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index cb2afcebbdf514..061919448d3936 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -373,7 +373,6 @@  struct ufs_hba_variant_ops {
 	int	(*get_outstanding_cqs)(struct ufs_hba *hba,
 				       unsigned long *ocqs);
 	int	(*config_esi)(struct ufs_hba *hba);
-	void	(*config_scsi_dev)(struct scsi_device *sdev);
 };
 
 /* clock gating state  */