Skip to content

Commit 78453a7

Browse files
paligregkh
authored andcommitted
ata: ahci: mvebu: Make SATA PHY optional for Armada 3720
commit 45aefe3d2251e4e229d7662052739f96ad1d08d9 upstream. Older ATF does not provide SMC call for SATA phy power on functionality and therefore initialization of ahci_mvebu is failing when older version of ATF is using. In this case phy_power_on() function returns -EOPNOTSUPP. This patch adds a new hflag AHCI_HFLAG_IGN_NOTSUPP_POWER_ON which cause that ahci_platform_enable_phys() would ignore -EOPNOTSUPP errors from phy_power_on() call. It fixes initialization of ahci_mvebu on Espressobin boards where is older Marvell's Arm Trusted Firmware without SMC call for SATA phy power. This is regression introduced in commit 8e18c8e ("arm64: dts: marvell: armada-3720-espressobin: declare SATA PHY property") where SATA phy was defined and therefore ahci_platform_enable_phys() on Espressobin started failing. Fixes: 8e18c8e ("arm64: dts: marvell: armada-3720-espressobin: declare SATA PHY property") Signed-off-by: Pali Rohár <pali@kernel.org> Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com> Cc: <stable@vger.kernel.org> # 5.1+: ea17a0f153af: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4752a13 commit 78453a7

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

drivers/ata/ahci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ enum {
240240
as default lpm_policy */
241241
AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during
242242
suspend/resume */
243+
AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP
244+
from phy_power_on() */
243245

244246
/* ap->flags bits */
245247

drivers/ata/ahci_mvebu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = {
227227

228228
static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = {
229229
.plat_config = ahci_mvebu_armada_3700_config,
230-
.flags = AHCI_HFLAG_SUSPEND_PHYS,
230+
.flags = AHCI_HFLAG_SUSPEND_PHYS | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON,
231231
};
232232

233233
static const struct of_device_id ahci_mvebu_of_match[] = {

drivers/ata/libahci_platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int ahci_platform_enable_phys(struct ahci_host_priv *hpriv)
5959
}
6060

6161
rc = phy_power_on(hpriv->phys[i]);
62-
if (rc) {
62+
if (rc && !(rc == -EOPNOTSUPP && (hpriv->flags & AHCI_HFLAG_IGN_NOTSUPP_POWER_ON))) {
6363
phy_exit(hpriv->phys[i]);
6464
goto disable_phys;
6565
}

0 commit comments

Comments
 (0)