linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/10] mtip32xx: Fix broken service thread handling
@ 2016-02-23  5:00 Asai Thambi SP
  0 siblings, 0 replies; only message in thread
From: Asai Thambi SP @ 2016-02-23  5:00 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-kernel, Sam Bradshaw, Selvan Mani, Rajesh Kumar Sambandam,
	Vignesh Gunasekaran


Service thread does not detect the need for taskfile error handling. Fixed the
flag condition to process taskfile error.

Signed-off-by: Selvan Mani <smani@micron.com>
Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
---
 drivers/block/mtip32xx/mtip32xx.c |    6 +++---
 drivers/block/mtip32xx/mtip32xx.h |    5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 37690ab..4dfe2be 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -2986,9 +2986,7 @@ static int mtip_service_thread(void *data)
          * is in progress nor error handling is active
          */
         wait_event_interruptible(port->svc_wait, (port->flags) &&
-            !(port->flags & MTIP_PF_PAUSE_IO));
-
-        set_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags);
+            (port->flags & MTIP_PF_SVC_THD_WORK));
 
         if (kthread_should_stop() ||
             test_bit(MTIP_PF_SVC_THD_STOP_BIT, &port->flags))
@@ -2998,6 +2996,8 @@ static int mtip_service_thread(void *data)
                 &dd->dd_flag)))
             goto st_out;
 
+        set_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags);
+
 restart_eh:
         /* Demux bits: start with error handling */
         if (test_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags)) {
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h
index 29357fd..64bfb82 100644
--- a/drivers/block/mtip32xx/mtip32xx.h
+++ b/drivers/block/mtip32xx/mtip32xx.h
@@ -144,6 +144,11 @@ enum {
     MTIP_PF_REBUILD_BIT         = 6,
     MTIP_PF_SVC_THD_STOP_BIT    = 8,
 
+    MTIP_PF_SVC_THD_WORK    = ((1 << MTIP_PF_EH_ACTIVE_BIT) |
+                  (1 << MTIP_PF_ISSUE_CMDS_BIT) |
+                  (1 << MTIP_PF_REBUILD_BIT) |
+                  (1 << MTIP_PF_SVC_THD_STOP_BIT)),
+
     /* below are bit numbers in 'dd_flag' defined in driver_data */
     MTIP_DDF_SEC_LOCK_BIT        = 0,
     MTIP_DDF_REMOVE_PENDING_BIT = 1,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-23  5:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23  5:00 [PATCH 02/10] mtip32xx: Fix broken service thread handling Asai Thambi SP

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