linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Two additional UFS patches
@ 2021-05-19 20:20 Bart Van Assche
  2021-05-19 20:20 ` [PATCH 1/2] ufs: Suppress false positive unhandled interrupt messages Bart Van Assche
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bart Van Assche @ 2021-05-19 20:20 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: James E . J . Bottomley, Jaegeuk Kim, linux-scsi, Bart Van Assche

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(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ufs: Suppress false positive unhandled interrupt messages
  2021-05-19 20:20 [PATCH 0/2] Two additional UFS patches Bart Van Assche
@ 2021-05-19 20:20 ` Bart Van Assche
  2021-05-19 20:20 ` [PATCH 2/2] ufs: Use designated initializers in ufs_pm_lvl_states[] Bart Van Assche
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2021-05-19 20:20 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: James E . J . Bottomley, Jaegeuk Kim, linux-scsi,
	Bart Van Assche, Stanley Chu, Can Guo, Bean Huo, Asutosh Das

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.

Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Suggested-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index c541b6953863..d330eae02890 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ufs: Use designated initializers in ufs_pm_lvl_states[]
  2021-05-19 20:20 [PATCH 0/2] Two additional UFS patches Bart Van Assche
  2021-05-19 20:20 ` [PATCH 1/2] ufs: Suppress false positive unhandled interrupt messages Bart Van Assche
@ 2021-05-19 20:20 ` Bart Van Assche
  2021-05-21 21:10 ` [PATCH 0/2] Two additional UFS patches Martin K. Petersen
  2021-05-26  4:07 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2021-05-19 20:20 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: James E . J . Bottomley, Jaegeuk Kim, linux-scsi,
	Bart Van Assche, Stanley Chu, Can Guo, Bean Huo, Asutosh Das

The 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.

Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufshcd.c | 14 +++++++-------
 drivers/scsi/ufs/ufshcd.h | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index d330eae02890..ed8b570f929c 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 0f0e62bfdafd..91f0a8d6d750 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -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
 };
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Two additional UFS patches
  2021-05-19 20:20 [PATCH 0/2] Two additional UFS patches Bart Van Assche
  2021-05-19 20:20 ` [PATCH 1/2] ufs: Suppress false positive unhandled interrupt messages Bart Van Assche
  2021-05-19 20:20 ` [PATCH 2/2] ufs: Use designated initializers in ufs_pm_lvl_states[] Bart Van Assche
@ 2021-05-21 21:10 ` Martin K. Petersen
  2021-05-26  4:07 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-05-21 21:10 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, James E . J . Bottomley, Jaegeuk Kim, linux-scsi


Bart,

> 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.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Two additional UFS patches
  2021-05-19 20:20 [PATCH 0/2] Two additional UFS patches Bart Van Assche
                   ` (2 preceding siblings ...)
  2021-05-21 21:10 ` [PATCH 0/2] Two additional UFS patches Martin K. Petersen
@ 2021-05-26  4:07 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-05-26  4:07 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, James E . J . Bottomley, Jaegeuk Kim, linux-scsi

On Wed, 19 May 2021 13:20:56 -0700, Bart Van Assche wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-26  4:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 20:20 [PATCH 0/2] Two additional UFS patches Bart Van Assche
2021-05-19 20:20 ` [PATCH 1/2] ufs: Suppress false positive unhandled interrupt messages Bart Van Assche
2021-05-19 20:20 ` [PATCH 2/2] ufs: Use designated initializers in ufs_pm_lvl_states[] Bart Van Assche
2021-05-21 21:10 ` [PATCH 0/2] Two additional UFS patches Martin K. Petersen
2021-05-26  4:07 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).