Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1985055pxx; Sat, 31 Oct 2020 04:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9T88PLSxhkC6XKecCcUz1XvXwHdRoPn+DrIQIvQHo/MtctH1DlXNvlKUXIAh/hK4LBlJr X-Received: by 2002:a05:6402:1241:: with SMTP id l1mr7180151edw.358.1604145142883; Sat, 31 Oct 2020 04:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604145142; cv=none; d=google.com; s=arc-20160816; b=NPNIr0+XGzUuEa6kMmqYBlq8oDTT1r//fXlQcgLt3eSM4Du/RfQDOZjPLm9cZFFrn9 ieay8afx4qqV7qusythyyydhwW+pu6ywmNoSNC5vHAJR2E3ZfELq2jBW1hnEPdpxvdzZ MthA6AVvpVZwacbYGvpMqlkJpVqPUnoW9DqldKk4Yl2top+SxiaXTagiVJoD26Qur9dS u9clhIJk1clHAr+oJYH+EW/X7jk3OKjGs/LKNs6W1j9eHhQjOOHu+hYL80/I1O2CoVjW WEjtYXYUJvZMSCvTihLr/VFVb9tQTMMhjR0SnpPyxOR81W1NrhCDCZdugDhO+7GEtyH8 jfRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7j2mbFZ2XjvPrkisxWvGSNtw1FaXG0zB3h7DIMdvgS0=; b=k2iGuPpwqoPBs+toKzfnLvCjRm2GsBc5e425aLvv2ZZAOFUSTlYQfiQOFHyToq6Rrl emiOdSkbxCMXqrBbxV6O0JVpWIfLyuy/9Ur6qQTkSciEyiPoJsueKVXhkFC7KXPME9Rs Lz8J+LXh/1NxTTVCePLm35ZwfrwT55Atof2gFtASVtrlldnOTEqgyWW/fWSHvxQ4DzjI QOo4n2G+AhKhzkPc6B8coEyYktRvxTaCpg82wZRezP/nam7SemO/aOFp8elumF0roiaQ gFBu8zg9OJA0Kz/tFIb4TFvKug3/8YFgjqUwYvkcg+crAUM4naM3CHqwWjEJ7yvLA6Ug qAWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ieUDEOvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t25si6364711ejr.282.2020.10.31.04.52.00; Sat, 31 Oct 2020 04:52:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ieUDEOvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727195AbgJaLnG (ORCPT + 99 others); Sat, 31 Oct 2020 07:43:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:42800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727942AbgJaLm6 (ORCPT ); Sat, 31 Oct 2020 07:42:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A85C20731; Sat, 31 Oct 2020 11:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144577; bh=SMfhHhQwtwwMYs3J42tcHlFTpIPOsdFSqU6SIl2UIY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ieUDEOvihh1Fpz/JQ1WUKGo8jkAbB4+/CkM5frLtCjeWsbGkd9wQLvhO2cYTMtgsX mQs8N0Hz7Niv1cnSBKgNjJL5t5uxXbBFaIL0FoIBubPXUcd/qMkK52opiT+hNkMRxr 9RkYmk1Y+oNR8TzvAysbxA6miDI+/eVpaA7PiSKw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Tomasz Maciej Nowak , Jens Axboe Subject: [PATCH 5.8 54/70] ata: ahci: mvebu: Make SATA PHY optional for Armada 3720 Date: Sat, 31 Oct 2020 12:36:26 +0100 Message-Id: <20201031113502.086799585@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113459.481803250@linuxfoundation.org> References: <20201031113459.481803250@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár 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 8e18c8e58da64 ("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: 8e18c8e58da64 ("arm64: dts: marvell: armada-3720-espressobin: declare SATA PHY property") Signed-off-by: Pali Rohár Tested-by: Tomasz Maciej Nowak Cc: # 5.1+: ea17a0f153af: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/ata/ahci.h | 2 ++ drivers/ata/ahci_mvebu.c | 2 +- drivers/ata/libahci_platform.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -240,6 +240,8 @@ enum { as default lpm_policy */ AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during suspend/resume */ + AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP + from phy_power_on() */ /* ap->flags bits */ --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { .plat_config = ahci_mvebu_armada_3700_config, - .flags = AHCI_HFLAG_SUSPEND_PHYS, + .flags = AHCI_HFLAG_SUSPEND_PHYS | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON, }; static const struct of_device_id ahci_mvebu_of_match[] = { --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -59,7 +59,7 @@ int ahci_platform_enable_phys(struct ahc } rc = phy_power_on(hpriv->phys[i]); - if (rc) { + if (rc && !(rc == -EOPNOTSUPP && (hpriv->flags & AHCI_HFLAG_IGN_NOTSUPP_POWER_ON))) { phy_exit(hpriv->phys[i]); goto disable_phys; }