All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Balsundar.P@microchip.com>
To: <hare@suse.de>, <martin.petersen@oracle.com>
Cc: <hch@lst.de>, <james.bottomley@hansenpartnership.com>,
	<linux-scsi@vger.kernel.org>, <balsundar.p@microsemi.com>,
	<aacraid@microsemi.com>
Subject: RE: [PATCH 08/11] aacraid: use scsi_host_quiesce() to wait for I/O to complete
Date: Thu, 28 Nov 2019 11:45:16 +0000	[thread overview]
Message-ID: <MN2PR11MB38219640907865F47666CB83F3470@MN2PR11MB3821.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20191120103114.24723-9-hare@suse.de>

NAK

After applying this patch, while IOs were running on physical drive, 
issued controller reset from management utility.
Observed below call trace. It is from scsi_device_quiesce().

Nov 27 19:24:21 ubuntu kernel: [ 1330.799311] INFO: task arcconf:2386 blocked for more than 120 seconds.
Nov 27 19:24:21 ubuntu kernel: [ 1330.799841]       Not tainted 5.4.0-rc1+ #2
Nov 27 19:24:21 ubuntu kernel: [ 1330.800235] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Nov 27 19:24:21 ubuntu kernel: [ 1330.800678] arcconf         D    0  2386   2173 0x00004000
Nov 27 19:24:21 ubuntu kernel: [ 1330.800682] Call Trace:
Nov 27 19:24:21 ubuntu kernel: [ 1330.800699]  __schedule+0x291/0x6f0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800703]  schedule+0x33/0xa0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800710]  blk_mq_freeze_queue_wait+0x4b/0xb0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800717]  ? wait_woken+0x80/0x80
Nov 27 19:24:21 ubuntu kernel: [ 1330.800721]  blk_mq_freeze_queue+0x1a/0x20
Nov 27 19:24:21 ubuntu kernel: [ 1330.800727]  scsi_device_quiesce+0x5d/0xb0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800730]  scsi_host_quiesce+0x41/0x60
Nov 27 19:24:21 ubuntu kernel: [ 1330.800742]  aac_send_shutdown+0x7c/0x180 [aacraid]
Nov 27 19:24:21 ubuntu kernel: [ 1330.800749]  aac_reset_adapter+0x29f/0x760 [aacraid]
Nov 27 19:24:21 ubuntu kernel: [ 1330.800757]  ? security_capable+0x3f/0x60
Nov 27 19:24:21 ubuntu kernel: [ 1330.800762]  aac_store_reset_adapter+0x41/0x60 [aacraid]
Nov 27 19:24:21 ubuntu kernel: [ 1330.800770]  dev_attr_store+0x17/0x30
Nov 27 19:24:21 ubuntu kernel: [ 1330.800777]  sysfs_kf_write+0x3c/0x50
Nov 27 19:24:21 ubuntu kernel: [ 1330.800779]  kernfs_fop_write+0x125/0x1a0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800785]  __vfs_write+0x1b/0x40
Nov 27 19:24:21 ubuntu kernel: [ 1330.800789]  vfs_write+0xb1/0x1a0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800792]  ksys_write+0xa7/0xe0
Nov 27 19:24:21 ubuntu kernel: [ 1330.800795]  __x64_sys_write+0x1a/0x20
Nov 27 19:24:21 ubuntu kernel: [ 1330.800802]  do_syscall_64+0x57/0x190
Nov 27 19:24:21 ubuntu kernel: [ 1330.800806]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Nov 27 19:24:21 ubuntu kernel: [ 1330.800810] RIP: 0033:0x7f67cfb7c2b7
Nov 27 19:24:21 ubuntu kernel: [ 1330.800819] Code: Bad RIP value.
Nov 27 19:24:21 ubuntu kernel: [ 1330.800821] RSP: 002b:00007ffeb23ca8c0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
Nov 27 19:24:21 ubuntu kernel: [ 1330.800823] RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007f67cfb7c2b7
Nov 27 19:24:21 ubuntu kernel: [ 1330.800825] RDX: 0000000000000002 RSI: 00007ffeb23ca8f0 RDI: 0000000000000006
Nov 27 19:24:21 ubuntu kernel: [ 1330.800826] RBP: 00007ffeb23ca8f0 R08: 0000000000000000 R09: 0000000000000000
Nov 27 19:24:21 ubuntu kernel: [ 1330.800828] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002
Nov 27 19:24:21 ubuntu kernel: [ 1330.800829] R13: 00007ffeb23cad20 R14: 00007ffeb23cadf0 R15: 00007ffeb23cac60

-----Original Message-----
From: Hannes Reinecke <hare@suse.de> 
Sent: Wednesday, November 20, 2019 16:01
To: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>; James Bottomley <james.bottomley@hansenpartnership.com>; linux-scsi@vger.kernel.org; Hannes Reinecke <hare@suse.de>; Balsundar P <balsundar.p@microsemi.com>; Adaptec OEM Raid Solutions <aacraid@microsemi.com>
Subject: [PATCH 08/11] aacraid: use scsi_host_quiesce() to wait for I/O to complete

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Instead of waiting for all I/O to complete by monitoring the request tags we can as well call scsi_host_quiesce() and drop the hand-crafted helpers.

Cc: Balsundar P <balsundar.p@microsemi.com>
Cc: Adaptec OEM Raid Solutions <aacraid@microsemi.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/aacraid/comminit.c | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index f75878d773cf..a01dca86eb37 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -272,38 +272,6 @@ static void aac_queue_init(struct aac_dev * dev, struct aac_queue * q, u32 *mem,
        q->entries = qsize;
 }

-static void aac_wait_for_io_completion(struct aac_dev *aac) -{
-       unsigned long flagv = 0;
-       int i = 0;
-
-       for (i = 60; i; --i) {
-               struct scsi_device *dev;
-               struct scsi_cmnd *command;
-               int active = 0;
-
-               __shost_for_each_device(dev, aac->scsi_host_ptr) {
-                       spin_lock_irqsave(&dev->list_lock, flagv);
-                       list_for_each_entry(command, &dev->cmd_list, list) {
-                               if (command->SCp.phase == AAC_OWNER_FIRMWARE) {
-                                       active++;
-                                       break;
-                               }
-                       }
-                       spin_unlock_irqrestore(&dev->list_lock, flagv);
-                       if (active)
-                               break;
-
-               }
-               /*
-                * We can exit If all the commands are complete
-                */
-               if (active == 0)
-                       break;
-               ssleep(1);
-       }
-}
-
 /**
  *     aac_send_shutdown               -       shutdown an adapter
  *     @dev: Adapter to shutdown
@@ -326,7 +294,7 @@ int aac_send_shutdown(struct aac_dev * dev)
                mutex_unlock(&dev->ioctl_mutex);
        }

-       aac_wait_for_io_completion(dev);
+       scsi_host_quiesce(dev->scsi_host_ptr);

        fibctx = aac_fib_alloc(dev);
        if (!fibctx)
@@ -352,6 +320,7 @@ int aac_send_shutdown(struct aac_dev * dev)
        if (aac_is_src(dev) &&
             dev->msi_enabled)
                aac_set_intx_mode(dev);
+       scsi_host_resume(dev->scsi_host_ptr);
        return status;
 }

--
2.16.4


  parent reply	other threads:[~2019-11-28 11:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 10:31 [PATCHv5 00/11] scsi: remove legacy cmd_list implementation Hannes Reinecke
2019-11-20 10:31 ` [PATCH 01/11] dpt_i2o: rename adpt_i2o_to_scsi() to adpt_i2o_scsi_complete() Hannes Reinecke
2019-11-26 16:54   ` Christoph Hellwig
2019-11-20 10:31 ` [PATCH 02/11] scsi: add scsi_host_flush_commands() helper Hannes Reinecke
2019-11-20 16:19   ` Bart Van Assche
2019-11-21 15:46     ` Hannes Reinecke
2019-11-26 16:55   ` Christoph Hellwig
2019-11-26 18:25     ` Hannes Reinecke
2019-11-20 10:31 ` [PATCH 03/11] dpt_i2o: use scsi_host_flush_commands() to abort outstanding commands Hannes Reinecke
2019-11-26 16:55   ` Christoph Hellwig
2019-11-20 10:31 ` [PATCH 04/11] aacraid: Do not wait for outstanding write commands on synchronize_cache Hannes Reinecke
2019-11-26 17:02   ` Christoph Hellwig
2019-11-28 11:40   ` Balsundar.P
2019-11-20 10:31 ` [PATCH 05/11] aacraid: use midlayer helper to terminate outstanding commands Hannes Reinecke
2019-11-26 17:02   ` Christoph Hellwig
2019-11-28 11:41   ` Balsundar.P
2019-11-20 10:31 ` [PATCH 06/11] aacraid: replace aac_flush_ios() with midlayer helper Hannes Reinecke
2019-11-20 16:14   ` Bart Van Assche
2019-11-28 11:41   ` Balsundar.P
2019-11-20 10:31 ` [PATCH 07/11] scsi: add scsi_host_quiesce()/scsi_host_resume() helper Hannes Reinecke
2019-11-20 10:31 ` [PATCH 08/11] aacraid: use scsi_host_quiesce() to wait for I/O to complete Hannes Reinecke
2019-11-20 16:23   ` Bart Van Assche
2019-11-26  8:29   ` Balsundar.P
2019-11-28 11:45   ` Balsundar.P [this message]
2019-11-28 12:09     ` Hannes Reinecke
2019-12-04 15:02       ` Hannes Reinecke
2019-11-20 10:31 ` [PATCH 09/11] scsi: add scsi_host_busy_iter() Hannes Reinecke
2019-11-20 10:31 ` [PATCH 10/11] aacraid: use scsi_host_busy_iter() in get_num_of_incomplete_fibs() Hannes Reinecke
2019-11-28 11:42   ` Balsundar.P
2019-11-20 10:31 ` [PATCH 11/11] scsi: Remove cmd_list functionality Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR11MB38219640907865F47666CB83F3470@MN2PR11MB3821.namprd11.prod.outlook.com \
    --to=balsundar.p@microchip.com \
    --cc=aacraid@microsemi.com \
    --cc=balsundar.p@microsemi.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.