Re: Disk spin down issue on shut down/suspend to disk
Michael Sedkowski wrote: > Dnia 07-08-2007, Wt o godzinie 03:43 +0900, Tejun Heo napisał(a): >> Does emergency unload count increase >> after each power down? > > I think I got it. > Using smartctl I've done a test and shut down, then repeted the test. > The only values that where diffrent are temperatures and > Hardware_ECC_Recovered which rised by 6 points. > However I have no idea which of those is the "emergency count"... > Full results in attachment. > > 192 Power-Off_Retract_Count 0x0032 100 100 000Old_age Always > - 388 I think this is the one. You can test it by forcefully powering off the machine (press power button for several secs or disconnect AC and battery) and see whether the count increases. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Disk spin down issue on shut down/suspend to disk
Henrique de Moraes Holschuh wrote: > On Tue, 07 Aug 2007, Tejun Heo wrote: >> Michael Sedkowski wrote: Hmmm... If the problem only shows up on nx6325, it might be that ACPI is pulling unnecessary stunt. Please apply the attached patch and report when the disk spins down and up. >>> Disk spins down on "Pre-shutdown prepare" and then goes up and down on >>> "Power down". >> Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether >> it spins down the disk correctly. Does emergency unload count increase >> after each power down? Also, please post the result of 'dmidecode'. > > You know, this actually make a lot of sense, and one can't even complain > about firmware that pulls that off. Well, I'm complaining. I think the problem here is that it isn't clear which one is who's responsibility. There's a Korean saying which approximately translates into "if you have too many boatmen on a ship, it goes to mountain". We also have a bunch of Toshiba laptops which want the ATA controller to be in enabled state when ACPI suspend is invoked because the suspend method apparently wants to execute some commands before going to sleep. I wish ACPI spec carries a big fat sign saying "stay f*** away from anything which isn't essential to the requested operation". > Any chances of changing things > so that we inspect/snoop all tasks sent to the device, and filter them > out, or react to them accordingly? No, we can't unless we snoop ACPI method execution and detect accesses to IO ports or iomem regions. It's not going through any driver. This is a gross mess. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Disk spin down issue on shut down/suspend to disk
Robert Hancock wrote: > Tejun Heo wrote: >> Michael Sedkowski wrote: Hmmm... If the problem only shows up on nx6325, it might be that ACPI is pulling unnecessary stunt. Please apply the attached patch and report when the disk spins down and up. >>> Disk spins down on "Pre-shutdown prepare" and then goes up and down on >>> "Power down". >> >> Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether >> it spins down the disk correctly. Does emergency unload count increase >> after each power down? Also, please post the result of 'dmidecode'. > > I know that my Compaq X1000-series laptop does do some kind of ACPI > games with the disk on ACPI power off (I assume it is putting the disk > in standby before power-off at least). It also does this if you boot > into DOS, GRUB, etc. and then hit the power button. Could be if the disk > is dumb enough to spin up for sync cache and standby when there is > nothing to flush, and the kernel does its own standby, this could cause > an extra spinup/down.. Yeah, that seems to be what's going on. I don't think we have any other choice than blacklisting those notebooks. This is a mess. How does the other OS cope with this? I'm thinking about using DMI vendor/product match to detect the affected systems but I think it would be better to match the ACPI implementation directly. Is there a way to match specific ACPI implementation? Thanks. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] libata: implement BROKEN_HPA horkage and apply it to HDS724040KLSA80
HDS724040KLSA80 reports that it supports HPA && LBA48 but craps itself on READ_NATIVE_MAX_EXT. Implement BROKEN_HPA horkage and apply it to the drive. If the horkage is set, all HPA operations are skipped. While at it, make HPA test a bit more reliable by also checking ata_id_has_hpa(). Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> Cc: Quel Qun <[EMAIL PROTECTED]> Cc: Luiz Fernando N. Capitulino <[EMAIL PROTECTED]> --- The drive worked fine before HPA support was added and thus this is a regression fix. Please consider for -stable. Thanks. drivers/ata/libata-core.c |4 +++- include/linux/libata.h|1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 60e78be..7158a06 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1911,7 +1911,8 @@ int ata_dev_configure(struct ata_device *dev) dev->flags |= ATA_DFLAG_FLUSH_EXT; } - if (ata_id_hpa_enabled(dev->id)) + if (!(dev->horkage & ATA_HORKAGE_BROKEN_HPA) && + ata_id_has_hpa(id) && ata_id_hpa_enabled(dev->id)) dev->n_sectors = ata_hpa_resize(dev); /* config NCQ */ @@ -3789,6 +3790,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "FUJITSU MHV2080BH", "00840028", ATA_HORKAGE_NONCQ, }, { "ST9160821AS","3.CLF",ATA_HORKAGE_NONCQ, }, { "SAMSUNG HD401LJ","ZZ100-15", ATA_HORKAGE_NONCQ, }, + { "HDS724040KLSA80","KFAOA20N", ATA_HORKAGE_BROKEN_HPA, }, /* Devices with NCQ limits */ diff --git a/include/linux/libata.h b/include/linux/libata.h index 41978a5..a67bb90 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -303,6 +303,7 @@ enum { ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ + ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */ }; enum hsm_task_states { - 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: Disk spin down issue on shut down/suspend to disk
On Tue, 07 Aug 2007, Tejun Heo wrote: > Michael Sedkowski wrote: > >> Hmmm... If the problem only shows up on nx6325, it might be that ACPI is > >> pulling unnecessary stunt. Please apply the attached patch and report > >> when the disk spins down and up. > > > > Disk spins down on "Pre-shutdown prepare" and then goes up and down on > > "Power down". > > Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether > it spins down the disk correctly. Does emergency unload count increase > after each power down? Also, please post the result of 'dmidecode'. You know, this actually make a lot of sense, and one can't even complain about firmware that pulls that off. Any chances of changing things so that we inspect/snoop all tasks sent to the device, and filter them out, or react to them accordingly? -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh - 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: Disk spin down issue on shut down/suspend to disk
Tejun Heo wrote: Michael Sedkowski wrote: Hmmm... If the problem only shows up on nx6325, it might be that ACPI is pulling unnecessary stunt. Please apply the attached patch and report when the disk spins down and up. Disk spins down on "Pre-shutdown prepare" and then goes up and down on "Power down". Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether it spins down the disk correctly. Does emergency unload count increase after each power down? Also, please post the result of 'dmidecode'. I know that my Compaq X1000-series laptop does do some kind of ACPI games with the disk on ACPI power off (I assume it is putting the disk in standby before power-off at least). It also does this if you boot into DOS, GRUB, etc. and then hit the power button. Could be if the disk is dumb enough to spin up for sync cache and standby when there is nothing to flush, and the kernel does its own standby, this could cause an extra spinup/down.. -- Robert Hancock Saskatoon, SK, Canada To email, remove "nospam" from [EMAIL PROTECTED] Home Page: http://www.roberthancock.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: Disk spin down issue on shut down/suspend to disk
Dnia 07-08-2007, Wt o godzinie 03:43 +0900, Tejun Heo napisał(a): > Does emergency unload count increase > after each power down? I think I got it. Using smartctl I've done a test and shut down, then repeted the test. The only values that where diffrent are temperatures and Hardware_ECC_Recovered which rised by 6 points. However I have no idea which of those is the "emergency count"... Full results in attachment. Regards, Michael ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 117 100 006Pre-fail Always - 126411939 3 Spin_Up_Time0x0002 095 094 000Old_age Always - 0 4 Start_Stop_Count0x0033 098 098 020Pre-fail Always - 2340 5 Reallocated_Sector_Ct 0x0033 100 100 036Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 081 060 030Pre-fail Always - 135278157 9 Power_On_Hours 0x0032 096 096 000Old_age Always - 3940 10 Spin_Retry_Count0x0013 100 100 034Pre-fail Always - 0 12 Power_Cycle_Count 0x0033 099 099 020Pre-fail Always - 1643 187 Unknown_Attribute 0x0032 100 100 000Old_age Always - 0 189 Unknown_Attribute 0x003a 100 100 000Old_age Always - 0 190 Temperature_Celsius 0x0022 056 049 045Old_age Always - 757727276 192 Power-Off_Retract_Count 0x0032 100 100 000Old_age Always - 388 193 Load_Cycle_Count0x0032 075 075 000Old_age Always - 51636 194 Temperature_Celsius 0x0022 044 051 000Old_age Always - 44 (Lifetime Min/Max 0/8) 195 Hardware_ECC_Recovered 0x001a 063 050 000Old_age Always - 68925016 197 Current_Pending_Sector 0x0012 100 100 000Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000Old_age Offline - 0 199 UDMA_CRC_Error_Count0x003e 200 200 000Old_age Always - 0 200 Multi_Zone_Error_Rate 0x 100 253 000Old_age Offline - 0 202 TA_Increase_Count 0x0032 100 253 000Old_age Always -0 After shut down: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 117 100 006Pre-fail Always - 126411939 3 Spin_Up_Time0x0002 095 094 000Old_age Always - 0 4 Start_Stop_Count0x0033 098 098 020Pre-fail Always - 2342 5 Reallocated_Sector_Ct 0x0033 100 100 036Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 081 060 030Pre-fail Always - 135286288 9 Power_On_Hours 0x0032 096 096 000Old_age Always - 3940 10 Spin_Retry_Count0x0013 100 100 034Pre-fail Always - 0 12 Power_Cycle_Count 0x0033 099 099 020Pre-fail Always - 1644 187 Unknown_Attribute 0x0032 100 100 000Old_age Always - 0 189 Unknown_Attribute 0x003a 100 100 000Old_age Always - 0 190 Temperature_Celsius 0x0022 057 049 045Old_age Always - 724172843 192 Power-Off_Retract_Count 0x0032 100 100 000Old_age Always - 388 193 Load_Cycle_Count0x0032 075 075 000Old_age Always - 51638 194 Temperature_Celsius 0x0022 043 051 000Old_age Always - 43 (Lifetime Min/Max 0/8) 195 Hardware_ECC_Recovered 0x001a 069 050 000Old_age Always - 71918457 197 Current_Pending_Sector 0x0012 100 100 000Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000Old_age Offline - 0 199 UDMA_CRC_Error_Count0x003e 200 200 000Old_age Always - 0 200 Multi_Zone_Error_Rate 0x 100 253 000Old_age Offline - 0 202 TA_Increase_Count 0x0032 100 253 000Old_age Always - 0
Re: [PATCH] mark PCI resource with start 0 as unassigned
On Mon, 2007-08-06 at 20:04 +0200, Segher Boessenkool wrote: > That's of course the smarter choice, _if_ we have a choice at > all -- on PowerPC, the PCI setup on certain platforms is done > by the firmware (and we don't want to mess with it for various > reasons), and some _do_ map PCI legacy I/O at 0. > > Not in this case though, so let's just ignore that possibility > until it hits us in the face :-) Agreed. We can always try to remap just that device if it becomes an issue. Ben. - 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: Boot fails on Intel SATA controller
Em Mon, 06 Aug 2007 19:17:32 + [EMAIL PROTECTED] (Quel Qun) escreveu: | The kernel compiles and boots after applying this patch to 2.6.23-rc1. Cool! Tejun, can you CC me when you submit this patch mainline so that I can track its inclusion? Thanks a lot. -- Luiz Fernando N. Capitulino - 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] mark PCI resource with start 0 as unassigned
O> That's of course the smarter choice, _if_ we have a choice at > all -- on PowerPC, the PCI setup on certain platforms is done > by the firmware (and we don't want to mess with it for various > reasons), and some _do_ map PCI legacy I/O at 0. > > Not in this case though, so let's just ignore that possibility > until it hits us in the face :-) An SFF controller mapped at I/O is basically not going to work. Take it up with the firmware - 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: Disk spin down issue on shut down/suspend to disk
Dnia 07-08-2007, Wt o godzinie 03:43 +0900, Tejun Heo napisał(a): > Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether > it spins down the disk correctly. Does emergency unload count increase > after each power down? Also, please post the result of 'dmidecode'. > > Thanks. > I do not know how to check this emergency unload count, so please explain what do I need to do. dmidecode: dmidecode 2.9 SMBIOS 2.4 present. 23 structures occupying 1029 bytes. Table at 0x000F38EB. Handle 0x, DMI type 0, 24 bytes BIOS Information Vendor: Hewlett-Packard Version: 68YDU Ver. F.0D Release Date: 04/17/2007 Address: 0xE Runtime Size: 128 kB ROM Size: 1024 kB Characteristics: PCI is supported PC Card (PCMCIA) is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported EDD is supported 3.5"/720 KB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) ACPI is supported USB legacy is supported LS-120 boot is supported Smart battery is supported BIOS boot specification is supported Function key-initiated network boot is supported Targeted content distribution is supported BIOS Revision: 15.13 Firmware Revision: 88.18 Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: Hewlett-Packard Product Name: Version: F.0D Serial Number: UUID: Not Settable Wake-up Type: Power Switch SKU Number: Family: 103C_5336AN Handle 0x0040, DMI type 126, 4 bytes Inactive Handle 0x0002, DMI type 2, 8 bytes Base Board Information Manufacturer: Hewlett-Packard Product Name: 30AA Version: KBC Version 58.12 Serial Number: Not Specified Handle 0x0003, DMI type 3, 13 bytes Chassis Information Manufacturer: Hewlett-Packard Type: Notebook Lock: Not Present Version: Not Specified Serial Number: Asset Tag: CNU63515Y3 Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: External Interface Enabled Handle 0x0041, DMI type 126, 10 bytes Inactive Handle 0x0004, DMI type 4, 35 bytes Processor Information Socket Designation: U10 Type: Central Processor Family: Pentium M Manufacturer: Intel(R) ID: E8 06 00 00 FF FB E9 BF Signature: Type 0, Family 6, Model 14, Stepping 8 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Genuine Intel(R) CPU T2050 @ 1.60GHz Voltage: 1.1 V External Clock: 133 MHz Max Speed: 1600 MHz Current Speed: 1600 MHz Status: Populated, Enabled Upgrade: None L1 Cache Handle: 0x0005 L2 Cache Handle: 0x0006 L3 Cache Handle: Not Provided Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0005, DMI type 7, 19 bytes Cache Information Socket Designation: Internal L1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back
Re: Disk spin down issue on shut down/suspend to disk
On Monday, 6 August 2007 20:43, Tejun Heo wrote: > Michael Sedkowski wrote: > >> Hmmm... If the problem only shows up on nx6325, it might be that ACPI is > >> pulling unnecessary stunt. Please apply the attached patch and report > >> when the disk spins down and up. > > > > Disk spins down on "Pre-shutdown prepare" and then goes up and down on > > "Power down". > > Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether > it spins down the disk correctly. Does emergency unload count increase > after each power down? How to check that? > Also, please post the result of 'dmidecode'. Here's mine, from nx6325 (Michael's is a different model): # dmidecode 2.8 SMBIOS 2.4 present. 23 structures occupying 1029 bytes. Table at 0x000F3FA3. Handle 0x, DMI type 0, 24 bytes BIOS Information Vendor: Hewlett-Packard Version: 68TT2 Ver. F.02 Release Date: 07/06/2006 Address: 0xE Runtime Size: 128 kB ROM Size: 1024 kB Characteristics: PCI is supported PC Card (PCMCIA) is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported EDD is supported 3.5"/720 KB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) ACPI is supported USB legacy is supported LS-120 boot is supported Smart battery is supported BIOS boot specification is supported Function key-initiated network boot is supported Targeted content distribution is supported BIOS Revision: 15.2 Firmware Revision: 64.21 Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: Hewlett-Packard Product Name: HP Compaq nx6325 (EY351EA#AKD) Version: F.02 Serial Number: CNU63201YR UUID: CDF6EA3B-A5D7-DD11-0188-6D990C3F6129 Wake-up Type: Power Switch SKU Number: EY351EA#AKD Family: 103C_5336AN Handle 0x0040, DMI type 126, 33 bytes Inactive Handle 0x0002, DMI type 2, 8 bytes Base Board Information Manufacturer: Hewlett-Packard Product Name: 30B0 Version: KBC Version 40.15 Serial Number: Not Specified Handle 0x0003, DMI type 3, 13 bytes Chassis Information Manufacturer: Hewlett-Packard Type: Notebook Lock: Not Present Version: Not Specified Serial Number: CNU63201YR Asset Tag: CNU63201YR Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: External Interface Enabled Handle 0x0041, DMI type 126, 32 bytes Inactive Handle 0x0004, DMI type 4, 35 bytes Processor Information Socket Designation: U10 Type: Central Processor Family: Athlon 64 Manufacturer: AMD(R) ID: 82 0F 04 00 FF FB 8B 17 Signature: Extended Family 0, Model 8, Stepping 2 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) HTT (Hyper-threading technology) Version: AMD Turion(tm) 64 X2 Mobile TL-60 Voltage: 1.1 V External Clock: 200 MHz Max Speed: 2000 MHz Current Speed: 2000 MHz Status: Populated, Enabled Upgrade: None L1 Cache Handle: 0x0005 L2 Cache Handle: 0x0006 L3 Cache Handle: Not Provided Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0005, DMI type 7, 19 bytes Cache Information Socket Designation: Internal L1 Cache
Re: [PATCH 1/2] hpt366: fix PCI clock detection for HPT374
> + if (chip_type == HPT374 && (PCI_FUNC(dev->devfn) & 1)) { > + struct pci_dev *dev1 = pci_get_slot(dev->bus, > + dev->devfn - 1); Can be NULL > + unsigned long io_base = pci_resource_start(dev1, 4); Kaboom - 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: Boot fails on Intel SATA controller
The kernel compiles and boots after applying this patch to 2.6.23-rc1. -- Eric -- Original message -- From: Tejun Heo <[EMAIL PROTECTED]> > Please test the attached patch. > > -- > tejun --- Begin Message --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 60e78be..7158a06 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1911,7 +1911,8 @@ int ata_dev_configure(struct ata_device *dev) dev->flags |= ATA_DFLAG_FLUSH_EXT; } - if (ata_id_hpa_enabled(dev->id)) + if (!(dev->horkage & ATA_HORKAGE_BROKEN_HPA) && + ata_id_has_hpa(id) && ata_id_hpa_enabled(dev->id)) dev->n_sectors = ata_hpa_resize(dev); /* config NCQ */ @@ -3789,6 +3790,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "FUJITSU MHV2080BH", "00840028", ATA_HORKAGE_NONCQ, }, { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, }, { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, }, + { "HDS724040KLSA80", "KFAOA20N", ATA_HORKAGE_BROKEN_HPA, }, /* Devices with NCQ limits */ diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h diff --git a/include/linux/libata.h b/include/linux/libata.h index 41978a5..a67bb90 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -303,6 +303,7 @@ enum { ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ + ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */ }; enum hsm_task_states { --- End Message ---
Re: Disk spin down issue on shut down/suspend to disk
On Monday, 6 August 2007 20:21, Michael Sedkowski wrote: > Dnia 07-08-2007, Wt o godzinie 02:03 +0900, Tejun Heo napisał(a): > > Rafael J. Wysocki wrote: > > >>> Sidux is a Debian Unstable based distro with it's own set of patches > > >>> including the shut down patch provided here: > > >>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 > > >> You'll probably have to ask Sidux what changes they made that could cause > > >> the double spin down, even if halt(8) is never passed the -h flag. > > > > > > Well, I've been observing the same behavior on nx6325 for some time and I > > > use openSUSE 10.2. I think this is kernel-related. > > > > Hmmm... If the problem only shows up on nx6325, it might be that ACPI is > > pulling unnecessary stunt. Please apply the attached patch and report > > when the disk spins down and up. > > > > Thanks. > > > > Disk spins down on "Pre-shutdown prepare" and then goes up and down on > "Power down". Same thing on my box. In kernel_shutdown_prepare(SYSTEM_POWER_OFF) we call device_shutdown(), so it looks like the drive is powered off by one driver's .shutdown() routine. Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - 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: Disk spin down issue on shut down/suspend to disk
Michael Sedkowski wrote: >> Hmmm... If the problem only shows up on nx6325, it might be that ACPI is >> pulling unnecessary stunt. Please apply the attached patch and report >> when the disk spins down and up. > > Disk spins down on "Pre-shutdown prepare" and then goes up and down on > "Power down". Oh... crap, so acpi wants to sync cache on shutdown. I wonder whether it spins down the disk correctly. Does emergency unload count increase after each power down? Also, please post the result of 'dmidecode'. Thanks. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Disk spin down issue on shut down/suspend to disk
Dnia 07-08-2007, Wt o godzinie 02:03 +0900, Tejun Heo napisał(a): > Rafael J. Wysocki wrote: > >>> Sidux is a Debian Unstable based distro with it's own set of patches > >>> including the shut down patch provided here: > >>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 > >> You'll probably have to ask Sidux what changes they made that could cause > >> the double spin down, even if halt(8) is never passed the -h flag. > > > > Well, I've been observing the same behavior on nx6325 for some time and I > > use openSUSE 10.2. I think this is kernel-related. > > Hmmm... If the problem only shows up on nx6325, it might be that ACPI is > pulling unnecessary stunt. Please apply the attached patch and report > when the disk spins down and up. > > Thanks. > Disk spins down on "Pre-shutdown prepare" and then goes up and down on "Power down". - 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] ide-cris: always tune PIO
Bartlomiej Zolnierkiewicz wrote: Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> MBR, Sergei - 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/11] au1xxx-ide: use ide_tune_dma()
Bartlomiej Zolnierkiewicz wrote: Good, that's what I lacked for hpt366.c! Were you planning to push it to Linus soon? * Add ->mdma_filter to ide_hwif_t and use it in ide_get_mode_mask(). Hm, why not mwdma_filter()? That "mdma" word has unneeded connotation. ;-) * Remove needless setting of drive->using_dma from auide_dma_check(). * Split off auide_mdma_filter() from auide_dma_check(). * Use ide_tune_dma() in auide_dma_check(), this fixes following issues: - device's DMA capability bit not being checked - device not being checked against generic DMA blacklist - transfer mode not being set on device/host * Add PIO autotune fallback to auide_dma_check(). Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Index: b/drivers/ide/mips/au1xxx-ide.c === --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c @@ -351,11 +351,18 @@ static int auide_dma_setup(ide_drive_t * return 0; } -static int auide_dma_check(ide_drive_t *drive) +static u8 auide_mdma_filter(ide_drive_t *drive) { - u8 speed = ide_max_dma_mode(drive); + /* +* FIXME: ->white_list and ->black_list are based on completely bogus +* ->ide_dma_check implementation which didn't set neither the host +* controller timings nor the device for the desired transfer mode. +* +* They should be either removed or 0x00 MWDMA mask should be +* returned for devices on the ->black_list. +*/ I don't get it -- why then introduce a method that does nothing? - if( dbdma_init_done == 0 ){ + if (dbdma_init_done == 0) { I wonder what this code is doing here at all... auide_hwif.white_list = ide_in_drive_list(drive->id, dma_white_list); auide_hwif.black_list = ide_in_drive_list(drive->id, Why the results of the drive list lockup gets tied to auide_hwif? :-O @@ -366,21 +373,20 @@ static int auide_dma_check(ide_drive_t * } /* Is the drive in our DMA black list? */ - - if ( auide_hwif.black_list ) { - drive->using_dma = 0; - - /* Borrowed the warning message from ide-dma.c */ - + if (auide_hwif.black_list) printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n", - drive->name, drive->id->model); - } - else - drive->using_dma = 1; + drive->name, drive->id->model); *Disabling* it, really? :-O - if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) + return drive->hwif->mwdma_mask; +} + +static int auide_dma_check(ide_drive_t *drive) +{ + if (ide_tune_dma(drive)) return 0; + ide_set_max_pio(drive); + return -1; } MBR, Sergei - 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] mark PCI resource with start 0 as unassigned
But 0 _is_ a valid PCI I/O address. Do we now have to start I wasn't in PCI 2.1 (later the corresponding passage have disppeared). SFF controllers often use 0 to indicate a channel isn't configured and present. Libata and old IDE both assume these semantics for an SFF IDE device reporting address zero. It matches the hardware behaviour. I would suggest you don't map one at I/O zero on your PCI. That's of course the smarter choice, _if_ we have a choice at all -- on PowerPC, the PCI setup on certain platforms is done by the firmware (and we don't want to mess with it for various reasons), and some _do_ map PCI legacy I/O at 0. Not in this case though, so let's just ignore that possibility until it hits us in the face :-) Segher - 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] ata_piix: update map 10b for ich8m
On Tue, 7 Aug 2007 02:43:27 +0900 Tejun Heo <[EMAIL PROTECTED]> wrote: > Fix map entry 10b for ich8. It's [P0 P2 IDE IDE] like ich6 / ich6m. > > Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] Acked-by: Kristen Carlson Accardi <[EMAIL PROTECTED]> > --- > Many users can be hit by this. Please consider for -stable. Thanks. > > drivers/ata/ata_piix.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c > index a78832e..c5b4509 100644 > --- a/drivers/ata/ata_piix.c > +++ b/drivers/ata/ata_piix.c > @@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = { > /* PM PS SM SS MAP */ > { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ > { RV, RV, RV, RV }, > - { IDE, IDE, NA, NA }, /* 10b (IDE mode) */ > + { P0, P2, IDE, IDE }, /* 10b (IDE mode) */ > { RV, RV, RV, RV }, > }, > }; > - 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] ata_piix: update map 10b for ich8m
Fix map entry 10b for ich8. It's [P0 P2 IDE IDE] like ich6 / ich6m. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] --- Many users can be hit by this. Please consider for -stable. Thanks. drivers/ata/ata_piix.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index a78832e..c5b4509 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = { /* PM PS SM SS MAP */ { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ { RV, RV, RV, RV }, - { IDE, IDE, NA, NA }, /* 10b (IDE mode) */ + { P0, P2, IDE, IDE }, /* 10b (IDE mode) */ { RV, RV, RV, RV }, }, }; - 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] ide: move ide_config_drive_speed() calls to upper layers
Hello again. :-) Bartlomiej Zolnierkiewicz wrote: * Add ide_set_pio_mode()/ide_set_dma_mode() helpers and convert all direct ->set_pio_mode/->speedproc users to use these helpers. * Move ide_config_drive_speed() calls from ->set_pio_mode/->speedproc methods to callers. * Rename ->speedproc method to ->set_dma_mode, make it void and update all implementations accordingly. * Update ide_set_xfer_rate() comments. Except removal of two debugging printk-s (from cs5530.c and sc1200.c) and the fact that transfer modes 0x00-0x07 passed from user space may be programmed twice on the device (not really an issue since 0x00-0x01 are handled by very few host drivers and 0x02-0x07 are simply invalid) there should be no other functionality changes caused by this patch. Haven't see any driver handling 0x01. 0x00 is usually handled by setting Maybe I haven't looked too hard though... :-) Index: b/drivers/ide/ide-lib.c === --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c @@ -349,7 +349,7 @@ void ide_set_pio(ide_drive_t *drive, u8 [...] + + /* +* TODO: temporary hack for some legacy host drivers that didn't +* set transfer mode on the device in ->set_pio_mode method... +*/ + if (hwif->set_dma_mode == NULL) { + hwif->set_pio_mode(drive, mode - XFER_PIO_0); + return 0; + } Er... I didn't quite get it. :-/ You mean those that are still unfixed WRT not calling ide_config_drive_speed()? Yes. Ah, so you're emulating the current behaviour with this... + + if (hwif->host_flags & IDE_HFLAG_POST_SET_MODE) { + if (ide_config_drive_speed(drive, mode)) + return -1; + hwif->set_pio_mode(drive, mode - XFER_PIO_0); + return 0; + } else { + hwif->set_pio_mode(drive, mode - XFER_PIO_0); + return ide_config_drive_speed(drive, mode); + } +} + +int ide_set_dma_mode(ide_drive_t *drive, const u8 mode) +{ + ide_hwif_t *hwif = drive->hwif; + + if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE) + return 0; I suggest that this be replaced by: if (hwif->set_dma_mode == NULL) return -1; Done. This alone would make ide_tune_dma() fail on it821x in smart mode but moving IDE_HFLAG_NO_SET_MODE checking there fixes the issue. Ah, I hadn't thought about all the consequencies... :-) + if (hwif->host_flags & IDE_HFLAG_POST_SET_MODE) { + if (ide_config_drive_speed(drive, mode)) + return -1; + hwif->set_dma_mode(drive, mode); + return 0; + } else { + hwif->set_dma_mode(drive, mode); + return ide_config_drive_speed(drive, mode); + } +} + /** * ide_set_xfer_rate - set transfer rate * @drive: drive to set - * @speed: speed to attempt to set + * @rate: speed to attempt to set * * General helper for setting the speed of an IDE device. This * function knows about user enforced limits from the configuration - * which speedproc() does not. High level drivers should never - * invoke speedproc() directly. + * which ->set_pio_mode/->set_dma_mode does not. */ - + int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) { ide_hwif_t *hwif = drive->hwif; - if (hwif->speedproc == NULL) + if (hwif->set_dma_mode == NULL) return -1; rate = ide_rate_filter(drive, rate); if (rate >= XFER_PIO_0 && rate <= XFER_PIO_5) { if (hwif->set_pio_mode) Won't be needed if we'll check it inside ide_set_pio_mode(). - hwif->set_pio_mode(drive, rate - XFER_PIO_0); + return ide_set_pio_mode(drive, rate); - /* -* FIXME: this is incorrect to return zero here but -* since all users of ide_set_xfer_rate() ignore -* the return value it is not a problem currently -*/ - return 0; + return -1; } - return hwif->speedproc(drive, rate); + /* +* TODO: transfer modes 0x00-0x07 passed from the user-space are +* currently handled here which needs fixing (please note that such +* case could happen iff the transfer mode has already been set on +* the device by ide-proc.c::set_xfer_rate()). +*/ Would be quite easy to hook and *properly* handle mode 0x00 here, however mode 0x01 would certainly be much trickier -- unless we'd want to delegate it to set_pio_mode() itself (I'm not suggesting it though :-)... We do want (patches are welcomed). :-) Erm, actually the preferrable way would be to handle 0x00/0x01 in some generic manner -- and I was talking about the drivers' set_pio_mode() me
Re: ICH8 CF timeout (regression)...
Kristen Carlson Accardi wrote: > In the data sheet in section 5.15.2.3 it describes a value of map.mv of > 1 as meaning that the SATA controller is emulating the logical secondary > channel, and the PATA channel will be the primary. For a value of > map.mv == 2, we have the SATA controller being primary, and the PATA > is secondary. So, if I'm understanding the way ata_piix does mapping, > it seems like for a value of 2, we should have [p0, p2, ide, ide] and > for a value of 1 we should have [ide, ide, p0, p2] - although for ICH8M > it seems like 1 should not be a valid value. My reading the ICH8 spec is > that ICH8M only implements a map value of 2, and 1 should be reserved > (see section 12.1.33). Alright, thanks a lot. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: ICH8 CF timeout (regression)...
On Sat, 04 Aug 2007 15:04:54 +0900 Tejun Heo <[EMAIL PROTECTED]> wrote: > Daniel J Blueman wrote: > > Tejun, > > > > On 03/08/07, Tejun Heo <[EMAIL PROTECTED]> wrote: > >> Daniel J Blueman wrote: > >>> The ICH8 south-bridge I have is the mobile variant and does come > >>> equipped with native parallel IDE - see page 447: > >>> http://download.intel.com/design/chipsets/datashts/31305603.pdf . I do > >>> see 35MB/s with DMA enabled from my CF on the 1 in 15 times the > >>> libata-kernel does work. > >>> > >>> I can dump off and decode the configuration registers for the timing > >>> and bus master registers in the working and non-working libata cases, > >>> and the legacy ATA working case and see what's different. > >> Does the attached patch change anything? > > > > This addresses the issue 100%! > > > > Due to the differences between the ICH8 non-mobile and mobile > > variants, I've cooked the change into a new initialisation structure > > for the ICH8M in the attached patch, if that helps at all. > > > > The changes thus affect (correct) behaviour on the ICH8M in IDE mode > > only...so should be safe for inclusion. There may be a similar > > situation with ICH9Ms also. > > [cc'ing Kristen, hello] > > I think [P0 P2 IDE IDE] is correct for MAP 01b but can't find anything > about it in the datasheet or spec update. Kristen, can you please > verify this. The following bug is also fixed by using [P0 P2 IDE IDE]. > > http://bugzilla.kernel.org/show_bug.cgi?id=8809 > > Thanks. > > -- > tejun > In the data sheet in section 5.15.2.3 it describes a value of map.mv of 1 as meaning that the SATA controller is emulating the logical secondary channel, and the PATA channel will be the primary. For a value of map.mv == 2, we have the SATA controller being primary, and the PATA is secondary. So, if I'm understanding the way ata_piix does mapping, it seems like for a value of 2, we should have [p0, p2, ide, ide] and for a value of 1 we should have [ide, ide, p0, p2] - although for ICH8M it seems like 1 should not be a valid value. My reading the ICH8 spec is that ICH8M only implements a map value of 2, and 1 should be reserved (see section 12.1.33). - 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/2] [POWERPC] MPC8349E-mITX: use platform IDE driver for CF interface
The hardware is called (E)IDE, the protocol is called ATA. Or that's what I was told -- I think there's some historic revisionism involved, too. ATA is the interface and standards for the ANSI standards based disk attachment. IDE "Integrated Drive Electronics" is a marketing name used to cover all sorts of ST412 compatible-ish early interfaces that moved the brains onto the disk. IDE doesn't really mean much but "brains on disk", ATA is a real standard. Thanks for refreshing my memory. We will have to support both names in OF device tree nodes, since both names are used in many existing device trees. For new nodes with no precedent, like this "mmio-ide", let's require the more correct "ata" name. Segher - 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 1/2] [IDE] Platform IDE driver
More importantly, "reg-shift" doesn't say what part of the bigger words to access. A common example is byte-wide registers on a 32-bit-only bus; it's about 50%-50% between connecting the registers to the low byte vs. connecting it to the byte with the lowest address. We already have "big-endian" prop used in MPIC nodes, IIRC. Could try to "reuse" it here as well... Sure. This would be an okay way to handle legacy devices that are connected in inventive ways: add "reg-shift" and/or "big-endian" properties. We should make sure this is documented in the appropriate bindings though, don't just assume it will work. For non-legacy devices, please just use the "compatible" property to figure out the endianness etc.; it is a bad idea to make a "blablabla-big-endian" compatible value, but you can almost often just use a more specific model name instead; and typically the device has some other quirks anyway ;-) It would be nice to not name similar properties in the device tree dissimilarly. Kernel code doesn't come into the picture here. The "reg-shift" prop is yet unaccepted ad-hockery at this point. ;-) So, I don't see why we have to be consistent with it. Don't treat your ad-hockery ad hoc, that way leads to insanity :-) It's quite important to use good names for all new properties you define, so you naturally end up with similar names for similar purposes. Of course it isn't a *requirement*, you're right about that. Segher - 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 1/2] hpt366: fix PCI clock detection for HPT374
Bob Ham wrote: HPT374 BIOS seems to only save f_CNT register value for the function #0 before re-tuning DPLL causing the driver to report obviously distorted f_CNT for the function #1 -- fix this by always reading the saved f_CNT register value from in the init_chipset() method the function #0 of HPT374 chip. While at it, introduce 'chip_type' for the copy of the 'struct hpt_info' member and replace the structure assignment by memcpy()... HPT374: IDE controller at PCI slot :00:0d.0 ACPI: PCI Interrupt :00:0d.0[A] -> GSI 16 (level, low) -> IRQ 16 HPT374: chipset revision 7 HPT374: DPLL base: 48 MHz, f_CNT: 142, assuming 33 MHz PCI HPT374: using 50 MHz DPLL clock HPT374: 100% native mode on irq 16 ide2: BM-DMA at 0xec00-0xec07, BIOS settings: hde:DMA, hdf:pio ide3: BM-DMA at 0xec08-0xec0f, BIOS settings: hdg:DMA, hdh:pio ACPI: PCI Interrupt :00:0d.1[A] -> GSI 16 (level, low) -> IRQ 16 HPT374: DPLL base: 48 MHz, f_CNT: 142, assuming 33 MHz PCI HPT374: using 50 MHz DPLL clock ide4: BM-DMA at 0xed00-0xed07, BIOS settings: hdi:DMA, hdj:pio ide5: BM-DMA at 0xed08-0xed0f, BIOS settings: hdk:DMA, hdl:pio again, followed by a hard lock Hm, well, this is indeed tough case but at least it prodded me to fix some issues. Maybe it's worth for you to file a bug at bugzilla.kernel.org... MBR, Sergei - 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 1/2] pata_hpt37x: actually clock HPT374 by 50 MHz DPLL
Bob Ham wrote: The DPLL tuning code always set up it for 66 MHz due to wrong UltraDMA mask including mode 5 used to check for the necessity of 66 MHz clocking -- This caused 66 MHz clock to be used for HPT374 chip that does not tolerate it. While fixing this, also remove PLL mode from the TODO list -- I don't think it's still relevant item. Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> --- This is against the current Linus tree. Bob, please test it and report what you'll find out... para_hpt37x: bus clock 33MHz, using 50MHz DPLL. Aha, note that 33 MHz PCI clock is now reported. ACPI: PCI Interrupt :00:0d.0[A] -> GSI 16 (level, low) -> IRQ 17 scsi2: pata_hpt37x scsi3: pata_hpt37x ata3: PATA max UDMA/100 cmd 0x0001efa0 ctl 0x0001ef9e bmdma 0x0001ec00 irq 17 ata4: PATA max UDMA/100 cmd 0x0001ef90 ctl 0x0001ef9a bmdma 0x0001ec00 irq 17 followed by a hard lock Well, so it's tougher than just that but the patches are good anyway. Wait... doesn't it get stuck trying to pick up the HPT374 chip's function 1? MBR, Sergei - 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 1/2] hpt366: fix PCI clock detection for HPT374
On Mon, 2007-08-06 at 00:06 +0400, Sergei Shtylyov wrote: > HPT374 BIOS seems to only save f_CNT register value for the function #0 before > re-tuning DPLL causing the driver to report obviously distorted f_CNT for the > function #1 -- fix this by always reading the saved f_CNT register value from > in the init_chipset() method the function #0 of HPT374 chip. > While at it, introduce 'chip_type' for the copy of the 'struct hpt_info' > member > and replace the structure assignment by memcpy()... HPT374: IDE controller at PCI slot :00:0d.0 ACPI: PCI Interrupt :00:0d.0[A] -> GSI 16 (level, low) -> IRQ 16 HPT374: chipset revision 7 HPT374: DPLL base: 48 MHz, f_CNT: 142, assuming 33 MHz PCI HPT374: using 50 MHz DPLL clock HPT374: 100% native mode on irq 16 ide2: BM-DMA at 0xec00-0xec07, BIOS settings: hde:DMA, hdf:pio ide3: BM-DMA at 0xec08-0xec0f, BIOS settings: hdg:DMA, hdh:pio ACPI: PCI Interrupt :00:0d.1[A] -> GSI 16 (level, low) -> IRQ 16 HPT374: DPLL base: 48 MHz, f_CNT: 142, assuming 33 MHz PCI HPT374: using 50 MHz DPLL clock ide4: BM-DMA at 0xed00-0xed07, BIOS settings: hdi:DMA, hdj:pio ide5: BM-DMA at 0xed08-0xed0f, BIOS settings: hdk:DMA, hdl:pio again, followed by a hard lock -- Bob Ham <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part
Re: Disk spin down issue on shut down/suspend to disk
Rafael J. Wysocki wrote: >>> Sidux is a Debian Unstable based distro with it's own set of patches >>> including the shut down patch provided here: >>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 >> You'll probably have to ask Sidux what changes they made that could cause >> the double spin down, even if halt(8) is never passed the -h flag. > > Well, I've been observing the same behavior on nx6325 for some time and I > use openSUSE 10.2. I think this is kernel-related. Hmmm... If the problem only shows up on nx6325, it might be that ACPI is pulling unnecessary stunt. Please apply the attached patch and report when the disk spins down and up. Thanks. -- tejun diff --git a/kernel/sys.c b/kernel/sys.c index 449b81b..9578e3f 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -875,10 +875,20 @@ EXPORT_SYMBOL_GPL(kernel_halt); */ void kernel_power_off(void) { + printk(KERN_EMERG "XXX: pre-shutdown prepare\n"); kernel_shutdown_prepare(SYSTEM_POWER_OFF); - if (pm_power_off_prepare) + printk(KERN_EMERG "XXX: post-shutdown prepare, sleeping 5\n"); + ssleep(5); + if (pm_power_off_prepare) { + printk(KERN_EMERG "XXX: pre-power_off_prepare\n"); pm_power_off_prepare(); + printk(KERN_EMERG "XXX: post-power_off_prepare, sleeping 5\n"); + ssleep(5); + } + printk(KERN_EMERG "XXX: pre-sysdev_shutdown\n"); sysdev_shutdown(); + printk(KERN_EMERG "XXX: post-sysdev_shutdown, sleeping 5\n"); + ssleep(5); printk(KERN_EMERG "Power down.\n"); machine_power_off(); }
Re: [PATCH 1/2] pata_hpt37x: actually clock HPT374 by 50 MHz DPLL
On Sun, 2007-08-05 at 22:45 +0400, Sergei Shtylyov wrote: > The DPLL tuning code always set up it for 66 MHz due to wrong UltraDMA mask > including mode 5 used to check for the necessity of 66 MHz clocking -- This > caused 66 MHz clock to be used for HPT374 chip that does not tolerate it. > While fixing this, also remove PLL mode from the TODO list -- I don't think > it's still relevant item. > > Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> > > --- > This is against the current Linus tree. > Bob, please test it and report what you'll find out... para_hpt37x: bus clock 33MHz, using 50MHz DPLL. ACPI: PCI Interrupt :00:0d.0[A] -> GSI 16 (level, low) -> IRQ 17 scsi2: pata_hpt37x scsi3: pata_hpt37x ata3: PATA max UDMA/100 cmd 0x0001efa0 ctl 0x0001ef9e bmdma 0x0001ec00 irq 17 ata4: PATA max UDMA/100 cmd 0x0001ef90 ctl 0x0001ef9a bmdma 0x0001ec00 irq 17 followed by a hard lock -- Bob Ham <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part
Re: [PATCH 9/10] ide-cris: add PIO autotune fallback to ->ide_dma_check
Bartlomiej Zolnierkiewicz wrote: Since ide-cris allows separate PIO and DMA timings, and ide-cris always sets ->autotune this change shouldn't have any other effect than bringing ide-cris driver in-line with other host drivers wrt ->ide_dma_check implementation. Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> MBR, Sergei - 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 10/11] ide-pmac: add PIO autotune fallback to ->ide_dma_check
Bartlomiej Zolnierkiewicz wrote: Since ide-pmac allows separate PIO and DMA timings, and ide-pmac always sets ->autotune this change shouldn't have any other effect than bringing ide-pmac driver in-line with other host drivers wrt ->ide_dma_check implementation. Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> MBR, Sergei - 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] sc1200: always tune PIO
Bartlomiej Zolnierkiewicz wrote: Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> MBR, Sergei - 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] ide: add cable detection for early UDMA66 devices (take 2)
Bartlomiej Zolnierkiewicz wrote: if (hwif->cbl == ATA_CBL_PATA40_SHORT) return 1; Wait, shouldn't this check come ahead of all the other code since we're basically overriding every other check with it? Fixed. Hm, not completely but well... [PATCH] ide: add cable detection for early UDMA66 devices (take 3) * Move ide_in_drive_list() from ide-dma.c to ide-iops.c. * Add ivb_list[] table for listening early UDMA66 devices which don't conform to ATA4 standard wrt cable detection (bit14 is zero, only bit13 is valid) and use only device side cable detection for them since host side cable detection may be unreliable. * Add model "QUANTUM FIREBALLlct10 05" with firwmare "A03.0900" to the list (from Craig's bugreport). v2: * Improve kernel message basing on suggestion from Sergei. v3: * Don't print kernel message when no device side cable detection is done, plus some minor fixes. (Noticed by Sergei) Thanks to Craig for testing this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> Index: b/drivers/ide/ide-dma.c === --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -135,25 +135,6 @@ static const struct drive_list_entry dri }; /** - * ide_in_drive_list - look for drive in black/white list - * @id: drive identifier - * @drive_table: list to inspect - * - * Look for a drive in the blacklist and the whitelist tables - * Returns 1 if the drive is found in the table. - */ - -int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) -{ - for ( ; drive_table->id_model ; drive_table++) - if ((!strcmp(drive_table->id_model, id->model)) && - (!drive_table->id_firmware || -strstr(id->fw_rev, drive_table->id_firmware))) - return 1; - return 0; -} - -/** * ide_dma_intr- IDE DMA interrupt handler * @drive: the drive the interrupt is for * Index: b/drivers/ide/ide-iops.c === --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c [...] @@ -573,11 +601,16 @@ u8 eighty_ninty_three (ide_drive_t *driv { ide_hwif_t *hwif = drive->hwif; struct hd_driveid *id = drive->id; + int ivb = ide_in_drive_list(id, ivb_list); Why do a loockup if we may override it anyway? if (hwif->cbl == ATA_CBL_PATA40_SHORT) return 1; MBR, Sergei - 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/3] aec62xx: always tune PIO
Bartlomiej Zolnierkiewicz wrote: Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> Index: b/drivers/ide/pci/aec62xx.c === --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -1,5 +1,5 @@ /* - * linux/drivers/ide/pci/aec62xx.c Version 0.24May 24, 2007 + * linux/drivers/ide/pci/aec62xx.c Version 0.25Aug 1, 2007 * * Copyright (C) 1999-2002 Andre Hedrick <[EMAIL PROTECTED]> * Copyright (C) 2007 MontaVista Software, Inc. <[EMAIL PROTECTED]> @@ -207,10 +207,10 @@ static void __devinit init_hwif_aec62xx( } else hwif->set_dma_mode = &aec6260_set_mode; - if (!hwif->dma_base) { - hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + + if (hwif->dma_base == 0) return; - } hwif->ultra_mask = hwif->cds->udma_mask; hwif->mwdma_mask = 0x07; Ugh, I really need to complete the patch de-uglifying the speedproc() methods in this driver... MBR, Sergei - 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 6/11] ide: remove ide_use_fast_pio()
Bartlomiej Zolnierkiewicz wrote: Remove ide_use_fast_pio() and just re-tune PIO unconditionally if DMA tuning has failed in ->ide_dma_check. All host drivers using ide_use_fast_pio() set drive->autotune so PIO is always tuned anyway and in some cases we _really_ need to re-tune PIO because PIO and DMA timings are shared. Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> Index: b/drivers/ide/ide-lib.c === --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c @@ -96,21 +96,6 @@ static u8 ide_rate_filter(ide_drive_t *d return min(speed, mode); } -int ide_use_fast_pio(ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - - if ((id->capability & 1) && drive->autodma) - return 1; - - if ((id->capability & 8) || (id->field_valid & 2)) - return 1; This reminds me to some time actually fix handling of pre-EIDE drives in ide_config_drive_speed()... :-) MBR, Sergei - 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: Disk spin down issue on shut down/suspend to disk
Dnia 06-08-2007, Pn o godzinie 12:01 -0300, Henrique de Moraes Holschuh napisał(a): > On Mon, 06 Aug 2007, Michael Sedkowski wrote: > > Dnia 06-08-2007, Pn o godzinie 11:23 -0300, Henrique de Moraes Holschuh > > napisa??(a): > > > On Mon, 06 Aug 2007, Tejun Heo wrote: > > > > Cc'ing Henrique. Any ideas? > > > > > > Check if /etc/init.d/halt is calling halt(8) with the -h flag. If it is, > > > remove that -h flag. Usually, there is a hddown variable that holds it, > > > you > > > just need to get rid of it. > > > > > > I don't know anything about a Sidux, though. > > > > Well there is an -h variable: > > # Don't shut down drives if we're using RAID. > > hddown="-h" > > if grep -qs '^md.*active' /proc/mdstat > > then > > hddown="" > > fi > > > > log_action_msg "Will now halt" > > halt -d -f $netdown $poweroff $hddown > > However removing it has no effect, the drive still spins down two times. > > Nothing in Debian userspace will spin down the drive if you kill that -h, at > least as far as I know. > > > Sidux is a Debian Unstable based distro with it's own set of patches > > including the shut down patch provided here: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 > > You'll probably have to ask Sidux what changes they made that could cause > the double spin down, even if halt(8) is never passed the -h flag. > The double spin down problem occurs not only on Sidux, but on all distros that I isued like Fedora 7, Mandriva, Debian or Ubuntu with kernels ranging from 2.6.18 to 2.6.22. I only use the Sidux because they released the shut down patch required to shut down properly on the 2.6.22 kernel line and on two other systems the drives are turned off nicely [standard Debian still runs on the old shut down scripts. On that basis I believe that this is a HP (Intel?) issue not related to any particular distro. - 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: Disk spin down issue on shut down/suspend to disk
On Monday, 6 August 2007 17:01, Henrique de Moraes Holschuh wrote: > On Mon, 06 Aug 2007, Michael Sedkowski wrote: > > Dnia 06-08-2007, Pn o godzinie 11:23 -0300, Henrique de Moraes Holschuh > > napisa??(a): > > > On Mon, 06 Aug 2007, Tejun Heo wrote: > > > > Cc'ing Henrique. Any ideas? > > > > > > Check if /etc/init.d/halt is calling halt(8) with the -h flag. If it is, > > > remove that -h flag. Usually, there is a hddown variable that holds it, > > > you > > > just need to get rid of it. > > > > > > I don't know anything about a Sidux, though. > > > > Well there is an -h variable: > > # Don't shut down drives if we're using RAID. > > hddown="-h" > > if grep -qs '^md.*active' /proc/mdstat > > then > > hddown="" > > fi > > > > log_action_msg "Will now halt" > > halt -d -f $netdown $poweroff $hddown > > However removing it has no effect, the drive still spins down two times. > > Nothing in Debian userspace will spin down the drive if you kill that -h, at > least as far as I know. > > > Sidux is a Debian Unstable based distro with it's own set of patches > > including the shut down patch provided here: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 > > You'll probably have to ask Sidux what changes they made that could cause > the double spin down, even if halt(8) is never passed the -h flag. Well, I've been observing the same behavior on nx6325 for some time and I use openSUSE 10.2. I think this is kernel-related. Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - 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 11/11] ide: remove ->ide_dma_check
Bartlomiej Zolnierkiewicz wrote: * Add IDE_HFLAG_TRUST_BIOS_FOR_DMA host flag for host drivers that depend on BIOS for programming device/controller for DMA. Set it in cy82c693, generic, ns87415, opti621 and trm290 host drivers. * Add IDE_HFLAG_VDMA host flag for host drivers using VDMA. Set it in cs5520 host driver. * Teach ide_tune_dma() about IDE_HFLAG_TRUST_BIOS_FOR_DMA flag. * Add generic ide_dma_check() helper and remove all open coded ->ide_dma_check implementations. Fix all places checking for presence of ->ide_dma_check hook to check for ->ide_dma_on instead. * Remove no longer needed code from config_drive_for_dma(). * Make ide_tune_dma() static. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> Index: b/drivers/ide/arm/icside.c === --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c @@ -309,14 +309,6 @@ static int icside_dma_on(ide_drive_t *dr return 0; } -static int icside_dma_check(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - return -1; -} - static int icside_dma_end(ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); Hm, looks like there's going to be some functionality change for this driver -- it didn't fallback to PIO before this patch... ;-) MBR, Sergei - 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: Disk spin down issue on shut down/suspend to disk
On Mon, 06 Aug 2007, Michael Sedkowski wrote: > Dnia 06-08-2007, Pn o godzinie 11:23 -0300, Henrique de Moraes Holschuh > napisa??(a): > > On Mon, 06 Aug 2007, Tejun Heo wrote: > > > Cc'ing Henrique. Any ideas? > > > > Check if /etc/init.d/halt is calling halt(8) with the -h flag. If it is, > > remove that -h flag. Usually, there is a hddown variable that holds it, you > > just need to get rid of it. > > > > I don't know anything about a Sidux, though. > > Well there is an -h variable: > # Don't shut down drives if we're using RAID. > hddown="-h" > if grep -qs '^md.*active' /proc/mdstat > then > hddown="" > fi > > log_action_msg "Will now halt" > halt -d -f $netdown $poweroff $hddown > However removing it has no effect, the drive still spins down two times. Nothing in Debian userspace will spin down the drive if you kill that -h, at least as far as I know. > Sidux is a Debian Unstable based distro with it's own set of patches > including the shut down patch provided here: > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 You'll probably have to ask Sidux what changes they made that could cause the double spin down, even if halt(8) is never passed the -h flag. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh - 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 IDE legacy mode resource
Hello Jeff, Do you have any comments? On Sun, 29 Jul 2007 17:15:44 +0900 Yoichi Yuasa <[EMAIL PROTECTED]> wrote: > On Sat, 28 Jul 2007 14:13:06 -0400 > Jeff Garzik <[EMAIL PROTECTED]> wrote: > > > Yoichi Yuasa wrote: > > > Hi, > > > > > > I got the following error on MIPS Cobalt. > > > MIPS Cobalt has the 0x1000 offset between resource and bus region. > > > > > > PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device > > > :00:09.1 > > > pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16) > > > PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device > > > :00:09.1 > > > pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16) > > > pata_via :00:09.1: no available native port > > > > > > At this point, these resources should be the bus regions. > > > > > > Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]> > > > > I'm not sure I understand what's going on here... could you or someone > > provide additional explanation as to why this is a fix? > > The legacy mode IDE resources set the following order. > > pci_setup_device() > Legacy mode ATA controllers have fixed addresses. > IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376 > | > V > pcibios_fixup_bus() > MIPS Cobalt PCI bus have the -0x1000 offset from PCI resources. > pcibios_fixup_bus() fix PCI bus regions. > 0x1F0 - 0x1000 = 0xF1F0 > | > V > ata_pci_init_one() > PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device > :00:09.1 > > In some architectures, PCI bus have the offset from PCI resource. > They are adjusted by pcibios_fixup_bus(). > > For this reason, pci_setup_device() should set PCI bus regions. - 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 1/11] atiixp: DMA setup fixes
Bartlomiej Zolnierkiewicz wrote: * Fix handling of unsupported/invalid modes in atiixp_set_dma_mode(). * ATI controllers allow separate PIO and DMA timings so remove programming of PIO modes from atiixp_set_dma_mode(). Also remove no longer needed atiixp_dma_2_pio() helper. Why they copied it over from the piix.c in the firs place?! Oh, the human laziness (an cluelessness too)! :-( * SWDMA timings are not programmed by atiixp_set_dma_mode() and if SWDMA mode is chosen atiixp_dma_host_on() erroneously enables UDMA, just disable support for SWDMA modes for now. * Enable support for MWDMA0 mode. * Bump driver version. Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]> MBR, Sergei - 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: Disk spin down issue on shut down/suspend to disk
Dnia 06-08-2007, Pn o godzinie 11:23 -0300, Henrique de Moraes Holschuh napisał(a): > On Mon, 06 Aug 2007, Tejun Heo wrote: > > Cc'ing Henrique. Any ideas? > > Check if /etc/init.d/halt is calling halt(8) with the -h flag. If it is, > remove that -h flag. Usually, there is a hddown variable that holds it, you > just need to get rid of it. > > I don't know anything about a Sidux, though. Well there is an -h variable: # Don't shut down drives if we're using RAID. hddown="-h" if grep -qs '^md.*active' /proc/mdstat then hddown="" fi log_action_msg "Will now halt" halt -d -f $netdown $poweroff $hddown However removing it has no effect, the drive still spins down two times. Sidux is a Debian Unstable based distro with it's own set of patches including the shut down patch provided here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 Michael - 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: Disk spin down issue on shut down/suspend to disk
On Mon, 06 Aug 2007, Tejun Heo wrote: > Cc'ing Henrique. Any ideas? Check if /etc/init.d/halt is calling halt(8) with the -h flag. If it is, remove that -h flag. Usually, there is a hddown variable that holds it, you just need to get rid of it. I don't know anything about a Sidux, though. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh - 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: Disk spin down issue on shut down/suspend to disk
Some additional info: As I stated before I'm using a patched sysvinit package with patch from Debian bug 426224 with provide a patched hddown.c. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426224 Michael - 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: ASUS P5W motherboard PMP
Also, please report the result of 'lspci -nn' and 'dmidecode'. -- tejun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 14/14] libata-link: update Power Management to handle PMP links
Update Power Management to consider PMP links. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 50721bc..d9e59e9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5893,6 +5893,7 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, for (i = 0; i < host->n_ports; i++) { struct ata_port *ap = host->ports[i]; + struct ata_link *link; /* Previous resume operation might still be in * progress. Wait for PM_PENDING to clear. @@ -5912,8 +5913,10 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, } ap->pflags |= ATA_PFLAG_PM_PENDING; - ap->link.eh_info.action |= action; - ap->link.eh_info.flags |= ehi_flags; + __ata_port_for_each_link(link, ap) { + link->eh_info.action |= action; + link->eh_info.flags |= ehi_flags; + } ata_port_schedule_eh(ap); -- 1.5.0.3 - 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 05/14] libata-link: linkify reset
Make reset methods and related functions deal with ata_link instead of ata_port. * ata_do_reset() * ata_eh_reset() * all prereset/reset/postreset methods and related functions This patch introduces no behavior change. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/ahci.c | 34 - drivers/ata/ata_piix.c |7 +++-- drivers/ata/libata-core.c | 49 +-- drivers/ata/libata-eh.c | 35 +++--- drivers/ata/pata_amd.c | 16 -- drivers/ata/pata_artop.c| 12 ++ drivers/ata/pata_atiixp.c |5 ++- drivers/ata/pata_efar.c |7 +++-- drivers/ata/pata_hpt37x.c | 12 ++ drivers/ata/pata_hpt3x2n.c |7 +++-- drivers/ata/pata_it8213.c |7 +++-- drivers/ata/pata_jmicron.c |8 +++--- drivers/ata/pata_marvell.c |7 +++-- drivers/ata/pata_mpiix.c|5 ++- drivers/ata/pata_ns87410.c |7 +++-- drivers/ata/pata_oldpiix.c |7 +++-- drivers/ata/pata_opti.c |7 +++-- drivers/ata/pata_optidma.c |7 +++-- drivers/ata/pata_pdc2027x.c |8 +++--- drivers/ata/pata_sil680.c |7 +++-- drivers/ata/pata_sis.c |7 +++-- drivers/ata/pata_sl82c105.c |7 +++-- drivers/ata/pata_triflex.c |7 +++-- drivers/ata/pata_via.c |5 ++- drivers/ata/sata_inic162x.c | 13 ++- drivers/ata/sata_mv.c | 19 +--- drivers/ata/sata_nv.c |4 +- drivers/ata/sata_sil24.c| 26 -- drivers/ata/sata_via.c |5 ++- drivers/scsi/ipr.c |8 +++--- include/linux/libata.h | 19 31 files changed, 203 insertions(+), 171 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 73ae6ee..da749af 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1040,9 +1040,10 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, return 0; } -static int ahci_do_softreset(struct ata_port *ap, unsigned int *class, +static int ahci_do_softreset(struct ata_link *link, unsigned int *class, int pmp, unsigned long deadline) { + struct ata_port *ap = link->ap; const char *reason = NULL; unsigned long now, msecs; struct ata_taskfile tf; @@ -1050,7 +1051,7 @@ static int ahci_do_softreset(struct ata_port *ap, unsigned int *class, DPRINTK("ENTER\n"); - if (ata_link_offline(&ap->link)) { + if (ata_link_offline(link)) { DPRINTK("PHY reports no device\n"); *class = ATA_DEV_NONE; return 0; @@ -1059,10 +1060,10 @@ static int ahci_do_softreset(struct ata_port *ap, unsigned int *class, /* prepare for SRST (AHCI-1.1 10.4.1) */ rc = ahci_kick_engine(ap, 1); if (rc) - ata_port_printk(ap, KERN_WARNING, + ata_link_printk(link, KERN_WARNING, "failed to reset engine (errno=%d)", rc); - ata_tf_init(ap->link.device, &tf); + ata_tf_init(link->device, &tf); /* issue the first D2H Register FIS */ msecs = 0; @@ -1107,19 +1108,20 @@ static int ahci_do_softreset(struct ata_port *ap, unsigned int *class, return 0; fail: - ata_port_printk(ap, KERN_ERR, "softreset failed (%s)\n", reason); + ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); return rc; } -static int ahci_softreset(struct ata_port *ap, unsigned int *class, +static int ahci_softreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { - return ahci_do_softreset(ap, class, 0, deadline); + return ahci_do_softreset(link, class, 0, deadline); } -static int ahci_hardreset(struct ata_port *ap, unsigned int *class, +static int ahci_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { + struct ata_port *ap = link->ap; struct ahci_port_priv *pp = ap->private_data; u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; struct ata_taskfile tf; @@ -1130,15 +1132,15 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class, ahci_stop_engine(ap); /* clear D2H reception area to properly wait for D2H FIS */ - ata_tf_init(ap->link.device, &tf); + ata_tf_init(link->device, &tf); tf.command = 0x80; ata_tf_to_fis(&tf, 0, 0, d2h_fis); - rc = sata_std_hardreset(ap, class, deadline); + rc = sata_std_hardreset(link, class, deadline); ahci_start_engine(ap); - if (rc == 0 && ata_link_online(&ap->link)) + if (rc == 0 && ata_link_online(link)) *class = ahci_dev_classify(ap); if (*class == ATA_DEV_UNKNOWN) *class = ATA_DEV_NONE; @@ -1147,9 +1149,10 @@ static int ahci_hardreset(struct ata_port *ap, unsigned in
[PATCH 12/14] libata-link: update EH to deal with PMP links
Update ata_eh_autopsy(), ata_eh_report(), ata_eh_revalidate_and_attach() and ata_eh_recover() to deal with PMP links. ata_eh_autopsy() and ata_eh_report() updates are straightforward. They just repeat the same operation over all configured links. The only change to ata_eh_revalidate_and_attach() is avoiding calling ->cable_select() on non-host ports. ata_eh_recover() update is more complex as it first processes all resets and then performs the rest. This is necessary as thawing with some links in unknown state can be dangerous. ehi->action is cleared on successful recovery of a link to avoid repeating recovery due to failures in other links. ata_eh_recover() iterates over only PMP links if PMP is attached, and, on failure, the failing link is returned in @failed_link instead of disabling devices directly. These are to integrate ata_eh_recover() into PMP EH later. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-eh.c | 228 -- 1 files changed, 158 insertions(+), 70 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 45eb932..2ddc2ed 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1578,8 +1578,8 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev, int is_io, } /** - * ata_eh_autopsy - analyze error and determine recovery action - * @link: ATA link to perform autopsy on + * ata_eh_link_autopsy - analyze error and determine recovery action + * @link: host link to perform autopsy on * * Analyze why @link failed and determine which recovery actions * are needed. This function also sets more detailed AC_ERR_* @@ -1588,7 +1588,7 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev, int is_io, * LOCKING: * Kernel thread context (may sleep). */ -static void ata_eh_autopsy(struct ata_link *link) +static void ata_eh_link_autopsy(struct ata_link *link) { struct ata_port *ap = link->ap; struct ata_eh_context *ehc = &link->eh_context; @@ -1680,7 +1680,25 @@ static void ata_eh_autopsy(struct ata_link *link) } /** - * ata_eh_report - report error handling to user + * ata_eh_autopsy - analyze error and determine recovery action + * @ap: host port to perform autopsy on + * + * Analyze all links of @ap and determine why they failed and + * which recovery actions are needed. + * + * LOCKING: + * Kernel thread context (may sleep). + */ +static void ata_eh_autopsy(struct ata_port *ap) +{ + struct ata_link *link; + + __ata_port_for_each_link(link, ap) + ata_eh_link_autopsy(link); +} + +/** + * ata_eh_link_report - report error handling to user * @link: ATA link EH is going on * * Report EH to user. @@ -1688,7 +1706,7 @@ static void ata_eh_autopsy(struct ata_link *link) * LOCKING: * None. */ -static void ata_eh_report(struct ata_link *link) +static void ata_eh_link_report(struct ata_link *link) { struct ata_port *ap = link->ap; struct ata_eh_context *ehc = &link->eh_context; @@ -1767,6 +1785,23 @@ static void ata_eh_report(struct ata_link *link) } } +/** + * ata_eh_report - report error handling to user + * @ap: ATA port to report EH about + * + * Report EH to user. + * + * LOCKING: + * None. + */ +static void ata_eh_report(struct ata_port *ap) +{ + struct ata_link *link; + + __ata_port_for_each_link(link, ap) + ata_eh_link_report(link); +} + static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset, unsigned int *classes, unsigned long deadline) { @@ -2036,7 +2071,8 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, } /* PDIAG- should have been released, ask cable type if post-reset */ - if ((ehc->i.flags & ATA_EHI_DID_RESET) && ap->ops->cable_detect) + if (ata_is_host_link(link) && ap->ops->cable_detect && + (ehc->i.flags & ATA_EHI_DID_RESET)) ap->cbl = ap->ops->cable_detect(ap); /* Configure new devices forward such that user doesn't see @@ -2110,7 +2146,7 @@ static int ata_eh_skip_recovery(struct ata_link *link) return 1; } -static void ata_eh_handle_dev_fail(struct ata_device *dev, int err) +static int ata_eh_handle_dev_fail(struct ata_device *dev, int err) { struct ata_eh_context *ehc = &dev->link->eh_context; @@ -2151,12 +2187,16 @@ static void ata_eh_handle_dev_fail(struct ata_device *dev, int err) ehc->did_probe_mask |= (1 << dev->devno); ehc->i.action |= ATA_EH_SOFTRESET; } + + return 1; } else { /* soft didn't work? be hard */ if (ehc->i.flags & ATA_EHI_DID_RESET) ehc->i.action |= ATA_EH_HARDRESET; else ehc->i.action |= AT
[PATCH 13/14] libata-link: update hotplug to handle PMP links
Update hotplug to handle PMP links. When PMP is attached, the PMP number corresponds to C of SCSI H:C:I:L. While at it, change argument to ata_find_dev() to @devno from @id to avoid confusion with SCSI device ID. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c |7 ++- drivers/ata/libata-scsi.c | 159 +++-- 2 files changed, 114 insertions(+), 52 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 601dcb1..50721bc 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6584,6 +6584,7 @@ int ata_host_activate(struct ata_host *host, int irq, void ata_port_detach(struct ata_port *ap) { unsigned long flags; + struct ata_link *link; struct ata_device *dev; if (!ap->ops->error_handler) @@ -6601,8 +6602,10 @@ void ata_port_detach(struct ata_port *ap) */ spin_lock_irqsave(ap->lock, flags); - ata_link_for_each_dev(dev, &ap->link) - ata_dev_disable(dev); + ata_port_for_each_link(link, ap) { + ata_link_for_each_dev(dev, link) + ata_dev_disable(dev); + } spin_unlock_irqrestore(ap->lock, flags); diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3d6d5f7..58051ee 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2423,21 +2423,36 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) return 0; } -static struct ata_device * ata_find_dev(struct ata_port *ap, int id) +static struct ata_device * ata_find_dev(struct ata_port *ap, int devno) { - if (likely(id < ata_link_max_devices(&ap->link))) - return &ap->link.device[id]; + if (ap->nr_pmp_links == 0) { + if (likely(devno < ata_link_max_devices(&ap->link))) + return &ap->link.device[devno]; + } else { + if (likely(devno < ap->nr_pmp_links)) + return &ap->pmp_link[devno].device[0]; + } + return NULL; } static struct ata_device * __ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) { + int devno; + /* skip commands not addressed to targets we simulate */ - if (unlikely(scsidev->channel || scsidev->lun)) - return NULL; + if (ap->nr_pmp_links == 0) { + if (unlikely(scsidev->channel || scsidev->lun)) + return NULL; + devno = scsidev->id; + } else { + if (unlikely(scsidev->id || scsidev->lun)) + return NULL; + devno = scsidev->channel; + } - return ata_find_dev(ap, scsidev->id); + return ata_find_dev(ap, devno); } /** @@ -2951,22 +2966,32 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync) { int tries = 5; struct ata_device *last_failed_dev = NULL; + struct ata_link *link; struct ata_device *dev; if (ap->flags & ATA_FLAG_DISABLED) return; repeat: - ata_link_for_each_dev(dev, &ap->link) { - struct scsi_device *sdev; + ata_port_for_each_link(link, ap) { + ata_link_for_each_dev(dev, link) { + struct scsi_device *sdev; + int channel = 0, id = 0; - if (!ata_dev_enabled(dev) || dev->sdev) - continue; + if (!ata_dev_enabled(dev) || dev->sdev) + continue; - sdev = __scsi_add_device(ap->scsi_host, 0, dev->devno, 0, NULL); - if (!IS_ERR(sdev)) { - dev->sdev = sdev; - scsi_device_put(sdev); + if (ata_is_host_link(link)) + id = dev->devno; + else + channel = link->pmp; + + sdev = __scsi_add_device(ap->scsi_host, channel, id, 0, +NULL); + if (!IS_ERR(sdev)) { + dev->sdev = sdev; + scsi_device_put(sdev); + } } } @@ -2974,11 +2999,14 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync) * failure occurred, scan would have failed silently. Check * whether all devices are attached. */ - ata_link_for_each_dev(dev, &ap->link) { - if (ata_dev_enabled(dev) && !dev->sdev) - break; + ata_port_for_each_link(link, ap) { + ata_link_for_each_dev(dev, link) { + if (ata_dev_enabled(dev) && !dev->sdev) + goto exit_loop; + } } - if (!dev) + exit_loop: + if (
[PATCH 10/14] libata-link: add PMP links
Add link->pmp, ap->nr_pmp_links, ap->pmp_link[], and implement/update link helpers. printk helpers are updated such that port and link are identifed as 'ataP:' if no PMP is attached, while device is identified as 'ataP.DD:'. If PMP is attached, they become 'ataP:', 'ataP.LL:' and 'ataP.LL' - ie. link and device are identified their PMP number. If PPM is attached (ap->nr_pmp_links != 0), ata_for_each_link() iterates over PMP links, while __ata_for_each_link() iterates over the host link + PMP links. If PMP is not attached (ap->nr_pmp_links == 0), both iterate over only the host link. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c |6 +++- include/linux/libata.h| 53 +++- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d1a5df7..601dcb1 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6044,13 +6044,14 @@ void ata_dev_init(struct ata_device *dev) * ata_link_init - Initialize an ata_link structure * @ap: ATA port link is attached to * @link: Link structure to initialize + * @pmp: Port multiplier port number * * Initialize @link. * * LOCKING: * Kernel thread context (may sleep) */ -static void ata_link_init(struct ata_port *ap, struct ata_link *link) +static void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp) { int i; @@ -6058,6 +6059,7 @@ static void ata_link_init(struct ata_port *ap, struct ata_link *link) memset(link, 0, offsetof(struct ata_link, device[0])); link->ap = ap; + link->pmp = pmp; link->active_tag = ATA_TAG_POISON; link->hw_sata_spd_limit = UINT_MAX; @@ -6153,7 +6155,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host) ap->cbl = ATA_CBL_NONE; - ata_link_init(ap, &ap->link); + ata_link_init(ap, &ap->link, 0); #ifdef ATA_IRQ_TRAP ap->stats.unhandled_irq = 1; diff --git a/include/linux/libata.h b/include/linux/libata.h index 884325b..26184ae 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -514,6 +514,7 @@ struct ata_acpi_gtm { struct ata_link { struct ata_port *ap; + int pmp;/* port multiplier port # */ unsigned intactive_tag; /* active tag on this link */ u32 sactive;/* active NCQ commands */ @@ -562,6 +563,9 @@ struct ata_port { struct ata_link link; /* host default link */ + int nr_pmp_links; /* nr of available PMP links */ + struct ata_link *pmp_link; /* array of PMP links */ + struct ata_port_stats stats; struct ata_host *host; struct device *dev; @@ -925,11 +929,17 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, #define ata_port_printk(ap, lv, fmt, args...) \ printk(lv"ata%u: "fmt, (ap)->print_id , ##args) -#define ata_link_printk(link, lv, fmt, args...) \ - printk(lv"ata%u: "fmt, (link)->ap->print_id , ##args) +#define ata_link_printk(link, lv, fmt, args...) do { \ + if ((link)->ap->nr_pmp_links) \ + printk(lv"ata%u.%02u: "fmt, (link)->ap->print_id, \ + (link)->pmp , ##args); \ + else \ + printk(lv"ata%u: "fmt, (link)->ap->print_id , ##args); \ + } while(0) #define ata_dev_printk(dev, lv, fmt, args...) \ - printk(lv"ata%u.%02u: "fmt, (dev)->link->ap->print_id, (dev)->devno , ##args) + printk(lv"ata%u.%02u: "fmt, (dev)->link->ap->print_id, \ + (dev)->link->pmp + (dev)->devno , ##args) /* * ata_eh_info helpers @@ -1038,15 +1048,46 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev) /* * link helpers */ +static inline int ata_is_host_link(const struct ata_link *link) +{ + return link == &link->ap->link; +} + static inline int ata_link_max_devices(const struct ata_link *link) { - if (link->ap->flags & ATA_FLAG_SLAVE_POSS) + if (ata_is_host_link(link) && link->ap->flags & ATA_FLAG_SLAVE_POSS) return 2; return 1; } -#define ata_port_for_each_link(lk, ap) \ - for ((lk) = &(ap)->link; (lk); (lk) = NULL) +static inline struct ata_link *ata_port_first_link(struct ata_port *ap) +{ + if (ap->nr_pmp_links) + return ap->pmp_link; + return &ap->link; +} + +static inline struct ata_link *ata_port_next_link(struct ata_link *link) +{ + struct ata_port *ap = link->ap; + + if (link == &ap->link) { + if (!ap->nr_pmp_links) + return NULL; + return ap->pmp_link; + } + + if (++link - ap->pmp_link < ap->nr_pmp_links) + return link; + return NULL; +} + +#define __ata_port_for_each_link(lk,
[PATCH 11/14] libata-link: update ata_scsi_error() to handle PMP links
Update ata_scsi_error() to handle PMP links. As error conditions can occur on both host and PMP links, __ata_port_for_each_link() is used. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-eh.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index eb4c059..45eb932 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -363,6 +363,8 @@ void ata_scsi_error(struct Scsi_Host *host) repeat: /* invoke error handler */ if (ap->ops->error_handler) { + struct ata_link *link; + /* kill fast drain timer */ del_timer_sync(&ap->fastdrain_timer); @@ -372,9 +374,11 @@ void ata_scsi_error(struct Scsi_Host *host) /* fetch & clear EH info */ spin_lock_irqsave(ap->lock, flags); - memset(&ap->link.eh_context, 0, sizeof(ap->link.eh_context)); - ap->link.eh_context.i = ap->link.eh_info; - memset(&ap->link.eh_info, 0, sizeof(ap->link.eh_info)); + __ata_port_for_each_link(link, ap) { + memset(&link->eh_context, 0, sizeof(link->eh_context)); + link->eh_context.i = link->eh_info; + memset(&link->eh_info, 0, sizeof(link->eh_info)); + } ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS; ap->pflags &= ~ATA_PFLAG_EH_PENDING; @@ -410,7 +414,8 @@ void ata_scsi_error(struct Scsi_Host *host) } /* this run is complete, make sure EH info is clear */ - memset(&ap->link.eh_info, 0, sizeof(ap->link.eh_info)); + __ata_port_for_each_link(link, ap) + memset(&link->eh_info, 0, sizeof(link->eh_info)); /* Clear host_eh_scheduled while holding ap->lock such * that if exception occurs after this point but -- 1.5.0.3 - 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 06/14] libata-link: linkify config/EH related functions
Make the following functions deal with ata_link instead of ata_port. * ata_set_mode() * ata_eh_autopsy() and related functions * ata_eh_report() and related functions * suspend/resume related functions * ata_eh_recover() and related functions Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/ata_generic.c|7 ++- drivers/ata/libata-core.c| 18 --- drivers/ata/libata-eh.c | 121 ++ drivers/ata/libata.h |2 +- drivers/ata/pata_it821x.c|6 +- drivers/ata/pata_ixp4xx_cf.c |4 +- drivers/ata/pata_legacy.c|6 +- drivers/ata/pata_optidma.c | 11 ++-- drivers/ata/pata_pcmcia.c| 12 ++-- drivers/ata/pata_pdc2027x.c | 11 ++-- drivers/ata/pata_platform.c |4 +- drivers/ata/pata_rz1000.c|6 +- drivers/ata/pdc_adma.c |5 +- drivers/ata/sata_sil.c | 16 +++--- include/linux/libata.h |4 +- 15 files changed, 122 insertions(+), 111 deletions(-) diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 85743ea..dec033b 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c @@ -34,7 +34,7 @@ /** * generic_set_mode- mode setting - * @ap: interface to set up + * @link: link to set up * @unused: returned device on error * * Use a non standard set_mode function. We don't want to be tuned. @@ -43,8 +43,9 @@ * and respect them. */ -static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) +static int generic_set_mode(struct ata_link *link, struct ata_device **unused) { + struct ata_port *ap = link->ap; int dma_enabled = 0; struct ata_device *dev; @@ -52,7 +53,7 @@ static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) if (ap->ioaddr.bmdma_addr) dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); - ata_link_for_each_dev(dev, &ap->link) { + ata_link_for_each_dev(dev, link) { if (ata_dev_enabled(dev)) { /* We don't really care */ dev->pio_mode = XFER_PIO_0; diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c53bd04..d7be9fb 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2170,7 +2170,7 @@ int ata_bus_probe(struct ata_port *ap) } /* configure transfer mode */ - rc = ata_set_mode(ap, &dev); + rc = ata_set_mode(&ap->link, &dev); if (rc) goto fail; @@ -2781,7 +2781,7 @@ static int ata_dev_set_mode(struct ata_device *dev) /** * ata_do_set_mode - Program timings and issue SET FEATURES - XFER - * @ap: port on which timings will be programmed + * @link: link on which timings will be programmed * @r_failed_dev: out paramter for failed device * * Standard implementation of the function used to tune and set @@ -2796,9 +2796,9 @@ static int ata_dev_set_mode(struct ata_device *dev) * 0 on success, negative errno otherwise */ -int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) +int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) { - struct ata_link *link = &ap->link; + struct ata_port *ap = link->ap; struct ata_device *dev; int rc = 0, used_dma = 0, found = 0; @@ -2876,7 +2876,7 @@ int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) /** * ata_set_mode - Program timings and issue SET FEATURES - XFER - * @ap: port on which timings will be programmed + * @link: link on which timings will be programmed * @r_failed_dev: out paramter for failed device * * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). If @@ -2889,12 +2889,14 @@ int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) * RETURNS: * 0 on success, negative errno otherwise */ -int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) +int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) { + struct ata_port *ap = link->ap; + /* has private set_mode? */ if (ap->ops->set_mode) - return ap->ops->set_mode(ap, r_failed_dev); - return ata_do_set_mode(ap, r_failed_dev); + return ap->ops->set_mode(link, r_failed_dev); + return ata_do_set_mode(link, r_failed_dev); } /** diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 0a9ce34..733aa76 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1201,7 +1201,7 @@ static unsigned int atapi_eh_request_sense(struct ata_queued_cmd *qc) /** * ata_eh_analyze_serror - analyze SError for a failed port - * @ap: ATA port to analyze SError for + * @link: ATA link to analyze SError for * * Analyze SError if available and further determine cause of * failure. @@ -
[PATCH 09/14] libata-link: implement ata_link_abort()
Implement ata_link_abort(). Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c |1 + drivers/ata/libata-eh.c | 50 include/linux/libata.h|1 + 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 0cbcddd..d1a5df7 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -7030,6 +7030,7 @@ EXPORT_SYMBOL_GPL(ata_ehi_push_desc); EXPORT_SYMBOL_GPL(ata_ehi_clear_desc); EXPORT_SYMBOL_GPL(ata_eng_timeout); EXPORT_SYMBOL_GPL(ata_port_schedule_eh); +EXPORT_SYMBOL_GPL(ata_link_abort); EXPORT_SYMBOL_GPL(ata_port_abort); EXPORT_SYMBOL_GPL(ata_port_freeze); EXPORT_SYMBOL_GPL(ata_eh_freeze_port); diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 733aa76..eb4c059 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -719,19 +719,7 @@ void ata_port_schedule_eh(struct ata_port *ap) DPRINTK("port EH scheduled\n"); } -/** - * ata_port_abort - abort all qc's on the port - * @ap: ATA port to abort qc's for - * - * Abort all active qc's of @ap and schedule EH. - * - * LOCKING: - * spin_lock_irqsave(host lock) - * - * RETURNS: - * Number of aborted qc's. - */ -int ata_port_abort(struct ata_port *ap) +static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) { int tag, nr_aborted = 0; @@ -743,7 +731,7 @@ int ata_port_abort(struct ata_port *ap) for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag); - if (qc) { + if (qc && (!link || qc->dev->link == link)) { qc->flags |= ATA_QCFLAG_FAILED; ata_qc_complete(qc); nr_aborted++; @@ -757,6 +745,40 @@ int ata_port_abort(struct ata_port *ap) } /** + * ata_link_abort - abort all qc's on the link + * @link: ATA link to abort qc's for + * + * Abort all active qc's active on @link and schedule EH. + * + * LOCKING: + * spin_lock_irqsave(host lock) + * + * RETURNS: + * Number of aborted qc's. + */ +int ata_link_abort(struct ata_link *link) +{ + return ata_do_link_abort(link->ap, link); +} + +/** + * ata_port_abort - abort all qc's on the port + * @ap: ATA port to abort qc's for + * + * Abort all active qc's of @ap and schedule EH. + * + * LOCKING: + * spin_lock_irqsave(host_set lock) + * + * RETURNS: + * Number of aborted qc's. + */ +int ata_port_abort(struct ata_port *ap) +{ + return ata_do_link_abort(ap, NULL); +} + +/** * __ata_port_freeze - freeze port * @ap: ATA port to freeze * diff --git a/include/linux/libata.h b/include/linux/libata.h index 27840f1..884325b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -905,6 +905,7 @@ extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); extern void ata_eng_timeout(struct ata_port *ap); extern void ata_port_schedule_eh(struct ata_port *ap); +extern int ata_link_abort(struct ata_link *link); extern int ata_port_abort(struct ata_port *ap); extern int ata_port_freeze(struct ata_port *ap); -- 1.5.0.3 - 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 07/14] libata-link: make two port flags HRST_TO_RESUME and SKIP_D2H_BSY link flags
HRST_TO_RESUME and SKIP_D2H_BSY are link attributes. Move them to ata_link->flags. This will allow host and PMP links to have different attributes. ata_port_info->link_flags is added and used by LLDs to specify these flags during initialization. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/ahci.c| 16 ++-- drivers/ata/libata-core.c |5 +++-- drivers/ata/sata_nv.c | 14 +++--- drivers/ata/sata_sil.c|7 ++- drivers/ata/sata_sil24.c |7 +-- include/linux/libata.h| 11 --- 6 files changed, 39 insertions(+), 21 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index da749af..757369e 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -178,8 +178,8 @@ enum { AHCI_FLAG_COMMON= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | - ATA_FLAG_SKIP_D2H_BSY | ATA_FLAG_ACPI_SATA, + AHCI_LFLAG_COMMON = ATA_LFLAG_SKIP_D2H_BSY, }; struct ahci_cmd_hdr { @@ -333,6 +333,7 @@ static const struct ata_port_info ahci_port_info[] = { /* board_ahci */ { .flags = AHCI_FLAG_COMMON, + .link_flags = AHCI_LFLAG_COMMON, .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, @@ -340,14 +341,15 @@ static const struct ata_port_info ahci_port_info[] = { /* board_ahci_pi */ { .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI, + .link_flags = AHCI_LFLAG_COMMON, .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, }, /* board_ahci_vt8251 */ { - .flags = AHCI_FLAG_COMMON | ATA_FLAG_HRST_TO_RESUME | - AHCI_FLAG_NO_NCQ, + .flags = AHCI_FLAG_COMMON | AHCI_FLAG_NO_NCQ, + .link_flags = AHCI_LFLAG_COMMON | ATA_LFLAG_HRST_TO_RESUME, .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = ATA_UDMA6, .port_ops = &ahci_vt8251_ops, @@ -355,6 +357,7 @@ static const struct ata_port_info ahci_port_info[] = { /* board_ahci_ign_iferr */ { .flags = AHCI_FLAG_COMMON | AHCI_FLAG_IGN_IRQ_IF_ERR, + .link_flags = AHCI_LFLAG_COMMON, .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, @@ -364,6 +367,7 @@ static const struct ata_port_info ahci_port_info[] = { .flags = AHCI_FLAG_COMMON | AHCI_FLAG_IGN_SERR_INTERNAL | AHCI_FLAG_32BIT_ONLY, + .link_flags = AHCI_LFLAG_COMMON, .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, @@ -373,9 +377,9 @@ static const struct ata_port_info ahci_port_info[] = { .sht= &ahci_sht, .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | - ATA_FLAG_SKIP_D2H_BSY | AHCI_FLAG_HONOR_PI | - AHCI_FLAG_NO_NCQ | AHCI_FLAG_NO_MSI | - AHCI_FLAG_MV_PATA, + AHCI_FLAG_HONOR_PI | AHCI_FLAG_NO_NCQ | + AHCI_FLAG_NO_MSI | AHCI_FLAG_MV_PATA, + .link_flags = AHCI_LFLAG_COMMON, .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d7be9fb..d2600e0 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3331,7 +3331,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline) /* handle link resume */ if ((ehc->i.flags & ATA_EHI_RESUME_LINK) && - (ap->flags & ATA_FLAG_HRST_TO_RESUME)) + (link->flags & ATA_LFLAG_HRST_TO_RESUME)) ehc->i.action |= ATA_EH_HARDRESET; /* if we're about to do hardreset, nothing more to do */ @@ -3350,7 +3350,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline) /* Wait for !BSY if the controller can wait for the first D2H * Reg FIS and we don't know that no device is attached. */ - if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_link_offline(link)) { + if (!(link->flags & ATA_LFLAG_SKIP_D2H_BSY) && !ata_link_offline(link)) {
[PATCH 04/14] libata-link: linkify EH action helpers
Make ata_eh_about_to_do() and ata_eh_done() deal with ata_link instead of ata_port. This patch introduces no behavior change. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-eh.c | 35 ++- 1 files changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 48ca68b..fc4b641 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -947,23 +947,24 @@ static void ata_eh_detach_dev(struct ata_device *dev) /** * ata_eh_about_to_do - about to perform eh_action - * @ap: target ATA port + * @link: target ATA link * @dev: target ATA dev for per-dev action (can be NULL) * @action: action about to be performed * * Called just before performing EH actions to clear related bits - * in @ap->link.eh_info such that eh actions are not - * unnecessarily repeated. + * in @link->eh_info such that eh actions are not unnecessarily + * repeated. * * LOCKING: * None. */ -static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, +static void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, unsigned int action) { + struct ata_port *ap = link->ap; + struct ata_eh_info *ehi = &link->eh_info; + struct ata_eh_context *ehc = &link->eh_context; unsigned long flags; - struct ata_eh_info *ehi = &ap->link.eh_info; - struct ata_eh_context *ehc = &ap->link.eh_context; spin_lock_irqsave(ap->lock, flags); @@ -980,7 +981,7 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, ehi->flags &= ~ATA_EHI_RESET_MODIFIER_MASK; } - ata_eh_clear_action(&ap->link, dev, ehi, action); + ata_eh_clear_action(link, dev, ehi, action); if (!(ehc->i.flags & ATA_EHI_QUIET)) ap->pflags |= ATA_PFLAG_RECOVERED; @@ -990,20 +991,20 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, /** * ata_eh_done - EH action complete - * @ap: target ATA port +* @ap: target ATA port * @dev: target ATA dev for per-dev action (can be NULL) * @action: action just completed * * Called right after performing EH actions to clear related bits - * in @ap->link.eh_context. + * in @link->eh_context. * * LOCKING: * None. */ -static void ata_eh_done(struct ata_port *ap, struct ata_device *dev, +static void ata_eh_done(struct ata_link *link, struct ata_device *dev, unsigned int action) { - struct ata_eh_context *ehc = &ap->link.eh_context; + struct ata_eh_context *ehc = &link->eh_context; /* if reset is complete, clear all reset actions & reset modifier */ if (action & ATA_EH_RESET_MASK) { @@ -1011,7 +1012,7 @@ static void ata_eh_done(struct ata_port *ap, struct ata_device *dev, ehc->i.flags &= ~ATA_EHI_RESET_MODIFIER_MASK; } - ata_eh_clear_action(&ap->link, dev, &ehc->i, action); + ata_eh_clear_action(link, dev, &ehc->i, action); } /** @@ -1795,7 +1796,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, int rc; /* about to reset */ - ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK); + ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK); /* Determine which reset to use and record in ehc->i.action. * prereset() may examine and modify it. @@ -1877,7 +1878,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, goto out; } - ata_eh_about_to_do(ap, NULL, ATA_EH_RESET_MASK); + ata_eh_about_to_do(link, NULL, ATA_EH_RESET_MASK); rc = ata_do_reset(ap, reset, classes, deadline); if (rc == 0 && classify && @@ -1927,7 +1928,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, postreset(ap, classes); /* reset successful, schedule revalidation */ - ata_eh_done(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK); + ata_eh_done(link, NULL, ehc->i.action & ATA_EH_RESET_MASK); ehc->i.action |= ATA_EH_REVALIDATE; } out: @@ -1964,12 +1965,12 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, goto err; } - ata_eh_about_to_do(ap, dev, ATA_EH_REVALIDATE); + ata_eh_about_to_do(&ap->link, dev, ATA_EH_REVALIDATE); rc = ata_dev_revalidate(dev, readid_flags); if (rc) goto err; - ata_eh_done(ap, dev, ATA_EH_REVALIDATE); + ata_eh_done(&ap->link, dev, ATA_EH_REVALIDATE); /* Configuration may
[PATCH 08/14] libata-link: separate out link initialization functions
Separate out link initialization into ata_link_init() and ata_link_init_sata_spd(). Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c | 84 ++--- 1 files changed, 64 insertions(+), 20 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d2600e0..0cbcddd 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6041,6 +6041,68 @@ void ata_dev_init(struct ata_device *dev) } /** + * ata_link_init - Initialize an ata_link structure + * @ap: ATA port link is attached to + * @link: Link structure to initialize + * + * Initialize @link. + * + * LOCKING: + * Kernel thread context (may sleep) + */ +static void ata_link_init(struct ata_port *ap, struct ata_link *link) +{ + int i; + + /* clear everything except for devices */ + memset(link, 0, offsetof(struct ata_link, device[0])); + + link->ap = ap; + link->active_tag = ATA_TAG_POISON; + link->hw_sata_spd_limit = UINT_MAX; + + /* can't use iterator, ap isn't initialized yet */ + for (i = 0; i < ATA_MAX_DEVICES; i++) { + struct ata_device *dev = &link->device[i]; + + dev->link = link; + dev->devno = dev - link->device; + ata_dev_init(dev); + } +} + +/** + * sata_link_init_spd - Initialize link->sata_spd_limit + * @link: Link to configure sata_spd_limit for + * + * Initialize @link->[hw_]sata_spd_limit to the currently + * configured value. + * + * LOCKING: + * Kernel thread context (may sleep). + * + * RETURNS: + * 0 on success, -errno on failure. + */ +static int sata_link_init_spd(struct ata_link *link) +{ + u32 scontrol, spd; + int rc; + + rc = sata_scr_read(link, SCR_CONTROL, &scontrol); + if (rc) + return rc; + + spd = (scontrol >> 4) & 0xf; + if (spd) + link->hw_sata_spd_limit &= (1 << spd) - 1; + + link->sata_spd_limit = link->hw_sata_spd_limit; + + return 0; +} + +/** * ata_port_alloc - allocate and initialize basic ATA port resources * @host: ATA host this allocated port belongs to * @@ -6055,7 +6117,6 @@ void ata_dev_init(struct ata_device *dev) struct ata_port *ata_port_alloc(struct ata_host *host) { struct ata_port *ap; - unsigned int i; DPRINTK("ENTER\n"); @@ -6070,9 +6131,6 @@ struct ata_port *ata_port_alloc(struct ata_host *host) ap->ctl = ATA_DEVCTL_OBS; ap->host = host; ap->dev = host->dev; - - ap->link.hw_sata_spd_limit = UINT_MAX; - ap->link.active_tag = ATA_TAG_POISON; ap->last_ctl = 0xFF; #if defined(ATA_VERBOSE_DEBUG) @@ -6095,15 +6153,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host) ap->cbl = ATA_CBL_NONE; - ap->link.ap = ap; - - /* can't use iterator, ap isn't initialized yet */ - for (i = 0; i < ATA_MAX_DEVICES; i++) { - struct ata_device *dev = &ap->link.device[i]; - dev->link = &ap->link; - dev->devno = i; - ata_dev_init(dev); - } + ata_link_init(ap, &ap->link); #ifdef ATA_IRQ_TRAP ap->stats.unhandled_irq = 1; @@ -6386,7 +6436,6 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) for (i = 0; i < host->n_ports; i++) { struct ata_port *ap = host->ports[i]; int irq_line; - u32 scontrol; unsigned long xfer_mask; /* set SATA cable type if still unset */ @@ -6394,12 +6443,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) ap->cbl = ATA_CBL_SATA; /* init sata_spd_limit to the current value */ - if (sata_scr_read(&ap->link, SCR_CONTROL, &scontrol) == 0) { - int spd = (scontrol >> 4) & 0xf; - if (spd) - ap->link.hw_sata_spd_limit &= (1 << spd) - 1; - } - ap->link.sata_spd_limit = ap->link.hw_sata_spd_limit; + sata_link_init_spd(&ap->link); /* report the secondary IRQ for second channel legacy */ irq_line = host->irq; -- 1.5.0.3 - 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 02/14] libata-link: implement and use link/device iterators
Multiple links and different number of devices per link should be considered to iterate over links and devices. This patch implements and uses link and device iterators - ata_port_for_each_link() and ata_link_for_each_dev() - and ata_link_max_devices(). This change makes a lot of functions iterate over only possible devices instead of from dev 0 to dev ATA_MAX_DEVICES. All such changes have been examined and nothing should be broken. While at it, add a separating comment before device helpers to distinguish them better from link helpers and others. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/ata_generic.c|7 +-- drivers/ata/libata-acpi.c|6 +- drivers/ata/libata-core.c| 58 + drivers/ata/libata-eh.c | 117 +- drivers/ata/libata-scsi.c| 26 -- drivers/ata/pata_it821x.c|5 +- drivers/ata/pata_ixp4xx_cf.c |5 +- drivers/ata/pata_legacy.c|5 +- drivers/ata/pata_pdc2027x.c | 13 ++--- drivers/ata/pata_platform.c |6 +-- drivers/ata/pata_rz1000.c|5 +- drivers/ata/sata_sil.c | 12 ++--- include/linux/libata.h | 17 +- 13 files changed, 134 insertions(+), 148 deletions(-) diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 7fbbec8..85743ea 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c @@ -46,21 +46,20 @@ static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) { int dma_enabled = 0; - int i; + struct ata_device *dev; /* Bits 5 and 6 indicate if DMA is active on master/slave */ if (ap->ioaddr.bmdma_addr) dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); - for (i = 0; i < ATA_MAX_DEVICES; i++) { - struct ata_device *dev = &ap->link.device[i]; + ata_link_for_each_dev(dev, &ap->link) { if (ata_dev_enabled(dev)) { /* We don't really care */ dev->pio_mode = XFER_PIO_0; dev->dma_mode = XFER_MW_DMA_0; /* We do need the right mode information for DMA or PIO and this comes from the current configuration flags */ - if (dma_enabled & (1 << (5 + i))) { + if (dma_enabled & (1 << (5 + dev->devno))) { ata_id_to_dma_mode(dev, XFER_MW_DMA_0); dev->flags &= ~ATA_DFLAG_PIO; } else { diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 0023ac4..43af2e0 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -509,7 +509,7 @@ int ata_acpi_on_suspend(struct ata_port *ap) */ void ata_acpi_on_resume(struct ata_port *ap) { - int i; + struct ata_device *dev; if (ap->acpi_handle && (ap->pflags & ATA_PFLAG_GTM_VALID)) { BUG_ON(ap->flags & ATA_FLAG_ACPI_SATA); @@ -519,8 +519,8 @@ void ata_acpi_on_resume(struct ata_port *ap) } /* schedule _GTF */ - for (i = 0; i < ATA_MAX_DEVICES; i++) - ap->link.device[i].flags |= ATA_DFLAG_ACPI_PENDING; + ata_link_for_each_dev(dev, &ap->link) + dev->flags |= ATA_DFLAG_ACPI_PENDING; } /** diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c31a07a..1133e24 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2104,21 +2104,19 @@ int ata_bus_probe(struct ata_port *ap) { unsigned int classes[ATA_MAX_DEVICES]; int tries[ATA_MAX_DEVICES]; - int i, rc; + int rc; struct ata_device *dev; ata_port_probe(ap); - for (i = 0; i < ATA_MAX_DEVICES; i++) - tries[i] = ATA_PROBE_MAX_TRIES; + ata_link_for_each_dev(dev, &ap->link) + tries[dev->devno] = ATA_PROBE_MAX_TRIES; retry: /* reset and determine device classes */ ap->ops->phy_reset(ap); - for (i = 0; i < ATA_MAX_DEVICES; i++) { - dev = &ap->link.device[i]; - + ata_link_for_each_dev(dev, &ap->link) { if (!(ap->flags & ATA_FLAG_DISABLED) && dev->class != ATA_DEV_UNKNOWN) classes[dev->devno] = dev->class; @@ -2133,18 +2131,16 @@ int ata_bus_probe(struct ata_port *ap) /* after the reset the device state is PIO 0 and the controller state is undefined. Record the mode */ - for (i = 0; i < ATA_MAX_DEVICES; i++) - ap->link.device[i].pio_mode = XFER_PIO_0; + ata_link_for_each_dev(dev, &ap->link) + dev->pio_mode = XFER_PIO_0; /* read IDENTIFY page and configure devices. We have to do the identify specific sequence bass-ackwards so that PDIAG- is released by the slave device */ - for (i = ATA_MAX_DEVICES
[PATCH 03/14] libata-link: linkify PHY-related functions
Make the following PHY-related functions to deal with ata_link instead of ata_port. * sata_print_link_status() * sata_down_spd_limit() * ata_set_sata_spd_limit() and friends * sata_link_debounce/resume() * sata_scr_valid/read/write/write_flush() * ata_link_on/offline() This patch introduces no behavior change. Signed-off-by: Tejun Heo <[EMAIL PROTECTED]> --- drivers/ata/ahci.c |4 +- drivers/ata/libata-core.c | 227 +++ drivers/ata/libata-eh.c | 31 +++--- drivers/ata/libata-sff.c|2 +- drivers/ata/libata.h|4 +- drivers/ata/pata_scc.c |2 +- drivers/ata/sata_inic162x.c |4 +- drivers/ata/sata_mv.c | 26 +++--- drivers/ata/sata_promise.c |4 +- drivers/ata/sata_sil24.c| 10 +- include/linux/libata.h | 24 +++--- 11 files changed, 177 insertions(+), 161 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 31fab22..73ae6ee 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1050,7 +1050,7 @@ static int ahci_do_softreset(struct ata_port *ap, unsigned int *class, DPRINTK("ENTER\n"); - if (ata_port_offline(ap)) { + if (ata_link_offline(&ap->link)) { DPRINTK("PHY reports no device\n"); *class = ATA_DEV_NONE; return 0; @@ -1138,7 +1138,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class, ahci_start_engine(ap); - if (rc == 0 && ata_port_online(ap)) + if (rc == 0 && ata_link_online(&ap->link)) *class = ahci_dev_classify(ap); if (*class == ATA_DEV_UNKNOWN) *class = ATA_DEV_NONE; diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 1133e24..9660ecf 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2200,7 +2200,7 @@ int ata_bus_probe(struct ata_port *ap) /* This is the last chance, better to slow * down than lose it. */ - sata_down_spd_limit(ap); + sata_down_spd_limit(&ap->link); ata_down_xfermask_limit(dev, ATA_DNXFER_PIO); } } @@ -2229,28 +2229,28 @@ void ata_port_probe(struct ata_port *ap) /** * sata_print_link_status - Print SATA link status - * @ap: SATA port to printk link status about + * @link: SATA link to printk link status about * * This function prints link speed and status of a SATA link. * * LOCKING: * None. */ -void sata_print_link_status(struct ata_port *ap) +void sata_print_link_status(struct ata_link *link) { u32 sstatus, scontrol, tmp; - if (sata_scr_read(ap, SCR_STATUS, &sstatus)) + if (sata_scr_read(link, SCR_STATUS, &sstatus)) return; - sata_scr_read(ap, SCR_CONTROL, &scontrol); + sata_scr_read(link, SCR_CONTROL, &scontrol); - if (ata_port_online(ap)) { + if (ata_link_online(link)) { tmp = (sstatus >> 4) & 0xf; - ata_port_printk(ap, KERN_INFO, + ata_link_printk(link, KERN_INFO, "SATA link up %s (SStatus %X SControl %X)\n", sata_spd_string(tmp), sstatus, scontrol); } else { - ata_port_printk(ap, KERN_INFO, + ata_link_printk(link, KERN_INFO, "SATA link down (SStatus %X SControl %X)\n", sstatus, scontrol); } @@ -2270,32 +2270,33 @@ void sata_print_link_status(struct ata_port *ap) */ void __sata_phy_reset(struct ata_port *ap) { - u32 sstatus; + struct ata_link *link = &ap->link; unsigned long timeout = jiffies + (HZ * 5); + u32 sstatus; if (ap->flags & ATA_FLAG_SATA_RESET) { /* issue phy wake/reset */ - sata_scr_write_flush(ap, SCR_CONTROL, 0x301); + sata_scr_write_flush(link, SCR_CONTROL, 0x301); /* Couldn't find anything in SATA I/II specs, but * AHCI-1.1 10.4.2 says at least 1 ms. */ mdelay(1); } /* phy wake/clear reset */ - sata_scr_write_flush(ap, SCR_CONTROL, 0x300); + sata_scr_write_flush(link, SCR_CONTROL, 0x300); /* wait for phy to become ready, if necessary */ do { msleep(200); - sata_scr_read(ap, SCR_STATUS, &sstatus); + sata_scr_read(link, SCR_STATUS, &sstatus); if ((sstatus & 0xf) != 1) break; } while (time_before(jiffies, timeout)); /* print link status */ - sata_print_link_status(ap); + sata_print_link_status(link); /* TODO: phy layer with polling, timeouts, etc. */ - if (!ata_port_offline(ap)) + if (!ata_link_offline(link)) ata_por
[PATCHSET 2/4] libata: implement ata_link, take 7
Hello, all. This is the seventh take of implement ata_link patchset. This patchset contains 14 patches which can be categorized as follows. #01-02: implement ata_link #03-06: make libata deal with link instead of port #07-09: misc link stuff (link init, reset_tries, ata_link_abort()) #10-14: add ap->pmp_link[] and update libata to deal with multiple links ata_link abstracts PHY and sits between ata_port and ata_device. The following attributes are moved to ata_link from ata_port. - active command state (active_tag, sactive) - [hw_]sata_spd_limit - eh_info and eh_context - device array With above and a few extra fields, a link can handle attached devices including qc management and EH/hotplug. This patchset makes libata ready to handle PMP links. Changes from the last take[L] are. * adapted to the current upstream * drivers/scsi/libsas/sas_ata.c updated This patchset is against libata-dev#upstream (5ee30f070f467aaae027f03ef6772128a887b1a3) Thanks. -- tejun [L] http://thread.gmane.org/gmane.linux.ide/21510 - 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: 2.6.23-rc2 regression: check_irq_resend() warning from cmd64x
commit 0fc4969b866671dfe39b1a9119d0fdc7ea0f63e5 Linus, please revert it. On Sunday 05 August 2007, Mikael Pettersson wrote: > This is on a sparc64 ultra5 with a rev 3 CMD646. Starting with kernel > 2.6.23-rc2, each boot triggers a WARNING from kernel/irq/resend.c: > > Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 > ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx > CMD646: IDE controller at PCI slot :01:03.0 > CMD646: chipset revision 3 > CMD646: MultiWord DMA force limited > CMD646: 100% native mode on irq 14 > ide0: BM-DMA at 0x1fe02c00020-0x1fe02c00027, BIOS settings: hda:pio, > hdb:pio > ide1: BM-DMA at 0x1fe02c00028-0x1fe02c0002f, BIOS settings: hdc:pio, > hdd:pio > Probing IDE interface ide0... > hda: ST320420A, ATA DISK drive > hda: selected mode 0x22 > ide0 at 0x1fe02c0-0x1fe02c7,0x1fe02ca on irq 14 > Probing IDE interface ide1... > hdc: CRD-8483B, ATAPI CD/DVD-ROM drive > WARNING: at kernel/irq/resend.c:70 check_irq_resend() > Call Trace: > [00475a84] enable_irq+0x9c/0xc8 > [00560438] probe_hwif+0x7bc/0x934 > [00560dbc] probe_hwif_init_with_fixup+0x10/0xc4 > [00563454] ide_setup_pci_device+0x94/0x9c > [005581f4] cmd64x_init_one+0x40/0x4c > [00680670] ide_scan_pcidev+0x48/0x84 > [006806e0] ide_scan_pcibus+0x34/0x100 > [0068061c] ide_init+0x60/0x6c > [00670200] kernel_init+0xf0/0x270 > [00427344] kernel_thread+0x38/0x48 > [005c5fd8] rest_init+0x18/0x5c > hdc: selected mode 0x22 > ide1 at 0x1fe02c00010-0x1fe02c00017,0x1fe02c0001a on irq 14 (shared with ide0) > hda: max request size: 128KiB > hda: 39851760 sectors (20404 MB) w/2048KiB Cache, CHS=39535/16/63, (U)DMA > hda: cache flushes not supported > hda: hda1 hda2 hda3 hda4 hda5 - 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: 2.6.23-rc2: check_irq_resend on resume (ali15x3)
commit 0fc4969b866671dfe39b1a9119d0fdc7ea0f63e5 I doubt that this particular report helps in debugging ne2k-pci problem... ;) On Saturday 04 August 2007, Andrey Borzenkov wrote: > Just noticed this; I do not remember having seen it before, but I also do not > check dmesg every time after resume. > > [ 54.154078] pnp: Failed to activate device 00:05. > [ 54.154120] pnp: Failed to activate device 00:06. > [ 54.159608] pnp: Device 00:09 activated. > [ 54.205284] WARNING: at /home/bor/src/linux-git/kernel/irq/resend.c:70 > check_irq_resend() > [ 54.205299] [] show_trace_log_lvl+0x1a/0x30 > [ 54.205332] [] show_trace+0x12/0x20 > [ 54.205343] [] dump_stack+0x15/0x20 > [ 54.205353] [] check_irq_resend+0x9e/0xb0 > [ 54.205388] [] enable_irq+0xb1/0xc0 > [ 54.205397] [] ide_config_drive_speed+0x18a/0x3e0 [ide_core] > [ 54.205570] [] ali15x3_tune_drive+0x1c/0x20 [alim15x3] > [ 54.205592] [] ide_do_request+0x8a3/0xa10 [ide_core] > [ 54.205623] [] ide_do_drive_cmd+0xc0/0x110 [ide_core] > [ 54.205652] [] generic_ide_resume+0x98/0xe0 [ide_core] > [ 54.205681] [] resume_device+0x4c/0xa0 > [ 54.205717] [] dpm_resume+0x5e/0x90 > [ 54.205727] [] device_resume+0x26/0x40 > [ 54.205736] [] hibernation_snapshot+0x69/0xd0 > [ 54.205747] [] hibernate+0xac/0x170 > [ 54.205755] [] state_store+0xbe/0xd0 > [ 54.205764] [] subsys_attr_store+0x32/0x50 > [ 54.205784] [] sysfs_write_file+0xdb/0x120 > [ 54.205795] [] vfs_write+0x99/0x130 > [ 54.205819] [] sys_write+0x3d/0x70 > [ 54.205829] [] sysenter_past_esp+0x5f/0x99 > [ 54.205839] === > [ 54.206084] hda: selected mode 0x42 > [ 54.225580] hdc: selected mode 0x42 > [ 54.228619] usb usb1: root hub lost power or was reset > [ 54.714012] eth1: PRI 31 variant 2 version 9.48 > [ 54.714075] eth1: NIC 5 variant 2 version 1.02 > [ 54.810451] Restarting tasks ... <5>toshiba_acpi: Re-enabled hotkeys > [ 54.925054] done. > [ 54.925134] swsusp: Basic memory bitmaps freed > [ 59.560144] eth1: PRI 31 variant 2 version 9.48 > [ 59.560231] eth1: NIC 5 variant 2 version 1.02 > [ 59.835398] eth1: PRI 31 variant 2 version 9.48 > [ 59.835487] eth1: NIC 5 variant 2 version 1.02 > [ 60.079468] eth1: PRI 31 variant 2 version 9.48 > [ 60.079553] eth1: NIC 5 variant 2 version 1.02 - 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