From: Johannes Thumshirn <jthumshirn@suse.de>
To: John Garry <john.garry@huawei.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
Tejun Heo <tj@kernel.org>,
James Bottomley <jejb@linux.vnet.ibm.com>,
Dan Williams <dan.j.williams@intel.com>,
Jack Wang <jinpu.wang@profitbricks.com>,
Hannes Reinecke <hare@suse.de>,
Linux SCSI Mailinglist <linux-scsi@vger.kernel.org>,
Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] scsi: sas: flush destruct workqueue on device unregister
Date: Wed, 29 Mar 2017 13:29:22 +0200 [thread overview]
Message-ID: <20170329112922.GB9183@linux-x5ow.site> (raw)
In-Reply-To: <02778435-6c67-0ac9-2faa-03ebb7934477@huawei.com>
On Wed, Mar 29, 2017 at 12:15:44PM +0100, John Garry wrote:
> On 29/03/2017 10:41, Johannes Thumshirn wrote:
> >In the advent of an SAS device unregister we have to wait for all destruct
> >works to be done to not accidently delay deletion of a SAS rphy or it's
> >children to the point when we're removing the SCSI or SAS hosts.
> >
> >Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> >---
> > drivers/scsi/libsas/sas_discover.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> >diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
> >index 60de662..75b18f1 100644
> >--- a/drivers/scsi/libsas/sas_discover.c
> >+++ b/drivers/scsi/libsas/sas_discover.c
> >@@ -382,9 +382,13 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev)
> > }
> >
> > if (!test_and_set_bit(SAS_DEV_DESTROY, &dev->state)) {
> >+ struct sas_discovery *disc = &dev->port->disc;
> >+ struct sas_work *sw = &disc->disc_work[DISCE_DESTRUCT].work;
> >+
> > sas_rphy_unlink(dev->rphy);
> > list_move_tail(&dev->disco_list_node, &port->destroy_list);
> > sas_discover_event(dev->port, DISCE_DESTRUCT);
> >+ flush_work(&sw->work);
>
> I quickly tested plugging out the expander and we never get past this call
> to flush - a hang results:
Can you activat lockdep so we can see which lock it is that we're blocking on?
It's most likely in sas_unregister_common_dev() but this function takes two spin
locks, port->dev_list_lock and ha->lock.
Thanks a lot,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
next prev parent reply other threads:[~2017-03-29 11:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 9:41 [PATCH 0/2] Fix sysfs recursive removal splats in isci Johannes Thumshirn
2017-03-29 9:41 ` [PATCH 1/2] scsi: sas: flush destruct workqueue on device unregister Johannes Thumshirn
2017-03-29 11:15 ` John Garry
2017-03-29 11:29 ` Johannes Thumshirn [this message]
2017-03-29 11:53 ` John Garry
2017-03-29 12:26 ` Johannes Thumshirn
2017-03-29 12:36 ` Jinpu Wang
2017-03-29 12:47 ` Johannes Thumshirn
2017-03-29 12:51 ` Johannes Thumshirn
2017-03-29 9:41 ` [PATCH 2/2] scsi: isci: remove the SAS host after the SCSI host Johannes Thumshirn
2017-03-29 10:17 ` Hannes Reinecke
2017-03-29 9:41 ` [PATCH 3/6] aic94xx: " Johannes Thumshirn
2017-03-29 10:17 ` Hannes Reinecke
2017-03-29 9:41 ` [PATCH 4/6] scsi: hisi_sas: " Johannes Thumshirn
2017-03-29 10:17 ` Hannes Reinecke
2017-03-29 9:41 ` [PATCH 5/6] mvsas: " Johannes Thumshirn
2017-03-29 10:18 ` Hannes Reinecke
2017-03-29 9:41 ` [PATCH 6/6] scsi: pm8001: " Johannes Thumshirn
2017-03-29 10:18 ` Hannes Reinecke
2017-03-29 10:27 ` Jinpu Wang
2017-03-29 10:30 ` Hannes Reinecke
2017-03-29 11:37 ` [PATCH 0/2] Fix sysfs recursive removal splats in isci James Bottomley
2017-03-29 15:23 ` Tejun Heo
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=20170329112922.GB9183@linux-x5ow.site \
--to=jthumshirn@suse.de \
--cc=dan.j.williams@intel.com \
--cc=hare@suse.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=jinpu.wang@profitbricks.com \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tj@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®