Message ID | CAPcyv4iyaCDchXt93aw0cjqcvL_RPZDU-LendmdhS7G8_AUxMA@mail.gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
> -----Original Message----- > From: Dan Williams [mailto:dan.j.williams@intel.com] > Sent: Monday, May 11, 2015 3:44 PM > To: Praveen Murali > Cc: James Bottomley (James.Bottomley@HansenPartnership.com); linux- > scsi@vger.kernel.org > Subject: Re: sysfs group not found for kobject on mvsas drive removal > > So I wonder if this is a new warning, because as far as I can tell > we've always been double deleting the devices below sas_port. It > seems we should delete all the devices from rphy down before deleting > the parent port. Something like this (excuse the whitespace > mangling). Only compile tested as I don't have a SAS setup handy. > Yes, this is a new warning. If I understand it correctly, the recursive deletion of sysfs nodes introduced it. Anyways, I will test it out and let you know.
> > -----Original Message----- > > From: Dan Williams [mailto:dan.j.williams@intel.com] > > Sent: Monday, May 11, 2015 3:44 PM > > To: Praveen Murali > > Cc: James Bottomley (James.Bottomley@HansenPartnership.com); linux- > > scsi@vger.kernel.org > > Subject: Re: sysfs group not found for kobject on mvsas drive removal > > > > So I wonder if this is a new warning, because as far as I can tell > > we've always been double deleting the devices below sas_port. It > > seems we should delete all the devices from rphy down before deleting > > the parent port. Something like this (excuse the whitespace > > mangling). Only compile tested as I don't have a SAS setup handy. > > I tested that patch on my setup with the Marvell SAS HBA and it seems to be working well; all the warnings are gone. Thanks, Praveen
On Tue, May 12, 2015 at 1:20 PM, Praveen Murali <pmurali@logicube.com> wrote: >> > -----Original Message----- >> > From: Dan Williams [mailto:dan.j.williams@intel.com] >> > Sent: Monday, May 11, 2015 3:44 PM >> > To: Praveen Murali >> > Cc: James Bottomley (James.Bottomley@HansenPartnership.com); linux- >> > scsi@vger.kernel.org >> > Subject: Re: sysfs group not found for kobject on mvsas drive removal >> > >> > So I wonder if this is a new warning, because as far as I can tell >> > we've always been double deleting the devices below sas_port. It >> > seems we should delete all the devices from rphy down before deleting >> > the parent port. Something like this (excuse the whitespace >> > mangling). Only compile tested as I don't have a SAS setup handy. >> > > I tested that patch on my setup with the Marvell SAS HBA and it seems to be working well; all the warnings are gone. Cool, hmm, makes me nervous when untested patches work right the first time :-). I wonder if we are still managing the reference counts correctly and not leaking devices. Previously we would get 2 calls to put_device() on the sas_port device. Now I think we only get one. Can you confirm that sas_port_release() is still being called. /me also wonders why the scsi_transport_class has "port->dev.parent = get_device(parent);" all over the place. Parents should be pinned as long as children are registered. James, do you recall why these extra/explicit references are taken? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBEYW4gV2lsbGlhbXMgW21haWx0 bzpkYW4uai53aWxsaWFtc0BpbnRlbC5jb21dDQo+IFNlbnQ6IFR1ZXNkYXksIE1heSAxMiwgMjAx NSAxOjMxIFBNDQo+IFRvOiBQcmF2ZWVuIE11cmFsaQ0KPiBDYzogSmFtZXMgQm90dG9tbGV5IChK YW1lcy5Cb3R0b21sZXlASGFuc2VuUGFydG5lcnNoaXAuY29tKTsgbGludXgtDQo+IHNjc2lAdmdl ci5rZXJuZWwub3JnDQo+IFN1YmplY3Q6IFJlOiBzeXNmcyBncm91cCBub3QgZm91bmQgZm9yIGtv YmplY3Qgb24gbXZzYXMgZHJpdmUgcmVtb3ZhbA0KPiANCj4gQ29vbCwgaG1tLCBtYWtlcyBtZSBu ZXJ2b3VzIHdoZW4gdW50ZXN0ZWQgcGF0Y2hlcyB3b3JrIHJpZ2h0IHRoZSBmaXJzdA0KPiB0aW1l IDotKS4gIEkgd29uZGVyIGlmIHdlIGFyZSBzdGlsbCBtYW5hZ2luZyB0aGUgcmVmZXJlbmNlIGNv dW50cw0KPiBjb3JyZWN0bHkgYW5kIG5vdCBsZWFraW5nIGRldmljZXMuICBQcmV2aW91c2x5IHdl IHdvdWxkIGdldCAyIGNhbGxzIHRvDQo+IHB1dF9kZXZpY2UoKSBvbiB0aGUgc2FzX3BvcnQgZGV2 aWNlLiAgTm93IEkgdGhpbmsgd2Ugb25seSBnZXQgb25lLg0KPiBDYW4geW91IGNvbmZpcm0gdGhh dCBzYXNfcG9ydF9yZWxlYXNlKCkgaXMgc3RpbGwgYmVpbmcgY2FsbGVkLg0KDQpKdXN0IGNvbmZp cm1lZCB0aGF0IHNhc19wb3J0X3JlbGVhc2UoKSBpcyBnZXR0aW5nIGNhbGxlZC4NCg0K -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 60de66252fa2..a4db770fe8b0 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -362,11 +362,14 @@ static void sas_destruct_devices(struct work_struct *work) clear_bit(DISCE_DESTRUCT, &port->disc.pending); list_for_each_entry_safe(dev, n, &port->destroy_list, disco_list_node) { + struct sas_port *sas_port = dev_to_sas_port(dev->rphy->dev.parent); + list_del_init(&dev->disco_list_node); sas_remove_children(&dev->rphy->dev); sas_rphy_delete(dev->rphy); sas_unregister_common_dev(port, dev); + sas_port_delete(sas_port); } } @@ -400,9 +403,6 @@ void sas_unregister_domain_devices(struct asd_sas_port *port, int gone) list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) sas_unregister_dev(port, dev); - - port->port->rphy = NULL; - } void sas_device_set_phy(struct domain_device *dev, struct sas_port *port) diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c index d3c5297c6c89..9a25ae3a52a4 100644 --- a/drivers/scsi/libsas/sas_port.c +++ b/drivers/scsi/libsas/sas_port.c @@ -219,7 +219,6 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) if (port->num_phys == 1) { sas_unregister_domain_devices(port, gone); - sas_port_delete(port->port); port->port = NULL; } else { sas_port_delete_phy(port->port, phy->phy);