Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3944910pxb; Tue, 2 Mar 2021 02:38:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlSLEUCQiiZeNVRdcrjK9oWXOaQHoMzoDbpGb80iPWuAC3THZpz105SLyV2tPbQ6VWnw9M X-Received: by 2002:a17:906:5607:: with SMTP id f7mr9713506ejq.262.1614681499570; Tue, 02 Mar 2021 02:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614681499; cv=none; d=google.com; s=arc-20160816; b=pf2uX8mJRP40YGb+fPuu13KxPwkkcrKW+EvyxcnTQo4GnkqL4rsiPaq5U20U0A9U4P VGfKV1+1W36fK6TM/4Qkl3WQ4gx6+VvDf2O2X6Yw//mwboeiFotD5VmX8v1auMJGaOEH Bn3U8uCTE2ZDWmuXIwz8E9G9f0xaYcjfiCmXhNvTb6X5SOPDYteUz8amNJ2jOVgNkvsk au18C1JK8SUdNvF0D+aI7AjLzJMnTYQj6JDzFzdlrfzmQdJEITypeJJdPSWomiUQravu 8NuMHAXoYx0tAvuw+IwByLZe4GTbzAyiglu+tMlKeNLBEnTvXfkvDY+43WDSCCwebyx8 aZWw== 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=alRk0NIOYg4ZglPJpab+lrA3IVhiC7B6OsrvbkQhOiM=; b=KnL6yHeCEk8mH5sdKLKR91QWpy4V4xN5UrAMglnJYKtT4BBGUopvOeD2/lKr2fF1hi CNQQzUsi3KRsaofapQrOyne1TwBkdjqwHmF+qrJxRGBkbPPWu8nmKTErp/+rIGe6dKDT 21/P0xzFwITdqESmWQse8lt646A3dwrkiGsDIbGy0+FEZ5oa2q2Wr/TWVFUnXLfa4zjH m1dj7EfNs81YhQnBENwZKvuO9Zyo8iffWPw+LNra1hWDQezjAqV7auLDSPIMTpWGI2Iq N8bbHAyWPwkheysCTQWvzp7kFBYpujWChIZasJMcWClN2jJw42IIs727cI1k63WvktML SbEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CvYjdt69; 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=pass (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 f7si13717783edd.343.2021.03.02.02.37.53; Tue, 02 Mar 2021 02:38:19 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=CvYjdt69; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241081AbhCBBpO (ORCPT + 99 others); Mon, 1 Mar 2021 20:45:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:46148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241415AbhCATVp (ORCPT ); Mon, 1 Mar 2021 14:21:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0178651B2; Mon, 1 Mar 2021 17:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618760; bh=/27xXjn+BzMKfvVCFqecqZkHe/uF80iAWHeGTl+SgVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvYjdt69qsnTrXU0HARYMHgIGzQrsHs1rTTEyTz6LG1iVU+6rP8o7Jp5CDdc3u5Ro rmi6UXHJ6rOJwlZmDWHCVd6/qmxU0lA2t5VrZ4NmfSIaF6B9zvwZQwlgDdh/MQxphQ rNRGlmvIBS+varuueklrNSnUyW0KahyyPo+cdcTY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 207/663] ata: ahci_brcm: Add back regulators management Date: Mon, 1 Mar 2021 17:07:35 +0100 Message-Id: <20210301161152.027900816@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@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: Florian Fainelli [ Upstream commit 10340f8d7b6dd54e616339c8ccb2f397133ebea0 ] 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 Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/ahci_brcm.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c index 49f7acbfcf01e..5b32df5d33adc 100644 --- a/drivers/ata/ahci_brcm.c +++ b/drivers/ata/ahci_brcm.c @@ -377,6 +377,10 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev) if (ret) return ret; + ret = ahci_platform_enable_regulators(hpriv); + if (ret) + goto out_disable_clks; + brcm_sata_init(priv); brcm_sata_phys_enable(priv); brcm_sata_alpm_init(hpriv); @@ -406,6 +410,8 @@ out_disable_platform_phys: ahci_platform_disable_phys(hpriv); out_disable_phys: brcm_sata_phys_disable(priv); + ahci_platform_disable_regulators(hpriv); +out_disable_clks: ahci_platform_disable_clks(hpriv); return ret; } @@ -490,6 +496,10 @@ static int brcm_ahci_probe(struct platform_device *pdev) if (ret) goto out_reset; + ret = ahci_platform_enable_regulators(hpriv); + if (ret) + goto out_disable_clks; + /* Must be first so as to configure endianness including that * of the standard AHCI register space. */ @@ -499,7 +509,7 @@ static int brcm_ahci_probe(struct platform_device *pdev) priv->port_mask = brcm_ahci_get_portmask(hpriv, priv); if (!priv->port_mask) { ret = -ENODEV; - goto out_disable_clks; + goto out_disable_regulators; } /* Must be done before ahci_platform_enable_phys() */ @@ -524,6 +534,8 @@ out_disable_platform_phys: ahci_platform_disable_phys(hpriv); out_disable_phys: brcm_sata_phys_disable(priv); +out_disable_regulators: + ahci_platform_disable_regulators(hpriv); out_disable_clks: ahci_platform_disable_clks(hpriv); out_reset: -- 2.27.0