Most recent kernel where this bug did not occur: Good question Distribution: Gentoo Hardware Environment: Pegasos 2 / PPC G4 1GHz / 1GB Ram Software Environment: - Problem Description: Generaly I must say my ATAPI drive fails always with libata pata driver, but some time ago I decide to upgrade my Fedora 6 to recent version and it seems they switched completly to libata and this is a good reason to report this here I guess. When booting libata enabled kernel it fails with following message: .... ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata2: soft resetting port ata2.00: configured for UDMA/66 ata2: EH complete ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata2: soft resetting port ata2.00: configured for UDMA/66 ata2: EH complete ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata2: soft resetting port ata2.00: configured for UDMA/66 ata2: EH complete ata2.00: limiting speed to UDMA/44:PIO4 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata2: soft resetting port ata2.00: configured for UDMA/44 ata2: EH complete .... In previous kernel version (.19) it fails when set xfermode with similar message, but after diging up on redhat bugzilla I located a patch to enable ATA_TFLAG_POLLING by default (Attached) and now it looks like that. Fedora installer complains about missing CD/DVD driver and it makes impossible to install/upgrade it here. I send some e-mails to Alan Cox about this problem when I first try to use pata_via (Around 2.6.16/2.6.17), but without any result. I attach a full serial log from faulty boot and hdparm/lspci info from my system. Steps to reproduce: -
Created attachment 11776 [details] Log from faulty boot
Created attachment 11777 [details] hda info
Created attachment 11778 [details] hdd info
Created attachment 11779 [details] lspci
Created attachment 11780 [details] Kernel configuration
Hmm... This is the third report where INQUIRY fails. Three different ODD models on three different controllers. Were you able to burn cd/dvd using cdrecord or wodim with the IDE driver?
(In reply to comment #6) This drive works without any problems with old via ata driver and I never had any problems with it. Also I burned at last one hundred dvd's using k3b without any problems too. Maybe this would help. Previously I had BenQ BenQ DW-1640 drive with similar problem, it fails with xfermode set when boot libata enabled kernel. I tired it on x86 box but with NForce2 chipset and it works without any problems with libata.
Hmmm, but maybe the present problem and set xfermode problem are two diffrent problems as xfer should be fixed with this attached patch. Unfortunatly I can not check current kernel with this old DW-1640 :(
The SETXFERMODE issue is caused by the via controller. It raises interrupt too early (before the command is actually complete) and thus causes HSM violation. Polling execution solves the problem.
Created attachment 11789 [details] pio-inquiry-horkage.patch Does this patch make any difference?
Im afraid this patch doesn't make any diffrence here ;( Still same messages when booting. Also a small thing take my attention: ata1: PATA max UDMA/100 cmd 0xfdff1040 ctl 0xfdff104e bmdma 0xfdff1060 irq 14 ata2: PATA max UDMA/100 cmd 0xfdff1050 ctl 0xfdff105e bmdma 0xfdff1068 irq 14 I wonder why both channels use same irq ? With old ata drivers it looks diffrent and ide0 uses irq 14 and ide1 uses irq 15.
Please post full dmesg. Hmmm... indeed. Please also post the result of 'lspci -nnvvvxxx'. Thanks.
Created attachment 11813 [details] use-irq-driven-IDENTIFY-and-SETXFERMODE.patch Also, please test this one and report the result.
Created attachment 11823 [details] update-ata_check_atapi_dma.patch Okay, scrap that. Please test this one. This gotta be it.
Created attachment 11825 [details] full dmesg from working kernel
Created attachment 11826 [details] lspci -nnvvvxxx as requested
I compiled kernel with path from #14, but this one doesn't solve my problem too. I can still see same error messages when boot. It detects my HD quite fast and stops when detecting DVD drive for maybe a second or two and prints this timeout error. I wonder about this irq thing, can this be related ?
Okay, got it. It's PPC CHRP, right? VIA chip on that machine lies about its IRQ usage. It reports it's in native PCI mode using IRQ 14 for both channels but it actually uses legacy IRQs (14 for primary, 15 for secondary). I'll prepare a quick fix for pata_via.
Created attachment 11836 [details] pata_via-ppc-chrp-workaround.patch Please test this patch. Thanks.
I assume this patch is for 2.6.22rcX as it not apply cleanly to 2.6.21. I will compile rc5 if required, but this will take some time. Anyway I apply it by hand to 2.6.21 and it seems this fixed this irq problem: .... loop: loaded (max 8 devices) ata1: PATA max UDMA/100 cmd 0xfdff01f0 ctl 0xfdff03f6 bmdma 0xfdff1060 irq 14 ata2: PATA max UDMA/100 cmd 0xfdff0170 ctl 0xfdff0376 bmdma 0xfdff1068 irq 15 scsi0 : pata_via scsi1 : pata_via PCI: Enabling device 0000:00:05.2 (0000 -> 0002) ehci_hcd 0000:00:05.2: EHCI Host Controller .... But as you can see it doesn't detect anything on both channels this way :/
Sorry about the delay. -EWASBURIEDINDEBUGGING. That's weird. Can you test 2.6.22-rc6 without the patch and report dmesg, both with pata_via and via82cxxx? Thanks.
Of, coz. Tested with rc7 for old ata and pata. BTW This legacy irq fix seems to be a good direction at last for irq problem. Take a look at: http://www.powerdeveloper.org/forums/viewtopic.php?p=8299#8299
Created attachment 11916 [details] Boot with old ata drivers && 2.6.22-rc7
Created attachment 11917 [details] Boot with libata pata drivers && 2.6.22-rc7
Hmmm... What did I do wrong? So, no device is detected if you apply the patch from comment 19, right? Can you turn on ATA_DEBUG in include/linux/libata.h and report the full boot log? The patch should only affect IRQ. Dunno why it's affecting device detection like that. I tried to comment on the powerdeveloper entry but my account hasn't been approved yet. Can you tell Matt Sealey that this case is a bit special because the controller claims to be in native mode and IO registers are allocated using PCI BARs but only IRQs are in legacy configuration (using both 14/15). I don't think you can work around this by flipping legacy bit in the PCI header.
Subject: Re: pata_via fails to initialize dvd burner 2007/7/2, bugme-daemon@bugzilla.kernel.org <bugme-daemon@bugzilla.kernel.org>: > http://bugzilla.kernel.org/show_bug.cgi?id=8649 > > > > > > ------- Comment #25 from htejun@gmail.com 2007-07-02 03:57 ------- > Hmmm... What did I do wrong? So, no device is detected if you apply the > patch > from comment 19, right? Can you turn on ATA_DEBUG in include/linux/libata.h > and report the full boot log? The patch should only affect IRQ. Dunno why > it's affecting device detection like that. > > I tried to comment on the powerdeveloper entry but my account hasn't been > approved yet. Can you tell Matt Sealey that this case is a bit special > because > the controller claims to be in native mode and IO registers are allocated > using > PCI BARs but only IRQs are in legacy configuration (using both 14/15). I > don't > think you can work around this by flipping legacy bit in the PCI header. > > > -- > Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. >
The strange thing in old IDE dmesg is the chip is detected as native "VP_IDE: 100% native mode on irq 14". However, later the ports are assigned with legacy (rather than native) irq number: "ide0 at 0x1040-0x1047,0x104e on irq 14" "ide1 at 0x1050-0x1057,0x105e on irq 15" Maybe the VIA native mode bit is incorrect and needs to be ignored? ======================================================== Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx VP_IDE: IDE controller at PCI slot 0000:00:0c.1 VP_IDE: chipset revision 6 VP_IDE: VIA vt8231 (rev 10) IDE UDMA100 controller on pci0000:00:0c.1 VP_IDE: 100% native mode on irq 14 ide0: BM-DMA at 0x1060-0x1067, BIOS settings: hda:pio, hdb:pio ide1: BM-DMA at 0x1068-0x106f, BIOS settings: hdc:pio, hdd:pio hda: WDC WD3200JB-00KFA0, ATA DISK drive ide0 at 0x1040-0x1047,0x104e on irq 14 hdc: PIONEER DVD-RW DVR-111L, ATAPI CD/DVD-ROM drive ide1 at 0x1050-0x1057,0x105e on irq 15 hda: max request size: 512KiB hda: 625142448 sectors (320072 MB) w/8192KiB Cache, CHS=38913/255/63, UDMA(100) hda: cache flushes supported hda: RDSK (512) hda1 (DOS^C)(res 2 spb 1) hda2 (SFS^@)(res 0 spb 1) hda3 (SFS^@)(res 0 spb 2) hda4 (SFS^@)(res 0 spb 1) hda5 (SFS^@)(res 0 spb 2) hda6 (SFS^@)(res 0 spb 1) hda7 (SFS^@)(res 0 spb 2) hda8 (SWP^@)(res 0 spb 1) hda9 (RFS^@)(res 0 spb 1) hda10 (RFS^@)(res 0 spb 1) hda11 (EXT^C)(res 0 spb 1) hda12 (RFS^@)(res 0 spb 1) hda13 (RFS^@)(res 0 spb 1) hdc: ATAPI 40X DVD-ROM DVD-R-RAM CD-R/RW drive, 2000kB Cache, UDMA(66) Uniform CD-ROM driver Revision: 3.20
IDE code has chrp specific workaround similar to the one I tried for libata (and failed :-). This isn't native nor legacy. IO regions are in PCI BARs but pdev->irq can't be trusted, so it's native for IO regions and legacy for irq. Solutions are... 1. Add chrp specific quirk into libata (no, can't be done from PCI quirk) 2. If the IO addresses are fixed, add arch-specific ATA_PRIMARY/SECONDARY_CMD/CTL macros and mark it legacy. ie. make it proper legacy SFF controller.
Matt Sealey propose a fixup on powerdev forum for this problem and I already tested it with final 2.6.22. It seems both irq's are set to 14, but this is correct now ? Anyway the problem with ATAPI device is still there and it still fails to initialize it ;( Should I apply any patches attached here in final 2.6.22 ?
Created attachment 11988 [details] Fixup for arch/powerpc/platforms/chrp/pci.c There is a small typo as ')' is missing from if(), but it compiles fine here.
Created attachment 11989 [details] fixup for arch/powerpc/platforms/chrp/pci.c No typo and url attach this time.
It needs to be combined with IDE un-quirking. The fixup looks good other than that. It's probably the way it should have been done in the first place. I think Matt will re-submit the patch in proper form after some verification from users.
There was some interesting new informations acording to this problem on powerdeveloper forum. Take a look at http://www.powerdeveloper.org/forums/viewtopic.php?t=1302&start=15&postdays=0&postorder=asc&highlight=
Created attachment 12014 [details] Recent version of fixup Anyway it seems there can be a problem with this kind of fix. Look at comment http://www.powerdeveloper.org/forums/viewtopic.php?p=8450#8450
Created attachment 12023 [details] Recent version of fixup
Created attachment 12024 [details] dmesg from boot with latest fix It seems with latest fix the timeouts are still there. Also I can not see my DVD drive in system (Al last not as sdX or sgX)
Created attachment 12025 [details] lspci after bootup with latest fix
Good news I was able to use libata drivers on my pegasos now. After apply a patch from Hejun (simplify PCI legacy SFF host handling) to 2.6.22 I tired atempt from http://bugzilla.kernel.org/attachment.cgi?id=11836&action=view and it seems this does the trick and libata works fine here. I will attach a lspci && dmegs in a minute.
Created attachment 12424 [details] ppc-pegasos-via-ata-legacy-irq.patch advertise correct IDE mode on Pegasos. http://ozlabs.org/pipermail/linuxppc-dev/2007-August/041095.html
Thanks, Olaf. That should do the trick for libata on kernels > 2.6.22 or 2.6.22 + simplify-PCI-legacy-SFF-host-handling. I think IDE should be fine too. If somebody can verify the patch works, I'll forward it upstream. Thanks.
I use it on 2.6.22 without any problems. Works fine.
Marcin, just to be sure, 2.6.22 + the patches work fine on chrp with ide and libata drivers, right?
Tired only on libata and use it on my gentoo and fresh installed fedora 7 currently without any problems. It is included in SuSe and Fedora 7 kernels already. As I can see SuSe and Fedora leave the old ata pegasos irq hack in kernel.
Please try ide on 2.6.22 + the patches. It might affect IDE. It should work but I wanna be sure before sending the patch upstream. Thanks.