History log of /linux-master/drivers/ata/ata_piix.c
Revision Date Author Comments
# 25df73d9 22-Mar-2023 Bart Van Assche <bvanassche@acm.org>

scsi: ata: Declare SCSI host templates const

Make it explicit that ATA host templates are not modified.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com> (for DWC AHCI SATA)
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com> (for Tegra)
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230322195515.1267197-5-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ec87cf37 02-Feb-2022 Sergey Shtylyov <s.shtylyov@omp.ru>

ata: libata: make ata_host_suspend() *void*

ata_host_suspend() always returns 0, so the result checks in many drivers
look pointless. Let's make this function return *void* instead of *int*.

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


# c206a389 21-Dec-2021 Hannes Reinecke <hare@suse.de>

ata: libata: tracepoints for bus-master DMA

Add tracepoints for bus-master DMA and taskfile related functions.
That allows us to drop the relevant DPRINTK() calls.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


# f3b9db5f 21-Dec-2021 Hannes Reinecke <hare@suse.de>

ata: libata: remove pointless debugging messages

Debugging messages in pci init functions or sg setup are pretty
much pointless, as the workflow pretty much decides what happened.
So drop them.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


# c3f69c7f 12-Oct-2021 Bart Van Assche <bvanassche@acm.org>

scsi: ata: Switch to attribute groups

struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.

Link: https://lore.kernel.org/r/20211012233558.4066756-3-bvanassche@acm.org
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# dee58fe8 06-Nov-2019 Michał Mirosław <mirq-linux@rere.qmqm.pl>

ata_piix: remove open-coded dmi_match(DMI_OEM_STRING)

Since de40614de99 ("firmware: dmi_scan: Add DMI_OEM_STRING support to
dmi_matches") dmi_check_system() can match OEM_STRINGs itself.
Use the feature.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Jens Axboe <axboe@kernel.dk>


# c82ee6d3 19-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 or at your option any
later version this program is distributed in the hope that it will
be useful but without any warranty without even the implied warranty
of merchantability or fitness for a particular purpose see the gnu
general public license for more details you should have received a
copy of the gnu general public license along with this program see
the file copying if not write to the free software foundation 675
mass ave cambridge ma 02139 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 52 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190519154042.342335923@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 494fd076 02-Jan-2018 Arvind Yadav <arvind.yadav.cs@gmail.com>

ata_piix: constify pci_bits

pci_bits are not supposed to change at runtime. Functions
pci_test_config_bits() working with const 'struct pci_bits'.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>


# 80a921e2 18-Sep-2017 Ville Syrjälä <ville.syrjala@linux.intel.com>

ata_piix: Add Fujitsu-Siemens Lifebook S6120 to short cable IDs

Fujitsu-Siemens Lifebook S6120 misdetects the cable type for some
drives. The problematic one in this case is an mSATA SSD hooked up via a
mSATA->PATA bridge. With regular hard disks the detection seems to work
correctly.

Strangely an older Lifebook model (S6020) detects the cable as 80c
with the mSATA SSD, even if using the exact same flex cable.

Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>


# 9bb9a39c 16-May-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

ata: update references for libata documentation

The libata documentation is now using ReST. Update references
to it to point to the new place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>


# 19285f3c 14-May-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

ata: update references for libata documentation

The libata documentation is now using ReST. Update references
to it to point to the new place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6cad1376 27-Aug-2014 James Ralston <james.d.ralston@intel.com>

ata_piix: Add Device IDs for Intel 9 Series PCH

This patch adds the IDE mode SATA Device IDs for the Intel 9 Series PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org


# 58eb8cd5 07-May-2014 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers

This patch fixes host drivers to use CONFIG_PM_SLEEP instead of CONFIG_PM
where applicable. Benefits of this change:

* unused code is not being compiled in for CONFIG_PM=y, CONFIG_PM_SLEEP=n
and CONFIG_PM_RUNTIME=y configurations

* easier transition to use struct dev_pm_ops and SIMPLE_DEV_PM_OPS() in
the future

* more consistent code (there are host drivers which are using the correct
CONFIG_PM_SLEEP checks already)

The patch leaves the core libata code and ->port_[suspend,resume] support
in sata_[inic162x,nv,sil24].c alone for now.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>


# 89951f22 01-Oct-2013 Levente Kurusa <levex@linux.com>

ata_piix: minor typo and a printk fix

The patch fixes a printk() being cut in half, some typos
and a change in comments to better reflect the specs.

Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>


# eac27f04 11-Jul-2013 Youquan Song <youquan.song@intel.com>

ata: Fix DVD not dectected at some platform with Wellsburg PCH

There is a patch b55f84e2d527182e7c611d466cd0bb6ddce201de "ata_piix: Fix DVD
not dectected at some Haswell platforms" to fix an issue of DVD not
recognized on Haswell Desktop platform with Lynx Point.
Recently, it is also found the same issue at some platformas with Wellsburg PCH.

So deliver a similar patch to fix it by disables 32bit PIO in IDE mode.

Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org


# c7e8695b 19-Jun-2013 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE-mode SATA patch for Intel Coleto Creek DeviceIDs

This patch adds the IDE-mode SATA DeviceIDs for the Intel Coleto Creek PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org


# 0a86e1c8 02-Jun-2013 Jingoo Han <jg1.han@samsung.com>

ata: use pci_get_drvdata()

Use the wrapper function for getting the driver data using pci_dev
instead of using dev_get_drvdata() with &pdev->dev, so we can directly
pass a struct pci_dev. This is a purely cosmetic change.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>


# fca8c90d5 16-May-2013 Chew, Chiau Ee <chiau.ee.chew@intel.com>

ata_piix: add PCI IDs for Intel BayTail

Adds IDE-mode SATA Device IDs for the Intel BayTrail platform.

Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org


# 8c3d3d4b 14-May-2013 Tejun Heo <tj@kernel.org>

libata: update "Maintained by:" tags

Jeff moved on to a greener pasture.

s/Maintained by: Jeff Garzik/Maintained by: Tejun Heo/g

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jgarzik@pobox.com>


# b55f84e2 06-Mar-2013 Youquan Song <youquan.song@intel.com>

ata_piix: Fix DVD not dectected at some Haswell platforms

There is a quirk patch 5e5a4f5d5a08c9c504fe956391ac3dae2c66556d
"ata_piix: make DVD Drive recognisable on systems with Intel Sandybridge
chipsets(v2)" fixing the 4 ports IDE controller 32bit PIO mode.

We've hit a problem with DVD not recognized on Haswell Desktop platform which
includes Lynx Point 2-port SATA controller.

This quirk patch disables 32bit PIO on this controller in IDE mode.

v2: Change spelling error in statememnt pointed by Sergei Shtylyov.
v3: Change comment statememnt and spliting line over 80 characters pointed by
Libor Pechacek and also rebase the patch against 3.8-rc7 kernel.

Tested-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Youquan Song <youquan.song@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 79e7654c 21-Feb-2013 Andrew Brownfield <abrownfi@redhat.com>

ata_piix: Add MODULE_PARM_DESC to prefer_ms_hyperv

In reference to the commit cd006086fa5d91414d8ff9ff2b78fbb593878e3c
"ata_piix: defer disks to the Hyper-V drivers by default",
this trivial patch adds a description to prefer_ms_hyperv.

[rvrbovsk@redhat.com: MODULE_PARM_DESC() string formatting modified]

Signed-off-by: Andrew Brownfield <abrownfi@redhat.com>
Signed-off-by: Radomir Vrbovsky <rvrbovsk@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 3aee8bc5 08-Feb-2013 James Ralston <james.d.ralston@intel.com>

ata_piix: Add Device IDs for Intel Wellsburg PCH

This patch adds the IDE-mode SATA Device IDs for the Intel Wellsburg PCH

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# aaa51527 25-Jan-2013 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE-mode SATA patch for Intel Avoton DeviceIDs

This patch adds the IDE-mode SATA DeviceIDs for the Intel Avoton SOC.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 0ec24914 21-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Drivers: ata: remove __dev* attributes.

CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Viresh Kumar <viresh.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f295be25 30-Nov-2012 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

ata_piix: re-order code and remove prototypes

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# d9904344 18-Sep-2012 Olaf Hering <olaf@aepfle.de>

ata_piix: reenable MS Virtual PC guests

An earlier commit cd006086fa5d91414d8ff9ff2b78fbb593878e3c ("ata_piix:
defer disks to the Hyper-V drivers by default") broke MS Virtual PC
guests. Hyper-V guests and Virtual PC guests have nearly identical DMI
info. As a result the driver does currently ignore the emulated hardware
in Virtual PC guests and defers the handling to hv_blkvsc. Since Virtual
PC does not offer paravirtualized drivers no disks will be found in the
guest.

One difference in the DMI info is the product version. This patch adds a
match for MS Virtual PC 2007 and "unignores" the emulated hardware.

This was reported for openSuSE 12.1 in bugzilla:
https://bugzilla.novell.com/show_bug.cgi?id=737532

Here is a detailed list of DMI info from example guests:

hwinfo --bios:

virtual pc guest:

System Info: #1
Manufacturer: "Microsoft Corporation"
Product: "Virtual Machine"
Version: "VS2005R2"
Serial: "3178-9905-1533-4840-9282-0569-59"
UUID: undefined, but settable
Wake-up: 0x06 (Power Switch)
Board Info: #2
Manufacturer: "Microsoft Corporation"
Product: "Virtual Machine"
Version: "5.0"
Serial: "3178-9905-1533-4840-9282-0569-59"
Chassis Info: #3
Manufacturer: "Microsoft Corporation"
Version: "5.0"
Serial: "3178-9905-1533-4840-9282-0569-59"
Asset Tag: "7188-3705-6309-9738-9645-0364-00"
Type: 0x03 (Desktop)
Bootup State: 0x03 (Safe)
Power Supply State: 0x03 (Safe)
Thermal State: 0x01 (Other)
Security Status: 0x01 (Other)

win2k8 guest:

System Info: #1
Manufacturer: "Microsoft Corporation"
Product: "Virtual Machine"
Version: "7.0"
Serial: "9106-3420-9819-5495-1514-2075-48"
UUID: undefined, but settable
Wake-up: 0x06 (Power Switch)
Board Info: #2
Manufacturer: "Microsoft Corporation"
Product: "Virtual Machine"
Version: "7.0"
Serial: "9106-3420-9819-5495-1514-2075-48"
Chassis Info: #3
Manufacturer: "Microsoft Corporation"
Version: "7.0"
Serial: "9106-3420-9819-5495-1514-2075-48"
Asset Tag: "7076-9522-6699-1042-9501-1785-77"
Type: 0x03 (Desktop)
Bootup State: 0x03 (Safe)
Power Supply State: 0x03 (Safe)
Thermal State: 0x01 (Other)
Security Status: 0x01 (Other)

win2k12 guest:

System Info: #1
Manufacturer: "Microsoft Corporation"
Product: "Virtual Machine"
Version: "7.0"
Serial: "8179-1954-0187-0085-3868-2270-14"
UUID: undefined, but settable
Wake-up: 0x06 (Power Switch)
Board Info: #2
Manufacturer: "Microsoft Corporation"
Product: "Virtual Machine"
Version: "7.0"
Serial: "8179-1954-0187-0085-3868-2270-14"
Chassis Info: #3
Manufacturer: "Microsoft Corporation"
Version: "7.0"
Serial: "8179-1954-0187-0085-3868-2270-14"
Asset Tag: "8374-0485-4557-6331-0620-5845-25"
Type: 0x03 (Desktop)
Bootup State: 0x03 (Safe)
Power Supply State: 0x03 (Safe)
Thermal State: 0x01 (Other)
Security Status: 0x01 (Other)

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 389cd784 09-Aug-2012 James Ralston <james.d.ralston@intel.com>

ata_piix: Add Device IDs for Intel Lynx Point-LP PCH

This patch adds the IDE-mode SATA Device IDs for the Intel Lynx Point-LP PCH

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# cd006086 04-May-2012 Andy Whitcroft <apw@canonical.com>

ata_piix: defer disks to the Hyper-V drivers by default

When we are hosted on a Microsoft Hyper-V hypervisor the guest disks
are exposed both via the Hyper-V paravirtualised drivers and via an
emulated SATA disk drive. In this case we want to use the paravirtualised
drivers if we can as they are much more efficient. Note that the Hyper-V
paravirtualised drivers only expose the virtual hard disk devices, the
CDROM/DVD devices must still be enumerated.

Mark the host controller ATA_HOST_IGNORE_ATA to prevent enumeration of
disk devices.

BugLink: http://bugs.launchpad.net/bugs/929545
BugLink: http://bugs.launchpad.net/bugs/942316
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 96d5d96a 21-Feb-2012 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE-mode SATA patch for Intel DH89xxCC DeviceIDs

This patch adds the IDE-mode SATA DeviceIDs for the Intel DH89xxCC PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 78140cfe 23-Jan-2012 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE-mode SATA patch for Intel Lynx Point DeviceIDs

This patch adds the IDE-mode SATA DeviceIDs for the Intel Lynx Point PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# b73fa463 07-Jan-2012 Benjamin Larsson <benjamin@southpole.se>

[libata] ata_piix: Add Toshiba Satellite Pro A120 to the quirks list
due to broken suspend functionality.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 6a94a746 13-Oct-2011 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

ata_piix: unify code for programming PIO and MWDMA timings

Besides making things noticably simpler it results in ~2% decrease in
the driver LOC count and also ~2% decrease in the driver binary size
(as measured on x86-32).

Fix piix_set_piomode() documentation while at it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# ce986690 13-Oct-2011 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

ata_piix: SITRE handling fix

Set SITRE (separate slave timing register) bit also in master-only
configurations to match other PIIX-alike drivers and make further
changes easier.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 5e5a4f5d 06-Oct-2011 Ming Lei <ming.lei@canonical.com>

ata_piix: make DVD Drive recognisable on systems with Intel Sandybridge chipsets(v2)

This quirk patch fixes one kind of bug inside some Intel Sandybridge
chipsets, see reports from

https://bugzilla.kernel.org/show_bug.cgi?id=40592.

Many guys also have reported the problem before:

https://bugs.launchpad.net/bugs/737388
https://bugs.launchpad.net/bugs/794642
https://bugs.launchpad.net/bugs/782389
......

With help from Tejun, the problem is found to be caused by 32bit PIO
mode, so introduce the quirk patch to disable 32bit PIO on SATA piix
for some Sandybridge CPT chipsets.

Seth also tested the patch on all five affected chipsets
(pci device ID: 0x1c00, 0x1c01, 0x1d00, 0x1e00, 0x1e01), and found
the patch does fix the problem.

Tested-by: Heasley, Seth <seth.heasley@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: stable@kernel.org


# 06296a1e 15-Apr-2011 Joe Perches <joe@perches.com>

ata: Add and use ata_print_version_once

Use a single mechanism to show driver version.
Reduces text a tiny bit too.

Remove uses of static int printed_version
Add and use ata_print_version(const struct device *, const char *ver)
and ata_print_version_once.

$ size drivers/ata/built-in.*
text data bss dec hex filename
544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
543870 73893 116592 734355 b34ad drivers/ata/built-in.allyesconfig.print_once.o
141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
141212 14689 4220 160121 27179 drivers/ata/built-in.defconfig.print_once.o

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>


# a44fec1f 15-Apr-2011 Joe Perches <joe@perches.com>

ata: Convert dev_printk(KERN_<LEVEL> to dev_<level>(

Saves a bit of text as the call takes fewer args.

Coalesce a few formats.
Convert a few bare printks to pr_cont.

$ size drivers/ata/built-in.o*
text data bss dec hex filename
558429 73893 117864 750186 b726a drivers/ata/built-in.o.allyesconfig.new
559574 73893 117888 751355 b76fb drivers/ata/built-in.o.allyesconfig.old
149567 14689 4220 168476 2921c drivers/ata/built-in.o.defconfig.new
149851 14689 4220 168760 29338 drivers/ata/built-in.o.defconfig.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>


# 4a836c70 20-Apr-2011 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE-mode SATA patch for Intel Panther Point DeviceIDs

The previously submitted patch was word-wrapped.

This patch adds the IDE-mode SATA DeviceIDs for the Intel Panther
Point PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# 4fca377f 14-Feb-2011 Jeff Garzik <jeff@garzik.org>

[libata] trivial: trim trailing whitespace for drivers/ata/*.[ch]


# 4bb969db 10-Oct-2010 Ben Hutchings <ben@decadent.org.uk>

ata_piix: Add device ID for ICH4-L

ICH4-L is a variant of ICH4 lacking USB2 functionality and with some
different device IDs.

It is documented in Intel specification update 290745-025, currently
at <http://www.intel.com/assets/pdf/specupdate/290745.pdf>, and is
included in the device ID table for piix.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 9950110c 06-Sep-2010 Tejun Heo <htejun@gmail.com>

ata_piix: remove SIDPR locking

Now that libata provides proper cross-port EH exclusion. The SIDPR
locking added by commit 213373cf (ata_piix: fix locking around SIDPR
access) is no longer necessary. Remove it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# a97c4006 01-Sep-2010 Tejun Heo <tj@kernel.org>

ata_piix: implement LPM support

Now that DIPM can be used independently from HIPM, ata_piix can
support LPM too.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 238e149c 09-Sep-2010 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE Mode SATA patch for Intel Patsburg DeviceIDs

This patch adds the Intel Patsburg (PCH) IDE mode SATA Controller DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 213373cf 20-Jul-2010 Tejun Heo <tj@kernel.org>

ata_piix: fix locking around SIDPR access

SIDPR window registers are shared across ports and as each access is
done in two steps, accesses to different ports under EH may race.
This primarily is caused by incorrect host locking in EH context and
should be fixed by defining locking requirements for each EH operation
which can be used during EH and enforcing them but for now work around
the problem by adding a dedicated SIDPR lock and grabbing it for each
SIDPR access.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Mark Knecht <markknecht@gmail.com>
Reported-by: Paul Check <paul@thechecks.ca>
Cc: stable@kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 1c5afdf7 19-May-2010 Tejun Heo <tj@kernel.org>

libata-sff: separate out BMDMA init

Separate out ata_pci_bmdma_prepare_host() and ata_pci_bmdma_init_one()
from their SFF counterparts. SFF ones no longer try to initialize
BMDMA or set PCI master.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# c3b28894 19-May-2010 Tejun Heo <tj@kernel.org>

libata-sff: separate out BMDMA irq handler

Separate out BMDMA irq handler from SFF irq handler. The misnamed
host_intr() functions are renamed to ata_sff_port_intr() and
ata_bmdma_port_intr(). Common parts are factored into
__ata_sff_port_intr() and __ata_sff_interrupt() and used by sff and
bmdma interrupt routines.

All BMDMA drivers now use ata_bmdma_interrupt() or
ata_bmdma_port_intr() while all non-BMDMA SFF ones use
ata_sff_interrupt() or ata_sff_port_intr().

For now, ata_pci_sff_init_one() uses ata_bmdma_interrupt() as it's
used by both SFF and BMDMA drivers.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 88393161 16-Mar-2010 Thomas Weber <swirl@gmx.li>

Fix typos in comments

[Ss]ytem => [Ss]ystem
udpate => update
paramters => parameters
orginal => original

Signed-off-by: Thomas Weber <swirl@gmx.li>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 27943620 18-Jan-2010 Tejun Heo <tj@kernel.org>

libata: implement spurious irq handling for SFF and apply it to piix

Traditional IDE interface sucks in that it doesn't have a reliable IRQ
pending bit, so if the controller raises IRQ while the driver is
expecting it not to, the IRQ won't be cleared and eventually the IRQ
line will be killed by interrupt subsystem. Some controllers have
non-standard mechanism to indicate IRQ pending so that this condition
can be detected and worked around.

This patch adds an optional operation ->sff_irq_check() which will be
called for each port from the ata_sff_interrupt() if an unexpected
interrupt is received. If the operation returns %true,
->sff_check_status() and ->sff_irq_clear() will be cleared for the
port. Note that this doesn't mark the interrupt as handled so it
won't prevent IRQ subsystem from killing the IRQ if this mechanism
fails to clear the spurious IRQ.

This patch also implements ->sff_irq_check() for ata_piix. Note that
this adds slight overhead to shared IRQ operation as IRQs which are
destined for other controllers will trigger extra register accesses to
check whether IDE interrupt is pending but this solves rare screaming
IRQ cases and for some curious reason also helps weird BIOS related
glitch on Samsung n130 as reported in bko#14314.

http://bugzilla.kernel.org/show_bug.cgi?id=14314

* piix_base_ops dropped as suggested by Sergei.

* Spurious IRQ detection doesn't kick in anymore if polling qc is in
progress. This provides less protection but some controllers have
possible data corruption issues if the wrong register is accessed
while a command is in progress.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Johannes Stezenbach <js@sig21.net>
Reported-by: Hans Werner <hwerner4@gmx.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 88e8201e 12-Jan-2010 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE Mode SATA patch for Intel Cougar Point DeviceIDs

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 0b67c743 11-Jan-2010 Tejun Heo <tj@kernel.org>

ata_piix: enable 32bit PIO on SATA piix

Commit 871af1210f13966ab911ed2166e4ab2ce775b99d enabled 32bit PIO for
PATA piix but didn't for SATA. There's no reason not to use 32bit PIO
on SATA piix. Enable it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# af901ca1 14-Nov-2009 André Goddard Rosa <andre.goddard@gmail.com>

tree-wide: fix assorted typos all over the place

That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 69385943 03-Dec-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

ata_piix: fix MWDMA handling on PIIX3

Fix erroneous check for ap->udma_mask in do_pata_set_dmamode()
resulting in controller not being programmed properly for MWDMA.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 60c3be38 30-Aug-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

ata_piix: parallel scanning on PATA needs an extra locking

Commit log for commit 517d3cc15b36392e518abab6bacbb72089658313
("[libata] ata_piix: Enable parallel scan") says:

This patch turns on parallel scanning for the ata_piix driver.
This driver is used on most netbooks (no AHCI for cheap storage it seems).
The scan is the dominating time factor in the kernel boot for these
devices; with this flag it gets cut in half for the device I used
for testing (eeepc).
Alan took a look at the driver source and concluded that it ought to be safe
to do for this driver. Alan has also checked with the hardware team.

and it is all true but once we put all things together additional
constraints for PATA controllers show up (some hardware registers
have per-host not per-port atomicity) and we risk misprogramming
the controller.

I used the following test to check whether the issue is real:

@@ -736,8 +736,20 @@ static void piix_set_piomode(struct ata_
(timings[pio][1] << 8);
}
pci_write_config_word(dev, master_port, master_data);
- if (is_slave)
+ if (is_slave) {
+ if (ap->port_no == 0) {
+ u8 tmp = slave_data;
+
+ while (slave_data == tmp) {
+ pci_read_config_byte(dev, slave_port, &tmp);
+ msleep(50);
+ }
+
+ dev_printk(KERN_ERR, &dev->dev, "PATA parallel scan "
+ "race detected\n");
+ }
pci_write_config_byte(dev, slave_port, slave_data);
+ }

/* Ensure the UDMA bit is off - it will be turned back on if
UDMA is selected */

and it indeed triggered the error message.

Lets fix all such races by adding an extra locking to ->set_piomode
and ->set_dmamode methods for PATA controllers.

[ Alan: would be better to take the host lock in libata-core for these
cases so that we fix all the adapters in one swoop. "Looks fine as a
temproary quickfix tho" ]

Cc: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 760cdb77 16-Jul-2009 Steve Conklin <sconklin@canonical.com>

ata_piix: Add new short cable ID

OriginalAuthor: Tony Espy <espy@canonical.com>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 6034734d 16-Jul-2009 Steve Conklin <sconklin@canonical.com>

ata_piix: Add new laptop short cable IDs

OriginalAuthor: Michael Frey <michael.frey@canonical.com>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 517d3cc1 13-May-2009 Arjan van de Ven <arjan@infradead.org>

[libata] ata_piix: Enable parallel scan

This patch turns on parallel scanning for the ata_piix driver.
This driver is used on most netbooks (no AHCI for cheap storage it seems).
The scan is the dominating time factor in the kernel boot for these
devices; with this flag it gets cut in half for the device I used
for testing (eeepc).
Alan took a look at the driver source and concluded that it ought to be safe
to do for this driver. Alan has also checked with the hardware team.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 7654db1a 06-May-2009 Alan Cox <alan@linux.intel.com>

ata_piix: Remove stale comment

Combined mode pci quirk hacks went away - so the table to keep in sync
no longer exists.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 347979a0 06-May-2009 Alan Cox <alan@linux.intel.com>

ata_piix: Turn on hotplugging support for older chips

We can't do this for the later ones as they have all sorts of magic boot
time stuff that needs reviewing and the like. However we can do it for the
older ones and it turns out we need to as some IBM docking stations have a
second PIIX series device in them and without this change you can't use it
very well

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 65e31643 18-May-2009 Ville Syrjala <syrjala@sci.fi>

ata_piix: Add HP Compaq nc6000 to the broken poweroff list

HP Compaq nc6000 suffers from the double disk spindown issue.
Add it to the broken poweroff DMI list.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 124a6eec 06-May-2009 Alan Cox <alan@linux.intel.com>

ata_piix: The Sony TZ90 needs the cable type hardcoding

The Sony TZ90 needs the cable type hardcoding. See bug #12734

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# c611bed7 06-May-2009 Alan Cox <alan@linux.intel.com>

ata_piix: ICH7 does not support correct MWDMA timings

See Errata documentation. The recommended workaround is to use PIO4 instead
which will we automatically do by flagging this mode not available.

Signed-off-by: Alan Cox <alan.cox@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# c3f93b8f 30-Mar-2009 Tejun Heo <tj@kernel.org>

ata_piix: VGN-BX297XP wants the controller power up on suspend

Sony VGN-BX297XP fails suspend if the controller is powered down when
calling into ACPI suspend. Add the machine to piix_broken_suspend
list.

This problem was reported by GNUtoo@no-log.org on bko#10293.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: GNUtoo@no-log.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 14bdef98 14-Mar-2009 Erik Inge Bolsø <knan-lkml@anduin.net>

[libata] convert drivers to use ata.h mode mask defines

No functional changes in this patch.

Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# e9c1670c 02-Mar-2009 Tejun Heo <tj@kernel.org>

ata_piix: add workaround for Samsung DB-P70

Samsung DB-P70 somehow botched the first ICH9 SATA port. The board
doesn't expose the first port but somehow SStatus reports link online
while failing SRST protocol leading to repeated probe failures and
thus long boot delay.

Because the BIOS doesn't carry any identifying DMI information, the
port can't be blacklisted safely. Fortunately, the controller does
have subsystem vendor and ID set. It's unclear whether the subsystem
IDs are used only for the board but it can be safely worked around by
disabling SIDPR access and just using SRST works around the problem.
Even when the workaround is triggered on an unaffected board the only
side effect will be missing SCR access.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Joseph Jang <josephjang@gmail.com>
Reported-by: Jonghyon Sohn <mrsohn@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 5f451fe1 19-Jan-2009 Rafael J. Wysocki <rjw@rjwysocki.net>

SATA PIIX: Blacklist system that spins off disks during ACPI power off

Some notebooks from HP have the problem that their BIOSes attempt to
spin down hard drives before entering ACPI system states S4 and S5.
This leads to a yo-yo effect during system power-off shutdown and the
last phase of hibernation when the disk is first spun down by the
kernel and then almost immediately turned on and off by the BIOS.
This, in turn, may result in shortening the disk's life times.

To prevent this from happening we can blacklist the affected systems
using DMI information.

Blacklist HP 2510p that uses the ata_piix driver.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 871af121 05-Jan-2009 Alan Cox <alan@redhat.com>

libata: Add 32bit PIO support

This matters for some controllers and in one or two cases almost doubles
PIO performance. Add a bmdma32 operations set we can inherit and activate
it for some controllers

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 2852bcf7 01-Jan-2009 Tejun Heo <tj@kernel.org>

ata_piix: save, use saved and restore IOCFG

Certain ACPI implementations mess up IOCFG on _STM making libata
detect cable type incorrectly after a suspend/resume cycle. This
patch makes ata_piix save IOCFG on attach, use the saved value for
things which aren't dynamic and restore it on detach so that the next
driver also gets the BIOS initialized value.

This patch contains the following changes.

* makes ich_pata_cable_detect() use saved_iocfg.

* make piix_iocfg_bit18_quirk() take @host and use saved_iocfg.

* hpriv allocation moved upwards to save iocfg before doing anything
else.

This fixes bz#11879. Andreas Mohr reported and diagnosed the problem.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Andreas Mohr <andi@lisas.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 3c387730 10-Dec-2008 Jiri Slaby <jirislaby@kernel.org>

[libata] ata_piix: cleanup dmi strings checking

Commit
ATA: piix, fix pointer deref on suspend
fixed a possible oops in an ugly manner. Use newly introduced dmi_match()
to make the code pretty again.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 9ac62126 03-Dec-2008 Jiri Slaby <jirislaby@kernel.org>

ATA: piix, fix pointer deref on suspend

Hi,

I've found this issue in the mmotm 2008-12-02-17-08.

--

Commit
ata_piix: add borked Tecra M4 to broken suspend list
introduced DMI variables checking, but they can be null, so that
we possibly dereference null.

Check if they are null and avoid checks in that case.

Solves:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
IP: [<ffffffff8043da97>] piix_pci_device_suspend+0x117/0x230

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 1eedb4a9 29-Nov-2008 Tejun Heo <tj@kernel.org>

ata_piix: add borked Tecra M4 to broken suspend list

Tecra M4 sometimes forget what it is and reports bogus data via DMI
which makes the machine evade broken suspend matching and thus fail
suspend/resume. This patch updates piix_broken_suspend() such that it
can match such case. As the borked DMI data is a bit generic,
matching many entries to make the match more specific is necessary.
As the usual DMI matching is limited to four entries, this patch uses
hard coded manual matching.

This is reported by Alexandru Romanescu.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 5b97fbd0 29-Oct-2008 Randy Dunlap <randy.dunlap@oracle.com>

ATA: remove excess kernel-doc notation

Remove excess kernel-doc function parameter notation from drivers/ata/:

Warning(drivers/ata/libata-core.c:1622): Excess function parameter or struct member 'fn' description in 'ata_pio_queue_task'
Warning(drivers/ata/libata-core.c:4655): Excess function parameter or struct member 'err_mask' description in 'ata_qc_complete'
Warning(drivers/ata/ata_piix.c:751): Excess function parameter or struct member 'udma' description in 'do_pata_set_dmamode'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# ab771630 27-Oct-2008 Alan Cox <alan@lxorguk.ukuu.org.uk>

ata: Switch all my stuff to a common address

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 0395e61b 27-Aug-2008 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE Mode SATA patch for Intel Ibex Peak DeviceIDs

This patch updates the Intel Ibex Peak (PCH) IDE mode SATA Controller DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# d09addf6 17-Sep-2008 Herton Ronaldo Krzesinski <herton@mandriva.com.br>

ata_piix: add Hercules EC-900 mini-notebook to ich_laptop short cable list

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# be77e43a 31-Jul-2008 Tejun Heo <tj@kernel.org>

ata_piix: drop merged SCR access and use slave_link instead

Now that libata has slave_link, there's no need to keep ugly merged
SCR access. Drop it and use slave_link instead. This results in
simpler code and much better separate link handling for master and
slave.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 82ef04fb 31-Jul-2008 Tejun Heo <tj@kernel.org>

libata: make SCR access ops per-link

Logically, SCR access ops should take @link; however, there was no
compelling reason to convert all SCR access ops when adding @link
abstraction as there's one-to-one mapping between a port and a non-PMP
link. However, that assumption won't hold anymore with the scheduled
addition of slave link.

Make SCR access ops per-link.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# da3ceb22 08-Sep-2008 Stephen Hemminger <shemminger@vyatta.com>

ata: duplicate variable sparse warning

drivers/ata/ata_piix.c:1502:7: warning: symbol 'rc' shadows an earlier one

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# c6c6a1af 11-Aug-2008 Seth Heasley <seth.heasley@intel.com>

ata_piix: IDE Mode SATA patch for Intel Ibex Peak DeviceIDs

This patch adds the Intel Ibex Peak (PCH) IDE mode SATA Controller DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 487eff68 29-Jul-2008 Tejun Heo <htejun@gmail.com>

ata_piix: subsys 106b:00a3 is apple ich8m too

Subsys 106b:00a3 also is the weird apple ich8m which chokes when the
latter two ports are accessed, add it. Reported by Felipe Sere.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Felipe Sere <dodofxp@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 040dee53 13-Jun-2008 Tejun Heo <htejun@gmail.com>

ata_piix: add TECRA M4 to broken suspend list

TOSHIBA also used "TECRA M4" in additon to "Tecra M4", add it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# e1fefea9 03-Jun-2008 Colin Ian King <colin.king@canonical.com>

[libata] ata_piix: more acer short cable quirks

Add ICH6 on ACER Aspire 1694WLMi to list of laptops that use short cables
rather than 80 wire

OriginalAuthor: Tiago Sousa
OriginalLocation: http://launchpadlibrarian.net/11627664/new.ich_laptop.short.cables.diff
Bug: #187121

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 23cf296e 29-May-2008 Tejun Heo <htejun@gmail.com>

ata_piix: fix macbook ich8m problems

ICH8M on macbooks are peculiar in that some of them lock up when the
second port is enabled, some return bogus values on SIDPR access while
yet others hang on SIDPR access. Also, the ich8m_apple_sata entry was
wrongly added below generic ich8m entry making it virtually useless.

This patch works around macbook ich8m problems by

* moving ich8m_apple_sata entry above generic ich8m entry
* dropping PIIX_FLAG_SIDPR from ich8m_apple_sata
* adding subsystem 106b:00a1 as ich8m_apple_sata

Reported and tested by MATSUBAYASHI.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# cb6716c8 30-Apr-2008 Tejun Heo <htejun@gmail.com>

ata_piix: verify SIDPR access before enabling it

On certain configurations (certain macbooks), even though all the
conditions for SIDPR access described in the datasheet are met,
actually reading those registers just returns 0 and have no effect on
write. Verify SIDPR is actually working before enabling it.

This is reported by Ryan Roth in bz#10512.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Ryan Roth <ryan.roth@ch2m.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 01ce2601 20-Apr-2008 Dan McGee <dpmcgee@gmail.com>

ata_piix: add Asus Eee 701 controller to short cable list

The drive is directly soldered to the controller, so there is no cable at
all. Remove the 40-wire assumption so the drive can operate at max speed.

Before patch:
$ dd if=/dev/sda of=/dev/null bs=2M count=64 iflag=direct
134217728 bytes (134 MB) copied, 5.29612 s, 25.3 MB/s

After patch:
$ dd if=/dev/sda of=/dev/null bs=2M count=64 iflag=direct
134217728 bytes (134 MB) copied, 3.94955 s, 34.0 MB/s

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 57c9efdf 07-Apr-2008 Tejun Heo <htejun@gmail.com>

libata: implement and use sata_std_hardreset()

Implement sata_std_hardreset(), which simply wraps around
sata_link_hardreset(). sata_std_hardreset() becomes new standard
hardreset method for sata_port_ops and sata_sff_hardreset() moves from
ata_base_port_ops to ata_sff_port_ops, which is where it really
belongs.

ata_is_builtin_hardreset() is added so that both
ata_std_error_handler() and ata_sff_error_handler() skip both builtin
hardresets if SCR isn't accessible.

piix_sidpr_hardreset() in ata_piix.c is identical to
sata_std_hardreset() in functionality and got replaced with the
standard function.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 9dadd45b 07-Apr-2008 Tejun Heo <htejun@gmail.com>

libata: move generic hardreset code from sata_sff_hardreset() to sata_link_hardreset()

sata_sff_hardreset() contains link readiness wait logic which isn't
SFF specific. Move that part into sata_link_hardreset(), which now
takes two more parameters - @online and @check_ready. Both are
optional. The former is out parameter for link onlineness after
reset. The latter is used to wait for link readiness after hardreset.

Users of sata_link_hardreset() is updated to use new funtionality and
ahci_hardreset() is updated to use sata_link_hardreset() instead of
sata_sff_hardreset(). This doesn't really cause any behavior change.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 9363c382 07-Apr-2008 Tejun Heo <htejun@gmail.com>

libata: rename SFF functions

SFF functions have confusing names. Some have sff prefix, some have
bmdma, some std, some pci and some none. Unify the naming by...

* SFF functions which are common to both BMDMA and non-BMDMA are
prefixed with ata_sff_.

* SFF functions which are specific to BMDMA are prefixed with
ata_bmdma_.

* SFF functions which are specific to PCI but apply to both BMDMA and
non-BMDMA are prefixed with ata_pci_sff_.

* SFF functions which are specific to PCI and BMDMA are prefixed with
ata_pci_bmdma_.

* Drop generic prefixes from LLD specific routines. For example,
bfin_std_dev_select -> bfin_dev_select.

The following renames are noteworthy.

ata_qc_issue_prot() -> ata_sff_qc_issue()
ata_pci_default_filter() -> ata_bmdma_mode_filter()
ata_dev_try_classify() -> ata_sff_dev_classify()

This rename is in preparation of separating SFF support out of libata
core layer. This patch strictly renames functions and doesn't
introduce any behavior difference.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 9c0bf675 26-Mar-2008 Tejun Heo <htejun@gmail.com>

ata_piix: kill ich6_sata_ahci and clean up

ich6_sata_ahci and ich6_sata are identical. Kill ich6_sata_ahci and
drop _ahci postfixes from controller ids, which doesn't really mean
anything at this point.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 5016d7d2 26-Mar-2008 Tejun Heo <htejun@gmail.com>

ata_piix: don't attach to ICH6M in ahci mode

ata_piix when attached to ICH6M in AHCI mode doesn't provide any
benefit over using ahci and has detection problems. Don't let
ata_piix claim ICH6M if it's in AHCI mode.

This change makes ICH6R the only one which ata_piix can attach to even
when it's in ahci mode which is necessary as some devices don't work
properly under ahci mode. Drop PIIX_FLAG_AHCI and match the
controller directly so that piix_disable_ahci() is called only for it.

This change makes PIIX_SCC no longer used and it gets dropped too.

This fixes bz 9491.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Robert M. Albrecht <romal@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# a1efdaba 24-Mar-2008 Tejun Heo <htejun@gmail.com>

libata: make reset related methods proper port operations

Currently reset methods are not specified directly in the
ata_port_operations table. If a LLD wants to use custom reset
methods, it should construct and use a error_handler which uses those
reset methods. It's done this way for two reasons.

First, the ops table already contained too many methods and adding
four more of them would noticeably increase the amount of necessary
boilerplate code all over low level drivers.

Second, as ->error_handler uses those reset methods, it can get
confusing. ie. By overriding ->error_handler, those reset ops can be
made useless making layering a bit hazy.

Now that ops table uses inheritance, the first problem doesn't exist
anymore. The second isn't completely solved but is relieved by
providing default values - most drivers can just override what it has
implemented and don't have to concern itself about higher level
callbacks. In fact, there currently is no driver which actually
modifies error handling behavior. Drivers which override
->error_handler just wraps the standard error handler only to prepare
the controller for EH. I don't think making ops layering strict has
any noticeable benefit.

This patch makes ->prereset, ->softreset, ->hardreset, ->postreset and
their PMP counterparts propoer ops. Default ops are provided in the
base ops tables and drivers are converted to override individual reset
methods instead of creating custom error_handler.

* ata_std_error_handler() doesn't use sata_std_hardreset() if SCRs
aren't accessible. sata_promise doesn't need to use separate
error_handlers for PATA and SATA anymore.

* softreset is broken for sata_inic162x and sata_sx4. As libata now
always prefers hardreset, this doesn't really matter but the ops are
forced to NULL using ATA_OP_NULL for documentation purpose.

* pata_hpt374 needs to use different prereset for the first and second
PCI functions. This used to be done by branching from
hpt374_error_handler(). The proper way to do this is to use
separate ops and port_info tables for each function. Converted.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 029cfd6b 24-Mar-2008 Tejun Heo <htejun@gmail.com>

libata: implement and use ops inheritance

libata lets low level drivers build ata_port_operations table and
register it with libata core layer. This allows low level drivers
high level of flexibility but also burdens them with lots of
boilerplate entries.

This becomes worse for drivers which support related similar
controllers which differ slightly. They share most of the operations
except for a few. However, the driver still needs to list all
operations for each variant. This results in large number of
duplicate entries, which is not only inefficient but also error-prone
as it becomes very difficult to tell what the actual differences are.

This duplicate boilerplates all over the low level drivers also make
updating the core layer exteremely difficult and error-prone. When
compounded with multi-branched development model, it ends up
accumulating inconsistencies over time. Some of those inconsistencies
cause immediate problems and fixed. Others just remain there dormant
making maintenance increasingly difficult.

To rectify the problem, this patch implements ata_port_operations
inheritance. To allow LLDs to easily re-use their own ops tables
overriding only specific methods, this patch implements poor man's
class inheritance. An ops table has ->inherits field which can be set
to any ops table as long as it doesn't create a loop. When the host
is started, the inheritance chain is followed and any operation which
isn't specified is taken from the nearest ancestor which has it
specified. This operation is called finalization and done only once
per an ops table and the LLD doesn't have to do anything special about
it other than making the ops table non-const such that libata can
update it.

libata provides four base ops tables lower drivers can inherit from -
base, sata, pmp, sff and bmdma. To avoid overriding these ops
accidentaly, these ops are declared const and LLDs should always
inherit these instead of using them directly.

After finalization, all the ops table are identical before and after
the patch except for setting .irq_handler to ata_interrupt in drivers
which didn't use to. The .irq_handler doesn't have any actual effect
and the field will soon be removed by later patch.

* sata_sx4 is still using old style EH and currently doesn't take
advantage of ops inheritance.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 68d1d07b 24-Mar-2008 Tejun Heo <htejun@gmail.com>

libata: implement and use SHT initializers

libata lets low level drivers build scsi_host_template and register it
to the SCSI layer. This allows low level drivers high level of
flexibility but also burdens them with lots of boilerplate entries.

This patch implements SHT initializers which can be used to initialize
all the boilerplate entries in a sht. Three variants of them are
implemented - BASE, BMDMA and NCQ - for different types of drivers.
Note that entries can be overriden by putting individual initializers
after the helper macro.

All sht tables are identical before and after this patch.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 6bd99b4e 24-Mar-2008 Tejun Heo <htejun@gmail.com>

libata: normalize port_info, port_operations and sht tables

Over the time, port info, ops and sht structures developed quite a bit
of inconsistencies. This patch updates drivers.

* Enable/disable_pm callbacks added to all ahci ops tables.

* Every driver for SFF controllers now uses ata_sff_port_start()
instead of ata_port_start() unless the driver has custom
implementation.

* Every driver for SFF controllers now uses ata_pci_default_filter()
unless the driver has custom implementation.

* Removed an odd port_info->sht initialization from ata_piix.c.
Likely a merge byproduct.

* A port which has ATA_FLAG_SATA set doesn't need to set cable_detect
to ata_cable_sata(). Remove it from via and mv port ops.

* Some drivers had unnecessary .max_sectors initialization which is
ignored and was missing .slave_destroy callback. Fixed.

* Removed unnecessary sht initializations port_info's.

* Removed onsolete scsi device suspend/resume callbacks from
pata_bf54x.

* No reason to set ata_pci_default_filter() and bmdma functions for
PIO-only drivers. Remove those callbacks and replace
ata_bmdma_irq_clear with ata_noop_irq_clear.

* pata_platform sets port_start to ata_dummy_ret0. port_start can
just be set to NULL.

* sata_fsl supports NCQ but was missing qc_defer. Fixed.

* pata_rb600_cf implements dummy port_start. Removed.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 3a2d5b70 23-Feb-2008 Rafael J. Wysocki <rjw@rjwysocki.net>

PM: Introduce PM_EVENT_HIBERNATE callback state

During the last step of hibernation in the "platform" mode (with the
help of ACPI) we use the suspend code, including the devices'
->suspend() methods, to prepare the system for entering the ACPI S4
system sleep state.

But at least for some devices the operations performed by the
->suspend() callback in that case must be different from its operations
during regular suspend.

For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
pass it to the device drivers' ->suspend() methods during the last phase
of hibernation, so that they can distinguish this case and handle it as
appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a
special way and need to handle PM_EVENT_HIBERNATE in the same way.

These changes are necessary to fix a hibernation regression related
to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 018d9827 13-Feb-2008 Harvey Harrison <harvey.harrison@gmail.com>

ata: fix sparse warning in ata_piix.c

drivers/ata/ata_piix.c:1655:8: warning: symbol 'rc' shadows an earlier one
drivers/ata/ata_piix.c:1616:6: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# bc5468f5 30-Jan-2008 Adrian Bunk <bunk@kernel.org>

ata_piix.c:piix_init_one() must be __devinit

This patch fixes the following section mismatches:

<-- snip -->

...
WARNING: drivers/ata/built-in.o(.text+0x15072): Section mismatch in reference from the function piix_init_one() to the function .devinit.text:piix_init_sata_map()
WARNING: drivers/ata/built-in.o(.text+0x150dd): Section mismatch in reference from the function piix_init_one() to the function .devinit.text:piix_init_pcs()
WARNING: drivers/ata/built-in.o(.text+0x150e5): Section mismatch in reference from the function piix_init_one() to the function .devinit.text:piix_init_sidpr()
WARNING: drivers/ata/built-in.o(.text+0x15107): Section mismatch in reference from the function piix_init_one() to the function .devinit.text:piix_check_450nx_errata()
...

<-- snip -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 1967b7ff 03-Feb-2008 Joe Perches <joe@perches.com>

drivers/ata/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>


# 4a537a55 28-Jan-2008 Adrian Bunk <bunk@kernel.org>

ata_piix.c: make piix_merge_scr() static

piix_merge_scr() can become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# bf7f22b9 28-Jan-2008 Jason Gaston <jason.d.gaston@intel.com>

ata_piix: IDE mode SATA patch for Intel ICH10 DeviceID's

This patch adds the Intel ICH10 IDE mode SATA Controller DeviceID's.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c7290724 18-Jan-2008 Tejun Heo <htejun@gmail.com>

ata_piix: implement SIDPR SCR access

For ICH8, SCRs can be accessed using index and data register pair
located at BAR 5. This patch implements support for it such that PHY
status, errors and hardreset are available for those controllers.

This is the only case where two devices on a PATA channel have access
to SCRs and creates a unique problem of mapping two SCRs to one link.
Note that this is different from PMP case in that they aren't quite
separate links - e.g. softreset resets both devices.

This problem is worked around by merging the SCR values. To upper
layer, it looks like there is a single link with one set of SCRs but
with two devices. This works well enough for PHY event, error
reporting and hardreset.

Supporting hardreset is important because in rare cases SATA devices
fail to recover without it after PHY errors.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 8b09f0da 18-Jan-2008 Tejun Heo <htejun@gmail.com>

ata_piix: convert to prepare - activate initialization

ata_piix requires more configuration during initialization than most
other SFF compliant controllers and one-go initialzation with
ata_pci_one() is too rigid.

This patch converts ata_piix to use two step prepare - activate
initialization used by other more advanced controllers. This
conversion brings the happy side effect of enabling PCI device before
accessing PCI configuration registers. Other than that, there
shouldn't be any behavior change.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 723159c5 04-Jan-2008 Tejun Heo <htejun@gmail.com>

ata_piix: kill unused constants and flags

Kill PIIX_FLAG_SCR, PIIX_PORT_ENABLED and PIIX_PORT_PRESENT. These
are unused.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 9cde9ed1 24-Nov-2007 Tejun Heo <htejun@gmail.com>

ata_piix: separate controller IDs into separate enum

Separate controller IDs into a separate enum as Jeff requested.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# ffe188dd 17-Jan-2008 Peter Schwenke <peter@bluetoad.com.au>

ata_piix: Add Toshiba Satellite R20 and Tecra M6 to broken suspend list.

Add Toshiba Satellite R20 and Tecra M6 to broken suspend list. Matt
Piermarini reported and provided the M6 patch. This is from OSDL bug 7780.

Signed-off-by: Peter Schwenke <peter@bluetoad.com.au>
Cc: Matt Piermarini <mattpiermarini@yahoo.com>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 25f98131 07-Jan-2008 Tejun Heo <htejun@gmail.com>

ata_piix: ignore ATA_DMA_ERR on vmware ich4

VMware ich4 emulation incorrectly sets DMA_ERR on TF error. Ignore
it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# d1aa690a 04-Dec-2007 Peter Schwenke <peter@bluetoad.com.au>

ata_piix: add Toshiba Tecra M4 to broken suspend list

Add Toshiba Tecra M4 to broken suspend list. This is from OSDL
bugzilla bug 7780.

Signed-off-by: Peter Schwenke <peter@bluetoad.com.au>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 04d86d6f 29-Nov-2007 Peter Schwenke <peter@bluetoad.com.au>

ata_piix: add more toshiba laptops to broken suspend list

Add more toshiba laptops to broken suspend list. This is from OSDL
bugzilla bug 7780.

tj: re-formatted patch and added description and SOB.

Signed-off-by: Peter Schwenke <peter@bluetoad.com.au>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c47a631f 19-Nov-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

ata_piix: Invalid use of writel/readl with iomap

Should use ioread* as discussed previously

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# a0ce9aca 18-Nov-2007 Tejun Heo <htejun@gmail.com>

ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3

ICH8 and 9 use two SFF controllers to show 6 SATA ports. The first
controllre hosts the first 4 ports while the second one hosts the last
2. The PCS register of the first controller encompasses the first
four ports or all six ports depending on configuration while PCS of
the second controller controls the last two ports. Using 0xf for the
first controller and 0x3 for the second controller always result in
the correct configuration.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# 8d8ef2fb 18-Nov-2007 Thomas Rohwer <tr@tng.de>

ata_piix: only enable the first port on apple macbook pro

ICH8M on apple macbook pro occasionally locks up completely during PCS
initialization if ports other than the first one are enabled. Add a
separate controller ID and only enable the first port.

tj: commit description added and patch updated to fit with the
previous controller ID update.

Signed-off-by: Thomas Rohwer <tr@tng.de>
Signed-off-by: Tejun Heo <htejun@gmail.com>


# 00242ec8 18-Nov-2007 Tejun Heo <htejun@gmail.com>

ata_piix: reorganize controller IDs

Move piix_pata_mwdma to top, rename ich9_2port_sata to ich8_2port_sata
for consistency and use automatically incremented values instead of
assigning fixed values to ease adding new controller IDs.

Signed-off-by: Tejun Heo <htejun@gmail.com>


# de753e5e 12-Nov-2007 Tejun Heo <htejun@gmail.com>

ata_piix: add SATELLITE U205 to broken suspend list

Satellite U205 has alternate product name where the satellite part is
all capatalized. Add it to the blacklist.

This is reported by Ross Patterson in kernel bugzilla bug #7780.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Ross Patterson <me@rpatterson.net>


# 62320e23 06-Nov-2007 Yann Chachkoff <yann.chachkoff@myrealbox.com>

ata_piix: add SATELLITE PRO U200 to broken suspend list

Please warmly welcome the PRO variant of Satellite U200 to the broken
suspend list.

Original patch is from Yann Chachkoff. Patch reformatted and
forwarded by Tejun Heo.

Signed-off-by: Yann Chachkoff <yann.chachkoff@myrealbox.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 2655e2ce 05-Nov-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

ata_piix: Add additional PCI identifier for 40 wire short cable

Keeping the list in sync with the old IDE driver

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 7f2803d0 05-Nov-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

ata_piix: Add additional PCI identifier for 40 wire short cable

Keeping the list in sync with the old IDE driver

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 2dcb407e 19-Oct-2007 Jeff Garzik <jeff@garzik.org>

[libata] checkpatch-inspired cleanups

Tackle the relatively sane complaints of checkpatch --file.

The vast majority is indentation and whitespace changes, the rest are

* #include fixes
* printk KERN_xxx prefix addition
* BSS/initializer cleanups

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 8f73a688 11-Oct-2007 Jason Gaston <jason.d.gaston@intel.com>

ata_piix: SATA 2port controller port map fix

This patch adds a port map for ICH9 and ICH8 SATA controllers that have only 2 ports available in that mode.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# b4482a4b 14-Oct-2007 Al Viro <viro@ftp.linux.org.uk>

more trivial signedness fixes in drivers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 54174db3 29-Sep-2007 Jeff Garzik <jeff@garzik.org>

[libata] ata_piix: add HP compaq laptop to short cable list

Reported by Andreas Messer.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# e2d352af 07-Sep-2007 Jason Gaston <jason.d.gaston@intel.com>

ata_piix: replace spaces with tabs

This patch removes some incorrect formatting spaces and replaces them with tabs.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# ec300d99 01-Sep-2007 Jeff Garzik <jeff@garzik.org>

[libata] ata_piix: Use more-robust form of array initialization

Use a form of array init that is less fragile, less sensitive to trivial
typos and ordering mismatches.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# ac8869d5 16-Aug-2007 Jeff Garzik <jeff@garzik.org>

[libata] Remove ->port_disable() hook

It was always set to ata_port_disable(). Removed the hook, and replaced
the very few ap->ops->port_disable() callsites with direct calls to
ata_port_disable().

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 6d32d30f 15-Aug-2007 Jeff Garzik <jeff@garzik.org>

[libata] Remove ->irq_ack() hook, and ata_dummy_irq_on()

* ->irq_ack() is redundant to what the irq handler already
performs... chk-status + irq-clear. Furthermore, it is only
called in one place, when screaming-irq-debugging is enabled,
so we don't want to bother with a hook just for that.

* ata_dummy_irq_on() is only ever used in drivers that have
no callpath reaching ->irq_on(). Remove .irq_on hook from
those drivers, and the now-unused ata_dummy_irq_on()

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 2eb829e9 10-Aug-2007 Christian Lamparter <chunkeey@web.de>

ata_piix: disallow UDMA 133 on ICH5 & ICH7

There is another outstanding issue with ata_piix.c. Intel has never
officially supported anything faster than PATA 100MB/s.

But, the ata_piix.c driver "define" the ICH5 & ICH7 as UDMA6 (aka 133MB/s)
capable. [ Well, no one has probably noticed it before, because there is bug
in do_pata_set_dmamode... Just look at
libata_atapiix_enable_real_udma133.patch and you'll see what wrong with it. ]

Here are Intel's datasheets for the affected chipsets: ICH5 Datasheet:
http://www.intel.com/design/chipsets/datashts/252516.htm (See note on page
183: "... the ICH5 supports reads at the maximum rate of 100MB/s.")

ICH7 Datasheet: http://www.intel.com/design/chipsets/datashts/307013.htm (See
first note on page 190: "... the ICH7 supports reads at the maximum rate of
100MB/s.")

They are two different ways to deal with it:

- Either -

1. replace all ich_pata_133 with ich_pata_100.
(libata_atapiix_disable_udma6.diff - diff from 2.6.22 )

- Or -

2. keep all ich_pata_133 and fix the bug in "do_pata_set_dmamode".
(libata_atapiix_enable_real_udma133.patch - diff from 2.6.22) If there are
any concerns about the safety of the patch patch:
http://lkml.org/lkml/2007/7/6/292 (It was already tested by an Intel
employee, but I guess a bit more user input is necessary here... )

This patch implements 1.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# cc0680a5 06-Aug-2007 Tejun Heo <htejun@gmail.com>

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 <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 1855256c 03-Oct-2007 Jeff Garzik <jeff@garzik.org>

drivers/firmware: const-ify DMI API and internals

Three main sets of changes:

1) dmi_get_system_info() return value should have been marked const,
since callers should not be changing that data.

2) const-ify DMI internals, since DMI firmware tables should,
whenever possible, be marked const to ensure we never ever write to
that data area.

3) const-ify DMI API, to enable marking tables const where possible
in low-level drivers.

And if we're really lucky, this might enable some additional
optimizations on the part of the compiler.

The bulk of the changes are #2 and #3, which are interrelated. #1 could
have been a separate patch, but it was so small compared to the others,
it was easier to roll it into this changeset.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


# 4c74d4ec 30-Sep-2007 Tejun Heo <htejun@gmail.com>

ata_piix: add another TECRA M3 entry to broken suspend list

There's a different version of DMI table for TECRA M3 where it has
proper vendor and product name entry. Add the entry to the broken
suspend list.

Angus Turnbull reported and provided initial patch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Angus Turnbull <angus@twinhelix.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 7d051548 01-Sep-2007 Jeff Garzik <jeff@garzik.org>

[libata] ata_piix: properly terminate DMI system list

If you don't terminate a list, bad things happen...

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 2a3103ce 31-Aug-2007 Jeff Garzik <jeff@garzik.org>

[libata] Bump driver versions

Bump the versions for drivers that were modified, but had not already
had a version number bump.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 43a98f05 22-Aug-2007 Tejun Heo <htejun@gmail.com>

ata_piix: implement IOCFG bit18 quirk

Some notebooks need bit18 of IOCFG to be cleared for the drive bay to
work even though the bit is NOOP according to the datasheet. This
patch implement IOCFG bit18 quirk and apply it to Clevo M570U.

http://bugzilla.kernel.org/show_bug.cgi?id=8051

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: D. Angelis <dangelis@beta-cae.gr>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 3cc0b9d3 24-Aug-2007 Tejun Heo <htejun@gmail.com>

ata_piix: add Satellite U200 to broken suspend list

Satellite U200 also shares the problem. Add it to the broken suspend
list. Original patch from John Schember.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: John Schember <john@nachtimwald.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c5cf0ffa 30-Aug-2007 Jason Gaston <jason.d.gaston@intel.com>

ata_piix: IDE mode SATA patch for Intel Tolapai

Resend trying to remove 8-bit characters in the email.

This patch adds the Intel Tolapai IDE mode SATA controller DID's.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 5c08ea01 14-Aug-2007 Tejun Heo <htejun@gmail.com>

ata_piix: add TECRA M7 to broken suspend list

Add TECRA M7 to broken suspend list. Reported by Marie Koreen.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Marie Koreen <kbug@koreen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# ac2b0437 06-Aug-2007 Tejun Heo <htejun@gmail.com>

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 <htejun@gmail.com>
Cc: <Kristen Carlson Accardi> kristen.c.accardi@intel.com
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 7abe79c3 26-Jul-2007 Tejun Heo <htejun@gmail.com>

ata_piix: add Tecra M3 to broken suspend blacklist

Add Tecra M3 to the broken suspend blacklist. Tecra M3 doesn't have
proper DMI_PRODUCT_NAME but has an OEM_STRING instead. Match it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 8c3832eb 26-Jul-2007 Tejun Heo <htejun@gmail.com>

ata_piix: implement piix_borken_suspend()

Separate out broken suspend blacklist matching into
piix_broken_suspend().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 0b62e13b 26-Jul-2007 Tejun Heo <htejun@gmail.com>

pci: rename __pci_reenable_device() to pci_reenable_device()

Rename __pci_reenable_device() to pci_reenable_device().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# b8b275ef 10-Jul-2007 Tejun Heo <htejun@gmail.com>

ata_piix: fix suspend/resume for some TOSHIBA laptops

ACPI implementations in several TOSHIBA laptops are weird and burn cpu
cycles for tens of seconds while trying to suspend if the PCI device
for the ATA controller is disabled when the ACPI suspend is called.

This patch uses DMI to match those machines and bypass device disable
on those machines during suspend. As the device needs to be put into
enabled state on resume without affecting PCI enable count, matching
resume callback uses __pci_reenable_device().

This bug is reported in bugzilla bug 7780.

http://bugzilla.kernel.org/show_bug.cgi?id=7780

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# e04b3b9d 10-Jul-2007 Tejun Heo <htejun@gmail.com>

ata_piix: kill incorrect invalid map value warning

The last two slots of MAP 00b of ich6m was incorrectly marked as
reserved. This is left over from converting the entry to allow 00b.
This causes no real problem. It only makes the driver print annoying
warning message. Fix it.

[patch also proferred by Pierre Tardy at the end of 2006 -jg]

Signed-off-by: Tejun Heo <htejun@gmail.com>
--
drivers/ata/ata_piix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 44c10138 08-Jun-2007 Auke Kok <auke-jan.h.kok@intel.com>

PCI: Change all drivers to use pci_device->revision

Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.

This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.

In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.

Compile tested with make all{yes,mod}config on x86_64 and i386.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# bf6263a8 08-Jul-2007 Jeff Garzik <jeff@garzik.org>

[libata] Use ATA_UDMAx standard masks when filling driver's udma_mask info

The ATA_UDMAx masks are self-documenting, and far better than manually
writing in the hex mask.

Note that pata_it8213 mask differed from the comment. Added a FIXME there.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c1e6f28c 03-Jul-2007 Christian Lamparter <chunkeey@web.de>

Add a PCI ID for santa rosa's PATA controller.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# a5bf5f5a 25-May-2007 Tejun Heo <htejun@gmail.com>

ata_piix: fix pio/mwdma programming

Fix various bugs in pio/mwdma mode programming.

* Control bits in the timing register wasn't cleared properly while
programming PIO mode.

* MWDMA mode programming cleared the wrong part of control bits.

* MWDMA mode programming cleared udma_mask even when the controller
doesn't support UDMA.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Art Haas <ahaas@airmail.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# b33620f9 22-May-2007 Tejun Heo <htejun@gmail.com>

ata_piix: add short 40c quirk for Acer Aspire 2030, take #2

Acer Aspire 2023WLMi uses short 40c cable. Add quirk for it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Steve H. <mail.pandor@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 2f91d81d 21-May-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

ata_piix: clean up

With cable methods in place we don't need a custom error handler for SATA
so get rid of it

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 1626aeb8 03-May-2007 Tejun Heo <htejun@gmail.com>

libata: clean up SFF init mess

The intention of using port_mask in SFF init helpers was to eventually
support exoctic configurations such as combination of legacy and
native port on the same controller. This never became actually
necessary and the related code always has been subtly broken one way
or the other. Now that new init model is in place, there is no reason
to make common helpers capable of handling all corner cases. Exotic
cases can simply dealt within LLDs as necessary.

This patch removes port_mask handling in SFF init helpers. SFF init
helpers don't take n_ports argument and interpret it into port_mask
anymore. All information is carried via port_info. n_ports argument
is dropped and always two ports are allocated. LLD can tell SFF to
skip certain port by marking it dummy. Note that SFF code has been
treating unuvailable ports this way for a long time until recent
breakage fix from Linus and is consistent with how other drivers
handle with unavailable ports.

This fixes 1-port legacy host handling still broken after the recent
native mode fix and simplifies SFF init logic. The following changes
are made...

* ata_pci_init_native_host() and ata_init_legacy_host() both now try
to initialized whatever they can and mark failed ports dummy. They
return 0 if any port is successfully initialized.

* ata_pci_prepare_native_host() and ata_pci_init_one() now doesn't
take n_ports argument. All info should be specified via port_info
array. Always two ports are allocated.

* ata_pci_init_bmdma() exported to be used by LLDs in exotic cases.

* port_info handling in all LLDs are standardized - all port_info
arrays are const stack variable named ppi. Unless the second port
is different from the first, its port_info is specified as NULL
(tells libata that it's identical to the last non-NULL port_info).

* pata_hpt37x/hpt3x2n: don't modify static variable directly. Make an
on-stack copy instead as ata_piix does.

* pata_uli: It has 4 ports instead of 2. Don't use
ata_pci_prepare_native_host(). Allocate the host explicitly and use
init helpers. It's simple enough.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 9666f400 04-May-2007 Tejun Heo <htejun@gmail.com>

libata: reimplement suspend/resume support using sdev->manage_start_stop

Reimplement suspend/resume support using sdev->manage_start_stop.

* Device suspend/resume is now SCSI layer's responsibility and the
code is simplified a lot.

* DPM is dropped. This also simplifies code a lot. Suspend/resume
status is port-wide now.

* ata_scsi_device_suspend/resume() and ata_dev_ready() removed.

* Resume now has to wait for disk to spin up before proceeding. I
couldn't find easy way out as libata is in EH waiting for the
disk to be ready and sd is waiting for EH to complete to issue
START_STOP.

* sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
This fixes spindown on shutdown and suspend-to-disk.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# d4b2bab4 02-Feb-2007 Tejun Heo <htejun@gmail.com>

libata: add deadline support to prereset and reset methods

Add @deadline to prereset and reset methods and make them honor it.
ata_wait_ready() which directly takes @deadline is implemented to be
used as the wait function. This patch is in preparation for EH timing
improvements.

* ata_wait_ready() never does busy sleep. It's only used from EH and
no wait in EH is that urgent. This function also prints 'be
patient' message automatically after 5 secs of waiting if more than
3 secs is remaining till deadline.

* ata_bus_post_reset() now fails with error code if any of its wait
fails. This is important because earlier reset tries will have
shorter timeout than the spec requires. If a device fails to
respond before the short timeout, reset should be retried with
longer timeout rather than silently ignoring the device.

There are three behavior differences.

1. Timeout is applied to both devices at once, not separately. This
is more consistent with what the spec says.

2. When a device passes devchk but fails to become ready before
deadline. Previouly, post_reset would just succeed and let
device classification remove the device. New code fails the
reset thus causing reset retry. After a few times, EH will give
up disabling the port.

3. When slave device passes devchk but fails to become accessible
(TF-wise) after reset. Original code disables dev1 after 30s
timeout and continues as if the device doesn't exist, while the
patched code fails reset. When this happens, new code fails
reset on whole port rather than proceeding with only the primary
device.

If the failing device is suffering transient problems, new code
retries reset which is a better behavior. If the failing device is
actually broken, the net effect is identical to it, but not to the
other device sharing the channel. In the previous code, reset would
have succeeded after 30s thus detecting the working one. In the new
code, reset fails and whole port gets disabled. IMO, it's a
pathological case anyway (broken device sharing bus with working
one) and doesn't really matter.

* ata_bus_softreset() is changed to return error code from
ata_bus_post_reset(). It used to return 0 unconditionally.

* Spin up waiting is to be removed and not converted to honor
deadline.

* To be on the safe side, deadline is set to 40s for the time being.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# eb4a2c7f 10-Apr-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

pata: cable methods

Versus upstream as requested

Last of the trivial switches to cable_detect methods.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 12340106 28-Mar-2007 Robin H\. Johnson <robbat2@gentoo.org>

Add notation that the Asus W5F laptop has a short cable instead of 80-wire.

The Asus W5F laptop uses a short cable instead of the 80-wire style, and thus
needs to be in the ich_laptop special cases for correct detection and support
of UDMA/100 for the hard drive. I noticed this because I have the W5F laptop,
and was tracing apparent slowness.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 9a2eb709 07-Mar-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

ata_piix: Remove ugly layering violation

A while ago I modified the libata code so that drivers can return -ENOENT
for unknown ports not fiddle with the EH flags and print stuff directly.
Somewhere along the line ata_piix didn't get fully converted.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 438ac6d5 02-Mar-2007 Tejun Heo <htejun@gmail.com>

libata: add missing CONFIG_PM in LLDs

Add missing #ifdef CONFIG_PM conditionals around all PM related parts
in libata LLDs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# cb48cab7 26-Feb-2007 Jeff Garzik <jeff@garzik.org>

[libata] bump versions

Bump versions based on changes submitted during 2.6.21 merge window.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# ec091503 23-Feb-2007 Jeff Garzik <jeff@garzik.org>

[libata] ata_piix: remove duplicate PCI IDs

Duplicate ids noticed by Kay Sievers <kay.sievers@suse.de>

Although 100% different, this is based on a patch by Greg Kroah-Hartman
<gregkh@suse.de>

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 66efc5a7 06-Feb-2007 Jeff Garzik <jeff@garzik.org>

libata: kill ATA_ENABLE_PATA

The ATA_ENABLE_PATA define was never meant to be permanent, and in
recent kernels, it's already been unconditionally enabled. Remove.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 246ce3b6 26-Jan-2007 Akira Iguchi <akira2.iguchi@toshiba.co.jp>

libata: add another IRQ calls (libata drivers)

This patch is against each libata driver.

Two IRQ calls are added in ata_port_operations.
- irq_on() is used to enable interrupts.
- irq_ack() is used to acknowledge a device interrupt.

In most drivers, ata_irq_on() and ata_irq_ack() are used for
irq_on and irq_ack respectively.

In some drivers (ex: ahci, sata_sil24) which cannot use them
as is, ata_dummy_irq_on() and ata_dummy_irq_ack() are used.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 0d5ff566 31-Jan-2007 Tejun Heo <htejun@gmail.com>

libata: convert to iomap

Convert libata core layer and LLDs to use iomap.

* managed iomap is used. Pointer to pcim_iomap_table() is cached at
host->iomap and used through out LLDs. This basically replaces
host->mmio_base.

* if possible, pcim_iomap_regions() is used

Most iomap operation conversions are taken from Jeff Garzik
<jgarzik@pobox.com>'s iomap branch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 24dc5f33 20-Jan-2007 Tejun Heo <htejun@gmail.com>

libata: update libata LLDs to use devres

Update libata LLDs to use devres. Core layer is already converted to
support managed LLDs. This patch simplifies initialization and fixes
many resource related bugs in init failure and detach path. For
example, all converted drivers now handle ata_device_add() failure
gracefully without excessive resource rollback code.

As most resources are released automatically on driver detach, many
drivers don't need or can do with much simpler ->{port|host}_stop().
In general, stop callbacks are need iff port or host needs to be given
commands to shut it down. Note that freezing is enough in many cases
and ports are automatically frozen before being detached.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# dedf61db 10-Jan-2007 Andrew Morton <akpm@osdl.org>

libata piix3 support warning fix

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# d2cdfc0d 10-Jan-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

libata: PIIX3 support

This I believe completes the PIIX range of support for libata

This adds the table entries needed for the PIIX3, both a new PCI
identifier and a new mode list. It also fixes an erroneous access to PCI
configuration 0x48 on non UDMA capable chips.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# babfb682 08-Jan-2007 J J <jakub007@go2.pl>

ata_piix: add ICH7 on Acer 3682WLMi to laptop list

In Acer Aspire hdd is connected to ICH7 via 40c cable, however it is
short cable and it is UDMA66 capable.

Signed-off-by: J J <jakub007@go2.pl>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# f20b16ff 11-Dec-2006 Jeff Garzik <jeff@garzik.org>

[libata] trim trailing whitespace

Most of these contributed by that mysterious figger known as A.C.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 14719f32 07-Feb-2007 Greg Kroah-Hartman <gregkh@suse.de>

Revert "PCI: remove duplicate device id from ata_piix"

This reverts commit b11056355ea149c37edf0ef54976a49f5258cd54.

It was incorrect, the proper fix is coming through the SATA tree, sorry
about that.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# b1105635 25-Jan-2007 Greg Kroah-Hartman <gregkh@suse.de>

PCI: remove duplicate device id from ata_piix

As pointed out by Kay Sievers <kay.sievers@suse.de>

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# fae07dc3 11-Dec-2006 Tejun Heo <htejun@gmail.com>

[PATCH] ata_piix: use piix_host_stop() in ich_pata_ops

piix_init_one() allocates host private data which should be freed by
piix_host_stop(). ich_pata_ops wasn't converted to piix_host_stop()
while merging, leaking 4 bytes on driver detach. Fix it.

This was spotted using Kmemleak by Catalin Marinas.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Catalin Marinas <catalin.marinas@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# f98b6573 07-Dec-2006 Jason Gaston <jason.d.gaston@intel.com>

[PATCH] ata_piix: IDE mode SATA patch for Intel ICH9

This updated patch adds the Intel ICH9 IDE mode SATA controller DID's.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Acked-by: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 2c5ff671 04-Dec-2006 Alan Cox <alan@lxorguk.ukuu.org.uk>

[PATCH] trivial piix: swap bogus dot for comma space

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 800b3996 03-Dec-2006 Tejun Heo <htejun@gmail.com>

[PATCH] libata: always use polling IDENTIFY

libata switched to IRQ-driven IDENTIFY when IRQ-driven PIO was
introduced. This has caused a lot of problems including device
misdetection and phantom device.

ATA_FLAG_DETECT_POLLING was added recently to selectively use polling
IDENTIFY on problemetic drivers but many controllers and devices are
affected by this problem and trying to adding ATA_FLAG_DETECT_POLLING
for each such case is diffcult and not very rewarding.

This patch makes libata always use polling IDENTIFY. This is
consistent with libata's original behavior and drivers/ide's behavior.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 5e56a37c 10-Nov-2006 Tejun Heo <htejun@gmail.com>

[PATCH] ata_piix: strip now unneded MAP related stuff

Now that PCS isn't used for device detection anymore...

* esb_sata is identical to ich5_sata
* no reason to know present_shift
* no reason to store map_db in host private area

The MAP table itself is left because it can be used for SCR access.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 228c1590 10-Nov-2006 Tejun Heo <htejun@gmail.com>

[PATCH] ata_piix: apply device detection via polling IDENTIFY

PATA PIIX uses reset signature + TF r/w test for device presence
detection, which doesn't always work. It sometimes reports phantom
device which results in IDENTIFY timeouts.

SATA PIIX uses some combination of PCS + reset signature + TF r/w test
for device presence detection. No combination satifies all and for
some controllers, there doesn't seem to be any combination which
works reliably.

This patch makes both PATA and SATA piix's use reset signature + TF
r/w + polling IDENTIFY for device detection. This is what the old
libata (before irq-pio and new EH) did and what IDE does.

This patch also removes now obsolete PIIX_FLAG_IGNORE_PCS, force_pcs
and related code.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# b3362f88 10-Nov-2006 Tejun Heo <htejun@gmail.com>

[PATCH] ata_piix: clean up port flags

* move common flags into PIIX_PATA_FLAGS and PIIX_SATA_FLAGS
* kill unnecessary ATA_FLAG_SRST

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# fc085150 10-Oct-2006 Alan Cox <alan@lxorguk.ukuu.org.uk>

[PATCH] libata: add 40pin "short" cable support, honour drive side speed detection

[deweerdt@free.fr: build fix]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Frederik Deweerdt <deweerdt@free.fr>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 732f74a4 01-Nov-2006 Jeff Garzik <jeff@garzik.org>

Revert "[PATCH] Add 0x7110 piix to ata_piix.c"

This reverts commit f833229c96c0bf53c05995e4bd58709d9e9edd67:

According to reviewers and the lspci data provided in commit message
itself, PCI ID 0x7110 should not have been added to ata_piix.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c6446a4c 08-Oct-2006 Tejun Heo <htejun@gmail.com>

[PATCH] ata_piix: allow 01b MAP for both ICH6M and ICH7M

ICH7M was separated from ICH6M to allow undocumented MAP value 01b
which was spotted on an ASUS notebook. However, there is also
notebooks with MAP value 01b on ICH6M. This patch re-merges ICH6M and
ICH7M entries and allows MAP value 01b for both.

This problem has been reported and initial patch provided by Jonathan
Dieter.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jonathan Dieter <jdieter@gmail.com>
Cc: Tom Deblauwe <tom.deblauwe@telenet.be>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# f833229c 31-Oct-2006 Jens Axboe <jens.axboe@oracle.com>

[PATCH] Add 0x7110 piix to ata_piix.c

Hi Jeff,

I tested the PATA support on my old VAIO notebook, and it failed to find
my piix device:

00:07.1 Class 0101: 8086:7111 (rev 01) (prog-if 80 [Master])
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Region 4: I/O ports at fc90 [size=16]

This patch adds the pci id to ata_piix.c and things then work as
expected.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 158f30c8 19-Oct-2006 Kristen Carlson Accardi <kristen.c.accardi@intel.com>

[PATCH] libata: use correct map_db values for ICH8

Use valid values for ICH8 map_db. With the old values, when the
controller was in Native mode, and SCC was 1 (drives configured for
IDE), any drive plugged into a slave port was not recognized. For
Combined Mode (and SCC is still 1), 2 is a value value for MAP.map_value,
and needs to be recognized.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c961922b 26-Sep-2006 Alan Cox <alan@lxorguk.ukuu.org.uk>

[PATCH] libata-eh: Remove layering violation and duplication when handling absent ports

This removes the layering violation where drivers have to fiddle
directly with EH flags. Instead we now recognize -ENOENT means "no port"
and do the handling in the core code.

This also removes an instance of a call to disable the port, and an
identical printk from each driver doing this. Even better - future rule
changes will be in one place only.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c32a8fd7 25-Sep-2006 Henrik Kretzschmar <henne@nachtwindheim.de>

[PATCH] ata-piix: fixes kerneldoc error

Fixes an error in kerneldoc of ata_piix.c.
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# b0fea350 12-Sep-2006 Jeff Garzik <jeff@garzik.org>

[libata] ata_piix: build fix

Spotted by Andrew Morton.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 85cd7251 30-Aug-2006 Jeff Garzik <jeff@garzik.org>

[libata #pata-drivers] Trim trailing whitespace.


# 669a5db4 29-Aug-2006 Jeff Garzik <jeff@garzik.org>

[libata] Add a bunch of PATA drivers.

The vast majority of drivers and changes are from Alan Cox. Albert Lee
contributed and maintains pata_pdc2027x. Adrian Bunk, Andrew Morton,
and Tejun Heo contributed various minor fixes and updates.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# cca3974e 24-Aug-2006 Jeff Garzik <jeff@garzik.org>

libata: Grand renaming.

The biggest change is that ata_host_set is renamed to ata_host.

* ata_host_set => ata_host
* ata_probe_ent->host_flags => ata_probe_ent->port_flags
* ata_probe_ent->host_set_flags => ata_probe_ent->_host_flags
* ata_host_stats => ata_port_stats
* ata_port->host => ata_port->scsi_host
* ata_port->host_set => ata_port->host
* ata_port_info->host_flags => ata_port_info->flags
* ata_(.*)host_set(.*)\(\) => ata_\1host\2()

The leading underscore in ata_probe_ent->_host_flags is to avoid
reusing ->host_flags for different purpose. Currently, the only user
of the field is libata-bmdma.c and probe_ent itself is scheduled to be
removed.

ata_port->host is reused for different purpose but this field is used
inside libata core proper and of different type.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>


# 24dd01bf 14-Aug-2006 Jeff Garzik <jeff@garzik.org>

[libata] ata_piix: add missing kfree()

Noticed by Andrew Morton.

Signed-off-by: Jeff Garzik <jeff@garzik.org>


# c6fd2807 10-Aug-2006 Jeff Garzik <jeff@garzik.org>

Move libata to drivers/ata.