linux-brain/drivers/ata
Ard Biesheuvel f2adb1f6f9 ahci: don't ignore result code of ahci_reset_controller()
[ Upstream commit d312fefea8 ]

ahci_pci_reset_controller() calls ahci_reset_controller(), which may
fail, but ignores the result code and always returns success. This
may result in failures like below

  ahci 0000:02:00.0: version 3.0
  ahci 0000:02:00.0: enabling device (0000 -> 0003)
  ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled
  ahci 0000:02:00.0: controller reset failed (0xffffffff)
  ahci 0000:02:00.0: failed to stop engine (-5)
    ... repeated many times ...
  ahci 0000:02:00.0: failed to stop engine (-5)
  Unable to handle kernel paging request at virtual address ffff0000093f9018
    ...
  PC is at ahci_stop_engine+0x5c/0xd8 [libahci]
  LR is at ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
    ...
  [<ffff000000a17014>] ahci_stop_engine+0x5c/0xd8 [libahci]
  [<ffff000000a196b4>] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
  [<ffff000000a197d8>] ahci_init_controller+0x80/0x168 [libahci]
  [<ffff000000a260f8>] ahci_pci_init_controller+0x60/0x68 [ahci]
  [<ffff000000a26f94>] ahci_init_one+0x75c/0xd88 [ahci]
  [<ffff000008430324>] local_pci_probe+0x3c/0xb8
  [<ffff000008431728>] pci_device_probe+0x138/0x170
  [<ffff000008585e54>] driver_probe_device+0x2dc/0x458
  [<ffff0000085860e4>] __driver_attach+0x114/0x118
  [<ffff000008583ca8>] bus_for_each_dev+0x60/0xa0
  [<ffff000008585638>] driver_attach+0x20/0x28
  [<ffff0000085850b0>] bus_add_driver+0x1f0/0x2a8
  [<ffff000008586ae0>] driver_register+0x60/0xf8
  [<ffff00000842f9b4>] __pci_register_driver+0x3c/0x48
  [<ffff000000a3001c>] ahci_pci_driver_init+0x1c/0x1000 [ahci]
  [<ffff000008083918>] do_one_initcall+0x38/0x120

where an obvious hardware level failure results in an unnecessary 15 second
delay and a subsequent crash.

So record the result code of ahci_reset_controller() and relay it, rather
than ignoring it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10 07:41:42 -08:00
..
acard-ahci.c ahci: Store irq number in struct ahci_host_priv 2015-06-03 01:37:49 -04:00
ahci_brcmstb.c ata: ahci_brcmstb: Fix misuse of IS_ENABLED 2015-08-06 14:30:07 -04:00
ahci_ceva.c drivers: ata: add support for Ceva sata host controller 2015-06-10 11:15:17 +09:00
ahci_da850.c ata: ahci_platform: fix owner module reference mismatch for scsi host 2015-01-28 18:45:23 -05:00
ahci_imx.c ata: ahci_platform: fix owner module reference mismatch for scsi host 2015-01-28 18:45:23 -05:00
ahci_mvebu.c sata/mvebu: use #ifdef around suspend/resume code 2015-11-20 14:59:43 -05:00
ahci_platform.c ata: ahci-platform: Add ports-implemented DT bindings. 2016-05-11 11:21:21 +02:00
ahci_qoriq.c ahci: qoriq: Disable NCQ on ls2080a SoC 2015-10-31 09:52:15 +09:00
ahci_st.c ata: ahci_st: fixup layering violations / drvdata errors 2015-04-20 13:36:38 -04:00
ahci_sunxi.c ata: ahci_platform: fix owner module reference mismatch for scsi host 2015-01-28 18:45:23 -05:00
ahci_tegra.c ata: ahci_platform: fix owner module reference mismatch for scsi host 2015-01-28 18:45:23 -05:00
ahci_xgene.c ata: ahci_xgene: dereferencing uninitialized pointer in probe 2016-05-11 11:21:10 +02:00
ahci.c ahci: don't ignore result code of ahci_reset_controller() 2018-11-10 07:41:42 -08:00
ahci.h ata: ahci: find eSATA ports and flag them as removable 2015-09-30 17:37:55 -04:00
ata_generic.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
ata_piix.c ata_piix: Add Device IDs for Intel 9 Series PCH 2014-08-28 08:53:40 -04:00
Kconfig ata: SATA_MV should depend on HAS_DMA 2017-11-21 09:21:19 +01:00
libahci_platform.c ata: libahci: properly propagate return value of platform_get_irq() 2018-04-13 19:50:06 +02:00
libahci.c ata: libahci: Correct setting of DEVSLP register 2018-09-19 22:48:58 +02:00
libata-acpi.c ACPI and power management updates for 3.15-rc1 2014-04-01 12:48:54 -07:00
libata-core.c ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS 2018-07-17 11:31:43 +02:00
libata-eh.c libata: Fix command retry decision 2018-08-06 16:24:36 +02:00
libata-pmp.c ata: pmp: add quirk for Marvell 4140 SATA PMP 2015-07-14 17:46:38 -04:00
libata-scsi.c libata: fix length validation of ATAPI-relayed SCSI commands 2018-03-28 18:40:13 +02:00
libata-sff.c libata: drop WARN from protocol error in ata_sff_qc_issue() 2017-12-16 10:33:52 +01:00
libata-trace.c libata: Add tracepoints 2015-03-27 11:59:22 -04:00
libata-transport.c libata: transport: Remove circular dependency at free time 2017-10-08 10:14:20 +02:00
libata-transport.h [libata] Add ATA transport class 2010-10-21 20:21:03 -04:00
libata-zpodd.c libata: zpodd: small read overflow in eject_tray() 2018-07-03 11:21:26 +02:00
libata.h Revert "libata: Implement NCQ autosense" 2015-08-03 12:01:54 -04:00
Makefile ahci: added a new driver for supporting Freescale AHCI sata 2015-09-08 12:30:06 -04:00
pata_acpi.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_ali.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_amd.c cs5536: add support for IDE controller variant 2017-09-13 14:09:45 -07:00
pata_arasan_cf.c Merge branch 'for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-09-02 08:00:54 -07:00
pata_artop.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_at32.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_at91.c ata: at91: use syscon to configure the smc 2015-05-20 16:36:50 +02:00
pata_atiixp.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_atp867x.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
pata_bf54x.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_cmd64x.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_cmd640.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_cs5520.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
pata_cs5530.c ata: Delete unnecessary checks before the function call "pci_dev_put" 2015-02-03 07:04:44 -05:00
pata_cs5535.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_cs5536.c cs5536: add support for IDE controller variant 2017-09-13 14:09:45 -07:00
pata_cypress.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_efar.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_ep93xx.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_hpt3x2n.c ata: delete non-required instances of include <linux/init.h> 2014-02-13 16:40:56 -05:00
pata_hpt3x3.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
pata_hpt37x.c ata: delete non-required instances of include <linux/init.h> 2014-02-13 16:40:56 -05:00
pata_hpt366.c ata: hpt366: fix constant cast warning 2015-05-21 17:37:51 -04:00
pata_icside.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_imx.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_isapnp.c PNP: ata/pata_isapnp: Use module_pnp_driver to register driver 2015-03-18 22:39:17 +01:00
pata_it821x.c pata_it821x: use "const char *" for string literals 2015-10-15 10:58:53 -04:00
pata_it8213.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_ixp4xx_cf.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_jmicron.c PCI: Disable async suspend/resume for JMicron multi-function SATA/AHCI 2015-08-24 15:27:11 -05:00
pata_legacy.c pata_legacy: Remove dead code 2014-03-11 08:30:53 -04:00
pata_macio.c ata: pata_macio: Fix module autoload for OF platform driver 2015-09-17 11:14:25 -04:00
pata_marvell.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_mpc52xx.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_mpiix.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_netcell.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_ninja32.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
pata_ns87410.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_ns87415.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_octeon_cf.c pata_octeon_cf: fix broken build 2015-06-08 18:03:04 +09:00
pata_of_platform.c ata: pata_platform: fix owner module reference mismatch for scsi host 2015-01-28 18:45:23 -05:00
pata_oldpiix.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_opti.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_optidma.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_palmld.c ata: drop owner assignment from platform_drivers 2014-10-20 16:20:17 +02:00
pata_pcmcia.c ata: delete non-required instances of include <linux/init.h> 2014-02-13 16:40:56 -05:00
pata_pdc202xx_old.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_pdc2027x.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
pata_piccolo.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_platform.c ata: pata_platform: fix owner module reference mismatch for scsi host 2015-01-28 18:45:23 -05:00
pata_pxa.c ata: pata_pxa: dmaengine conversion 2015-09-10 17:02:04 -04:00
pata_radisys.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_rb532_cf.c pata-rb532-cf: get rid of the irq_to_gpio() call 2016-03-09 15:34:53 -08:00
pata_rdc.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_rz1000.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_samsung_cf.c libata: samsung_cf: fix handling platform_get_irq result 2015-09-25 11:50:15 -04:00
pata_sc1200.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_sch.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_serverworks.c pata_serverworks: disable 64-KB DMA transfers on Broadcom OSB4 IDE Controller 2014-10-07 17:10:14 -04:00
pata_sil680.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
pata_sis.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_sl82c105.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_triflex.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pata_via.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
pdc_adma.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sata_dwc_460ex.c sata_dwc_460ex: indent an if statement 2015-03-30 13:14:40 -04:00
sata_fsl.c ata/sata_fsl.c: add ATA_FLAG_NO_LOG_PAGE to blacklist the controller for log page reads 2015-12-07 10:25:57 -05:00
sata_highbank.c ahci: Store irq number in struct ahci_host_priv 2015-06-03 01:37:49 -04:00
sata_inic162x.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sata_mv.c ata: sata_mv:- Handle return value of devm_ioremap. 2017-02-09 08:02:45 +01:00
sata_nv.c ata:sata_nv - Change 1 to true for bool type variable. 2015-05-25 20:06:55 -04:00
sata_promise.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sata_promise.h libata annotations and fixes 2008-01-23 05:24:15 -05:00
sata_qstor.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sata_rcar.c ata: sata_rcar: Remove obsolete sata-r8a779* platform_device_id entries 2015-07-14 17:38:43 -04:00
sata_sil.c sata_sil: disable trim 2015-11-30 10:02:49 -05:00
sata_sil24.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sata_sis.c ata: use CONFIG_PM_SLEEP instead of CONFIG_PM where applicable in host drivers 2014-05-09 22:37:49 -04:00
sata_svw.c powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
sata_sx4.c sata_sx4: Check return code from pdc20621_i2c_read() 2015-08-06 12:38:14 -04:00
sata_uli.c ata: delete non-required instances of include <linux/init.h> 2014-02-13 16:40:56 -05:00
sata_via.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sata_vsc.c ata: remove deprecated use of pci api 2015-04-08 10:55:05 -04:00
sis.h libata: PATA-mode fixes for sis_sata 2007-07-02 10:17:42 -04:00