mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keoseong Park <keosung.park@samsung.com>
To: Avri Altman <avri.altman@wdc.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bean Huo <beanhuo@micron.com>,
	Stanley Chu <stanley.chu@mediatek.com>
Subject: RE: [PATCH v2] scsi: ufs: core: Do not open code SZ_x
Date: Wed, 31 May 2023 14:34:54 +0900	[thread overview]
Message-ID: <20230531053454epcms2p3f1905b079d3b624cf4e8d7c536690ed8@epcms2p3> (raw)
In-Reply-To: <20230531051713.2080-1-avri.altman@wdc.com>

>v1 -> v2: Attend UTMRD as well
>
>A tad cleanup - No functional change.
>
>Signed-off-by: Avri Altman <avri.altman@wdc.com>
>Reviewed-by: Bean Huo <beanhuo@micron.com>
>Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>

Reviewed-by: Keoseong Park <keosung.park@samsung.com>

Best Regards,
Keoseong

>---
> drivers/ufs/core/ufshcd.c | 10 +++++-----
> include/ufs/ufshci.h      |  2 +-
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
>index fdf5073c7c6c..10a10f8f0bd1 100644
>--- a/drivers/ufs/core/ufshcd.c
>+++ b/drivers/ufs/core/ufshcd.c
>@@ -2519,7 +2519,7 @@ static void ufshcd_sgl_to_prdt(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, int
> 			 * 11b to indicate Dword granularity. A value of '3'
> 			 * indicates 4 bytes, '7' indicates 8 bytes, etc."
> 			 */
>-			WARN_ONCE(len > 256 * 1024, "len = %#x\n", len);
>+			WARN_ONCE(len > SZ_256K, "len = %#x\n", len);
> 			prd->size = cpu_to_le32(len - 1);
> 			prd->addr = cpu_to_le64(sg->dma_address);
> 			prd->reserved = 0;
>@@ -3765,7 +3765,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba)
> 
> 	/*
> 	 * Allocate memory for UTP Transfer descriptors
>-	 * UFSHCI requires 1024 byte alignment of UTRD
>+	 * UFSHCI requires 1KB alignment of UTRD
> 	 */
> 	utrdl_size = (sizeof(struct utp_transfer_req_desc) * hba->nutrs);
> 	hba->utrdl_base_addr = dmam_alloc_coherent(hba->dev,
>@@ -3773,7 +3773,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba)
> 						   &hba->utrdl_dma_addr,
> 						   GFP_KERNEL);
> 	if (!hba->utrdl_base_addr ||
>-	    WARN_ON(hba->utrdl_dma_addr & (1024 - 1))) {
>+	    WARN_ON(hba->utrdl_dma_addr & (SZ_1K - 1))) {
> 		dev_err(hba->dev,
> 			"Transfer Descriptor Memory allocation failed\n");
> 		goto out;
>@@ -3797,7 +3797,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba)
> 						    &hba->utmrdl_dma_addr,
> 						    GFP_KERNEL);
> 	if (!hba->utmrdl_base_addr ||
>-	    WARN_ON(hba->utmrdl_dma_addr & (1024 - 1))) {
>+	    WARN_ON(hba->utmrdl_dma_addr & (SZ_1K - 1))) {
> 		dev_err(hba->dev,
> 		"Task Management Descriptor Memory allocation failed\n");
> 		goto out;
>@@ -8760,7 +8760,7 @@ static const struct scsi_host_template ufshcd_driver_template = {
> 	.cmd_per_lun		= UFSHCD_CMD_PER_LUN,
> 	.can_queue		= UFSHCD_CAN_QUEUE,
> 	.max_segment_size	= PRDT_DATA_BYTE_COUNT_MAX,
>-	.max_sectors		= (1 << 20) / SECTOR_SIZE, /* 1 MiB */
>+	.max_sectors		= SZ_1M / SECTOR_SIZE,
> 	.max_host_blocked	= 1,
> 	.track_queue_depth	= 1,
> 	.skip_settle_delay	= 1,
>diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h
>index 11424bb03814..db2d5db5c88e 100644
>--- a/include/ufs/ufshci.h
>+++ b/include/ufs/ufshci.h
>@@ -453,7 +453,7 @@ enum {
> };
> 
> /* The maximum length of the data byte count field in the PRDT is 256KB */
>-#define PRDT_DATA_BYTE_COUNT_MAX	(256 * 1024)
>+#define PRDT_DATA_BYTE_COUNT_MAX	SZ_256K
> /* The granularity of the data byte count field in the PRDT is 32-bit */
> #define PRDT_DATA_BYTE_COUNT_PAD	4
> 
>-- 
>2.40.0

  parent reply	other threads:[~2023-05-31  5:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  5:17 Avri Altman
     [not found] ` <CGME20230531051800epcas2p4479389ea7e7da9a60180cbac0e865450@epcms2p3>
2023-05-31  5:34   ` Keoseong Park [this message]
2023-05-31  5:46 ` Bao D. Nguyen

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=20230531053454epcms2p3f1905b079d3b624cf4e8d7c536690ed8@epcms2p3 \
    --to=keosung.park@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.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

all inboxes | Powered by JetHome®