Re: Iomega ZIP-100 drive unsupported with jmicron JMB361 chip?
On Mon, 10 Dec 2007 15:09:43 -0500 trash can [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have tolerated this problem for a year and do not post to this list in haste. I have posted on forums and searched the community over the past year. Your report is welcome - thanks. Let's cc the IDE/sata development list. I have looked at the list archive on gossamer-threads.com for solutions. With Fedora Core 6 unsupported (the last kernel for which my zip drive worked), it is time for my last attempt at a solution. Please CC: any response as I have not joined the list. I have compiled a kernel-debug RPM and can run this if its output would help. Thank you for any time you might devote to this problem. motherboard: MSI P965 Platinum/Intel P965 Express Chipset Based (MS-7238 series) Fedora 8 : kernel 2.6.23.1-42.fc8 Iomega Zip drive internal Model Z100ATAPI lspci 03:00.0 SATA controller: JMicron Technologies, Inc. JMB361 AHCI/IDE (rev 02) 03:00.1 IDE interface: JMicron Technologies, Inc. JMB361 AHCI/IDE (rev 02) # lsmod | grep ata pata_jmicron8257 0 ata_generic 8901 0 ata_piix 16709 0 libata 99633 4 ahci,pata_jmicron,ata_generic,ata_piix scsi_mod 119757 4 sr_mod,sg,libata,sd_mod I have recently changed the BIOS setting for the SATA#1 Controller from [IDE] to [AHCI] with no effect. I assume AHCI is correct? Text below attached as text.txt for readability. from dmesg: libata version 2.21 loaded. device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: [EMAIL PROTECTED] PCI: Enabling device :03:00.1 ( - 0001) ACPI: PCI Interrupt :03:00.1[B] - GSI 17 (level, low) - IRQ 17 PCI: Setting latency timer of device :03:00.1 to 64 scsi0 : pata_jmicron scsi1 : pata_jmicron ata1: PATA max UDMA/100 cmd 0x0001cc00 ctl 0x0001c882 bmdma 0x0001c400 irq 17 ata2: PATA max UDMA/100 cmd 0x0001c800 ctl 0x0001c482 bmdma 0x0001c408 irq 17 ata1.00: ATAPI: LITE-ON DVDRW SOHW-1693S, KS0B, max UDMA/66 ata1.01: ATAPI: IOMEGA ZIP 100 ATAPI, 05.H, max MWDMA1, CDB intr ata1.00: configured for UDMA/66 ata1.01: configured for MWDMA1 scsi 0:0:0:0: CD-ROMLITE-ON DVDRW SOHW-1693S KS0B PQ: 0 ANSI: 5 scsi 0:0:1:0: Direct-Access IOMEGA ZIP 100 05.H PQ: 0 ANSI: 5 sd 0:0:1:0: [sda] 196608 512-byte hardware sectors (101 MB) sd 0:0:1:0: [sda] Write Protect is off sd 0:0:1:0: [sda] Mode Sense: 00 40 00 00 sd 0:0:1:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:1:0: [sda] 196608 512-byte hardware sectors (101 MB) sd 0:0:1:0: [sda] Write Protect is off sd 0:0:1:0: [sda] Mode Sense: 00 40 00 00 sd 0:0:1:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sda:6sd 0:0:1:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK sd 0:0:1:0: [sda] Sense Key : Hardware Error [current] sd 0:0:1:0: [sda] Add. Sense: Scsi parity error end_request: I/O error, dev sda, sector 0 Buffer I/O error on device sda, logical block 0 If a disk is inserted into the drive (/var/log/messages) Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Spinning up disk.5sd 0:0:1:0: [sda] Spinning up diskready Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] 196608 512-byte hardware sectors (101 MB) Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Write Protect is off Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] 196608 512-byte hardware sectors (101 MB) Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Write Protect is off Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Dec 10 14:22:53 localhost kernel: sda:6sd 0:0:1:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Sense Key : Hardware Error [current] Dec 10 14:22:53 localhost kernel: sd 0:0:1:0: [sda] Add. Sense: Scsi parity error Dec 10 14:22:53 localhost kernel: end_request: I/O error, dev sda, sector 0 Dec 10 14:22:53 localhost kernel: printk: 42 messages suppressed. Dec 10 14:22:53 localhost kernel: Buffer I/O error on device sda, logical block 0 So which is the most recent kernel version which worked OK? - 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: ATA bus error with external hd on esata
On Sat, 15 Dec 2007 21:10:47 +0100 Zsolt Barat [EMAIL PROTECTED] wrote: Zsolt Barat schrieb: hi list, Let's cc the IDE development list. i just bought a MyBook called external HD with a fixed enclosure, from WD. Connected to the SATA port i constantly get ATA bus error messages in the kernel log. Is this a known issue? /var/log/messages: Dec 15 18:37:53 proto1 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 Dec 15 18:37:53 proto1 ata2.00: irq_stat 0x4001 Dec 15 18:37:53 proto1 ata2.00: cmd 35/00:e0:a7:d2:01/00:01:33:00:00/e0 tag 0 cdb 0x0 data 245760 out Dec 15 18:37:53 proto1 res 51/84:00:86:d4:01/00:00:33:00:00/e0 Emask 0x10 (ATA bus error) Dec 15 18:37:54 proto1 ata2: soft resetting port Dec 15 18:37:54 proto1 ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) Dec 15 18:37:54 proto1 ata2.00: configured for UDMA/33 Dec 15 18:37:54 proto1 ata2: EH complete Dec 15 18:37:54 proto1 sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB) Dec 15 18:37:54 proto1 sd 1:0:0:0: [sdb] Write Protect is off Dec 15 18:37:54 proto1 sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 Dec 15 18:37:54 proto1 sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Dec 15 18:38:15 proto1 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 Dec 15 18:38:15 proto1 ata2.00: irq_stat 0x4001 Dec 15 18:38:15 proto1 ata2.00: cmd 35/00:80:bf:09:14/00:01:33:00:00/e0 tag 0 cdb 0x0 data 196608 out Dec 15 18:38:15 proto1 res 51/84:00:3e:0b:14/00:00:33:00:00/e0 Emask 0x10 (ATA bus error) Dec 15 18:38:15 proto1 ata2: soft resetting port Dec 15 18:38:15 proto1 ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) Dec 15 18:38:15 proto1 ata2.00: configured for UDMA/33 Dec 15 18:38:15 proto1 ata2: EH complete Dec 15 18:38:15 proto1 sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB) Dec 15 18:38:15 proto1 sd 1:0:0:0: [sdb] Write Protect is off Dec 15 18:38:15 proto1 sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 Dec 15 18:38:15 proto1 sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA lspci: 00:00.0 Host bridge: ATI Technologies Inc Unknown device 7910 00:01.0 PCI bridge: ATI Technologies Inc Unknown device 7912 00:07.0 PCI bridge: ATI Technologies Inc Unknown device 7917 00:12.0 SATA controller: ATI Technologies Inc SB600 Non-Raid-5 SATA 00:13.0 USB Controller: ATI Technologies Inc SB600 USB (OHCI0) 00:13.1 USB Controller: ATI Technologies Inc SB600 USB (OHCI1) 00:13.2 USB Controller: ATI Technologies Inc SB600 USB (OHCI2) 00:13.3 USB Controller: ATI Technologies Inc SB600 USB (OHCI3) 00:13.4 USB Controller: ATI Technologies Inc SB600 USB (OHCI4) 00:13.5 USB Controller: ATI Technologies Inc SB600 USB Controller (EHCI) 00:14.0 SMBus: ATI Technologies Inc SB600 SMBus (rev 13) 00:14.1 IDE interface: ATI Technologies Inc SB600 IDE 00:14.2 Audio device: ATI Technologies Inc SB600 Azalia 00:14.3 ISA bridge: ATI Technologies Inc SB600 PCI to LPC Bridge 00:14.4 PCI bridge: ATI Technologies Inc SB600 PCI to PCI Bridge 00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 01:05.0 VGA compatible controller: ATI Technologies Inc Radeon X1200 Series 01:05.2 Audio device: ATI Technologies Inc Radeon X1200 Series Audio Controller 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01) 03:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev c0) thanks and best regards zsolt sorry, kernel version is: 2.6.23-gentoo-r1 - 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: CMD646 cdrom: drive appears confused drive not ready for command
On Mon, 17 Dec 2007 02:59:03 -0800 Andrew Morton [EMAIL PROTECTED] wrote: (added linux-ide) (Ths time for real) On Sun, 16 Dec 2007 20:36:04 +0200 (EET) Meelis Roos [EMAIL PROTECTED] wrote: I just noticed that all my recent test kernels on Sun Ultra 5 spam dmesg with hdc: drive not ready for command messages. Oldest logs that I have are from 2.6.24-rc4-g94545bad and they are already bad. So when did thi start? Is 2.6.23 OK? The spamming does not happen right away but some time later, and hald-addon-storage is the userspace daemon that polls the cdrom regularly. Full dmesg until the spamming begins - notice there are first some drive appears confused messages right before it happens. Dec 15 14:11:00 mandariin kernel: PROMLIB: Sun IEEE Boot Prom 'OBP 3.31.0 2001/07/25 20:36' Dec 15 14:11:00 mandariin kernel: PROMLIB: Root node compatible: Dec 15 14:11:00 mandariin kernel: Linux version 2.6.24-rc5-gda8cadb3 ([EMAIL PROTECTED]) (gcc version 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)) #38 Sat Dec 15 13:00:43 EET 2007 Dec 15 14:11:00 mandariin kernel: ARCH: SUN4U Dec 15 14:11:00 mandariin kernel: Ethernet address: 08:00:20:f8:c7:72 Dec 15 14:11:00 mandariin kernel: [0002-f880] page_structs=262144 node=0 entry=0/0 Dec 15 14:11:00 mandariin kernel: [0002-f8c0] page_structs=262144 node=0 entry=1/0 Dec 15 14:11:00 mandariin kernel: [0002-f8000100] page_structs=262144 node=0 entry=2/0 Dec 15 14:11:00 mandariin kernel: [0002-f8000140] page_structs=262144 node=0 entry=3/0 Dec 15 14:11:00 mandariin kernel: OF stdout device is: /[EMAIL PROTECTED],0/[EMAIL PROTECTED],1/[EMAIL PROTECTED]/[EMAIL PROTECTED],40:a Dec 15 14:11:00 mandariin kernel: PROM: Built device tree with 42042 bytes of memory. Dec 15 14:11:00 mandariin kernel: On node 0 totalpages: 64952 Dec 15 14:11:00 mandariin kernel: Normal zone: 447 pages used for memmap Dec 15 14:11:00 mandariin kernel: Normal zone: 0 pages reserved Dec 15 14:11:00 mandariin kernel: Normal zone: 64505 pages, LIFO batch:15 Dec 15 14:11:00 mandariin kernel: Movable zone: 0 pages used for memmap Dec 15 14:11:00 mandariin kernel: Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64505 Dec 15 14:11:00 mandariin kernel: Kernel command line: root=/dev/hda1 ro Dec 15 14:11:00 mandariin kernel: PID hash table entries: 2048 (order: 11, 16384 bytes) Dec 15 14:11:00 mandariin kernel: clocksource: mult[2c71c] shift[16] Dec 15 14:11:00 mandariin kernel: clockevent: mult[5c28f5c2] shift[32] Dec 15 14:11:00 mandariin kernel: Console: colour dummy device 80x25 Dec 15 14:11:00 mandariin kernel: console [tty0] enabled Dec 15 14:11:00 mandariin kernel: Dentry cache hash table entries: 65536 (order: 6, 524288 bytes) Dec 15 14:11:00 mandariin kernel: Inode-cache hash table entries: 32768 (order: 5, 262144 bytes) Dec 15 14:11:00 mandariin kernel: Memory: 501368k available (2696k kernel code, 904k data, 128k init) [f800,1ff42000] Dec 15 14:11:00 mandariin kernel: SLUB: Genslabs=12, HWalign=32, Order=0-2, MinObjects=8, CPUs=1, Nodes=1 Dec 15 14:11:00 mandariin kernel: Calibrating delay using timer specific routine.. 721.25 BogoMIPS (lpj=3606278) Dec 15 14:11:00 mandariin kernel: Mount-cache hash table entries: 512 Dec 15 14:11:00 mandariin kernel: Initializing cgroup subsys ns Dec 15 14:11:00 mandariin kernel: net_namespace: 120 bytes Dec 15 14:11:00 mandariin kernel: NET: Registered protocol family 16 Dec 15 14:11:00 mandariin kernel: PCI: Probing for controllers. Dec 15 14:11:00 mandariin kernel: /[EMAIL PROTECTED],0: SABRE PCI Bus Module Dec 15 14:11:00 mandariin kernel: /[EMAIL PROTECTED],0: PCI IO[1fe0200] MEM[1ff] Dec 15 14:11:00 mandariin kernel: PCI: Scanning PBM /[EMAIL PROTECTED],0 Dec 15 14:11:00 mandariin kernel: ebus0: [auxio] [power] [SUNW,pll] [se] [su] [su] [ecpp] [fdthree] [eeprom] [flashprom] [SUNW,CS4231] Dec 15 14:11:00 mandariin kernel: power: Control reg at 1fff1724000 Dec 15 14:11:00 mandariin kernel: SCSI subsystem initialized Dec 15 14:11:00 mandariin kernel: libata version 3.00 loaded. Dec 15 14:11:00 mandariin kernel: AUXIO: Found device at /[EMAIL PROTECTED],0/[EMAIL PROTECTED],1/[EMAIL PROTECTED]/[EMAIL PROTECTED],726000 Dec 15 14:11:00 mandariin kernel: /[EMAIL PROTECTED],0/[EMAIL PROTECTED],1/[EMAIL PROTECTED]/[EMAIL PROTECTED],0: Clock regs at 01fff100 Dec 15 14:11:00 mandariin kernel: NET: Registered protocol family 2 Dec 15 14:11:00 mandariin kernel: Time: tick clocksource has been installed. Dec 15 14:11:00 mandariin kernel: Switched to high resolution mode on CPU 0 Dec 15 14:11:00 mandariin kernel: IP route cache hash table entries: 4096 (order: 2, 32768 bytes) Dec 15 14:11:00 mandariin kernel: TCP established
sata_mv not working with a RocketRaid 2220
Added CC to linux-ide Originele bericht Onderwerp: sata_mv not working with a RocketRaid 2220 Datum: Mon, 17 Dec 2007 00:15:30 +0100 Van:Jean-Louis Dupond [EMAIL PROTECTED] Aan:[EMAIL PROTECTED] Hello, I'm trying to get my HighPoint RocketRaid Controller working with the sata_mv drivers. But something is not working correctly :( Kernel version 2.6.23.11 (also tried 2.6.24-rc5 with same results) Controller in lspci: Marvell Technology Group Ltd. MV88SX6081 8-port SATA II PCI-X Controller (rev 07) 1. Dec 16 22:44:29 localhost kernel: sata_mv :05:08.0: Gen-II 32 slots 8 ports SCSI mode IRQ via INTx 2. Dec 16 22:44:29 localhost kernel: scsi4 : sata_mv 3. Dec 16 22:44:29 localhost kernel: scsi5 : sata_mv 4. Dec 16 22:44:29 localhost kernel: scsi6 : sata_mv 5. Dec 16 22:44:29 localhost kernel: scsi7 : sata_mv 6. Dec 16 22:44:29 localhost kernel: scsi8 : sata_mv 7. Dec 16 22:44:29 localhost kernel: scsi9 : sata_mv 8. Dec 16 22:44:29 localhost kernel: scsi10 : sata_mv 9. Dec 16 22:44:29 localhost kernel: scsi11 : sata_mv 10. Dec 16 22:44:29 localhost kernel: ata5: SATA max UDMA/133 cmd 0x ctl 0xc20010122120 bmdma 0x irq 16 11. Dec 16 22:44:29 localhost kernel: ata6: SATA max UDMA/133 cmd 0x ctl 0xc20010124120 bmdma 0x irq 16 12. Dec 16 22:44:29 localhost kernel: ata7: SATA max UDMA/133 cmd 0x ctl 0xc20010126120 bmdma 0x irq 16 13. Dec 16 22:44:29 localhost kernel: ata8: SATA max UDMA/133 cmd 0x ctl 0xc20010128120 bmdma 0x irq 16 14. Dec 16 22:44:29 localhost kernel: ata9: SATA max UDMA/133 cmd 0x ctl 0xc20010132120 bmdma 0x irq 16 15. Dec 16 22:44:29 localhost kernel: ata10: SATA max UDMA/133 cmd 0x ctl 0xc20010134120 bmdma 0x irq 16 16. Dec 16 22:44:29 localhost kernel: ata11: SATA max UDMA/133 cmd 0x ctl 0xc20010136120 bmdma 0x irq 16 17. Dec 16 22:44:29 localhost kernel: ata12: SATA max UDMA/133 cmd 0x ctl 0xc20010138120 bmdma 0x irq 16 18. Dec 16 22:44:29 localhost kernel: ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 19. Dec 16 22:44:29 localhost kernel: ata5.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7 20. Dec 16 22:44:29 localhost kernel: ata5.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 0/32) 21. Dec 16 22:44:29 localhost kernel: ata5.00: configured for UDMA/133 22. Dec 16 22:44:29 localhost kernel: ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 23. Dec 16 22:44:29 localhost kernel: ata6.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7 24. Dec 16 22:44:29 localhost kernel: ata6.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 0/32) 25. Dec 16 22:44:29 localhost kernel: ata6.00: configured for UDMA/133 26. Dec 16 22:44:29 localhost kernel: ata7: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 27. Dec 16 22:44:29 localhost kernel: ata7.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7 28. Dec 16 22:44:29 localhost kernel: ata7.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 0/32) 29. Dec 16 22:44:29 localhost kernel: ata7.00: configured for UDMA/133 30. Dec 16 22:44:29 localhost kernel: ata8: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 31. Dec 16 22:44:29 localhost kernel: ata8.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7 32. Dec 16 22:44:29 localhost kernel: ata8.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 0/32) 33. Dec 16 22:44:29 localhost kernel: ata8.00: configured for UDMA/133 34. Dec 16 22:44:29 localhost kernel: ata9: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 35. Dec 16 22:44:29 localhost kernel: ata9.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7 36. Dec 16 22:44:29 localhost kernel: ata9.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 0/32) 37. Dec 16 22:44:29 localhost kernel: ata9.00: configured for UDMA/133 38. Dec 16 22:44:29 localhost kernel: ata10: SATA link down (SStatus 0 SControl 300) 39. Dec 16 22:44:29 localhost kernel: ata11: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 40. Dec 16 22:44:29 localhost kernel: ata11.00: ATA-7: SAMSUNG SP2504C, VT100-33, max UDMA7 41. Dec 16 22:44:29 localhost kernel: ata11.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 0/32) 42. Dec 16 22:44:29 localhost kernel: ata11.00: configured for UDMA/133 43. Dec 16 22:44:29 localhost kernel: ata12: SATA link down (SStatus 0 SControl 300) 44. Dec 16 22:44:29 localhost kernel: scsi 4:0:0:0: Direct-Access ATA SAMSUNG SP2504C VT10 PQ: 0 ANSI: 5 45. Dec 16 22:44:29 localhost kernel: sd 4:0:0:0:
Re: CMD646 cdrom: drive appears confused drive not ready for command
So when did thi start? Is 2.6.23 OK? I have 2.6.23 running now and will see if something happens. Are there any other consequences apart from log spam? Any CD communication seems to be impossible after this starts. Will retest when it happens again. -- Meelis Roos ([EMAIL PROTECTED]) - 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: [PATCH 2/3] Add GD-Rom support to the SEGA Dreamcast
On Mon, December 17, 2007 2:06 pm, Jens Axboe wrote: On Sun, Dec 16 2007, Adrian McMenamin wrote: Few notes: Thanks for these, very helpful. - Compare rq_data_dir() with WRITE, don't just assume that any non-zero will be a write. - You need to offload this request handling to a workqueue of some sort, your current request handling is very broken for two reasons: One is that interrupts are still disabled when you drop your queue lock, so you cannot use sleeping functions like GFP_KERNEL allocations or wait_event(). The other is that it's illegal to sleep from your request_fn context in the first place, since you could be stalling others. Ah. OK. Funnily enough an earlier version did offload to a workqueue but i thought that was too convoluted. I didn't realise interrupts were disabled inside the request_fn context. - You also seem to be busy waiting for other transactions to finish. Any idea how long those might take? Perhaps put an upper bound on this waiting, and/or do blocking waits? Well, when the register bit clears they are over, seems to be about 200 - 400 microseconds or there abouts (ie that length of time between the interrupt signalling that the transfer is over and the bit clearing to allow a new transfer) - so I could time that out at say HZ/2 and be very safe. - I'm assuming this hardware can't do sg transfers? Afraid not. - 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: ATA bus error with external hd on esata
On Dec 17, 2007 5:53 AM, Andrew Morton [EMAIL PROTECTED] wrote: On Sat, 15 Dec 2007 21:10:47 +0100 Zsolt Barat [EMAIL PROTECTED] wrote: Zsolt Barat schrieb: hi list, Let's cc the IDE development list. i just bought a MyBook called external HD with a fixed enclosure, from WD. Connected to the SATA port i constantly get ATA bus error messages in the kernel log. Is this a known issue? As an FYI: I've had a lot of problems with the big prepackaged drives in the last 6 months even from Windows, so I would not be too quick to blame Linux. ie. I bought several 500GB / 1000GB Buffalo Drives last month with plans to use them from Windows via USB. I attempted to do a lot of heavy file copying to/from them. I was getting a bunch of Delayed Write Failures, I finally gave up. The 500GB drives had a single hard drive internally, so I opened the case, removed the drive and connected them via standalone external carriers I had around. In that mode the drives worked fine (from Windows). I've used both standalone eSata external carriers and standalone USB external carriers with these same physical drives with no issues. My conclusion is that the electronics in the prepackaged external units is just not up to the job if your doing heavy i/o. Greg -- Greg Freemyer Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer First 99 Days Litigation White Paper - http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf The Norcross Group The Intersection of Evidence Technology http://www.norcrossgroup.com - 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: ATA bus error with external hd on esata
Greg Freemyer schreef: On Dec 17, 2007 5:53 AM, Andrew Morton [EMAIL PROTECTED] wrote: On Sat, 15 Dec 2007 21:10:47 +0100 Zsolt Barat [EMAIL PROTECTED] wrote: Zsolt Barat schrieb: hi list, Let's cc the IDE development list. i just bought a MyBook called external HD with a fixed enclosure, from WD. Connected to the SATA port i constantly get ATA bus error messages in the kernel log. Is this a known issue? As an FYI: I've had a lot of problems with the big prepackaged drives in the last 6 months even from Windows, so I would not be too quick to blame Linux. ie. I bought several 500GB / 1000GB Buffalo Drives last month with plans to use them from Windows via USB. I attempted to do a lot of heavy file copying to/from them. I was getting a bunch of Delayed Write Failures, I finally gave up. The 500GB drives had a single hard drive internally, so I opened the case, removed the drive and connected them via standalone external carriers I had around. In that mode the drives worked fine (from Windows). I've used both standalone eSata external carriers and standalone USB external carriers with these same physical drives with no issues. My conclusion is that the electronics in the prepackaged external units is just not up to the job if your doing heavy i/o. Greg Could u check the temps of the disk ? I had that error in windows also with to hot disks ! If temp is 50°C I would start to worry :) - 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
[PATCH] drivers/ide/: Spelling fixes
Signed-off-by: Joe Perches [EMAIL PROTECTED] --- drivers/ide/pci/cs5535.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index 9094916..ddcbeba 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c @@ -49,7 +49,7 @@ #define ATAC_BM0_PRD 0x04 #define CS5535_CABLE_DETECT0x48 -/* Format I PIO settings. We seperate out cmd and data for safer timings */ +/* Format I PIO settings. We separate out cmd and data for safer timings */ static unsigned int cs5535_pio_cmd_timings[5] = { 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 }; -- 1.5.3.7.949.g2221a6 - 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
[PATCH] drivers/ata/: Spelling fixes
Signed-off-by: Joe Perches [EMAIL PROTECTED] --- drivers/ata/ata_piix.c|2 +- drivers/ata/libata-core.c |4 ++-- drivers/ata/pata_at32.c |2 +- drivers/ata/pata_efar.c |2 +- drivers/ata/pata_it8213.c |2 +- drivers/ata/pata_sis.c|4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index bb62a58..ee51853 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -769,7 +769,7 @@ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev) if (is_slave) { /* clear TIME1|IE1|PPE1|DTE1 */ master_data = 0xff0f; - /* Enable SITRE (seperate slave timing register) */ + /* Enable SITRE (separate slave timing register) */ master_data |= 0x4000; /* enable PPE1, IE1 and TIME1 as needed */ master_data |= (control 4); diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e4dea86..debbfc3 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3065,7 +3065,7 @@ static int ata_dev_set_mode(struct ata_device *dev) /** * ata_do_set_mode - Program timings and issue SET FEATURES - XFER * @link: link on which timings will be programmed - * @r_failed_dev: out paramter for failed device + * @r_failed_dev: out parameter for failed device * * Standard implementation of the function used to tune and set * ATA device disk transfer mode (PIO3, UDMA6, etc.). If @@ -3173,7 +3173,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) /** * ata_set_mode - Program timings and issue SET FEATURES - XFER * @link: link on which timings will be programmed - * @r_failed_dev: out paramter for failed device + * @r_failed_dev: out parameter for failed device * * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). If * ata_set_mode() fails, pointer to the failing device is diff --git a/drivers/ata/pata_at32.c b/drivers/ata/pata_at32.c index 67e574d..db057b1 100644 --- a/drivers/ata/pata_at32.c +++ b/drivers/ata/pata_at32.c @@ -324,7 +324,7 @@ static int __init pata_at32_probe(struct platform_device *pdev) if (irq 0) return irq; - /* Setup struct containing private infomation */ + /* Setup struct containing private information */ info = kzalloc(sizeof(struct at32_ide_info), GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c index 043dcd3..dc33220 100644 --- a/drivers/ata/pata_efar.c +++ b/drivers/ata/pata_efar.c @@ -135,7 +135,7 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev) idetm_data = 0xCC0F; idetm_data |= (control 4); - /* Slave timing in seperate register */ + /* Slave timing in separate register */ pci_read_config_byte(dev, 0x44, slave_data); slave_data = 0x0F shift; slave_data |= ((timings[pio][0] 2) | timings[pio][1]) shift; diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c index 1eda821..e0c2cc2 100644 --- a/drivers/ata/pata_it8213.c +++ b/drivers/ata/pata_it8213.c @@ -128,7 +128,7 @@ static void it8213_set_piomode (struct ata_port *ap, struct ata_device *adev) idetm_data = 0xCC0F; idetm_data |= (control 4); - /* Slave timing in seperate register */ + /* Slave timing in separate register */ pci_read_config_byte(dev, 0x44, slave_data); slave_data = 0xF0; slave_data |= ((timings[pio][0] 2) | timings[pio][1]) 4; diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index 87546d9..dc7e915 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c @@ -345,7 +345,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev) if (adev-dma_mode XFER_UDMA_0) { /* bits 3-0 hold recovery timing bits 8-10 active timing and - the higer bits are dependant on the device */ + the higher bits are dependant on the device */ timing = ~0x870F; timing |= mwdma_bits[speed]; } else { @@ -385,7 +385,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev) if (adev-dma_mode XFER_UDMA_0) { /* bits 3-0 hold recovery timing bits 8-10 active timing and - the higer bits are dependant on the device, bit 15 udma */ + the higher bits are dependant on the device, bit 15 udma */ timing = ~0x870F; timing |= mwdma_bits[speed]; } else { -- 1.5.3.7.949.g2221a6 - To unsubscribe from this list: send the line unsubscribe linux-ide in the body
Re: [PATCH] Fix build break caused by ide: remove ideprobe_init()
Hi, On Friday 14 December 2007, Olof Johansson wrote: Fix build break of powerpc holly_defconfig: Sorry for breaking the hol[l]y powerpc platform. ;) In file included from arch/powerpc/platforms/embedded6xx/holly.c:24: include/linux/ide.h:1206: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here (not in a function) There's no need to have a sized array in the prototype, might as well turn it into a pointer. It could probably be argued that large parts of the include file can be covered under #ifdef CONFIG_IDE, but that's a larger undertaking. Signed-off-by: Olof Johansson [EMAIL PROTECTED] applied but... --- On Sun, Nov 18, 2007 at 11:25:09PM +0100, Bartlomiej Zolnierkiewicz wrote: * Rename ide_device_add() to ide_device_add_all() and make it accept 'u8 idx[MAX_HWIFS]' instead of 'u8 idx[4]' as an argument. * Add ide_device_add() wrapper for ide_device_add_all(). * Convert ide_generic_init() to use ide_device_add_all(). * Remove no longer needed ideprobe_init(). There should be no functionality changes caused by this patch. This patch broke builds of powerpc holly_defconfig in -mm. It has CONFIG_EMBEDDED=y, CONFIG_IDE=n but includes linux/ide.h: ^ ...could you also fix the root source of the problem so the similar issue won't re-appear in the future? linux/ide.h is IDE subsystem specific in the same way that linux/libata.h is libata specific, linux/ata.h is the place to put subsystem independent defines, inlines and co. There are some powerpc abusers of the above rule but they should at least cover references to linux/ide.h and IDE subsystem specific code with #ifdef/#endif CONFIG_BLK_DEV_IDE. In arch/powerpc/platforms/embedded6xx/holly.c case it seems that linux/ide.h include is actually not needed and may be just removed? Bart Index: mm/drivers/ide/ide-probe.c === --- mm.orig/drivers/ide/ide-probe.c +++ mm/drivers/ide/ide-probe.c @@ -1335,7 +1335,7 @@ static void hwif_register_devices(ide_hw } } -int ide_device_add_all(u8 idx[MAX_HWIFS]) +int ide_device_add_all(u8 *idx) { ide_hwif_t *hwif; int i, rc = 0; Index: mm/include/linux/ide.h === --- mm.orig/include/linux/ide.h +++ mm/include/linux/ide.h @@ -1203,7 +1203,7 @@ void ide_unregister_region(struct gendis void ide_undecoded_slave(ide_drive_t *); -int ide_device_add_all(u8 idx[MAX_HWIFS]); +int ide_device_add_all(u8 *idx); int ide_device_add(u8 idx[4]); static inline void *ide_get_hwifdata (ide_hwif_t * hwif) - 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: [PATCH] drivers/ide/: Spelling fixes
On Monday 17 December 2007, Joe Perches wrote: Signed-off-by: Joe Perches [EMAIL PROTECTED] applied - 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: [PATCH pata-2.6] hpt366: merge set_dma_mode() methods
On Friday 14 December 2007, Sergei Shtylyov wrote: Group the array of pointers to the timing tables with the timing register masks which allows us to merge HPT36x/HPT37x set_dma_mode() methods into one. Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED] applied - 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
[PATCH] libata-core: blacklist drives from using NCQ
Blacklist HITACHI HDS7225SCSUN250G* and SEAGATE STN7225SASUN250G* drives from using NCQ. Signed-off-by David Milburn [EMAIL PROTECTED] --- libata-core.c |2 ++ 1 files changed, 2 insertions(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 597e07c..c117afa 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4149,6 +4149,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { Maxtor 7V300F0, VA111630, ATA_HORKAGE_NONCQ }, { HITACHI HDS7250SASUN500G*, NULL,ATA_HORKAGE_NONCQ }, { HITACHI HDS7225SBSUN250G*, NULL,ATA_HORKAGE_NONCQ }, + { HITACHI HDS7225SCSUN250G*, NULL,ATA_HORKAGE_NONCQ }, + { SEAGATE STN7225SASUN250G*, NULL,ATA_HORKAGE_NONCQ }, { ST380817AS, 3.42, ATA_HORKAGE_NONCQ }, /* Blacklist entries taken from Silicon Image 3124/3132 - 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: sata_mv not working with a RocketRaid 2220
Jean-Louis Dupond wrote: Added CC to linux-ide Originele bericht Onderwerp: sata_mv not working with a RocketRaid 2220 Datum: Mon, 17 Dec 2007 00:15:30 +0100 Van: Jean-Louis Dupond [EMAIL PROTECTED] Aan: [EMAIL PROTECTED] Hello, I'm trying to get my HighPoint RocketRaid Controller working with the sata_mv drivers. But something is not working correctly :( Kernel version 2.6.23.11 (also tried 2.6.24-rc5 with same results) Controller in lspci: Marvell Technology Group Ltd. MV88SX6081 8-port SATA II PCI-X Controller (rev 07) .. The sata_mv driver is currently not very good, but should improve over this winter as some effort is finally going into fixing it. And the Highpoint RocketRAID cards are a similarly dubious choice, as their onboard BIOS is known to corrupt filesystems before Linux is even booted. In particular, an unconfigured drive -- just plugged into a RR card without entering the BIOS setup to configure a RAID -- gets sector 8 overwritten by the BIOS. This will destroy GRUB if it was installed. And for drives which *have* been configured in the RR BIOS, it overwrites a sector at the end of the final full GB on the drive, for holding RR metadata. 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: [PATCH] Fix build break caused by ide: remove ideprobe_init()
On Mon, Dec 17, 2007 at 09:53:31PM +0100, Bartlomiej Zolnierkiewicz wrote: Hi, applied but... --- On Sun, Nov 18, 2007 at 11:25:09PM +0100, Bartlomiej Zolnierkiewicz wrote: * Rename ide_device_add() to ide_device_add_all() and make it accept 'u8 idx[MAX_HWIFS]' instead of 'u8 idx[4]' as an argument. * Add ide_device_add() wrapper for ide_device_add_all(). * Convert ide_generic_init() to use ide_device_add_all(). * Remove no longer needed ideprobe_init(). There should be no functionality changes caused by this patch. This patch broke builds of powerpc holly_defconfig in -mm. It has CONFIG_EMBEDDED=y, CONFIG_IDE=n but includes linux/ide.h: ^ ...could you also fix the root source of the problem so the similar issue won't re-appear in the future? linux/ide.h is IDE subsystem specific in the same way that linux/libata.h is libata specific, linux/ata.h is the place to put subsystem independent defines, inlines and co. There are some powerpc abusers of the above rule but they should at least cover references to linux/ide.h and IDE subsystem specific code with #ifdef/#endif CONFIG_BLK_DEV_IDE. In arch/powerpc/platforms/embedded6xx/holly.c case it seems that linux/ide.h include is actually not needed and may be just removed? Yep, that was my original simple fix to the problem, but when I looked closer I wanted to get the include file fixed as well. Turns out I never posted the powerpc patch :), I'll do so (and audit other platforms for the same). Thanks, -Olof - 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: [PATCH 2/3] Add GD-Rom support to the SEGA Dreamcast
On Dec 16 2007 18:50, Paul Mundt wrote: On Sun, Dec 16, 2007 at 12:21:21AM +, Adrian McMenamin wrote: +/* GD Rom registers */ +#define GDROM_BASE_REG 0xA05F7000 +#define GDROM_ALTSTATUS_REG GDROM_BASE_REG + 0x18 +#define GDROM_DATA_REG GDROM_BASE_REG + 0x80 +#define GDROM_ERROR_REG GDROM_BASE_REG + 0x84 +#define GDROM_INTSEC_REG GDROM_BASE_REG + 0x88 +#define GDROM_SECNUM_REG GDROM_BASE_REG + 0x8C +#define GDROM_BCL_REG GDROM_BASE_REG + 0x90 +#define GDROM_BCH_REG GDROM_BASE_REG + 0x94 +#define GDROM_DSEL_REG GDROM_BASE_REG + 0x98 +#define GDROM_STATUSCOMMAND_REG GDROM_BASE_REG + 0x9C +#define GDROM_RESET_REG GDROM_BASE_REG + 0x4E4 + +#define GDROM_DATA_REG_P0 0x005F7080 + +#define GDROM_DMA_STARTADDR_REG GDROM_BASE_REG + 0x404 +#define GDROM_DMA_LENGTH_REG GDROM_BASE_REG + 0x408 +#define GDROM_DMA_DIRECTION_REG GDROM_BASE_REG + 0x40C +#define GDROM_DMA_ENABLE_REG GDROM_BASE_REG + 0x414 +#define GDROM_DMA_STATUS_REG GDROM_BASE_REG + 0x418 +#define GDROM_DMA_WAIT_REG GDROM_BASE_REG + 0x4A0 +#define GDROM_DMA_ACCESS_CTRL_REG GDROM_BASE_REG + 0x4B8 + These should all be encapsulated by brackets. Or making it an enum { GDROM_DMA_ACCESS_CTL_REG = GDROM_BASE_REG + 0x4B8, }; without brackets. - 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: [PATCH] libata-core: blacklist drives from using NCQ
On Mon, 17 Dec 2007 16:17:59 -0600 David Milburn [EMAIL PROTECTED] wrote: Blacklist HITACHI HDS7225SCSUN250G* and SEAGATE STN7225SASUN250G* drives from using NCQ. Signed-off-by David Milburn [EMAIL PROTECTED] Tejun fixed the bug causing the false reporting of NCQ errors so these blacklist entries should no longer be needed. - 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: [patch 3/9] libata: xfer_mask is unsigned int not unsigned long
[EMAIL PROTECTED] wrote: From: Tejun Heo [EMAIL PROTECTED] xfer_mask is unsigned int not unsigned long. Change -mode_filter to take and return unsigned int. While at it, rename @adev of ata_pci_default_filter() to @dev for consistency. [EMAIL PROTECTED]: fix types] Signed-off-by: Tejun Heo [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/ata/libata-sff.c |5 +++-- drivers/ata/pata_acpi.c|2 +- drivers/ata/pata_ali.c |2 +- drivers/ata/pata_amd.c | 10 +- drivers/ata/pata_hpt366.c |2 +- drivers/ata/pata_hpt37x.c |4 ++-- drivers/ata/pata_pdc2027x.c|4 ++-- drivers/ata/pata_scc.c |2 +- drivers/ata/pata_serverworks.c |4 ++-- include/linux/libata.h |9 + 10 files changed, 23 insertions(+), 21 deletions(-) patch is outdated... - 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: [PATCH 01/10] libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters
Tejun Heo wrote: * No internal function uses const ata_port. Drop const from @ap. * Make ata_acpi_stm() copy @stm before using it and change @stm to const. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- drivers/ata/libata-acpi.c |7 --- include/linux/libata.h|4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) applied 1-10 to #upstream-fixes - 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: [PATCH 01/10] libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters
Tejun Heo wrote: * No internal function uses const ata_port. Drop const from @ap. * Make ata_acpi_stm() copy @stm before using it and change @stm to const. for the record, I -would- use const ata_port where feasible; its just so rarely feasible, since members of that struct are often being modified. However in a small query-style function, I could see some const-ness perhaps... Jeff - 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: [PATCH #upstream-fixes] sata_sil: fix spurious IRQ handling
Tejun Heo wrote: Interestingly, sata_sil raises spurious interrupts if it's coupled with Sil SATA_PATA bridge. Currently, sata_sil interrupt handler is strict about spurious interrupts and freezes the port when it occurs. This patch makes it more forgiving. * On SATA PHY event interrupt, serror value is checked to see whether it really is PHYRDY CHG event. If not, SATA PHY event interrupt is ignored. * If ATA interrupt occurs while no command is in progress, it's cleared and ignored. This fixes bugzilla bug 9505. http://bugzilla.kernel.org/show_bug.cgi?id=9505 Signed-off-by: Tejun Heo [EMAIL PROTECTED] applied #upstream-fixes - 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: [PATCH #upstream-fixes] libata: clear link-eh_info.serror from ata_std_postreset()
Tejun Heo wrote: link-eh_info.serror is used to cache SError for controllers which need it cleared from interrupt handler to clear IRQ. It also should be cleared after reset just like SError itself. Make ata_std_postreset() clear link-eh_info.serror too and update sata_sil such that it doesn't care about bookkeeping the value. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- drivers/ata/libata-core.c |1 + drivers/ata/sata_sil.c| 11 +-- 2 files changed, 2 insertions(+), 10 deletions(-) applied #upstream-fixes - 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: [PATCH #upstream-fixes] libata: add ST3160023AS / 3.42 to NCQ blacklist
Tejun Heo wrote: Like ST380817AS / 3.42, ST3160023AS / 3.42 times out commands if NCQ is used. Blacklist it. This is reported by Matheus Izvekov in the following thread. http://thread.gmane.org/gmane.linux.ide/24202 Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Matheus Izvekov [EMAIL PROTECTED] --- It could be that all devices with 3.42 firmware have this problem. I'll ask around. Thanks. drivers/ata/libata-core.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e4dea86..e080b07 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4149,6 +4149,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { HITACHI HDS7250SASUN500G*, NULL,ATA_HORKAGE_NONCQ }, { HITACHI HDS7225SBSUN250G*, NULL,ATA_HORKAGE_NONCQ }, { ST380817AS, 3.42, ATA_HORKAGE_NONCQ }, + { ST3160023AS, 3.42, ATA_HORKAGE_NONCQ }, applied #upstream-fixes - 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: [PATCH #upstream-fixes] libata: update atapi_eh_request_sense() such that lbam/lbah contains buffer size
Tejun Heo wrote: While updating lbam/h for ATAPI commands, atapi_eh_request_sense() was left out. Update it. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- This patch is from improve-ATAPI-data-xfer patchset pending for #upstream. drivers/ata/libata-eh.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) applied #upstream-fixes - 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: [PATCH #upstream-fixes] libata: fix ATAPI draining
Tejun Heo wrote: With ATAPI transfer chunk size properly programmed, libata PIO HSM should be able to handle full spurious data chunks. Also, it's a good idea to suppress trailing data warning for misc ATAPI commands as there can be many of them per command - for example, if the chunk size is 16 and the drive tries to transfer 510 bytes, there can be 31 trailing data messages. This patch makes the following updates to libata ATAPI PIO HSM implementation. * Make it drain full spurious chunks. * Suppress trailing data warning message for misc commands. * Put limit on how many bytes can be drained. * If odd, round up consumed bytes and the number of bytes to be drained. This gets the number of bytes to drain right for drivers which do 16bit PIO. This patch is partial backport of improve-ATAPI-data-xfer patchset pending for #upstream. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- This combined with the previous patch fixes bug 9346. drivers/ata/libata-core.c | 87 ++ include/linux/libata.h|2 + 2 files changed, 67 insertions(+), 22 deletions(-) Index: work/drivers/ata/libata-core.c === --- work.orig/drivers/ata/libata-core.c +++ work/drivers/ata/libata-core.c @@ -64,6 +64,7 @@ #include linux/libata.h #include asm/semaphore.h #include asm/byteorder.h +#include linux/cdrom.h #include libata.h @@ -4649,6 +4650,43 @@ int ata_check_atapi_dma(struct ata_queue } /** + * atapi_qc_may_overflow - Check whether data transfer may overflow + * @qc: ATA command in question + * + * ATAPI commands which transfer variable length data to host + * might overflow due to application error or hardare bug. This + * function checks whether overflow should be drained and ignored + * for @qc. + * + * LOCKING: + * None. + * + * RETURNS: + * 1 if @qc may overflow; otherwise, 0. + */ +static int atapi_qc_may_overflow(struct ata_queued_cmd *qc) +{ + if (qc-tf.protocol != ATA_PROT_ATAPI + qc-tf.protocol != ATA_PROT_ATAPI_DMA) + return 0; + + if (qc-tf.flags ATA_TFLAG_WRITE) + return 0; + + switch (qc-cdb[0]) { + case READ_10: + case READ_12: + case WRITE_10: + case WRITE_12: + case GPCMD_READ_CD: + case GPCMD_READ_CD_MSF: + return 0; + } + + return 1; applied, though I hope we can eventually find a better solution... - 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: git repo and #upstream merging
Tejun Heo wrote: Tejun Heo wrote: This is the second take of improve-ACPI-corner-case-handling patchset and contains the following ten patches. Jeff, this patchset can also be pulled from the following git tree. master.kernel.org:/pub/scm/linux/kernel/git/tj/libata-dev.git acpi-fixes Also, merging this into #upstream can cause some interesting conflicts w/ ACPI timing handling update patches. If you ACK the patchset, I'll prep merged git HEAD for you. It was easier for me to * merge the patches into #upstream-fixes * rebase #upstream on top of #upstream-fixes, while dropping the conflicting ACPI patches And IMO that gives you a bit more freedom to do the merged git -- though that obviously implies you will need to resend the ACPI patchset that you had previously submitted. Jeff - 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
[git patches] libata fixes
In 2.6.24, we turned on ACPI support in libata. This is needed in order to support suspend/resume and BIOS passworded drives, but it inevitably brought with it a host of new regressions -- which is what happens anytime you blindly accept ATA commands the BIOS has decided to toss your way. :) It is bigger than I would like for -rc5, but the bulk of these changes are Tejun addressing regressions from 2.6.23, most of which are ACPI-related. Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus to receive the following updates: drivers/ata/libata-acpi.c | 387 +++-- drivers/ata/libata-core.c | 101 + drivers/ata/libata-eh.c |4 +- drivers/ata/libata.h |8 +- drivers/ata/sata_mv.c | 30 +++- drivers/ata/sata_sil.c| 18 +-- include/linux/ata.h | 15 ++ include/linux/libata.h| 29 +++- 8 files changed, 419 insertions(+), 173 deletions(-) Mark Lord (1): sata_mv: improve warnings about Highpoint RocketRAID 23xx cards Tejun Heo (15): sata_sil: fix spurious IRQ handling libata: clear link-eh_info.serror from ata_std_postreset() libata: add ST3160023AS / 3.42 to NCQ blacklist libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters libata: update ata_*_printk() macros such that level can be a variable libata: add more opcodes to ata.h libata: ata_dev_disable() should be called from EH context libata-acpi: add new hooks ata_acpi_dissociate() and ata_acpi_on_disable() libata-acpi: implement and use ata_acpi_init_gtm() libata-acpi: implement dev-gtf_cache and evaluate _GTF right after _STM during resume libata-acpi: improve ACPI disabling libata-acpi: improve _GTF execution error handling and reporting libata-acpi: implement _GTF command filtering libata: update atapi_eh_request_sense() such that lbam/lbah contains buffer size libata: fix ATAPI draining diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 545ea86..7bf4bef 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -6,6 +6,7 @@ * Copyright (C) 2006 Randy Dunlap */ +#include linux/module.h #include linux/ata.h #include linux/delay.h #include linux/device.h @@ -25,6 +26,18 @@ #include acpi/acmacros.h #include acpi/actypes.h +enum { + ATA_ACPI_FILTER_SETXFER = 1 0, + ATA_ACPI_FILTER_LOCK= 1 1, + + ATA_ACPI_FILTER_DEFAULT = ATA_ACPI_FILTER_SETXFER | + ATA_ACPI_FILTER_LOCK, +}; + +static unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT; +module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644); +MODULE_PARM_DESC(acpi_gtf_filter, filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock)); + #define NO_PORT_MULT 0x #define SATA_ADR(root, pmp)(((root) 16) | (pmp)) @@ -41,6 +54,12 @@ static int is_pci_dev(struct device *dev) return (dev-bus == pci_bus_type); } +static void ata_acpi_clear_gtf(struct ata_device *dev) +{ + kfree(dev-gtf_cache); + dev-gtf_cache = NULL; +} + /** * ata_acpi_associate_sata_port - associate SATA port with ACPI objects * @ap: target SATA port @@ -94,6 +113,9 @@ static void ata_acpi_associate_ide_port(struct ata_port *ap) dev-acpi_handle = acpi_get_child(ap-acpi_handle, i); } + + if (ata_acpi_gtm(ap, ap-__acpi_init_gtm) == 0) + ap-pflags |= ATA_PFLAG_INIT_GTM_VALID; } static void ata_acpi_handle_hotplug(struct ata_port *ap, struct kobject *kobj, @@ -188,6 +210,32 @@ void ata_acpi_associate(struct ata_host *host) } /** + * ata_acpi_dissociate - dissociate ATA host from ACPI objects + * @host: target ATA host + * + * This function is called during driver detach after the whole host + * is shut down. + * + * LOCKING: + * EH context. + */ +void ata_acpi_dissociate(struct ata_host *host) +{ + int i; + + /* Restore initial _GTM values so that driver which attaches +* afterward can use them too. +*/ + for (i = 0; i host-n_ports; i++) { + struct ata_port *ap = host-ports[i]; + const struct ata_acpi_gtm *gtm = ata_acpi_init_gtm(ap); + + if (ap-acpi_handle gtm) + ata_acpi_stm(ap, gtm); + } +} + +/** * ata_acpi_gtm - execute _GTM * @ap: target ATA port * @gtm: out parameter for _GTM result @@ -200,7 +248,7 @@ void ata_acpi_associate(struct ata_host *host) * RETURNS: * 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure. */ -int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *gtm) +int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm) { struct acpi_buffer output = { .length = ACPI_ALLOCATE_BUFFER }; union acpi_object *out_obj; @@ -259,15 +307,16
Re: [patch 3/9] libata: xfer_mask is unsigned int not unsigned long
On Mon, 17 Dec 2007 20:30:33 -0500 Jeff Garzik [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: From: Tejun Heo [EMAIL PROTECTED] xfer_mask is unsigned int not unsigned long. Change -mode_filter to take and return unsigned int. While at it, rename @adev of ata_pci_default_filter() to @dev for consistency. [EMAIL PROTECTED]: fix types] Signed-off-by: Tejun Heo [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/ata/libata-sff.c |5 +++-- drivers/ata/pata_acpi.c|2 +- drivers/ata/pata_ali.c |2 +- drivers/ata/pata_amd.c | 10 +- drivers/ata/pata_hpt366.c |2 +- drivers/ata/pata_hpt37x.c |4 ++-- drivers/ata/pata_pdc2027x.c|4 ++-- drivers/ata/pata_scc.c |2 +- drivers/ata/pata_serverworks.c |4 ++-- include/linux/libata.h |9 + 10 files changed, 23 insertions(+), 21 deletions(-) patch is outdated... What does this mean?? - 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: [patch 3/9] libata: xfer_mask is unsigned int not unsigned long
Andrew Morton wrote: On Mon, 17 Dec 2007 20:30:33 -0500 Jeff Garzik [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: From: Tejun Heo [EMAIL PROTECTED] xfer_mask is unsigned int not unsigned long. Change -mode_filter to take and return unsigned int. While at it, rename @adev of ata_pci_default_filter() to @dev for consistency. [EMAIL PROTECTED]: fix types] Signed-off-by: Tejun Heo [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/ata/libata-sff.c |5 +++-- drivers/ata/pata_acpi.c|2 +- drivers/ata/pata_ali.c |2 +- drivers/ata/pata_amd.c | 10 +- drivers/ata/pata_hpt366.c |2 +- drivers/ata/pata_hpt37x.c |4 ++-- drivers/ata/pata_pdc2027x.c|4 ++-- drivers/ata/pata_scc.c |2 +- drivers/ata/pata_serverworks.c |4 ++-- include/linux/libata.h |9 + 10 files changed, 23 insertions(+), 21 deletions(-) patch is outdated... What does this mean?? following discussion, was superceded by commit 52fc241b4c5ef60d73327d9468634694a1f7d359 Author: Tejun Heo [EMAIL PROTECTED] Date: Tue Nov 27 19:43:42 2007 +0900 libata: xfer_mask is unsigned long not unsigned int which has been in netdev#upstream for a few weeks, and probably at least one -mm release. - 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
[PATCH 2/5] libata: fix ata_acpi_gtm_xfermask()
ata_acpi_gtm_xfermask() as separated out from pacpi_discover_modes() has various bugs. Fix them. * The wrong comparison operator is used when finding for matching cycle resulting totally bogus result. * With the comparion operator fixed, boundary condtion handling is clumsy. * Setting of any DMA mask bit set all bits in PIO mask. * MWDMA and UDMA blocks are swapped. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- drivers/ata/libata-acpi.c | 42 +- 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index d6697ba..9f0b208 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -473,49 +473,49 @@ EXPORT_SYMBOL_GPL(ata_acpi_udma_cycle); unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, const struct ata_acpi_gtm *gtm) { + unsigned long pio_mask = 0, mwdma_mask = 0, udma_mask = 0; int unit, i; u32 t; - unsigned long mask = (0x7f ATA_SHIFT_UDMA) | (0x7 ATA_SHIFT_MWDMA) | (0x1F ATA_SHIFT_PIO); /* we always use the 0 slot for crap hardware */ unit = dev-devno; if (!(gtm-flags 0x10)) unit = 0; + /* Values larger than the longest cycle results in 0 mask +* while values equal to smaller than the shortest cycle +* results in mask which includes all supported modes. +* Disabled transfer method has the value of 0x which +* will always result in 0 mask. +*/ + /* start by scanning for PIO modes */ - for (i = 0; i 7; i++) { - t = gtm-drive[unit].pio; - if (t = ata_acpi_pio_cycle[i]) { - mask |= (2 (ATA_SHIFT_PIO + i)) - 1; + t = gtm-drive[unit].pio; + for (i = 0; i ARRAY_SIZE(ata_acpi_pio_cycle); i++) + if (t ata_acpi_pio_cycle[i]) break; - } - } + pio_mask = (1 i) - 1; /* See if we have MWDMA or UDMA data. We don't bother with * MWDMA if UDMA is available as this means the BIOS set UDMA * and our error changedown if it works is UDMA to PIO anyway. */ - if (gtm-flags (1 (2 * unit))) { + t = gtm-drive[unit].dma; + if (!(gtm-flags (1 (2 * unit { /* MWDMA */ - for (i = 0; i 5; i++) { - t = gtm-drive[unit].dma; - if (t = ata_acpi_mwdma_cycle[i]) { - mask |= (2 (ATA_SHIFT_MWDMA + i)) - 1; + for (i = 0; i ARRAY_SIZE(ata_acpi_mwdma_cycle); i++) + if (t ata_acpi_mwdma_cycle[i]) break; - } - } + mwdma_mask = (1 i) - 1; } else { /* UDMA */ - for (i = 0; i 7; i++) { - t = gtm-drive[unit].dma; - if (t = ata_acpi_udma_cycle[i]) { - mask |= (2 (ATA_SHIFT_UDMA + i)) - 1; + for (i = 0; i ARRAY_SIZE(ata_acpi_udma_cycle); i++) + if (t ata_acpi_udma_cycle[i]) break; - } - } + udma_mask = (1 i) - 1; } - return mask; + return ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask); } EXPORT_SYMBOL_GPL(ata_acpi_gtm_xfermask); -- 1.5.2.4 - 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
[PATCH 1/5] libata: separate out ata_acpi_gtm_xfermask() from pacpi_discover_modes()
Finding out matching transfer mode from ACPI GTM values is useful for other purposes too. Separate out the function and timing tables from pata_acpi::pacpi_discover_modes(). Other than checking shared-configuration bit after doing ata_acpi_gtm() in pacpi_discover_modes() which should be safe, this patch doesn't introduce any behavior change. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- drivers/ata/libata-acpi.c | 78 + drivers/ata/pata_acpi.c | 66 ++--- include/linux/libata.h| 25 ++ 3 files changed, 114 insertions(+), 55 deletions(-) diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index ebc4dfc..d6697ba 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -441,6 +441,84 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) return rc; } +/* Welcome to ACPI, bring a bucket */ +const unsigned int ata_acpi_pio_cycle[7] = { + 600, 383, 240, 180, 120, 100, 80 +}; +EXPORT_SYMBOL_GPL(ata_acpi_pio_cycle); + +const unsigned int ata_acpi_mwdma_cycle[5] = { + 480, 150, 120, 100, 80 +}; +EXPORT_SYMBOL_GPL(ata_acpi_mwdma_cycle); + +const unsigned int ata_acpi_udma_cycle[7] = { + 120, 80, 60, 45, 30, 20, 15 +}; +EXPORT_SYMBOL_GPL(ata_acpi_udma_cycle); + +/** + * ata_acpi_gtm_xfermode - determine xfermode from GTM parameter + * @dev: target device + * @gtm: GTM parameter to use + * + * Determine xfermask for @dev from @gtm. + * + * LOCKING: + * None. + * + * RETURNS: + * Determined xfermask. + */ +unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, + const struct ata_acpi_gtm *gtm) +{ + int unit, i; + u32 t; + unsigned long mask = (0x7f ATA_SHIFT_UDMA) | (0x7 ATA_SHIFT_MWDMA) | (0x1F ATA_SHIFT_PIO); + + /* we always use the 0 slot for crap hardware */ + unit = dev-devno; + if (!(gtm-flags 0x10)) + unit = 0; + + /* start by scanning for PIO modes */ + for (i = 0; i 7; i++) { + t = gtm-drive[unit].pio; + if (t = ata_acpi_pio_cycle[i]) { + mask |= (2 (ATA_SHIFT_PIO + i)) - 1; + break; + } + } + + /* See if we have MWDMA or UDMA data. We don't bother with +* MWDMA if UDMA is available as this means the BIOS set UDMA +* and our error changedown if it works is UDMA to PIO anyway. +*/ + if (gtm-flags (1 (2 * unit))) { + /* MWDMA */ + for (i = 0; i 5; i++) { + t = gtm-drive[unit].dma; + if (t = ata_acpi_mwdma_cycle[i]) { + mask |= (2 (ATA_SHIFT_MWDMA + i)) - 1; + break; + } + } + } else { + /* UDMA */ + for (i = 0; i 7; i++) { + t = gtm-drive[unit].dma; + if (t = ata_acpi_udma_cycle[i]) { + mask |= (2 (ATA_SHIFT_UDMA + i)) - 1; + break; + } + } + } + + return mask; +} +EXPORT_SYMBOL_GPL(ata_acpi_gtm_xfermask); + /** * ata_acpi_cbl_80wire - Check for 80 wire cable * @ap: Port to check diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c index e4542ab..a4737a3 100644 --- a/drivers/ata/pata_acpi.c +++ b/drivers/ata/pata_acpi.c @@ -81,17 +81,6 @@ static void pacpi_error_handler(struct ata_port *ap) NULL, ata_std_postreset); } -/* Welcome to ACPI, bring a bucket */ -static const unsigned int pio_cycle[7] = { - 600, 383, 240, 180, 120, 100, 80 -}; -static const unsigned int mwdma_cycle[5] = { - 480, 150, 120, 100, 80 -}; -static const unsigned int udma_cycle[7] = { - 120, 80, 60, 45, 30, 20, 15 -}; - /** * pacpi_discover_modes- filter non ACPI modes * @adev: ATA device @@ -103,56 +92,20 @@ static const unsigned int udma_cycle[7] = { static unsigned long pacpi_discover_modes(struct ata_port *ap, struct ata_device *adev) { - int unit = adev-devno; struct pata_acpi *acpi = ap-private_data; - int i; - u32 t; - unsigned long mask = (0x7f ATA_SHIFT_UDMA) | (0x7 ATA_SHIFT_MWDMA) | (0x1F ATA_SHIFT_PIO); - struct ata_acpi_gtm probe; + unsigned int xfer_mask; probe = acpi-gtm; - /* We always use the 0 slot for crap hardware */ - if (!(probe.flags 0x10)) - unit = 0; - ata_acpi_gtm(ap, probe); - /* Start by scanning for PIO modes */ - for (i = 0; i 7; i++) { - t = probe.drive[unit].pio; - if (t = pio_cycle[i]) { - mask |= (2 (ATA_SHIFT_PIO + i)) - 1; -
[PATCH 3/5] libata: implement ata_timing_cycle2mode() and use it in libata-acpi and pata_acpi
libata-acpi is using separate timing tables for transfer modes although libata-core has the complete ata_timing table. Implement ata_timing_cycle2mode() to look for matching mode given transfer type and cycle duration and use it in libata-acpi and pata_acpi to replace private timing tables. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- drivers/ata/libata-acpi.c | 62 +++-- drivers/ata/libata-core.c | 52 + drivers/ata/pata_acpi.c | 13 + include/linux/libata.h|5 +--- 4 files changed, 75 insertions(+), 57 deletions(-) diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 9f0b208..a6f1a6b 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -441,22 +441,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) return rc; } -/* Welcome to ACPI, bring a bucket */ -const unsigned int ata_acpi_pio_cycle[7] = { - 600, 383, 240, 180, 120, 100, 80 -}; -EXPORT_SYMBOL_GPL(ata_acpi_pio_cycle); - -const unsigned int ata_acpi_mwdma_cycle[5] = { - 480, 150, 120, 100, 80 -}; -EXPORT_SYMBOL_GPL(ata_acpi_mwdma_cycle); - -const unsigned int ata_acpi_udma_cycle[7] = { - 120, 80, 60, 45, 30, 20, 15 -}; -EXPORT_SYMBOL_GPL(ata_acpi_udma_cycle); - /** * ata_acpi_gtm_xfermode - determine xfermode from GTM parameter * @dev: target device @@ -473,49 +457,33 @@ EXPORT_SYMBOL_GPL(ata_acpi_udma_cycle); unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, const struct ata_acpi_gtm *gtm) { - unsigned long pio_mask = 0, mwdma_mask = 0, udma_mask = 0; - int unit, i; - u32 t; + unsigned long xfer_mask = 0; + unsigned int type; + int unit; + u8 mode; /* we always use the 0 slot for crap hardware */ unit = dev-devno; if (!(gtm-flags 0x10)) unit = 0; - /* Values larger than the longest cycle results in 0 mask -* while values equal to smaller than the shortest cycle -* results in mask which includes all supported modes. -* Disabled transfer method has the value of 0x which -* will always result in 0 mask. -*/ - - /* start by scanning for PIO modes */ - t = gtm-drive[unit].pio; - for (i = 0; i ARRAY_SIZE(ata_acpi_pio_cycle); i++) - if (t ata_acpi_pio_cycle[i]) - break; - pio_mask = (1 i) - 1; + /* PIO */ + mode = ata_timing_cycle2mode(ATA_SHIFT_PIO, gtm-drive[unit].pio); + xfer_mask |= ata_xfer_mode2mask(mode); /* See if we have MWDMA or UDMA data. We don't bother with * MWDMA if UDMA is available as this means the BIOS set UDMA * and our error changedown if it works is UDMA to PIO anyway. */ - t = gtm-drive[unit].dma; - if (!(gtm-flags (1 (2 * unit { - /* MWDMA */ - for (i = 0; i ARRAY_SIZE(ata_acpi_mwdma_cycle); i++) - if (t ata_acpi_mwdma_cycle[i]) - break; - mwdma_mask = (1 i) - 1; - } else { - /* UDMA */ - for (i = 0; i ARRAY_SIZE(ata_acpi_udma_cycle); i++) - if (t ata_acpi_udma_cycle[i]) - break; - udma_mask = (1 i) - 1; - } + if (!(gtm-flags (1 (2 * unit + type = ATA_SHIFT_MWDMA; + else + type = ATA_SHIFT_UDMA; + + mode = ata_timing_cycle2mode(type, gtm-drive[unit].dma); + xfer_mask |= ata_xfer_mode2mask(mode); - return ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask); + return xfer_mask; } EXPORT_SYMBOL_GPL(ata_acpi_gtm_xfermask); diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 77974ca..9804127 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2903,6 +2903,57 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, } /** + * ata_timing_cycle2mode - find xfer mode for the specified cycle duration + * @xfer_shift: ATA_SHIFT_* value for transfer type to examine. + * @cycle: cycle duration in ns + * + * Return matching xfer mode for @cycle. The returned mode is of + * the transfer type specified by @xfer_shift. If @cycle is too + * slow for @xfer_shift, 0xff is returned. If @cycle is faster + * than the fastest known mode, the fasted mode is returned. + * + * LOCKING: + * None. + * + * RETURNS: + * Matching xfer_mode, 0xff if no match found. + */ +u8 ata_timing_cycle2mode(unsigned int xfer_shift, int cycle) +{ + u8 base_mode = 0xff, last_mode = 0xff; + const struct ata_xfer_ent *ent; + const struct ata_timing *t; + + for (ent = ata_xfer_tbl; ent-shift = 0; ent++) +
[PATCH 4/5] libata: reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask()
Reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask() and while at it relocate the function below ata_acpi_gtm_xfermask(). New ata_acpi_cbl_80wire() implementation takes @gtm, in both pata_via and pata_amd, use the initial GTM value. Both are trying to peek initial BIOS configuration, so using initial caching value makes sense. This fixes ACPI part of cable detection in pata_amd which previously always returned 0 because configuring PIO0 during reset clears DMA configuration. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- drivers/ata/libata-acpi.c | 41 - drivers/ata/pata_amd.c|3 ++- drivers/ata/pata_via.c|3 ++- include/linux/libata.h| 10 +++--- 4 files changed, 27 insertions(+), 30 deletions(-) diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index a6f1a6b..9e8ec19 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -490,38 +490,29 @@ EXPORT_SYMBOL_GPL(ata_acpi_gtm_xfermask); /** * ata_acpi_cbl_80wire - Check for 80 wire cable * @ap: Port to check + * @gtm: GTM data to use * - * Return 1 if the ACPI mode data for this port indicates the BIOS selected - * an 80wire mode. + * Return 1 if the @gtm indicates the BIOS selected an 80wire mode. */ - -int ata_acpi_cbl_80wire(struct ata_port *ap) +int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm) { - const struct ata_acpi_gtm *gtm = ata_acpi_init_gtm(ap); - int valid = 0; + struct ata_device *dev; - if (!gtm) - return 0; + ata_link_for_each_dev(dev, ap-link) { + unsigned long xfer_mask, udma_mask; + + if (!ata_dev_enabled(dev)) + continue; + + xfer_mask = ata_acpi_gtm_xfermask(dev, gtm); + ata_unpack_xfermask(xfer_mask, NULL, NULL, udma_mask); + + if (udma_mask ~ATA_UDMA_MASK_40C) + return 1; + } - /* Split timing, DMA enabled */ - if ((gtm-flags 0x11) == 0x11 gtm-drive[0].dma 55) - valid |= 1; - if ((gtm-flags 0x14) == 0x14 gtm-drive[1].dma 55) - valid |= 2; - /* Shared timing, DMA enabled */ - if ((gtm-flags 0x11) == 0x01 gtm-drive[0].dma 55) - valid |= 1; - if ((gtm-flags 0x14) == 0x04 gtm-drive[0].dma 55) - valid |= 2; - - /* Drive check */ - if ((valid 1) ata_dev_enabled(ap-link.device[0])) - return 1; - if ((valid 2) ata_dev_enabled(ap-link.device[1])) - return 1; return 0; } - EXPORT_SYMBOL_GPL(ata_acpi_cbl_80wire); static void ata_acpi_gtf_to_tf(struct ata_device *dev, diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 3cc27b5..e71125a 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c @@ -272,7 +272,8 @@ static int nv_cable_detect(struct ata_port *ap) if ((udma 0xC4) == 0xC4 || (udma 0xC400) == 0xC400) cbl = ATA_CBL_PATA80; /* And a triple check across suspend/resume with ACPI around */ - if (ata_acpi_cbl_80wire(ap)) + if (ata_acpi_init_gtm(ap) + ata_acpi_cbl_80wire(ap, ata_acpi_init_gtm(ap))) cbl = ATA_CBL_PATA80; return cbl; } diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 453d72b..39627ab 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c @@ -185,7 +185,8 @@ static int via_cable_detect(struct ata_port *ap) { if (ata66 (0x1010 (16 * ap-port_no))) return ATA_CBL_PATA80; /* Check with ACPI so we can spot BIOS reported SATA bridges */ - if (ata_acpi_cbl_80wire(ap)) + if (ata_acpi_init_gtm(ap) + ata_acpi_cbl_80wire(ap, ata_acpi_init_gtm(ap))) return ATA_CBL_PATA80; return ATA_CBL_PATA40; } diff --git a/include/linux/libata.h b/include/linux/libata.h index 8ede93b..cc4eaef 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -968,18 +968,16 @@ static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap) return ap-__acpi_init_gtm; return NULL; } -extern int ata_acpi_cbl_80wire(struct ata_port *ap); int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm); int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm); unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, const struct ata_acpi_gtm *gtm); - +int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm); #else static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap) { return NULL; } -static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; } static inline int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm
[PATCH 5/5] pata_amd: update mode selection for NV PATAs
Cable detection on NV PATA hosts isn't implemented and the CBLID- cable isn't wired according to the sepc either, so both host-side and generic drive-side cable detections are broken. Till now, nv_cable_detect() relied on peeking BIOS and ACPI configurations to upgrade to 80C but this often results in misdetection of 40C cable as 80C. Also, the original implementation was broken in that by the time BIOS configuration is read it has already been cleared by programming PIO0 during reset. This patch reimplements NV mode selection such that... * BIOS configuration value is stored during driver attach and restored on detach. * Cable type is fixed to ATA_CBL_PATA_IGN and mode selection is soley done by nv_mode_filter() which peeks both BIOS and ACPI configurations and filter accordingly. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- drivers/ata/pata_amd.c | 129 ++- 1 files changed, 93 insertions(+), 36 deletions(-) diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index e71125a..761a666 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c @@ -220,6 +220,62 @@ static void amd133_set_dmamode(struct ata_port *ap, struct ata_device *adev) timing_setup(ap, adev, 0x40, adev-dma_mode, 4); } +/* Both host-side and drive-side detection results are worthless on NV + * PATAs. Ignore them and just follow what BIOS configured. Both the + * current configuration in PCI config reg and ACPI GTM result are + * cached during driver attach and are consulted to select transfer + * mode. + */ +static unsigned long nv_mode_filter(struct ata_device *dev, + unsigned long xfer_mask) +{ + static const unsigned int udma_mask_map[] = + { ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0, + ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 }; + struct ata_port *ap = dev-link-ap; + char acpi_str[32] = ; + u32 saved_udma, udma; + const struct ata_acpi_gtm *gtm; + unsigned long bios_limit = 0, acpi_limit = 0, limit; + + /* find out what BIOS configured */ + udma = saved_udma = (unsigned long)ap-host-private_data; + + if (ap-port_no == 0) + udma = 16; + if (dev-devno == 0) + udma = 8; + + if ((udma 0xc0) == 0xc0) + bios_limit = ata_pack_xfermask(0, 0, udma_mask_map[udma 0x7]); + + /* consult ACPI GTM too */ + gtm = ata_acpi_init_gtm(ap); + if (gtm) { + acpi_limit = ata_acpi_gtm_xfermask(dev, gtm); + + snprintf(acpi_str, sizeof(acpi_str), (%u:%u:0x%x), +gtm-drive[0].dma, gtm-drive[1].dma, gtm-flags); + } + + /* be optimistic, EH can take care of things if something goes wrong */ + limit = bios_limit | acpi_limit; + + /* If PIO or DMA isn't configured at all, don't limit. Let EH +* handle it. +*/ + if (!(limit ATA_MASK_PIO)) + limit |= ATA_MASK_PIO; + if (!(limit (ATA_MASK_MWDMA | ATA_MASK_UDMA))) + limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA; + + ata_port_printk(ap, KERN_DEBUG, nv_mode_filter: 0x%lx0x%lx-0x%lx, + BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n, + xfer_mask, limit, xfer_mask limit, bios_limit, + saved_udma, acpi_limit, acpi_str); + + return xfer_mask limit; +} /** * nv_probe_init - cable detection @@ -252,32 +308,6 @@ static void nv_error_handler(struct ata_port *ap) ata_std_postreset); } -static int nv_cable_detect(struct ata_port *ap) -{ - static const u8 bitmask[2] = {0x03, 0x0C}; - struct pci_dev *pdev = to_pci_dev(ap-host-dev); - u8 ata66; - u16 udma; - int cbl; - - pci_read_config_byte(pdev, 0x52, ata66); - if (ata66 bitmask[ap-port_no]) - cbl = ATA_CBL_PATA80; - else - cbl = ATA_CBL_PATA40; - - /* We now have to double check because the Nvidia boxes BIOS - doesn't always set the cable bits but does set mode bits */ - pci_read_config_word(pdev, 0x62 - 2 * ap-port_no, udma); - if ((udma 0xC4) == 0xC4 || (udma 0xC400) == 0xC400) - cbl = ATA_CBL_PATA80; - /* And a triple check across suspend/resume with ACPI around */ - if (ata_acpi_init_gtm(ap) - ata_acpi_cbl_80wire(ap, ata_acpi_init_gtm(ap))) - cbl = ATA_CBL_PATA80; - return cbl; -} - /** * nv100_set_piomode - set initial PIO mode data * @ap: ATA interface @@ -315,6 +345,14 @@ static void nv133_set_dmamode(struct ata_port *ap, struct ata_device *adev) timing_setup(ap, adev, 0x50, adev-dma_mode, 4); } +static void nv_host_stop(struct ata_host *host) +{ + u32 udma = (unsigned long)host-private_data; + + /* restore PCI config
RE: Questions about SATA hotplug in linux 2.6
Hi Jeff and Tejun: I want to continue this discussion with some questions: From: Tejun Heo wrote: Jeff Garzik wrote: Shane Huang wrote: 1. If users unplug one SATA HDD(no-root partition) or SATA ODD when the system is running, then plug it back to the same SATA port, Should the system and SATA HDD/ODD still work well? Yes. To add a bit, libata hotplug has grace time of at least 15secs. If the same device is plugged out and then plugged in in that time, libata considers that the device and/or connection has suffered transient failure and assumes it's the same device and there's no modification to its content. This means that if you disconnect a harddrive, write to it and then connect it back in the grace period corruption will occur. It will be fun to have some sort of competition to actually do this. :-) These questions come up when our QA test our SB700 SATA drivers, but I don't know the SATA hotplug support in linux 2.6. Is there any guy who can give some official confirmation? :-) The main thing of note with regards to hotplug is that the associated device (/dev/sdb, /dev/scd0, etc.) may change between plug and unplug. For example, if you unplug a SATA HDD then plug it back in, the user might see /dev/sdb disappear, and /dev/sdd appear -- even if it is the exact same HDD, on the exact same port. Yeah, using LABEL and/or UUID is a good idea. In the future, it will be nice to have persistent block device name as netdevices do. When I disconnect SATA ODD and plug it back to the same SATA port after several seconds, it can still work well. But if I plug it to a different SATA port, it will NOT able to work any more. I will attach the log messages at the end of this mail, please check them. My Env: SB700 + RS780, openSUSE10.3 i386. I also find the same symptom on Intel E210882 (ICH5) under RedHat RHEL4U5. That's to say failure of SATA hotplug to different ports also exist on some Intel platforms. Do you guys think it's normal? It not, how to make SATA hotplug work on different SATA port? Should it be supported by BIOS or hardware? == plug SATA ODD to the original port, still can work = Dec 18 15:06:29 linux-i276 kernel: ata3: exception Emask 0x10 SAct 0x0 SErr 0x90200 action 0xe frozen Dec 18 15:06:29 linux-i276 kernel: ata3: irq_stat 0x0040 , PHY RDY changed Dec 18 15:06:29 linux-i276 kernel: ata3: hard resetting link Dec 18 15:06:30 linux-i276 kernel: ata3: SATA link down (SStatus 0 SControl 300) Dec 18 15:06:30 linux-i276 kernel: ata3: failed to recover some devices, retrying in 5 secs Dec 18 15:06:35 linux-i276 kernel: ata3: hard resetting link Dec 18 15:06:35 linux-i276 kernel: ata3: SATA link down (SStatus 0 SControl 300) Dec 18 15:06:35 linux-i276 kernel: ata3: limiting SATA link speed to 1.5 Gbps Dec 18 15:06:35 linux-i276 kernel: ata3.00: limiting speed to UDMA/33:PIO3 Dec 18 15:06:35 linux-i276 kernel: ata3: failed to recover some devices, retrying in 5 secs Dec 18 15:06:40 linux-i276 kernel: ata3: hard resetting link Dec 18 15:06:41 linux-i276 kernel: ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310) Dec 18 15:06:41 linux-i276 kernel: ata3.00: configured for UDMA/33 Dec 18 15:06:41 linux-i276 kernel: ata3: EH pending after completion, repeating EH (cnt=4) Dec 18 15:06:41 linux-i276 kernel: ata3: exception Emask 0x10 SAct 0x0 SErr 0x40c action 0xb Dec 18 15:06:41 linux-i276 kernel: ata3: irq_stat 0x0040 , connection status changed Dec 18 15:06:42 linux-i276 kernel: ata3: soft resetting link Dec 18 15:06:42 linux-i276 kernel: ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310) Dec 18 15:06:42 linux-i276 kernel: ata3.00: configured for UDMA/33 Dec 18 15:06:42 linux-i276 kernel: ata3: EH complete == plug SATA ODD to a different SATA port, can NOT work = Dec 18 15:09:10 linux-i276 kernel: ata3: exception Emask 0x10 SAct 0x0 SErr 0x90200 action 0xe frozen Dec 18 15:09:10 linux-i276 kernel: ata3: irq_stat 0x0040 , PHY RDY changed Dec 18 15:09:10 linux-i276 kernel: ata3: hard resetting link Dec 18 15:09:10 linux-i276 kernel: ata3: SATA link down (SStatus 0 SControl 310) Dec 18 15:09:10 linux-i276 kernel: ata3: failed to recover some devices, retrying in 5 secs Dec 18 15:09:15 linux-i276 kernel: ata3: hard resetting link Dec 18 15:09:16 linux-i276 kernel: ata3: SATA link down (SStatus 0 SControl 310) Dec 18 15:09:16 linux-i276 kernel: ata3.00: limiting speed to UDMA/33:PIO2 Dec 18 15:09:16 linux-i276 kernel: ata3: failed to recover some devices, retrying in 5 secs Dec 18 15:09:21 linux-i276 kernel: ata3: hard resetting link Dec 18 15:09:21 linux-i276 kernel: ata3: SATA link down (SStatus 0 SControl 310) Dec 18 15:09:21 linux-i276 kernel: ata3.00: disabled Dec 18 15:09:21 linux-i276 kernel: ata3: EH complete Dec 18 15:09:21 linux-i276 kernel: ata3.00: detaching (SCSI 2:0:0:0) Dec 18 15:09:22 linux-i276 kernel: scsi 2:0:0:0: rejecting I/O to dead device Thanks Shane - To unsubscribe