scsi: ufs: Enable WriteBooster on some pre-3.1 UFS devices
authorStanley Chu <stanley.chu@mediatek.com>
Fri, 8 May 2020 08:01:08 +0000 (16:01 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 12 May 2020 02:48:41 +0000 (22:48 -0400)
commit817d7e140283f4afc766569c670997df79a7c9ee
treeee76d113a11ed6de4365ecad6ec01e5029968562
parent6e27a86aed9760780666b062abbcf5e1408e8376
scsi: ufs: Enable WriteBooster on some pre-3.1 UFS devices

The WriteBooster feature can be supported by some pre-3.1 UFS devices by
upgrading firmware.

To enable WriteBooster feature in such devices, introduce a device quirk to
relax the entrance condition of ufshcd_wb_probe() to allow host driver to
check those devices' WriteBooster capability.

WriteBooster feature can be available if below all conditions are
satisfied,

 1. Host enables WriteBooster capability

 2. UFS 3.1 device or UFS pre-3.1 device with quirk
    UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES enabled

 3. The device descriptor shall have DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP
    field

 4. WriteBooster support is specified in above field

Link: https://lore.kernel.org/r/20200508080115.24233-2-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs_quirks.h
drivers/scsi/ufs/ufshcd.c