]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mtip32xx: Fix broken service thread handling
authorAsai Thambi SP <asamymuthupa@micron.com>
Thu, 25 Feb 2016 05:16:00 +0000 (21:16 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:05:52 +0000 (00:05 +0200)
commit cfc05bd31384c4898bf2437a4de5557f3cf9803a upstream.

Service thread does not detect the need for taskfile error hanlding. 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>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/block/mtip32xx/mtip32xx.c
drivers/block/mtip32xx/mtip32xx.h

index 295f3afbbef53e382d5786f9b7a09c0803c7eb66..ad109a99dce3b73cce53c5ee3861d626d80b408c 100644 (file)
@@ -2982,9 +2982,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)) {
index ba1b31ee22ec7e72e7649d743e5a25f2e22a3941..03d1607d8a90dfc9f64cd0466509c3be2f9c5756 100644 (file)
@@ -145,6 +145,11 @@ enum {
        MTIP_PF_SR_CLEANUP_BIT      = 7,
        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,