diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-03-22 00:09:07 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-04-23 07:11:47 -0400 |
commit | b2024459252a9d2d312ee562f86f332a1498f412 (patch) | |
tree | 751987779eee44a601a68c766ba2ff258b77d25a /drivers/scsi/libsas/sas_expander.c | |
parent | 0f3fce5cc77e1f35758ef0e46a989e76e5046a7b (diff) |
[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>
Diffstat (limited to 'drivers/scsi/libsas/sas_expander.c')
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index c1f91b1c27c3..75247a176c6b 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -790,12 +790,14 @@ static struct domain_device *sas_ex_discover_end_dev( | |||
790 | if (res) | 790 | if (res) |
791 | goto out_free; | 791 | goto out_free; |
792 | 792 | ||
793 | sas_init_dev(child); | ||
794 | res = sas_ata_init(child); | ||
795 | if (res) | ||
796 | goto out_free; | ||
793 | rphy = sas_end_device_alloc(phy->port); | 797 | rphy = sas_end_device_alloc(phy->port); |
794 | if (unlikely(!rphy)) | 798 | if (!rphy) |
795 | goto out_free; | 799 | goto out_free; |
796 | 800 | ||
797 | sas_init_dev(child); | ||
798 | |||
799 | child->rphy = rphy; | 801 | child->rphy = rphy; |
800 | get_device(&rphy->dev); | 802 | get_device(&rphy->dev); |
801 | 803 | ||