linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* libata/ipr/powerpc: regression between 2.6.39-rc4 and 2.6.39-rc5
@ 2011-06-15 19:17 Nishanth Aravamudan
  2011-06-15 20:02 ` Brian King
  0 siblings, 1 reply; 15+ messages in thread
From: Nishanth Aravamudan @ 2011-06-15 19:17 UTC (permalink / raw)
  To: jgarzik; +Cc: wayneb, linux-kernel, linux-ide, tj, mbizon, linuxppc-dev

Hi Jeff,

It appears that commit 7b3a24c57d2eeda8dba9c205342b12689c4679f9 broke
CD-ROMs on the IPR SATA bus on powerpc 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 commit in question is tagged as AHCI, but does touch the libata
core. I'm not well-versed with this code, but here's what I think I know
:)

>From __scsi_add_device, we first allocate the target:

 scsi_alloc_target ->
  shost->hostt->target_alloc ->
   ipr_target_alloc ->
    ata_port_alloc ->
     sets FROZEN

We error out when we allocate the sdev:

 scsi_alloc_sdev ->
  shost->hostt->slave_alloc ->
   ipr_slave_alloc ->
    ipr_ata_slave_alloc ->
     ata_sas_port_init ->
      ata_port_probe

>From what I can tell, the only place that explicitly clears the FROZEN
flag is the error-handling code via ata_eh_thaw_port().

So I thought either we're not invoking the error-handler at probe time
correctly to kick the port or perhaps the SAS code is not clearing the
flag?

I tried the following patch:

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index d51f979..abd0e0b 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3797,6 +3797,7 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc);
  */
 int ata_sas_port_start(struct ata_port *ap)
 {
+       ap->pflags &= ~ATA_PFLAG_FROZEN;
        return 0;
 }
 EXPORT_SYMBOL_GPL(ata_sas_port_start);

and the CD-ROM drive works, but I have no idea if it's the right thing
to do. I chose this particular change, FWIW, because we call
ata_sas_port_start before we probe in ata_sas_port_init and it seems
like we need to mark the port as not frozen before we init it? Perhaps
that should really be a call to a thaw function, not sure. Let's just
say the ATA/SAS/SCSI interactions are a bit hard to follow at first :)

Any insight you can provide would be great!

Thanks,
Nish


-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-06-23 21:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15 19:17 libata/ipr/powerpc: regression between 2.6.39-rc4 and 2.6.39-rc5 Nishanth Aravamudan
2011-06-15 20:02 ` Brian King
2011-06-15 23:34   ` Nishanth Aravamudan
2011-06-16  7:51     ` Tejun Heo
2011-06-16 13:28       ` Brian King
2011-06-16 15:28         ` [PATCH] libata/sas: only set FROZEN flag if new EH is supported Nishanth Aravamudan
2011-06-21 16:07           ` Nishanth Aravamudan
2011-06-21 20:30             ` Brian King
2011-06-21 20:39               ` Jeff Garzik
2011-06-23  4:31               ` Benjamin Herrenschmidt
2011-06-23  4:42                 ` Benjamin Herrenschmidt
2011-06-23  5:10                   ` Benjamin Herrenschmidt
2011-06-23 17:15                   ` Nishanth Aravamudan
2011-06-23 20:05                     ` Brian King
2011-06-23 21:43                       ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).