[SCSI] libsas, libata: fix start of life for a sas ata_port
This changes the ordering of initialization and probing events from: 1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN 2/ allocate ata_port and schedule port probe in DISCE_PROBE ...to: 1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN 2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN 3/ schedule port probe in DISCE_PROBE This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to destrory ata devices before they have been fully initialized: BUG: unable to handle kernel paging request at 0000000000003b10 IP: [<ffffffffa0053d7e>] sas_ata_end_eh+0x12/0x5e [libsas] ... [<ffffffffa004d1af>] sas_unregister_common_dev+0x78/0xc9 [libsas] [<ffffffffa004d4d4>] sas_unregister_dev+0x4f/0xad [libsas] [<ffffffffa004d5b1>] sas_unregister_domain_devices+0x7f/0xbf [libsas] [<ffffffffa004c487>] sas_deform_port+0x61/0x1b8 [libsas] [<ffffffffa004bed0>] sas_phye_loss_of_signal+0x29/0x2b [libsas] ...and kills the awkward "sata domain_device briefly existing in the domain without an ata_port" state. Reported-by: Michal Kosciowski <michal.kosciowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:

committed by
James Bottomley

parent
0f3fce5cc7
commit
b202445925
@@ -790,11 +790,13 @@ static struct domain_device *sas_ex_discover_end_dev(
|
||||
if (res)
|
||||
goto out_free;
|
||||
|
||||
rphy = sas_end_device_alloc(phy->port);
|
||||
if (unlikely(!rphy))
|
||||
goto out_free;
|
||||
|
||||
sas_init_dev(child);
|
||||
res = sas_ata_init(child);
|
||||
if (res)
|
||||
goto out_free;
|
||||
rphy = sas_end_device_alloc(phy->port);
|
||||
if (!rphy)
|
||||
goto out_free;
|
||||
|
||||
child->rphy = rphy;
|
||||
get_device(&rphy->dev);
|
||||
|
Reference in New Issue
Block a user