Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: ahci_brcm: Add back regulators management

While reworking the resources management and departing from using
ahci_platform_enable_resources() which did not allow a proper step
separation like we need, we unfortunately lost the ability to control
AHCI regulators. This broke some Broadcom STB systems that do expect
regulators to be turned on to link up with attached hard drives.

Fixes: c0cdf2ac4b5b ("ata: ahci_brcm: Fix AHCI resources management")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Florian Fainelli and committed by
Jens Axboe
10340f8d 6ee1d745

+13 -1
+13 -1
drivers/ata/ahci_brcm.c
··· 377 377 if (ret) 378 378 return ret; 379 379 380 + ret = ahci_platform_enable_regulators(hpriv); 381 + if (ret) 382 + goto out_disable_clks; 383 + 380 384 brcm_sata_init(priv); 381 385 brcm_sata_phys_enable(priv); 382 386 brcm_sata_alpm_init(hpriv); ··· 410 406 ahci_platform_disable_phys(hpriv); 411 407 out_disable_phys: 412 408 brcm_sata_phys_disable(priv); 409 + ahci_platform_disable_regulators(hpriv); 410 + out_disable_clks: 413 411 ahci_platform_disable_clks(hpriv); 414 412 return ret; 415 413 } ··· 496 490 if (ret) 497 491 goto out_reset; 498 492 493 + ret = ahci_platform_enable_regulators(hpriv); 494 + if (ret) 495 + goto out_disable_clks; 496 + 499 497 /* Must be first so as to configure endianness including that 500 498 * of the standard AHCI register space. 501 499 */ ··· 509 499 priv->port_mask = brcm_ahci_get_portmask(hpriv, priv); 510 500 if (!priv->port_mask) { 511 501 ret = -ENODEV; 512 - goto out_disable_clks; 502 + goto out_disable_regulators; 513 503 } 514 504 515 505 /* Must be done before ahci_platform_enable_phys() */ ··· 534 524 ahci_platform_disable_phys(hpriv); 535 525 out_disable_phys: 536 526 brcm_sata_phys_disable(priv); 527 + out_disable_regulators: 528 + ahci_platform_disable_regulators(hpriv); 537 529 out_disable_clks: 538 530 ahci_platform_disable_clks(hpriv); 539 531 out_reset: