From patchwork Tue Jan 7 20:53:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 234267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1811EC282DD for ; Tue, 7 Jan 2020 21:25:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD465206F0 for ; Tue, 7 Jan 2020 21:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578432305; bh=XN91WMhPprD4b/UsTpOvfPCPOXJC3jVmbpYkSX+YEIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xBGtD4SHblpZZXOLs42pySdb0lAvg7oL6BQb/q7yJ4IskQ3Tc4Ey4WHMkLfenVpYM XEHbl3YCDpTbcaFjA6b6NKJYYiUISRfRepgLuGJiQ9Xi2oJvUqnwpfJ7O5tH09s2mr /K6CGufCSLE4rplcJtwBoDe3oX7BhtwWJT/PGmuo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgAGVZE (ORCPT ); Tue, 7 Jan 2020 16:25:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:34564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbgAGVAQ (ORCPT ); Tue, 7 Jan 2020 16:00:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 3FD7F2081E; Tue, 7 Jan 2020 21:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578430814; bh=XN91WMhPprD4b/UsTpOvfPCPOXJC3jVmbpYkSX+YEIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WQF57/XrZJAaWdUS3aqjk7c/Z+kNQo2COOd7rfO4NSxA3lnwFpdNsLJJS5D0Exmrq CvJu9SjQmIULX9F7YT/A+ffoMhDvXE5wVte34hA+l35fNzN2dgoBzsIIOl5XAV21rI RhLQ5ZarHXql/zxAQIphYtlsqGgHiaVC6pcqlk4Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Florian Fainelli , Jens Axboe Subject: [PATCH 5.4 107/191] ata: ahci_brcm: Add missing clock management during recovery Date: Tue, 7 Jan 2020 21:53:47 +0100 Message-Id: <20200107205338.715588859@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107205332.984228665@linuxfoundation.org> References: <20200107205332.984228665@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli commit bf0e5013bc2dcac205417e1252205dca39dfc005 upstream. The downstream implementation of ahci_brcm.c did contain clock management recovery, but until recently, did that outside of the libahci_platform helpers and this was unintentionally stripped out while forward porting the patch upstream. Add the missing clock management during recovery and sleep for 10 milliseconds per the design team recommendations to ensure the SATA PHY controller and AFE have been fully quiesced. Fixes: eb73390ae241 ("ata: ahci_brcm: Recover from failures to identify devices") Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede Signed-off-by: Florian Fainelli Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/ata/ahci_brcm.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/ata/ahci_brcm.c +++ b/drivers/ata/ahci_brcm.c @@ -275,6 +275,13 @@ static unsigned int brcm_ahci_read_id(st /* Perform the SATA PHY reset sequence */ brcm_sata_phy_disable(priv, ap->port_no); + /* Reset the SATA clock */ + ahci_platform_disable_clks(hpriv); + msleep(10); + + ahci_platform_enable_clks(hpriv); + msleep(10); + /* Bring the PHY back on */ brcm_sata_phy_enable(priv, ap->port_no);