diff mbox

[2/2] hpsa: destroy sas transport properties before scsi_host

Message ID 20161121140429.12788-3-mwilck@suse.de (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Martin Wilck Nov. 21, 2016, 2:04 p.m. UTC
Unloading the hpsa driver causes warnings

[ 1063.793652] WARNING: CPU: 1 PID: 4850 at ../fs/sysfs/group.c:237 device_del+0x54/0x240()
[ 1063.793659] sysfs group ffffffff81cf21a0 not found for kobject 'port-2:0'

with two different stacks:
1)
[ 1063.793774]  [<ffffffff81448af4>] device_del+0x54/0x240
[ 1063.793780]  [<ffffffff8145178a>] transport_remove_classdev+0x4a/0x60
[ 1063.793784]  [<ffffffff81451216>] attribute_container_device_trigger+0xa6/0xb0
[ 1063.793802]  [<ffffffffa0105d46>] sas_port_delete+0x126/0x160 [scsi_transport_sas]
[ 1063.793819]  [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]

2)
[ 1063.797103]  [<ffffffff81448af4>] device_del+0x54/0x240
[ 1063.797118]  [<ffffffffa0105d4e>] sas_port_delete+0x12e/0x160 [scsi_transport_sas]
[ 1063.797134]  [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]

This is caused by the fact that host device hostX is deleted before the
SAS transport devices hostX/port-a:b.

This patch fixes this by reverting the order of device deletions.

References: bsc#1010946
Signed-off-by: Martin Wilck <mwilck@suse.de>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Thumshirn Nov. 21, 2016, 2:14 p.m. UTC | #1
On Mon, Nov 21, 2016 at 03:04:29PM +0100, Martin Wilck wrote:
> Unloading the hpsa driver causes warnings
> 
> [ 1063.793652] WARNING: CPU: 1 PID: 4850 at ../fs/sysfs/group.c:237 device_del+0x54/0x240()
> [ 1063.793659] sysfs group ffffffff81cf21a0 not found for kobject 'port-2:0'
> 
> with two different stacks:
> 1)
> [ 1063.793774]  [<ffffffff81448af4>] device_del+0x54/0x240
> [ 1063.793780]  [<ffffffff8145178a>] transport_remove_classdev+0x4a/0x60
> [ 1063.793784]  [<ffffffff81451216>] attribute_container_device_trigger+0xa6/0xb0
> [ 1063.793802]  [<ffffffffa0105d46>] sas_port_delete+0x126/0x160 [scsi_transport_sas]
> [ 1063.793819]  [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]
> 
> 2)
> [ 1063.797103]  [<ffffffff81448af4>] device_del+0x54/0x240
> [ 1063.797118]  [<ffffffffa0105d4e>] sas_port_delete+0x12e/0x160 [scsi_transport_sas]
> [ 1063.797134]  [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]
> 
> This is caused by the fact that host device hostX is deleted before the
> SAS transport devices hostX/port-a:b.
> 
> This patch fixes this by reverting the order of device deletions.
> 
> References: bsc#1010946
> Signed-off-by: Martin Wilck <mwilck@suse.de>
> ---

With the References changed to the bug link like in patch 1/2 
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Don Brace Oct. 10, 2017, 11:04 p.m. UTC | #2
> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Monday, November 21, 2016 8:15 AM
> To: Martin Wilck <mwilck@suse.de>
> Cc: Don Brace <don.brace@microsemi.com>; dl-esc-Team ESD Storage Dev
> Support <esc-TeamESDStorageDevSupport@microsemi.com>;
> iss_storagedev@hp.com; linux-scsi@vger.kernel.org; JBottomley@odin.com;
> hch@lst.de; hare@suse.de
> Subject: Re: [PATCH 2/2] hpsa: destroy sas transport properties before
> scsi_host
> 
> EXTERNAL EMAIL
> 
> 
> On Mon, Nov 21, 2016 at 03:04:29PM +0100, Martin Wilck wrote:
> > Unloading the hpsa driver causes warnings
> >
> > [ 1063.793652] WARNING: CPU: 1 PID: 4850 at ../fs/sysfs/group.c:237
> device_del+0x54/0x240()
> > [ 1063.793659] sysfs group ffffffff81cf21a0 not found for kobject 'port-2:0'
> >
> > with two different stacks:
> > 1)
> > [ 1063.793774]  [<ffffffff81448af4>] device_del+0x54/0x240
> > [ 1063.793780]  [<ffffffff8145178a>]
> transport_remove_classdev+0x4a/0x60
> > [ 1063.793784]  [<ffffffff81451216>]
> attribute_container_device_trigger+0xa6/0xb0
> > [ 1063.793802]  [<ffffffffa0105d46>] sas_port_delete+0x126/0x160
> [scsi_transport_sas]
> > [ 1063.793819]  [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]
> >
> > 2)
> > [ 1063.797103]  [<ffffffff81448af4>] device_del+0x54/0x240
> > [ 1063.797118]  [<ffffffffa0105d4e>] sas_port_delete+0x12e/0x160
> [scsi_transport_sas]
> > [ 1063.797134]  [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]
> >
> > This is caused by the fact that host device hostX is deleted before the
> > SAS transport devices hostX/port-a:b.
> >
> > This patch fixes this by reverting the order of device deletions.
> >
> > References: bsc#1010946
> > Signed-off-by: Martin Wilck <mwilck@suse.de>
> > ---
> 
> With the References changed to the bug link like in patch 1/2
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

Now that Hannes's patch  9441284fbc39610c0f9ec0ed118ff85d78352906
has been applied, this patch corrects the stack trace issue.

Would you like to re-submit this patch or would you like me to send it up?
I'll run some quick tests if you do decide to send it up. 
If you want me to send it up, you will get the credit anyway.

Thanks for your help and attention to this issue.
And thanks again to Hannes.

Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation


> --
> 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
Martin Wilck Oct. 11, 2017, 9:15 a.m. UTC | #3
On Tue, 2017-10-10 at 23:04 +0000, Don Brace wrote:
> Now that Hannes's patch  9441284fbc39610c0f9ec0ed118ff85d78352906
> has been applied, this patch corrects the stack trace issue.
> 
> Would you like to re-submit this patch or would you like me to send
> it up?
> I'll run some quick tests if you do decide to send it up. 
> If you want me to send it up, you will get the credit anyway.

From my PoV, just go ahead and re-submit. It'll be faster than me
diving into this again.

Thanks,
Martin
diff mbox

Patch

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 8ec77c3..f23f680 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -9020,6 +9020,7 @@  static void hpsa_remove_one(struct pci_dev *pdev)
 	destroy_workqueue(h->rescan_ctlr_wq);
 	destroy_workqueue(h->resubmit_wq);
 
+	hpsa_delete_sas_host(h);
 	/*
 	 * Call before disabling interrupts.
 	 * scsi_remove_host can trigger I/O operations especially
@@ -9054,7 +9055,6 @@  static void hpsa_remove_one(struct pci_dev *pdev)
 	h->lockup_detected = NULL;			/* init_one 2 */
 	/* (void) pci_disable_pcie_error_reporting(pdev); */	/* init_one 1 */
 
-	hpsa_delete_sas_host(h);
 
 	kfree(h);					/* init_one 1 */
 }