[kernel/f15] Fix drive detection failure on mvsas (rhbz#705019)

Chuck Ebbert cebbert at fedoraproject.org
Fri Jun 24 19:24:55 UTC 2011


commit 1d95757421daf57e341d65fe2c8fbcc6b5ea064f
Author: Chuck Ebbert <cebbert at redhat.com>
Date:   Fri Jun 24 15:25:26 2011 -0400

    Fix drive detection failure on mvsas (rhbz#705019)

 kernel.spec                                        |    8 ++-
 ...ly-set-frozen-flag-if-new-eh-is-supported.patch |   72 ++++++++++++++++++++
 2 files changed, 78 insertions(+), 2 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 98d3330..80ee3ca 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -668,6 +668,7 @@ Patch602: block-blkdev_get-should-access-bd_disk-only-after.patch
 
 # libata
 Patch620: ahci-add-another-pci-id-for-marvell.patch
+Patch621: libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch
 
 Patch650: hda_intel-prealloc-4mb-dmabuffer.patch
 
@@ -1300,6 +1301,8 @@ ApplyPatch block-blkdev_get-should-access-bd_disk-only-after.patch
 
 # libata
 ApplyPatch ahci-add-another-pci-id-for-marvell.patch
+# Fix drive detection failure on mvsas (rhbz#705019)
+ApplyPatch libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch
 
 # ACPI
 
@@ -2046,9 +2049,10 @@ fi
 - Minor cleanup: use upstream patch to export block_{get,put}_queue
 - block-blkdev_get-should-access-bd_disk-only-after.patch:
   fix potential oops introduced in 2.6.38.8
-- ahci-add-another-pci-id-for-marvell.patch (#705960)
+- ahci-add-another-pci-id-for-marvell.patch (rhbz#705960)
 - CVE-2011-2183: ksm: race between ksmd and exiting task
-- Revert 2.6.38.8 patch that broke magicmouse (#714381)
+- Revert 2.6.38.8 patch that broke magicmouse (rhbz#714381)
+- Fix drive detection failure on mvsas (rhbz#705019)
 
 * Thu Jun 23 2011 Dave Airlie <airlied at redhat.com> 2.6.38.8-34
 - drm-i915-snb-irq-stalls-fix.patch: fix Sandybridge IRQ stalls
diff --git a/libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch b/libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch
new file mode 100644
index 0000000..85016b4
--- /dev/null
+++ b/libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch
@@ -0,0 +1,72 @@
+From: Nishanth Aravamudan <nacc at us.ibm.com>
+Date: Thu, 16 Jun 2011 15:28:36 +0000 (-0700)
+Subject: libata/sas: only set FROZEN flag if new EH is supported
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=3f1e046ad3370d22d39529103667354eb50abc08
+
+libata/sas: only set FROZEN flag if new EH is supported
+
+On 16.06.2011 [08:28:39 -0500], Brian King wrote:
+> On 06/16/2011 02:51 AM, Tejun Heo wrote:
+> > On Wed, Jun 15, 2011 at 04:34:17PM -0700, Nishanth Aravamudan wrote:
+> >>> That looks like the right thing to do. For ipr's usage of
+> >>> libata, we don't have the concept of a port frozen state, so this flag
+> >>> should really never get set. The alternate way to fix this would be to
+> >>> only set ATA_PFLAG_FROZEN in ata_port_alloc if ap->ops->error_handler
+> >>> is not NULL.
+> >>
+> >> It seemed like ipr is as you say, but I wasn't sure if it was
+> >> appropriate to make the change above in the common libata-scis code or
+> >> not. I don't want to break some other device on accident.
+> >>
+> >> Also, I tried your suggestion, but I don't think that can happen in
+> >> ata_port_alloc? ata_port_alloc is allocated ap itself, and it seems like
+> >> ap->ops typically gets set only after ata_port_alloc returns?
+> >
+> > Maybe we can test error_handler in ata_sas_port_start()?
+>
+> Good point. Since libsas is converted to the new eh now, we would need to have
+> this test.
+
+Commit 7b3a24c57d2eeda8dba9c205342b12689c4679f9 ("ahci: don't enable
+port irq before handler is registered") caused a regression for CD-ROMs
+attached to the IPR SATA bus on Power machines:
+
+  ata_port_alloc: ENTER
+  ata_port_probe: ata1: bus probe begin
+  ata1.00: ata_dev_read_id: ENTER
+  ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40)
+  ata1.00: ata_dev_read_id: ENTER
+  ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40)
+  ata1.00: limiting speed to UDMA7:PIO5
+  ata1.00: ata_dev_read_id: ENTER
+  ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40)
+  ata1.00: disabled
+  ata_port_probe: ata1: bus probe end
+  scsi_alloc_sdev: Allocation failure during SCSI scanning, some SCSI devices might not be configured
+
+The FROZEN flag added in that commit is only cleared by the new EH code,
+which is not used by ipr. Clear this flag in the SAS code if we don't
+support new EH.
+
+Reported-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
+Signed-off-by: Nishanth Aravamudan <nacc at us.ibm.com>
+Signed-off-by: Jeff Garzik <jgarzik at pobox.com>
+---
+
+diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
+index d51f979..927f968 100644
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -3797,6 +3797,12 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc);
+  */
+ int ata_sas_port_start(struct ata_port *ap)
+ {
++	/*
++	 * the port is marked as frozen at allocation time, but if we don't
++	 * have new eh, we won't thaw it
++	 */
++	if (!ap->ops->error_handler)
++		ap->pflags &= ~ATA_PFLAG_FROZEN;
+ 	return 0;
+ }
+ EXPORT_SYMBOL_GPL(ata_sas_port_start);


More information about the scm-commits mailing list