Bug 7608 - 2.6.19 - ATA Support for ICH4 with libata 2.0 layer partially broken
Summary: 2.6.19 - ATA Support for ICH4 with libata 2.0 layer partially broken
Status: RESOLVED CODE_FIX
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Serial ATA (show other bugs)
Hardware: i386 Linux
: P2 high
Assignee: Tejun Heo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-01 01:58 UTC by Torsten Krah
Modified: 2007-01-23 08:35 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.19
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
debug patch (1.68 KB, patch)
2006-12-03 22:54 UTC, Tejun Heo
Details | Diff
common-pio-mode (1.34 KB, patch)
2006-12-06 20:23 UTC, Tejun Heo
Details | Diff
common-pio-mode-patch-against-2.6.19 (1.27 KB, patch)
2006-12-07 03:03 UTC, Tejun Heo
Details | Diff
dmesg after patching (15.05 KB, text/plain)
2006-12-07 10:23 UTC, Torsten Krah
Details
test patch (430 bytes, patch)
2006-12-27 05:25 UTC, Tejun Heo
Details | Diff
dmesg with applied test patch (15.03 KB, text/plain)
2006-12-27 07:02 UTC, Torsten Krah
Details
libata patch cocktail (8.05 KB, patch)
2007-01-03 00:04 UTC, Tejun Heo
Details | Diff
dmesg with 2.6.20-rc3 + patch (15.55 KB, text/plain)
2007-01-07 01:49 UTC, Torsten Krah
Details

Description Torsten Krah 2006-12-01 01:58:08 UTC
Most recent kernel where this bug did *NOT* occur: 2.6.18.x
Distribution: Gentoo
Hardware Environment: Samsung P35 1600 III
Software Environment: 
Problem Description:

Got an ICH4 chipset.
On 2.6.19 i tried to use the new ATA layer.

Removed all from the old layer and only checked PATA Support for PIIX old und MPIIX.
It does not find the controller - i have to check the PIIX SATA Support too - i
think this should be a dependeny automatically set or build, because PATA does
not work without the SATA driver for PIIX.

The thing which wont work - my DVD drive is gone - the HDD works fine with the
new layer, dmesg output:

ata_piix 0000:00:1f.1: version 2.00ac6
ata1: PATA max UDMA/100 cmd 0x1F0 ctl 0x3F6 bmdma 0x1860 irq 14
ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1868 irq 15
scsi0 : ata_piix
ata1.00: ATA-7, max UDMA/100, 156368016 sectors: LBA48
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/100
scsi1 : ata_piix
ata2.00: ATAPI, max UDMA/33
ata2.00: configured for UDMA/33
scsi 0:0:0:0: Direct-Access     ATA      SAMSUNG MP0804H  UE10 PQ: 0 ANSI: 5
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2.00: configured for UDMA/33
ata2: EH complete
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2.00: configured for UDMA/33
ata2: EH complete
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2.00: configured for UDMA/33
ata2: EH complete
ata2.00: limiting speed to UDMA/25
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2.00: configured for UDMA/25
ata2: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: (BMDMA stat 0x4)
ata1.00: tag 0 cmd 0xca Emask 0x2 stat 0x58 err 0x0 (HSM violation)
ata1: soft resetting port
ata1.00: configured for UDMA/100
ata1: EH complete
ata1: EH complete


2.6.18.1 output:

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH4: IDE controller at PCI slot 0000:00:1f.1
ICH4: chipset revision 3
ICH4: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x1860-0x1867, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0x1868-0x186f, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
hda: SAMSUNG MP0804H, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: DV-W24ES, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 512KiB
hda: 156368016 sectors (80060 MB) w/8192KiB Cache, CHS=16383/255/63, UDMA(100)
hda: cache flushes supported
 hda: hda1 hda2 hda3 hda4
hdc: ATAPI 24X DVD-ROM DVD-R-RAM CD-R/RW drive, 2193kB Cache, UDMA(33)


Steps to reproduce:

Compile kernel without old ATA support, only include ATA, PIIX SATA, MPIIX PATA
and PATA PIIX old PATA driver.
Boot and watch.

Any help welcome. 

thx, Torsten
Comment 1 Torsten Krah 2006-12-01 02:01:29 UTC
Comment to first post:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: (BMDMA stat 0x4)
ata1.00: tag 0 cmd 0xca Emask 0x2 stat 0x58 err 0x0 (HSM violation)
ata1: soft resetting port
ata1.00: configured for UDMA/100
ata1: EH complete
ata1: EH complete

These lines from the output above was produced, trying to set different
parameters to the ide hdd drive with hdparm - i have to do so to set -S0 to get
rid of the annoying 5 seconds spin down/up cycles.
However, does not work.
Comment 2 Alan 2006-12-01 11:16:10 UTC
Yes its another of the billion examples of the broken new EH behaviour. libata
PATA work is essentially halted barring some chip specific debug until this one
gets sorted. Back out the new eh/probe code and everything works fine.

Probably all these bugs should get merged into a single bug entry.

[removing cc]
Comment 3 Tejun Heo 2006-12-03 22:54:50 UTC
Created attachment 9730 [details]
debug patch

Please apply the attached patch on 2.6.19 and report boot dmesg.
Comment 4 Torsten Krah 2006-12-04 00:50:08 UTC
Applied the patch, this was the output:

libata version 2.00 loaded.
ata_piix 0000:00:1f.1: version 2.00ac6
ata1: PATA max UDMA/100 cmd 0x1F0 ctl 0x3F6 bmdma 0x1860 irq 14
ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1868 irq 15
scsi0 : ata_piix
ata1.00: ATA-7, max UDMA/100, 156368016 sectors: LBA48
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/100
scsi1 : ata_piix
ata2.00: ATAPI, max UDMA/33
ata2.00: configured for UDMA/33
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
(scsi_eh_1)
ata2: soft resetting port
ata2.00: configured for UDMA/33
ata2: EH complete
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
(scsi_eh_1)
ata2: soft resetting port
ata2.00: configured for UDMA/33
ata2: EH complete
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
(scsi_eh_1)
ata2: soft resetting port
ata2.00: configured for UDMA/33
ata2: EH complete
ata2.00: limiting speed to UDMA/25
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x4)
ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
(scsi_eh_1)
ata2: soft resetting port
ata2.00: configured for UDMA/25
ata2: EH complete
Comment 5 Tejun Heo 2006-12-06 20:23:12 UTC
Please test the attached patch.
Comment 6 Tejun Heo 2006-12-06 20:23:49 UTC
Created attachment 9749 [details]
common-pio-mode
Comment 7 Torsten Krah 2006-12-07 02:39:43 UTC
Patch does not apply - i'll try my best to comply, but your are not using 2.6.19
vanilla, do you?
Comment 8 Tejun Heo 2006-12-07 03:03:20 UTC
Created attachment 9752 [details]
common-pio-mode-patch-against-2.6.19

Argh... You're right.  I thought there was no xfermode related change in devel
tree.  Sorry about that.  Here's regenerated patch against 2.6.19.
Comment 9 Torsten Krah 2006-12-07 10:23:42 UTC
Created attachment 9756 [details]
dmesg after patching 

Applied the changes myself - like the second patch ;-).

Result are bad - drive still not there, same EH messages - but additionally,
udev crashs ( kernel bug ) and the sound semaphore got some errors ( near end
of dmesg ) - look at the complete dmesg dump.
This only happens with the last patch, without - all is fine.
Comment 10 Torsten Krah 2006-12-07 10:25:31 UTC
Comment to last one:

All is fine except the bug discussed - thought of the udev crash and semaphore
things ;-).
Comment 11 Tejun Heo 2006-12-27 05:25:28 UTC
Created attachment 9954 [details]
test patch
Comment 12 Tejun Heo 2006-12-27 05:26:08 UTC
Please test the attached patch.  It's against 2.6.19.  Thanks and happy new year.
Comment 13 Torsten Krah 2006-12-27 07:02:34 UTC
Created attachment 9956 [details]
dmesg with applied test patch

Applied the patch.
No udev crash or oops anymore - but still no success with the dvd drive.
The other patches are still applied, if i have to apply some of your patches
against a clean tree plz tell.
Best wishes for you too.

Torsten
Comment 14 Tejun Heo 2006-12-27 19:34:07 UTC
That's enough.  Hmm... Can you give a shot at 2.6.20-rc2?  Thanks.
Comment 15 Tejun Heo 2007-01-03 00:04:30 UTC
Created attachment 9997 [details]
libata patch cocktail

Please test 2.6.20-rc3 with the patch applied, thanks.
Comment 16 Torsten Krah 2007-01-07 01:49:04 UTC
Created attachment 10016 [details]
dmesg with 2.6.20-rc3 + patch

DVD is found now. 
Looks good - although if you look at the end of the dmesg report, sometimes
there are some HSM Violations on the port with my harddisk drive - don't know
if this is related to this bug, don't think so - should i create a new one or
is this a known problem, or should we discuss here too?
Comment 17 Sero 2007-01-14 02:10:50 UTC
Is there a chance to get this fix commited befor the 2.6.20 release? This bug
makes kernels > 2.8.16 unusable for me (e.g. some recent distros like opensuse
10.2 and ubuntu feisty won't even install). Do you need any additional information?

Regards
Sero 
Comment 18 Tejun Heo 2007-01-14 19:36:41 UTC
Sorry, I didn't have time to work on this last week.  The cocktail patch is
cocktail of candidate fixes.  I still need to narrow down which exact change
fixes the problem.  I'll post a patch to do that today or tomorrow.  Thanks for
your patience.
Comment 19 Sero 2007-01-15 23:30:24 UTC
Thanks for your new patch cocktail Tejun Heo. It works fine against
kernel-2.6.20-rc5, my DVD drive is found and all error messages are gone. I have
to go to university now and will report back everything you requested in your
mail this evening. 
Comment 20 Sero 2007-01-22 13:26:50 UTC
As I already wrote you via E-Mail the problem is gone for me in 2.6.20-rc5 (no
need for you patches). So it seems my problem was a little different from the
one in this bugreport.
Comment 21 Torsten Krah 2007-01-23 08:30:24 UTC
With 2.6.20-rc5 the problem is gone for me too, my dvd drive is found and
programmed without any problems.
Should i still test your cocktail patch and reports things?
Comment 22 Tejun Heo 2007-01-23 08:35:40 UTC
No, that's enough.  Thanks.  Closing this bug.

Note You need to log in before you can comment on or make changes to this bug.