Commit Graph

2445 Commits (b0e73af78a1ceeeabf2bb30e798ecf55243edba8)

Author SHA1 Message Date
H Hartley Sweeten b0e73af78a libata-transport.c: local functions should not be exposed globally
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.

This quiets the sparse warnings:

warning: symbol 'ata_is_port' was not declared. Should it be static?
warning: symbol 'ata_is_link' was not declared. Should it be static?
warning: symbol 'ata_is_ata_dev' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 15:14:55 -04:00
Thang Q. Nguyen 3a8b788f61 sata_dwc_460ex: support hardreset
The hardreset operation is currently not supported. This causes
sometime the SATA driver does cause kernel crash because of
none-determined state.a This patch will fix the issue.

Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 15:13:53 -04:00
Axel Lin 2fc75da0c5 ata: use module_pci_driver
This patch converts the drivers in drivers/ata/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>
Cc: Mark Lord <kernel@teksavvy.com>
Cc: Jeremy Higdon <jeremy@sgi.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 15:12:11 -04:00
Julia Lawall b08f5bc404 drivers/ata/pata_pcmcia.c: adjust suspicious bit operation
IO_DATA_PATH_WIDTH_8 is 0, so a bit-and with it is always false.  The
value IO_DATA_PATH_WIDTH covers the bits of the IO_DATA_PATH constants, so
first pick those bits and then make the test using !=.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 15:06:20 -04:00
Fabio Estevam a18dada08e pata_imx: Convert to clk_prepare_enable/clk_disable_unprepare
With the new i.mx clock framework, we need to use
clk_prepare_enable/clk_disable_unprepare.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 15:05:43 -04:00
Mark Nelson ff0173c1a3 ahci: Enable SB600 64bit DMA on MSI K9AGM2 (MS-7327) v2
Like e65cc194f7 (ahci: Enable SB600 64bit
DMA on MSI K9A2 Platinum) and 3c4aa91f21
(ahci: Enable SB600 64bit DMA on Asus M3A), this patch enables 64bit DMA
for the AHCI SATA controller of another board that has the SB600
southbridge.

In this case though we're enabling 64bit DMA for another MSI motherboard,
the K9AGM2 or MS-7327. It is new enough that all of the BIOS releases
since the initial release (1.0 from 2007-02-09) work correctly with 64bit
DMA enabled.

Signed-off-by: Mark Nelson <mdnelson8@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 14:39:35 -04:00
Daniel J Blueman c531077f40 [libata] Prevent interface errors with Seagate FreeAgent GoFlex
When using my Seagate FreeAgent GoFlex eSATAp external disk enclosure,
interface errors are always seen until 1.5Gbps is negotiated [1]. This
occurs using any disk in the enclosure, and when the disk is connected
directly with a generic passive eSATAp cable, we see stable 3Gbps
operation as expected.

Blacklist 3Gbps mode to avoid dataloss and the ~30s delay bus reset
and renegotiation incurs.

Signed-off-by: Daniel J Blueman <daniel@quora.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 14:34:42 -04:00
Lin Ming e91df93ebd libata-acpi: add missing inlines in libata.h
Adds inline for ata_acpi_unregister/ata_acpi_bind/ata_acpi_unbind
in drivers/ata/libata.h for !CONFIG_ATA_ACPI to fix below warnings.

warning: 'ata_acpi_unregister' defined but not used [-Wunused-function]
warning: 'ata_acpi_bind' defined but not used [-Wunused-function]
warning: 'ata_acpi_unbind' defined but not used [-Wunused-function]

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-07-25 14:15:03 -04:00
Aaron Lu 166a2967b4 libata: tell scsi layer device supports runtime power off
If ATA device supports "Device Attention", then tell scsi layer that
the device supports runtime power off.

Signed-off-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:45 -04:00
Lin Ming b1354cbb5b libata: detect Device Attention support
Add a new flag ATA_DFLAG_DA to indicate that device supports "Device
Attention".

Acked-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:17 -04:00
Lin Ming a606dac368 libata-acpi: register/unregister device to/from power resource
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:15 -04:00
Lin Ming 3bd46600a7 libata-acpi: add ata port runtime D3Cold support
ATA port may support runtime D3Cold state, for example, Zero-power ODD case.
This patch adds wakeup notifier and enable/disable run_wake during
supend/resume.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:13 -04:00
Lin Ming febe53ba6b libata-acpi: set acpi state for SATA port
Currently, ata_acpi_set_state() only sets acpi sate for IDE port.
Remove this limitation.

Acked-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:12 -04:00
Matthew Garrett 30dcf76acc libata: migrate ACPI code over to new bindings
Now that we have the ability to directly glue the ACPI namespace to the
driver model in libata, we don't need the custom code to handle the same
thing. Remove it and migrate the functions over to the new code.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Holger Macht <holger@homac.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:11 -04:00
Matthew Garrett 6b66d95895 libata: bind the Linux device tree to the ACPI device tree
Associate the ACPI device tree and libata devices.
This patch uses the generic ACPI glue framework to do so.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Holger Macht <holger@homac.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-06-29 11:38:10 -04:00
Viresh Kumar 10d8935f46 Viresh has moved
viresh.kumar@st.com email-id doesn't exist anymore as I have left the
company.  Replace ST's id with viresh.linux@gmail.com.

It also updates .mailmap file to fix address for 'git shortlog'

Signed-off-by: Viresh Kumar <viresh.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-06-20 14:39:36 -07:00
Linus Torvalds 2795343705 arm-soc: clock driver changes
The new clock subsystem was merged in linux-3.4 without any users, this
 now moves the first three platforms over to it: imx, mxs and spear.
 
 The series also contains the changes for the clock subsystem itself,
 since Mike preferred to have it together with the platforms that require
 these changes, in order to avoid interdependencies and conflicts.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPuexPAAoJEIwa5zzehBx3YBsP/0nFhXjb5t1PdLfFzGKtcZVB
 j4zXWXMHQ1fA7wIfEpZF3Nnco6MQkufF5wJPoPdn1+wmkzCn3D6IwNVWVtW4U5i9
 VGyShSbgusAAYXUe/9yYj8eN+bbRQSvdN4eWYWU6+rRXShGZ5dZZmp+IPNl54dnW
 6F8uCnHX0cnIMCpGqV+41zZgZ/4wL2k9gdqu0LO6pi07o4tGd0Z4gcySgUFAnn1R
 kofNHueYIP4UgOg8DREoBzVKlpRqMou3S2kSZUfMeb3Q9ryF7UIvaGqIILyi7PKL
 kWd3nptg0EPavfL21SwXHiGpnDpB/Gj/F70kcPLus5RYujB24C9bvBmc26z68NZx
 Sz9mbElkkIU5duZsl1nxBWJ8IZ/tSWdtmC2xQMznmV7gHyGgVwr4j47f4Uv5sBvM
 14JHDO7mqN6E6FnTFZu/oPAN5pDjgL+TVNK5BU6Wkq0zitrA6eyKDqCvBCqkO6Nn
 tNzOuyRDzMOwM7HzqXhxqtzJWXylO1Mldc4bM8X4Cocf4pnLna/X6uP6dgE6A+JY
 azVYx4I/0NdEPerDTzIcEhBDgZeBVROhUQr+kHxc4rf6WzUUbu/wEo1UKXWV66oW
 1jb1yAFFWqYjkQuQc2PD4JSx35sFJaoSaoneRtmzBzRDfzSr5KjKj1E0e1skyMFq
 7ZVLCqZD0cB9DhmMDkWP
 =rwFF
 -----END PGP SIGNATURE-----

Merge tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull arm-soc clock driver changes from Olof Johansson:
 "The new clock subsystem was merged in linux-3.4 without any users,
  this now moves the first three platforms over to it: imx, mxs and
  spear.

  The series also contains the changes for the clock subsystem itself,
  since Mike preferred to have it together with the platforms that
  require these changes, in order to avoid interdependencies and
  conflicts."

Fix up trivial conflicts in arch/arm/mach-kirkwood/common.c (code
removed in one branch, added OF support in another) and
drivers/dma/imx-sdma.c (independent changes next to each other).

* tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
  clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate().
  clk: Provide dummy clk_unregister()
  SPEAr: Update defconfigs
  SPEAr: Add SMI NOR partition info in dts files
  SPEAr: Switch to common clock framework
  SPEAr: Call clk_prepare() before calling clk_enable
  SPEAr: clk: Add General Purpose Timer Synthesizer clock
  SPEAr: clk: Add Fractional Synthesizer clock
  SPEAr: clk: Add Auxiliary Synthesizer clock
  SPEAr: clk: Add VCO-PLL Synthesizer clock
  SPEAr: Add DT bindings for SPEAr's timer
  ARM i.MX: remove now unused clock files
  ARM: i.MX6: implement clocks using common clock framework
  ARM i.MX35: implement clocks using common clock framework
  ARM i.MX5: implement clocks using common clock framework
  ARM: Kirkwood: Replace clock gating
  ARM: Orion: Audio: Add clk/clkdev support
  ARM: Orion: PCIE: Add support for clk
  ARM: Orion: XOR: Add support for clk
  ARM: Orion: CESA: Add support for clk
  ...
2012-05-26 12:42:29 -07:00
Rafal Prylowski 2fff275126 PATA host controller driver for ep93xx
Add PATA host controller driver for ep93xx.

Signed-off-by: Rafal Prylowski <prylowski@metasoft.pl>
Cc: Joao Ramos <joao.ramos@inov.pt>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22 16:02:34 -04:00
Prarit Bhargava d70e551c8e [libata] Add " 2GB ATA Flash Disk"/"ADMA428M" to DMA blacklist
A user has several systems with a couple of models of flash disks with IDE
connectors.  These disks work fine in 2.6.18-ish kernels but corrupt data on
new kernels.

The difference appears to be with the default I/O method used by the IDE
controller driver between the kernels.  In the older kernels, the
configuration is very conservative and the driver stays in PIO mode.  With
new kernels, the ata driver (pata_serverworks) attempts to use UDMA/66
which the drive claims to support.  This mode, however, does not appear to
work in DMA mode.  The drive does work correctly and no corruption is
seen if the kernel parameter "libata.force=5:pio0,6:pio0" is used to force
the driver to use PIO instead of DMA mode.

Blacklist these drives.  Unfortunately the model name of the drive is very
generic, " 2GB ATA Flash Disk", but the revision is specific, "ADMA428M".

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22 16:02:14 -04:00
Andi Kleen 47ee9108c1 ata_generic: Skip is_intel_ider() check when ata_generic=1 is set
When ata_generic_ide=1 is set don't do the is_intel_ider() magic
check. We found at least one box who needed that.

Cc: alan@linux.intel.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-22 15:54:13 -04:00
Arnd Bergmann 3c0dec5f58 Merge branch 'clk-next' of git://git.linaro.org/people/mturquette/linux into next/clock
* 'clk-next' of git://git.linaro.org/people/mturquette/linux:
  clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate().
  clk: Provide dummy clk_unregister()
  ARM: Kirkwood: Replace clock gating
  ARM: Orion: Audio: Add clk/clkdev support
  ARM: Orion: PCIE: Add support for clk
  ARM: Orion: XOR: Add support for clk
  ARM: Orion: CESA: Add support for clk
  ARM: Orion: SDIO: Add support for clk.
  ARM: Orion: NAND: Add support for clk, if there is one.
  ARM: Orion: EHCI: Add support for enabling clocks
  ARM: Orion: SATA: Add per channel clk/clkdev support.
  ARM: Orion: UART: Get the clock rate via clk_get_rate().
  ARM: Orion: WDT: Add clk/clkdev support
  ARM: Orion: Eth: Add clk/clkdev support.
  ARM: Orion: SPI: Add clk/clkdev support.
  ARM: Orion: Add clocks using the generic clk infrastructure.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-05-16 16:35:25 +02:00
Andrew Lunn eee989902a ARM: Orion: SATA: Add per channel clk/clkdev support.
The Orion kirkwood chips have a gatable clock per SATA channel. Add
code to get and enable this clk if it exists.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2012-05-08 16:33:58 -07:00
Mark Lord 8d899e70c1 libata-eh don't waste time retrying media errors (v3)
ATA and SATA drives have had built-in retries for media errors
for as long as they've been commonplace in computers (early 1990s).

When libata stumbles across a bad sector, it can waste minutes
sitting there doing retry after retry before finally giving up
and letting the higher layers deal with it.

This patch removes retries for media errors only.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-07 15:40:34 -04:00
Andy Whitcroft cd006086fa 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>
2012-05-07 15:32:58 -04:00
Andy Whitcroft db63a4c811 libata: add a host flag to ignore detected ATA devices
Where devices are visible via more than one host we sometimes wish to
indicate that cirtain devices should be ignored on a specific host.  Add a
host flag indicating that this host wishes to ignore ATA specific devices.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-07 15:32:23 -04:00
Linus Torvalds 6b4c555a6b Change summary:
1) Fix regression that could cause a misdiagnosis, which in turn could
    lead to an erroneous 3.0 Gbps -> 1.5 downshift, particularly when hotplug
    and suspend/resume is involved.
 
 2) Fix a regression that led to ata%d controller ids being numbered one
    larger than in <= 3.4-rc3 (oh, the horror!).  Controller ids should now be
    as expected.
 
 3) add some DT, PCI id's
 
 4) ata/pata_arasan_cf: minor cpp fixing/cleaning
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAT6LKvSWzCDIBeCsvAQIq2BAAikXKo+1ZVjeG4qRQvjCLFC0vaP7Roflr
 aWpcl4Dmrq3MFw7L69uUnYnZETaBETiMuXYqj8ysaB6EUZHcXYUvgK96iWU4+gmb
 rLVXj5KJqMREQiAxwvYhhYYEsJHeKWSdNJKhCJPL9knfDzrB8rYznfSSZCpBNazk
 cKPJFBQJbIfbhtJce1QRatnT0B7bEJongnEmNiaBKoUyfdJslUw7XqfxwWRGphwg
 QGJez8GPDKPRnKL9d8j1zoDjTTrSSPCkpyGwl66cGov65CRFJKekanz9l7+E5ztY
 Uzyce/ew3VUXYFErIJUGzVu9pdBWdYnrDHvnvMbOgiy2kUfdVLNfQ3p8mToHTaN7
 SBuzrNwG+UxSMMioXdE4yLaQ8mI2xY4XC6iaHHSb0f30xmzCvLRZ8FbOXM/gETAd
 s65lLC+9ebrmVdz15MLLbJsjgnovpgMehpjAZ6EZhKxbw0oAnybrRLceilKBDSkl
 gzjK38HKZke08EZ0t5QsNOPV878ELY0exl724YRk35W5kTJkvUptFDmbgJ5s/uAx
 BJinG2xHGp0HAbdSfxrFbBmUjlCO0cmdUWVk7ZxvEsWQ7EGmLleCFFSbCeTWA6Ah
 QRDZpEWA9wjku1Q6d05KYfz364nUksKds1VobHCOwodsPdWdWs59oYbNf38Gu/mh
 qlgFHFVU/j0=
 =c7fz
 -----END PGP SIGNATURE-----

Merge tag 'tag/upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

Pull libata fixes from Jeff Garzik:

1) Fix regression that could cause a misdiagnosis, which in turn could
   lead to an erroneous 3.0 Gbps -> 1.5 downshift, particularly when hotplug
   and suspend/resume is involved.

2) Fix a regression that led to ata%d controller ids being numbered one
   larger than in <= 3.4-rc3 (oh, the horror!).  Controller ids should now be
   as expected.

3) add some DT, PCI id's

4) ata/pata_arasan_cf: minor cpp fixing/cleaning

* tag 'tag/upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ata: ahci_platform: Add synopsys ahci controller in DT's compatible list
  ata/pata_arasan_cf: Move arasan_cf_pm_ops out of #ifdef, #endif macros
  libata: init ata_print_id to 0
  ahci: Detect Marvell 88SE9172 SATA controller
  libata: skip old error history when counting probe trials
2012-05-03 17:16:52 -07:00
Viresh Kumar 5f098a3ea7 ata: ahci_platform: Add synopsys ahci controller in DT's compatible list
SPEAr13xx series of SoCs contain Synopsys AHCI SATA Controller which shares
ahci_platform driver with other controller versions.

This patch updates DT compatible list for ahci_platform. It also updates and
renames binding documentation to more generic name.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-03 14:08:53 -04:00
Viresh Kumar fb9751d471 ata/pata_arasan_cf: Move arasan_cf_pm_ops out of #ifdef, #endif macros
#ifdef, #endif is not required in definition/usage of arasan_cf_pm_ops. So, move
this definition and its usage outside of them.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-03 14:08:03 -04:00
Tero Roponen a78f57af61 libata: init ata_print_id to 0
When comparing the dmesg between 3.4-rc3 and 3.4-rc4 I found the
following differences:

 -ata1: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff100 irq 47
 -ata2: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff180 irq 47
 -ata3: DUMMY
 +ata2: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff100 irq 47
 +ata3: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff180 irq 47
  ata4: DUMMY
  ata5: DUMMY
 -ata6: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff380 irq 47
 +ata6: DUMMY
 +ata7: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff380 irq 47

The change of numbering comes from commit 85d6725b7c ("libata:
make ata_print_id atomic") that changed lines like

	ap->print_id = ata_print_id++;
		to
	ap->print_id = atomic_inc_return(&ata_print_id);

As the latter behaves like ++ata_print_id, we must initialize
it to zero to start the numbering from one.

Signed-off-by: Tero Roponen <tero.roponen@gmail.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-03 14:07:59 -04:00
Matt Johnson 642d892522 ahci: Detect Marvell 88SE9172 SATA controller
The Marvell 88SE9172 SATA controller (PCI ID 1b4b 917a) already worked
once it was detected, but was missing an ahci_pci_tbl entry.

Boot tested on a Gigabyte Z68X-UD3H-B3 motherboard.

Signed-off-by: Matt Johnson <johnso87@illinois.edu>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-03 14:07:40 -04:00
Lin Ming 6868225e3e libata: skip old error history when counting probe trials
Commit d902747("[libata] Add ATA transport class") introduced
ATA_EFLAG_OLD_ER to mark entries in the error ring as cleared.

But ata_count_probe_trials_cb() didn't check this flag and it still
counts the old error history. So wrong probe trials count is returned
and it causes problem, for example, SATA link speed is slowed down from
3.0Gbps to 1.5Gbps.

Fix it by checking ATA_EFLAG_OLD_ER in ata_count_probe_trials_cb().

Cc: stable <stable@vger.kernel.org> # 2.6.37+
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-05-03 14:05:58 -04:00
Dan Williams b202445925 [SCSI] libsas, libata: fix start of life for a sas ata_port
This changes the ordering of initialization and probing events from:
  1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
  2/ allocate ata_port and schedule port probe in DISCE_PROBE
...to:
  1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
  2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
  3/ schedule port probe in DISCE_PROBE

This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to
destrory ata devices before they have been fully initialized:

  BUG: unable to handle kernel paging request at 0000000000003b10
  IP: [<ffffffffa0053d7e>] sas_ata_end_eh+0x12/0x5e [libsas]
  ...
  [<ffffffffa004d1af>] sas_unregister_common_dev+0x78/0xc9 [libsas]
  [<ffffffffa004d4d4>] sas_unregister_dev+0x4f/0xad [libsas]
  [<ffffffffa004d5b1>] sas_unregister_domain_devices+0x7f/0xbf [libsas]
  [<ffffffffa004c487>] sas_deform_port+0x61/0x1b8 [libsas]
  [<ffffffffa004bed0>] sas_phye_loss_of_signal+0x29/0x2b [libsas]

...and kills the awkward "sata domain_device briefly existing in the
domain without an ata_port" state.

Reported-by: Michal Kosciowski <michal.kosciowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-04-23 12:11:47 +01:00
Lin Ming f8fc75dc57 [SCSI] libata: Pass correct DMA device to scsi host
Use scsi_add_host_with_dma in ata_scsi_add_hosts to pass in the
correct DMA device(ATA host).

Bug report: http://marc.info/?l=linux-ide&m=133177818318187&w=2

Reported-and-tested-by: Jörg Sommer <joerg@alea.gnuu.de>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-04-22 19:00:21 +01:00
Lin Ming 0c8d32c27f libata: forbid port runtime pm by default, fixing regression
Forbid port runtime pm by default because it has known hotplug issue.
User can allow it by, for example

echo auto > /sys/devices/pci0000:00/0000:00:1f.2/ata2/power/control

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-04-18 14:33:25 -04:00
Dan Williams 85d6725b7c libata: make ata_print_id atomic
This variable is incremented from multiple contexts (module_init via
libata-lldds and the libsas discovery thread).  Make it atomic to head
off any chance of libsas and libata creating duplicate ids.

Acked-by: Jacek Danecki <jacek.danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-04-12 15:57:51 -04:00
Dan Carpenter 99b80e9771 sata_mv: silence an uninitialized variable warning
Gcc version 4.6.2-12 complains that if we can't find the "nr-ports"
property in of_property_read_u32_array() then "n_ports" is used
uninitialized.  Let's set it to zero in that case.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-04-12 15:57:22 -04:00
Seth Heasley 96d5d96aed 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>
2012-04-12 15:57:07 -04:00
Linus Torvalds 90597b6cfc 1) AHCI regression fix. A recent "make driver conform to spec" change
broke on deployed hardware.  Make new behavior optional, rather than
    default, turning it on only for specific embedded platforms that need this.
 
    Everybody else runs in the famous "non conformant but working" mode.
 
 2) pata_cmd64x, pata_legacy cleanups
 
 3) new Intel SATA PCI IDs
 
 4) misc minor vendor feature additions
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAT2qyoCWzCDIBeCsvAQLbJRAA0vrulsqMUe9dKCK+21zBMtMhnC1/jFqL
 TrKVh3Ia4ekjJXboUiR2ManmGwLmV+It3jpufb8G+MKb428PI6lrARVEsP8dWEZB
 mgootmdbsVz4JPw38/ll3mYYFBeVu3dY2aK54i79Jaj6N4IUbnPpTpK5kQBYiVEA
 VVZoNEYh2Msn7rFV2O36wyUW0DngA3IDpMZTt4c2K8jmNOh1q0rDCc8MetPWEWS8
 g/QO7s0+37Qfw89nDvx3ZsoeNfrGF+NoXQXTcOHf7eFKIYac3AIdu/FE/sC6vWSV
 FPxanJrtblgfJ0EN461olWsB5h6S4oWRxyog6hluxOsP6ZbB9AfyePSTwP91gkBh
 xFTfO4aF1XNtQjr3YUuUPJlxMK2JMdhZ75Ljhyf8+ufSSjdf8GuvAoDwjqz3QjkI
 jLFV9dWZ3S+VuU8ltj3ItZiSE2UYoVPIZwdw0jdbSC+Y2thaOq1QRHrkopthGsJQ
 av5gqNi4gUxYOa2b6GaoOr+Ozl4TphO4HmT6EOtvypIk0k5YkrdhcK7ZEKzxk8PM
 Jo5InlWN6YqDiB3h/RXyTgChRStBadQuzpKJo+Iy16+m+/XD+dft8XqAizJ+/DMB
 cYo2vrtxnyK8kgYHRdqyEnkuOqj9BNYga0ul9pZDMkuCepPmzrtJWFsqUSbLQCcS
 WXYwayo1PUQ=
 =98ld
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

Pull libata updates from Jeff Garzik:

 1) AHCI regression fix.  A recent "make driver conform to spec" change
    broke on deployed hardware.  Make new behavior optional, rather than
    default, turning it on only for specific embedded platforms that
    need this.

    Everybody else runs in the famous "non conformant but working" mode.

 2) pata_cmd64x, pata_legacy cleanups

 3) new Intel SATA PCI IDs

 4) misc minor vendor feature additions

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  pata_cmd64x: implement sff_irq_check() method
  pata_cmd64x: implement sff_irq_clear() method
  pata_cmd64x: use interrupt status from MRDMODE register
  pata_cmd64x: turn string of *if* statements into *switch*
  drivers/ata/pata_mpc52xx.c: clean up error handling code
  ahci_platform: add STRICT_AHCI platform type
  ahci: move AHCI_HFLAGS() macro to ahci.h
  ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
  sata_fsl: add support for interrupt coalsecing feature
  ata/pata_arasan_cf: Add Hibernation support
  pata_legacy: correctly mask recovery field for HT6560B
  ata_piix: IDE-mode SATA patch for Intel Lynx Point DeviceIDs
  ahci: AHCI-mode SATA patch for Intel Lynx Point DeviceIDs
2012-03-22 20:22:30 -07:00
Linus Torvalds 424a6f6ef9 SCSI updates on 20120319
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJPZxSnAAoJEDeqqVYsXL0M0Y4IAMX0vrTVZbg6psA5/gMcWGRP
 CkFXEQ8n0PL2SCaj6BoDqamJFe5Nc7dnqxM0fGawB4S9vr3rHhiOlwO+NbV9zFYC
 2skBTpeL3sjgtN/jTBdfeeAa7xTYpu/XGyei0NS1A5c2AyMVXV0uYV2s4VNZxe44
 tVIn1OEzM2giZ9EB1OZslDMrg5XXm3MBIUECP0LbWUhBm/35caSFKzMXRwhh7WiK
 +AVmc2AZYtdEwuknDyiH7KlsaoB3vGL9pPrAUJzIgEhy2pOo2A7W72HfA4Fj+y6a
 uF9HBS5zciMp1+sGWry62AjNbWgin9BRlozBEO/lJhIfMGDV1nXEIJsOkOgkdoE=
 =1TxB
 -----END PGP SIGNATURE-----

Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

SCSI updates from James Bottomley:
 "The update includes the usual assortment of driver updates (lpfc,
  qla2xxx, qla4xxx, bfa, bnx2fc, bnx2i, isci, fcoe, hpsa) plus a huge
  amount of infrastructure work in the SAS library and transport class
  as well as an iSCSI update.  There's also a new SCSI based virtio
  driver."

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (177 commits)
  [SCSI] qla4xxx: Update driver version to 5.02.00-k15
  [SCSI] qla4xxx: trivial cleanup
  [SCSI] qla4xxx: Fix sparse warning
  [SCSI] qla4xxx: Add support for multiple session per host.
  [SCSI] qla4xxx: Export CHAP index as sysfs attribute
  [SCSI] scsi_transport: Export CHAP index as sysfs attribute
  [SCSI] qla4xxx: Add support to display CHAP list and delete CHAP entry
  [SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry
  [SCSI] pm8001: fix endian issue with code optimization.
  [SCSI] pm8001: Fix possible racing condition.
  [SCSI] pm8001: Fix bogus interrupt state flag issue.
  [SCSI] ipr: update PCI ID definitions for new adapters
  [SCSI] qla2xxx: handle default case in qla2x00_request_firmware()
  [SCSI] isci: improvements in driver unloading routine
  [SCSI] isci: improve phy event warnings
  [SCSI] isci: debug, provide state-enum-to-string conversions
  [SCSI] scsi_transport_sas: 'enable' phys on reset
  [SCSI] libsas: don't recover end devices attached to disabled phys
  [SCSI] libsas: fixup target_port_protocols for expanders that don't report sata
  [SCSI] libsas: set attached device type and target protocols for local phys
  ...
2012-03-22 12:55:29 -07:00
Cong Wang 496cda8e75 ata: remove the second argument of k[un]map_atomic()
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
2012-03-20 21:48:16 +08:00
Sergei Shtylyov b8cec3c253 pata_cmd64x: implement sff_irq_check() method
Implement sff_irq_check() method for both old and new chips.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 16:43:11 -04:00
Sergei Shtylyov 419fd24613 pata_cmd64x: implement sff_irq_clear() method
Convert the driver's two bmdma_stop() methods into sff_irq_clear() methods --
they shouldn't have been bothering with clearing interrupts from the very start;
the driver will now use the standard bmdma_stop() method implementation (where
appropriate).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 16:43:04 -04:00
Sergei Shtylyov 8a686bc984 pata_cmd64x: use interrupt status from MRDMODE register
Start using faster version of the bmdma_stop() method for the PCI0646U and newer
chips that have the duplicate interrupt status  bits  in  the I/O mapped MRDMODE
register. Use the old, slow bmdma_stop() method on the older chips,  taking into
account that the interrupt bits are not coupled to DMA and that's enough to read
the register to clear the interrupt (on the older chips).  Determine what method
to use at the driver load time.

Fix kernel-doc of the bmdma_stop() methods, while at it.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 16:42:54 -04:00
Sergei Shtylyov 8fcfa7bd1b pata_cmd64x: turn string of *if* statements into *switch*
Convert string of the *if* statements all checking 'pdev->revision' into more
natural *switch* statement. While at it, somewhat clarify the comments there...

Increment the driver version, accounting for the patches that neglected to do
this in the past.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 16:41:31 -04:00
Julia Lawall d01159dffa drivers/ata/pata_mpc52xx.c: clean up error handling code
This patch makes a number of changes with respect to the error-handling
code:

* Remove cleanup calls for the devm functions in both the error handling
  code and the remove function.  This cleanup is done automatically.

* The previous change simplifies the cleanup code at the end of the
  function such that there is nothing to do on the failure of the call to
  devm_ioremap.  So it is changed to just return directly.

* There is no need for the ifs in the cleanup code at the end of the
  function, because in each case the cleanup needed is statically
  known.  Drop the ifs, add new err labels, and drop the initializations of
  the tested variables to NULL.

* Change the call to request_irq to a call to devm_request_irq, so that it
  is cleaned up on exit.

* Cause the return value of devm_request_irq to go into the returned
  variable rv rather than the unused variable ret.  Drop ret.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 16:41:08 -04:00
Brian Norris d408e2b14f ahci_platform: add STRICT_AHCI platform type
Some platforms need to make use of the AHCI_HFLAG_DELAY_ENGINE flag.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: stable@kernel.org
2012-03-13 16:36:18 -04:00
Brian Norris 55d5ec3166 ahci: move AHCI_HFLAGS() macro to ahci.h
We will need this macro in both ahci.c and ahci_platform.c, so just move it
to the header.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: stable@kernel.org
2012-03-13 16:35:47 -04:00
Brian Norris 66583c9fa6 ahci: add AHCI_HFLAG_DELAY_ENGINE host flag
The following commit was intended to fix problems with specific AHCI
controller(s) that would become bricks if the AHCI specification was not
followed strictly (that is, if ahci_start_engine() was called while the
controller was in the wrong state):

    commit 7faa33da9b
    ahci: start engine only during soft/hard resets

However, some devices currently have issues with that fix, so we must
implement a flag that delays the ahci_start_engine() call only for specific
controllers.

This commit simply introduces the flag, without enabling it in any driver.

Note that even when AHCI_HFLAG_DELAY_ENGINE is not enabled, this patch does
not constitue a full revert to commit 7faa33da; there is still a change in
behavior to the ahci_port_suspend() failure path.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: stable@kernel.org
2012-03-13 16:35:37 -04:00
Qiang Liu 6b4b8fc87d sata_fsl: add support for interrupt coalsecing feature
Adds support for interrupt coalescing feature to reduce interrupt events.
Provides a mechanism of adjusting coalescing count and timeout tick by sysfs
at runtime, so that tradeoff of latency and CPU load can be made depending
on different applications.

Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 12:43:13 -04:00
Viresh Kumar 40679b3ce9 ata/pata_arasan_cf: Add Hibernation support
This patch adds in Hibernation related callbacks. Also we don't really need to
free DMA channel on suspend.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2012-03-13 12:43:13 -04:00