RE: CF flash IDE failure to attach with 2.6.20+

2007-06-25 Thread Andrew Hall
 Does piix driver work?  If so, can you post boot dmesg and the result
 of
 'hdparm -I /dev/hdX'?

I've still been battling to get this hardware detected with any of the
drivers mentioned previously except the newer libata piix driver. However
when using the old driver and using all-generic-ide and irqpoll as
kernel parameters I now have the device being detected albeit complaining
about lost interrupts and DMA timeouts. Here is the output from the hdparm
-I /dev/hda that you requested:

/dev/hda:

ATA device, with non-removable media
Model Number:   CF CARD 512MB
Serial Number:  CF512   0001943B
Firmware Revision:  20070131
Standards:
Likely used: 5
Configuration:
Logical max current
cylinders   983 983
heads   16  16
sectors/track   63  63
--
CHS current addressable sectors: 990864
LBAuser addressable sectors: 990864
device size with M = 1024*1024: 483 MBytes
device size with M = 1000*1000: 507 MBytes
Capabilities:
LBA, IORDY(may be)(cannot be disabled)
bytes avail on r/w long: 4  Queue depth: 1
Standby timer values: spec'd by Vendor
R/W multiple sector transfer: Max = 1   Current = 1
DMA: mdma0 mdma1 *mdma2
 Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
 Cycle time: no flow control=120ns  IORDY flow control=120ns
HW reset results:
CBLID- below Vih
Device num = 0

Many thanks for your help.

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: CF flash IDE failure to attach with 2.6.20+

2007-06-21 Thread Andrew Hall
 
 Does piix driver work?  If so, can you post boot dmesg and the result
 of
 'hdparm -I /dev/hdX'?

Unfortunately it doesn't seem to be detected at all, although I'm not
exactly sure which driver you're referring to. I have tried:

New ATA drivers: 
Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support - is detected but fails
Intel PATA MPIIX support - is not detected at all (which I think is right)
Intel PATA old PIIX support (Experimental) - is not detected at all (which I
think is wrong - it should be)

Old ATA/IDE driver:
Intel PIIXn chipsets support - is not detected at all (which is right as the
bus is SATA)

Thanks,


-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: CF flash IDE failure to attach with 2.6.20+

2007-06-21 Thread Mark Lord

Andrew Hall wrote:

Does piix driver work?  If so, can you post boot dmesg and the result
of
'hdparm -I /dev/hdX'?


Unfortunately it doesn't seem to be detected at all, although I'm not
exactly sure which driver you're referring to. I have tried:

New ATA drivers: 
Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support - is detected but fails

Intel PATA MPIIX support - is not detected at all (which I think is right)
Intel PATA old PIIX support (Experimental) - is not detected at all (which I
think is wrong - it should be)

Old ATA/IDE driver:
Intel PIIXn chipsets support - is not detected at all (which is right as the
bus is SATA)


I think Tejun would like you to patch the PCI ID for your ICH8
into the Old ATA/IDE PIIXn driver, and then try that.

Cheers
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: CF flash IDE failure to attach with 2.6.20+

2007-06-21 Thread Andrew Hall
 
 I think Tejun would like you to patch the PCI ID for your ICH8
 into the Old ATA/IDE PIIXn driver, and then try that.

Maybe I'm a bit slow on the uptake, but how exactly do I do this patch the
PCI ID into the driver? I run a monolithic kernel will all these drivers
compiled in. None of them are found by the hardware except the newer libATA
driver (CONFIG_ATA_PIIX) for Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA. If I
have removed each driver in turn and none of the others are detected. 

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: CF flash IDE failure to attach with 2.6.20+

2007-06-20 Thread Andrew Hall
 I suppose you were using ata_piix too in older kernel, right?  Can you
 post the boot dmesg of 2.6.19?  We used to ignore mwdma mode before and
 enabled it at some point after that.  That may be the cause here.
 
 Also, please try the attached patch on top of 2.6.20.

Sorry guys, I've actually got it wrong. The hardware that I have been
testing on has a different chipset: Intel ICH8, to what I was using
previously with success with 2.6.19 (this was ICH4 based hardware) - so the
driver is actually different now. 

Tejun, your patch for 2.6.20 failed with the same errors.

For completeness I have tested the newer ICH8 hardware with everything from
2.6.15 through to 2.6.21.5 using the ata_piix drivers and it (the Compact
Flash) fails in all kernels. Here is the (relevant) dmesg from 2.6.21.5
showing the CF being disabled:

ata_piix :00:1f.2: version 2.10ac1
ata_piix :00:1f.2: MAP [ P0 P2 P1 P3 ]
ACPI: PCI Interrupt :00:1f.2[B] - GSI 19 (level, low) - IRQ 19
PCI: Setting latency timer of device :00:1f.2 to 64
ata1: SATA max UDMA/133 cmd 0x0001fa00 ctl 0x0001f902 bmdma 0x0001f600 irq
19
ata2: SATA max UDMA/133 cmd 0x0001f800 ctl 0x0001f702 bmdma 0x0001f608 irq
19
scsi0 : ata_piix
ata1.00: ATA-0: CF CARD 512MB, 20070131, max MWDMA2
ata1.00: 990864 sectors, multi 0: LBA
ata1.00: applying bridge limits
ata1.00: configured for MWDMA2
scsi1 : ata_piix
ATA: abnormal status 0x7F on port 0x0001f807
scsi 0:0:0:0: Direct-Access ATA  CF CARD 512MB2007 PQ: 0 ANSI: 5
SCSI device sda: 990864 512-byte hdwr sectors (507 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: disabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sda: 990864 512-byte hdwr sectors (507 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: disabled, read cache: enabled, doesn't support
DPO or FUA
 sda:3ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
 res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1: port is slow to respond, please be patient (Status 0xd0)
ata1: port failed to respond (30 secs, Status 0xd0)
ata1: soft resetting port
ata1.00: failed to IDENTIFY (INIT_DEV_PARAMS failed, err_mask=0x80)
ata1.00: revalidation failed (errno=-5)
ata1: failed to recover some devices, retrying in 5 secs
ata1: soft resetting port
ata1.00: failed to IDENTIFY (INIT_DEV_PARAMS failed, err_mask=0x80)
ata1.00: revalidation failed (errno=-5)
ata1.00: limiting speed to MWDMA2:PIO3
ata1: failed to recover some devices, retrying in 5 secs
ata1: soft resetting port
ata1.00: failed to IDENTIFY (INIT_DEV_PARAMS failed, err_mask=0x80)
ata1.00: revalidation failed (errno=-5)
ata1.00: disabled
ata1: EH complete
sd 0:0:0:0: SCSI error: return code = 0x0004
end_request: I/O error, dev sda, sector 0

Here is the lspci -v for the controller:

00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA
IDE Controller (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
Subsystem: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE
Controller
Flags: bus master, 66Mhz, medium devsel, latency 0, IRQ 19
I/O ports at fa00 [size=8]
I/O ports at f900 [size=4]
I/O ports at f800 [size=8]
I/O ports at f700 [size=4]
I/O ports at f600 [size=16]
I/O ports at f500 [size=16]
Capabilities: [70] Power Management version 3

Please let me know if there is any further information I can provide to help
fix this issue.

Thanks,

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: CF flash IDE failure to attach with 2.6.20+

2007-06-20 Thread Tejun Heo
Andrew Hall wrote:
 I suppose you were using ata_piix too in older kernel, right?  Can you
 post the boot dmesg of 2.6.19?  We used to ignore mwdma mode before and
 enabled it at some point after that.  That may be the cause here.

 Also, please try the attached patch on top of 2.6.20.
 
 Sorry guys, I've actually got it wrong. The hardware that I have been
 testing on has a different chipset: Intel ICH8, to what I was using
 previously with success with 2.6.19 (this was ICH4 based hardware) - so the
 driver is actually different now. 
 
 Tejun, your patch for 2.6.20 failed with the same errors.
 
 For completeness I have tested the newer ICH8 hardware with everything from
 2.6.15 through to 2.6.21.5 using the ata_piix drivers and it (the Compact
 Flash) fails in all kernels. Here is the (relevant) dmesg from 2.6.21.5
 showing the CF being disabled:

Does piix driver work?  If so, can you post boot dmesg and the result of
'hdparm -I /dev/hdX'?

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: CF flash IDE failure to attach with 2.6.20+

2007-06-18 Thread Tejun Heo
Andrew_hall wrote:
 We have a series of machines that use CF as a boot media. Since upgrading to
 2.6.20 (tried .9-.14), system will boot (from the flash media) but then fail
 to initialise the same media. Here is the dmesg from 2.6.20.14:
 
 ata_piix :00:1f.2: version 2.00ac7
 ata_piix :00:1f.2: MAP [ P0 P2 P1 P3 ]
 ACPI: PCI Interrupt :00:1f.2[B] - GSI 19 (level, low) - IRQ 19
 PCI: Setting latency timer of device :00:1f.2 to 64
 ata1: SATA max UDMA/133 cmd 0xFA00 ctl 0xF902 bmdma 0xF600 irq 19
 ata2: SATA max UDMA/133 cmd 0xF800 ctl 0xF702 bmdma 0xF608 irq 19
 scsi0 : ata_piix
 ata1.00: ATA-0, max MWDMA2, 990864 sectors: LBA
 ata1.00: ata1: dev 0 multi count 0
 ata1.00: applying bridge limits
 ata1.00: configured for MWDMA2

For some reason, mwdma doesn't work in libata now.  I'm not sure why
tho.  Alan, can you enlighten us?

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: CF flash IDE failure to attach with 2.6.20+

2007-06-18 Thread Alan Cox
On Mon, 18 Jun 2007 20:26:11 +0900
Tejun Heo [EMAIL PROTECTED] wrote:

 Andrew_hall wrote:
  We have a series of machines that use CF as a boot media. Since upgrading to
  2.6.20 (tried .9-.14), system will boot (from the flash media) but then fail
  to initialise the same media. Here is the dmesg from 2.6.20.14:
  
  ata_piix :00:1f.2: version 2.00ac7
  ata_piix :00:1f.2: MAP [ P0 P2 P1 P3 ]
  ACPI: PCI Interrupt :00:1f.2[B] - GSI 19 (level, low) - IRQ 19
  PCI: Setting latency timer of device :00:1f.2 to 64
  ata1: SATA max UDMA/133 cmd 0xFA00 ctl 0xF902 bmdma 0xF600 irq 19
  ata2: SATA max UDMA/133 cmd 0xF800 ctl 0xF702 bmdma 0xF608 irq 19
  scsi0 : ata_piix
  ata1.00: ATA-0, max MWDMA2, 990864 sectors: LBA
  ata1.00: ata1: dev 0 multi count 0
  ata1.00: applying bridge limits
  ata1.00: configured for MWDMA2
 
 For some reason, mwdma doesn't work in libata now.  I'm not sure why
 tho.  Alan, can you enlighten us?

No idea at all. All my hardware is still happy. 2.6.20 is an old kernel
however so it does predate the fixes you did for ata_piix mode setup ?

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: CF flash IDE failure to attach with 2.6.20+

2007-06-18 Thread Andrew Hall
 
  For some reason, mwdma doesn't work in libata now.  I'm not sure why
  tho.  Alan, can you enlighten us?
 
 No idea at all. All my hardware is still happy. 2.6.20 is an old
 kernel
 however so it does predate the fixes you did for ata_piix mode setup ?

Old - yes, but more stable in all other respects it seems to the .21 series.
Are these patches available for me to try on .20 or are there dependencies
on 21? 

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: CF flash IDE failure to attach with 2.6.20+

2007-06-18 Thread Andrew Hall

  ata1.00: configured for MWDMA2
 
 For some reason, mwdma doesn't work in libata now.  I'm not sure why
 tho.  Alan, can you enlighten us?

If the CF is having trouble with DMA, how do I specifically turn off DMA
only on this one bus?

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: CF flash IDE failure to attach with 2.6.20+

2007-06-18 Thread Tejun Heo
Andrew Hall wrote:
 For some reason, mwdma doesn't work in libata now.  I'm not sure why
 tho.  Alan, can you enlighten us?
 No idea at all. All my hardware is still happy. 2.6.20 is an old
 kernel
 however so it does predate the fixes you did for ata_piix mode setup ?
 
 Old - yes, but more stable in all other respects it seems to the .21 series.
 Are these patches available for me to try on .20 or are there dependencies
 on 21? 
 

I suppose you were using ata_piix too in older kernel, right?  Can you
post the boot dmesg of 2.6.19?  We used to ignore mwdma mode before and
enabled it at some point after that.  That may be the cause here.

Also, please try the attached patch on top of 2.6.20.

-- 
tejun
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 9c07b88..924e447 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -685,8 +685,14 @@ static void piix_set_piomode (struct ata_port *ap, struct 
ata_device *adev)
if (adev-class == ATA_DEV_ATA)
control |= 4;   /* PPE enable */
 
+   /* PIO configuration clears DTE unconditionally.  It will be
+* programmed in set_dmamode which is guaranteed to be called
+* after set_piomode if any DMA mode is available.
+*/
pci_read_config_word(dev, master_port, master_data);
if (is_slave) {
+   /* clear TIME1|IE1|PPE1|DTE1 */
+   master_data = 0xff0f;
/* Enable SITRE (seperate slave timing register) */
master_data |= 0x4000;
/* enable PPE1, IE1 and TIME1 as needed */
@@ -694,12 +700,14 @@ static void piix_set_piomode (struct ata_port *ap, struct 
ata_device *adev)
pci_read_config_byte(dev, slave_port, slave_data);
slave_data = (ap-port_no ? 0x0f : 0xf0);
/* Load the timing nibble for this slave */
-   slave_data |= ((timings[pio][0]  2) | timings[pio][1])  
(ap-port_no ? 4 : 0);
+   slave_data |= ((timings[pio][0]  2) | timings[pio][1])
+(ap-port_no ? 4 : 0);
} else {
-   /* Master keeps the bits in a different format */
-   master_data = 0xccf8;
+   /* clear ISP|RCT|TIME0|IE0|PPE0|DTE0 */
+   master_data = 0xccf0;
/* Enable PPE, IE and TIME as appropriate */
master_data |= control;
+   /* load ISP and RCT */
master_data |=
(timings[pio][0]  12) |
(timings[pio][1]  8);
@@ -816,7 +824,7 @@ static void do_pata_set_dmamode (struct ata_port *ap, 
struct ata_device *adev, i
master_data = 0xFF4F;  /* Mask out IORDY|TIME1|DMAONLY 
*/
master_data |= control  4;
pci_read_config_byte(dev, 0x44, slave_data);
-   slave_data = (0x0F + 0xE1 * ap-port_no);
+   slave_data = (ap-port_no ? 0x0f : 0xf0);
/* Load the matching timing */
slave_data |= ((timings[pio][0]  2) | 
timings[pio][1])  (ap-port_no ? 4 : 0);
pci_write_config_byte(dev, 0x44, slave_data);
@@ -828,8 +836,11 @@ static void do_pata_set_dmamode (struct ata_port *ap, 
struct ata_device *adev, i
(timings[pio][0]  12) |
(timings[pio][1]  8);
}
-   udma_enable = ~(1  devid);
-   pci_write_config_word(dev, master_port, master_data);
+
+   if (ap-udma_mask) {
+   udma_enable = ~(1  devid);
+   pci_write_config_word(dev, master_port, master_data);
+   }
}
/* Don't scribble on 0x48 if the controller does not support UDMA */
if (ap-udma_mask)