Two additional UFS patches
cover Two additional UFS patches
Hi Martin,
There are two UFS patches in this series. One bug fix and one cleanup patch. Please consider the bug fix for kernel v5.13 and the cleanup patch for kernel v5.14.
Thanks,
Bart.
Bart Van Assche (2):
ufs: Suppress false positive unhandled interrupt messages
ufs: Use designated initializers in ufs_pm_lvl_states[]
drivers/scsi/ufs/ufshcd.c | 17 +++++++++-------- drivers/scsi/ufs/ufshcd.h | 14 +++++++------- 2 files changed, 16 insertions(+), 15 deletions(-)
PATCH 1/2 ufs: Suppress false positive unhandled interrupt messages
From ufshcd_transfer_req_compl():
<quote>Resetting interrupt aggregation counters first and reading the DOOR_BELL afterward allows us to handle all the completed requests. In order to prevent other interrupts starvation the DB is read once after reset. The down side of this solution is the possibility of false interrupt if device completes another request after resetting aggregation and before reading the DB.</quote>
This patch prevents that ufshcd_intr() reports a false positive "Unhandled interrupt" message if the above scenario is triggered.
--- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +2 -1
@@ -6454,7 +6454,8 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) }if (enabled_intr_status && retval ==IRQ_NONE && - !ufshcd_eh_in_progress (hba)) { + (!(enabled_intr_status &UTP_TRANSFER_REQ_COMPL ) || + hba->outstanding_reqs) && !ufshcd_eh_in_progress (hba)) { dev_err(hba->dev, "%s: Unhandled interrupt 0x%08x (0x%08x, 0x%08x)\n", __func__, intr_status,
PATCH 2/2 ufs: Use designated initializers in ufs_pm_lvl_states[]
In reply to Bart Van AsscheThe comments in the enum ufs_pm_level definition are redundant. Remove the comments from the ufs_pm_level enum and use designated initializers in the ufs_pm_lvl_states[] definition instead.
--- drivers/scsi/ufs/ufshcd.c | 14 +++++++------- drivers/scsi/ufs/ufshcd.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-)
drivers/scsi/ufs/ufshcd.c +7 -7
@@ -162,17 +162,17 @@ enum { ((h)->eh_flags &= ~UFSHCD_EH_IN_PROGRESS)struct ufs_pm_lvl_states ufs_pm_lvl_states[] = { - {UFS_ACTIVE_PWR_MODE ,UIC_LINK_ACTIVE_STATE }, - {UFS_ACTIVE_PWR_MODE ,UIC_LINK_HIBERN8_STATE }, - {UFS_SLEEP_PWR_MODE ,UIC_LINK_ACTIVE_STATE }, - {UFS_SLEEP_PWR_MODE ,UIC_LINK_HIBERN8_STATE }, - {UFS_POWERDOWN_PWR_MODE ,UIC_LINK_HIBERN8_STATE }, - {UFS_POWERDOWN_PWR_MODE ,UIC_LINK_OFF_STATE }, + [UFS_PM_LVL_0 ] = {UFS_ACTIVE_PWR_MODE ,UIC_LINK_ACTIVE_STATE }, + [UFS_PM_LVL_1 ] = {UFS_ACTIVE_PWR_MODE ,UIC_LINK_HIBERN8_STATE }, + [UFS_PM_LVL_2 ] = {UFS_SLEEP_PWR_MODE ,UIC_LINK_ACTIVE_STATE }, + [UFS_PM_LVL_3 ] = {UFS_SLEEP_PWR_MODE ,UIC_LINK_HIBERN8_STATE }, + [UFS_PM_LVL_4 ] = {UFS_POWERDOWN_PWR_MODE ,UIC_LINK_HIBERN8_STATE }, + [UFS_PM_LVL_5 ] = {UFS_POWERDOWN_PWR_MODE ,UIC_LINK_OFF_STATE },/* * For DeepSleep, the link is first put in hibern8 and then off. * Leaving the link in hibern8 is not supported. */ - {UFS_DEEPSLEEP_PWR_MODE ,UIC_LINK_OFF_STATE }, + [UFS_PM_LVL_6 ] = {UFS_DEEPSLEEP_PWR_MODE ,UIC_LINK_OFF_STATE }, }; static inline enum ufs_dev_pwr_mode
drivers/scsi/ufs/ufshcd.h +7 -7
@@ -155,13 +155,13 @@ enum uic_link_state {* power off. */ enum ufs_pm_level { -UFS_PM_LVL_0 ,/* UFS_ACTIVE_PWR_MODE, UIC_LINK_ACTIVE_STATE */ -UFS_PM_LVL_1 ,/* UFS_ACTIVE_PWR_MODE, UIC_LINK_HIBERN8_STATE */ -UFS_PM_LVL_2 ,/* UFS_SLEEP_PWR_MODE, UIC_LINK_ACTIVE_STATE */ -UFS_PM_LVL_3 ,/* UFS_SLEEP_PWR_MODE, UIC_LINK_HIBERN8_STATE */ -UFS_PM_LVL_4 ,/* UFS_POWERDOWN_PWR_MODE, UIC_LINK_HIBERN8_STATE */ -UFS_PM_LVL_5 ,/* UFS_POWERDOWN_PWR_MODE, UIC_LINK_OFF_STATE */ -UFS_PM_LVL_6 ,/* UFS_DEEPSLEEP_PWR_MODE, UIC_LINK_OFF_STATE */ +UFS_PM_LVL_0 , +UFS_PM_LVL_1 , +UFS_PM_LVL_2 , +UFS_PM_LVL_3 , +UFS_PM_LVL_4 , +UFS_PM_LVL_5 , +UFS_PM_LVL_6 ,UFS_PM_LVL_MAX };
Martin K. Petersen
AppliedBart,
Quoted 3 lines
There are two UFS patches in this series. One bug fix and one cleanup patch. Please consider the bug fix for kernel v5.13 and the cleanup patch for kernel v5.14.
Applied patch #2 to 5.14/scsi-staging, thanks!
Minor nit: Please send separate series for separate trees. b4 doesn't deal particularly gracefully with parts of a series ending up in different branches.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 9 lines · Bart Van Assche
There are two UFS patches in this series. One bug fix and one cleanup patch. Please consider the bug fix for kernel v5.13 and the cleanup patch for kernel v5.14.
Thanks,
Bart.
[...]
Applied to 5.14/scsi-queue, thanks!
[1/2] ufs: Suppress false positive unhandled interrupt messages
(no commit info)
[2/2] ufs: Use designated initializers in ufs_pm_lvl_states[]
https://git.kernel.org/mkp/scsi/c/e2ac7ab281c0
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering