2020-05-22 08:35:15

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v4 0/4] scsi: ufs: Fix WriteBooster and cleanup UFS driver

Hi,

This patch set fixes some WriteBooster issues and do small cleanup in UFS driver

v3 -> v4
- Squash patch [4] and [5] (Asutosh)
- Fix commit message in patch [4]

v2 -> v3
- Introduce patch [5] to fix possible VCC power drain during runtime suspend (Asutosh)

v1 -> v2
- Remove dummy new line in patch [4] (Asutosh)
- Add more limitation to allow WriteBooster flush during Hibern8 in runtime-suspend. Now the device power mode is kept as Active power mode only if link is put in Hibern8 or Auto-Hibern8 is enabled during runtime-suspend (Asutosh)

Stanley Chu (4):
scsi: ufs: Remove unnecessary memset for dev_info
scsi: ufs: Allow WriteBooster on UFS 2.2 devices
scsi: ufs: Fix index of attributes query for WriteBooster feature
scsi: ufs: Fix WriteBooster flush during runtime suspend

drivers/scsi/ufs/ufs-sysfs.c | 13 ++++-
drivers/scsi/ufs/ufs.h | 2 +-
drivers/scsi/ufs/ufshcd.c | 99 +++++++++++++++++++++++++-----------
drivers/scsi/ufs/ufshcd.h | 3 +-
4 files changed, 82 insertions(+), 35 deletions(-)

--
2.18.0


2020-05-22 08:35:48

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v4 2/4] scsi: ufs: Allow WriteBooster on UFS 2.2 devices

According to the UFS specification, WriteBooster is officially
supported by UFS 2.2.

Since UFS 2.2 specification has been finalized in JEDEC and
such devices have also showed up in the market, modify the
checking rule for ufshcd_wb_probe() to allow these devices to enable
WriteBooster.

Signed-off-by: Stanley Chu <[email protected]>
Reviewed-by: Avri Altman <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 9e55c524f330..0dbd8a7a6642 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6930,6 +6930,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
* UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES enabled
*/
if (dev_info->wspecversion >= 0x310 ||
+ dev_info->wspecversion == 0x220 ||
(hba->dev_quirks & UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES))
ufshcd_wb_probe(hba, desc_buf);

--
2.18.0

2020-05-22 08:36:02

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v4 1/4] scsi: ufs: Remove unnecessary memset for dev_info

The whole UFS host instance has been zero-initialized by
scsi_host_alloc(), thus UFS driver does not need to clear
"dev_info" member specifically in ufshcd_device_params_init().

Simply remove the unnecessary code.

Signed-off-by: Stanley Chu <[email protected]>
Reviewed-by: Avri Altman <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index c3389c9a4f29..9e55c524f330 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7267,9 +7267,6 @@ static int ufshcd_device_params_init(struct ufs_hba *hba)
bool flag;
int ret;

- /* Clear any previous UFS device information */
- memset(&hba->dev_info, 0, sizeof(hba->dev_info));
-
/* Init check for device descriptor sizes */
ufshcd_init_desc_sizes(hba);

--
2.18.0

2020-05-26 17:29:14

by Asutosh Das (asd)

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] scsi: ufs: Fix WriteBooster and cleanup UFS driver

On 5/22/2020 1:32 AM, Stanley Chu wrote:
> Hi,
>
> This patch set fixes some WriteBooster issues and do small cleanup in UFS driver
>
> v3 -> v4
> - Squash patch [4] and [5] (Asutosh)
> - Fix commit message in patch [4]
>
> v2 -> v3
> - Introduce patch [5] to fix possible VCC power drain during runtime suspend (Asutosh)
>
> v1 -> v2
> - Remove dummy new line in patch [4] (Asutosh)
> - Add more limitation to allow WriteBooster flush during Hibern8 in runtime-suspend. Now the device power mode is kept as Active power mode only if link is put in Hibern8 or Auto-Hibern8 is enabled during runtime-suspend (Asutosh)
>
> Stanley Chu (4):
> scsi: ufs: Remove unnecessary memset for dev_info
> scsi: ufs: Allow WriteBooster on UFS 2.2 devices
> scsi: ufs: Fix index of attributes query for WriteBooster feature
> scsi: ufs: Fix WriteBooster flush during runtime suspend
>
> drivers/scsi/ufs/ufs-sysfs.c | 13 ++++-
> drivers/scsi/ufs/ufs.h | 2 +-
> drivers/scsi/ufs/ufshcd.c | 99 +++++++++++++++++++++++++-----------
> drivers/scsi/ufs/ufshcd.h | 3 +-
> 4 files changed, 82 insertions(+), 35 deletions(-)
>

This set looks good to me.

Reviewed-by: Asutosh Das <[email protected]>

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project

2020-05-27 05:06:56

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] scsi: ufs: Fix WriteBooster and cleanup UFS driver

On Fri, 22 May 2020 16:32:08 +0800, Stanley Chu wrote:

> This patch set fixes some WriteBooster issues and do small cleanup in UFS driver
>
> v3 -> v4
> - Squash patch [4] and [5] (Asutosh)
> - Fix commit message in patch [4]
>
> v2 -> v3
> - Introduce patch [5] to fix possible VCC power drain during runtime suspend (Asutosh)
>
> [...]

Applied to 5.8/scsi-queue, thanks!

[1/4] scsi: ufs: Remove unnecessary memset for dev_info
https://git.kernel.org/mkp/scsi/c/3a66ae512b09
[2/4] scsi: ufs: Allow WriteBooster on UFS 2.2 devices
https://git.kernel.org/mkp/scsi/c/c7cee3e746a5
[3/4] scsi: ufs: Fix index of attributes query for WriteBooster feature
https://git.kernel.org/mkp/scsi/c/e31011ab3709
[4/4] scsi: ufs: Fix WriteBooster flush during runtime suspend
https://git.kernel.org/mkp/scsi/c/51dd905bd2f6

--
Martin K. Petersen Oracle Linux Engineering