linux-stable/drivers/ata
Florian Fainelli ea0b4277ea ata: ahci_brcm: Fix AHCI resources management
commit c0cdf2ac4b upstream.

The AHCI resources management within ahci_brcm.c is a little
convoluted, largely because it historically had a dedicated clock that
was managed within this file in the downstream tree. Once brough
upstream though, the clock was left to be managed by libahci_platform.c
which is entirely appropriate.

This patch series ensures that the AHCI resources are fetched and
enabled before any register access is done, thus avoiding bus errors on
platforms which clock gate the controller by default.

As a result we need to re-arrange the suspend() and resume() functions
in order to avoid accessing registers after the clocks have been turned
off respectively before the clocks have been turned on. Finally, we can
refactor brcm_ahci_get_portmask() in order to fetch the number of ports
from hpriv->mmio which is now accessible without jumping through hoops
like we used to do.

The commit pointed in the Fixes tag is both old and new enough not to
require major headaches for backporting of this patch.

Fixes: eba68f8297 ("ata: ahci_brcmstb: rename to support across Broadcom SoC's")
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09 10:17:55 +01:00
..
acard-ahci.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
ahci.c ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS 2018-07-17 11:39:25 +02:00
ahci.h libahci: Allow drivers to override stop_engine 2018-06-21 04:02:49 +09:00
ahci_brcm.c ata: ahci_brcm: Fix AHCI resources management 2020-01-09 10:17:55 +01:00
ahci_ceva.c
ahci_da850.c sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()' 2017-08-16 07:38:27 -07:00
ahci_dm816.c ata: ahci: add support for DaVinci DM816 SATA controller 2017-03-24 11:40:03 -04:00
ahci_imx.c
ahci_mtk.c ata: mediatek: add support for MediaTek SATA controller 2017-08-28 10:54:42 -07:00
ahci_mvebu.c ata: ahci: mvebu: override ahci_stop_engine for mvebu AHCI 2018-06-21 04:02:49 +09:00
ahci_octeon.c Delete redundant return value check of platform_get_resource() 2017-03-06 15:40:59 -05:00
ahci_platform.c ata: ahci_platform: Add shutdown handler 2017-08-04 13:34:14 -07:00
ahci_qoriq.c libahci: Allow drivers to override stop_engine 2018-06-21 04:02:49 +09:00
ahci_seattle.c
ahci_st.c
ahci_sunxi.c
ahci_tegra.c
ahci_xgene.c libahci: Allow drivers to override stop_engine 2018-06-21 04:02:49 +09:00
ata_generic.c
ata_piix.c ata_piix: Add Fujitsu-Siemens Lifebook S6120 to short cable IDs 2017-09-18 20:32:02 -07:00
Kconfig ata: ahci_brcm: Allow using driver or DSL SoCs 2019-11-24 08:22:54 +01:00
libahci.c ata: libahci: Correct setting of DEVSLP register 2018-09-19 22:43:41 +02:00
libahci_platform.c ata: libahci_platform: Export again ahci_platform_<en/dis>able_phys() 2020-01-09 10:17:55 +01:00
libata-acpi.c
libata-core.c libata: Ensure ata_port probe has completed before detach 2019-12-31 12:37:18 +01:00
libata-eh.c libata: don't request sense data on !ZAC ATA devices 2019-07-31 07:28:30 +02:00
libata-pmp.c
libata-scsi.c libata: have ata_scsi_rw_xlat() fail invalid passthrough requests 2019-08-29 08:26:41 +02:00
libata-sff.c libata: add SG safety checks in SFF pio transfers 2019-08-29 08:26:41 +02:00
libata-trace.c
libata-transport.c libata: transport: Remove circular dependency at free time 2017-03-06 15:24:48 -05:00
libata-transport.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
libata-zpodd.c libata: zpodd: Fix small read overflow in zpodd_get_mech_type() 2019-08-25 10:50:12 +02:00
libata.h libata: move ata_read_log_page to libata-core.c 2017-06-05 15:29:21 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pata_acpi.c
pata_ali.c
pata_amd.c cs5536: add support for IDE controller variant 2017-08-11 10:35:07 -07:00
pata_arasan_cf.c
pata_artop.c
pata_at32.c
pata_atiixp.c Revert "pata_atiixp: Don't use unconnected secondary port on SB600/SB700" 2017-03-27 13:52:00 -04:00
pata_atp867x.c
pata_bf54x.c ata: bf54x: cut drvdata assignment 2017-05-30 11:54:36 -04:00
pata_bk3710.c pata_bk3710: clear status bits of BMISP on chipset initialization 2017-03-30 16:13:04 +05:30
pata_cmd64x.c
pata_cmd640.c
pata_cs5520.c
pata_cs5530.c
pata_cs5535.c
pata_cs5536.c cs5536: add support for IDE controller variant 2017-08-11 10:35:07 -07:00
pata_cypress.c
pata_efar.c
pata_ep93xx.c ata: ep93xx: Use proper enums for directions 2019-11-24 08:23:06 +01:00
pata_falcon.c Merge branch 'for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2017-02-21 17:21:32 -08:00
pata_ftide010.c ata: ftide010: Add a quirk for SQ201 2018-10-03 17:00:59 -07:00
pata_hpt3x2n.c
pata_hpt3x3.c
pata_hpt37x.c
pata_hpt366.c
pata_icside.c
pata_imx.c
pata_isapnp.c
pata_it821x.c
pata_it8213.c
pata_ixp4xx_cf.c
pata_jmicron.c
pata_legacy.c
pata_macio.c ata: constify of_device_id structures 2017-03-06 15:18:01 -05:00
pata_marvell.c
pata_mpc52xx.c ata: constify of_device_id structures 2017-03-06 15:18:01 -05:00
pata_mpiix.c
pata_netcell.c
pata_ninja32.c
pata_ns87410.c
pata_ns87415.c
pata_octeon_cf.c pata_octeon_cf: use of_property_read_{bool|u32}() 2017-08-28 10:44:24 -07:00
pata_of_platform.c ata: constify of_device_id structures 2017-03-06 15:18:01 -05:00
pata_oldpiix.c
pata_opti.c
pata_optidma.c
pata_palmld.c
pata_pcmcia.c
pata_pdc202xx_old.c
pata_pdc2027x.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
pata_piccolo.c
pata_platform.c
pata_pxa.c
pata_radisys.c
pata_rb532_cf.c ata: rb532_cf: cut drvdata assignment 2017-05-30 11:54:37 -04:00
pata_rdc.c ata: declare ata_port_info structures as const 2017-06-12 14:06:34 -04:00
pata_rz1000.c
pata_samsung_cf.c ata: samsung_cf: cut drvdata assignment 2017-05-30 11:54:37 -04:00
pata_sc1200.c
pata_sch.c ata: declare ata_port_info structures as const 2017-06-12 14:06:34 -04:00
pata_serverworks.c
pata_sil680.c
pata_sis.c
pata_sl82c105.c
pata_triflex.c
pata_via.c
pdc_adma.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_dwc_460ex.c ata: dwc_460ex: cut drvdata assignment 2017-05-30 11:54:37 -04:00
sata_fsl.c ata: sata_fsl: cut drvdata assignment 2017-05-30 11:54:37 -04:00
sata_gemini.c ata: sata_gemini: Introduce explicit IDE pin control 2017-08-11 10:32:09 -07:00
sata_gemini.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sata_highbank.c libahci: Allow drivers to override stop_engine 2018-06-21 04:02:49 +09:00
sata_inic162x.c ata: declare ata_port_info structures as const 2017-06-12 14:06:34 -04:00
sata_mv.c Revert "ata: sata_mv: Convert to devm_ioremap_resource()" 2017-05-24 10:56:32 -04:00
sata_nv.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_promise.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_promise.h ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_qstor.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_rcar.c sata_rcar: fix deferred probing 2019-02-12 19:46:03 +01:00
sata_sil.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_sil24.c
sata_sis.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_svw.c ata: Convert to using %pOF instead of full_name 2017-07-18 18:02:36 -04:00
sata_sx4.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_uli.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sata_via.c sata_via: Enable optional hotplug on VT6420 2017-06-26 16:54:53 -04:00
sata_vsc.c ata: update references for libata documentation 2017-05-16 11:25:59 -04:00
sis.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00