Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3724870pxb; Mon, 24 Jan 2022 16:24:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCkVqSy9vDHrHkSo8yTuMBSzavIwfT2JA5KYwRQ7XyYt4Z4v0RiQaixMMq77GVrixrttZw X-Received: by 2002:a17:902:9a87:b0:14b:6dd6:f4b1 with SMTP id w7-20020a1709029a8700b0014b6dd6f4b1mr1893655plp.6.1643070250931; Mon, 24 Jan 2022 16:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070250; cv=none; d=google.com; s=arc-20160816; b=xNo92o1ra8Uam3wDtqAFLuaOJsl4LJZbcADy4PiXAue6doyhdOilx+UlfFWunDb2H9 7lQMHehESxBdvjciCtlS07fakif9aW86xBqte/cs9VWUjF5k23qR2HK5vCyrMeAE4dRS DHh1GBtagB9kDUTPtRFZ8jAyorHauBlQtv99Kzyc+ruHeSjqJwhpl+fmt25srK9oMiG7 ASBhz+E6Lt/33Vt65GkhCEgsszI1ZzSLiZpECeeVONMp46TU71M9lnEsVMMPM0kK0FKX cKbiekhiUssN8l+DN1aaLzbT9kADO8FmAnFC2ZvTcem6KCBNpfATSslZuLgFg8IPwlsB QEug== 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=3wlbOTy9j0RBw2/sfPlV+t8i+iy3pWGDJF4+VKK2y94=; b=ygFAASp5O/fV/lBbXzEpRiW68k2L04rqHLVml58yOOnqwdHPQ5ohx8ftGj7CnrlyqS cblAPMHRMEjbAuoricHaW3g4/WeyADB68Kt7ummJvqxQ457jLZ29SWZsF7ptsaeQgirA Sw0JYpT9dRbRZ/nzpHUdxzgN/ogMli8iK4Dg2YtWyiOI/NIrQA/TEW2nLxJJV9POw1WA SHKSfuXHZDQICZbAbKg4WcEJcpb9fWZa9VPjWFiv1+OkgVhjb9h+2M2ZiXIjKi+09Eu8 3JCPxmaL4Qu7m1Iv/RxjB/HFYf1xI8fu8xMrsYN878xBPBYnXjU9/KC8NlalfLVnlpD2 ciGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p7fR+ZSS; 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 k35si15185922pgl.310.2022.01.24.16.23.58; Mon, 24 Jan 2022 16:24:10 -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=p7fR+ZSS; 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 S1357445AbiAYAOd (ORCPT + 99 others); Mon, 24 Jan 2022 19:14:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572900AbiAXX2Q (ORCPT ); Mon, 24 Jan 2022 18:28:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D07FBC01D7FD; Mon, 24 Jan 2022 13:32:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 98E1EB8105C; Mon, 24 Jan 2022 21:32:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC73BC340E4; Mon, 24 Jan 2022 21:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059944; bh=vqNbZ/QgN62kkNQGfD6HduBejctEmovphbmTpQUP7KY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p7fR+ZSS1Q2jhLpUR3LqYDADPC44hGRpt+x+T/MoQQaCXxQLKyCPuf97coRGlysDG S81rR5lTZeh0QyteKg7vk3flmz88MEYvCdek0t7OG66byPkGIQz4zSIiqHD2567cNc siH97xj94usC7Ezxpp/8eSc14CjI0aAjn38q2ECI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hector Martin , Lorenzo Pieralisi , Marc Zyngier , Sasha Levin Subject: [PATCH 5.16 0787/1039] PCI: apple: Fix REFCLK1 enable/poll logic Date: Mon, 24 Jan 2022 19:42:56 +0100 Message-Id: <20220124184151.746567209@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Hector Martin [ Upstream commit 75d36df6807838f3c826c21c0fa51cdc079667d1 ] REFCLK1 has req/ack bits that need to be programmed, just like REFCLK0. Link: https://lore.kernel.org/r/20211117140044.193865-1-marcan@marcan.st Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up") Signed-off-by: Hector Martin Signed-off-by: Lorenzo Pieralisi Acked-by: Marc Zyngier Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-apple.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index b090924b41fee..537ac9fe2e842 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -42,8 +42,9 @@ #define CORE_FABRIC_STAT_MASK 0x001F001F #define CORE_LANE_CFG(port) (0x84000 + 0x4000 * (port)) #define CORE_LANE_CFG_REFCLK0REQ BIT(0) -#define CORE_LANE_CFG_REFCLK1 BIT(1) +#define CORE_LANE_CFG_REFCLK1REQ BIT(1) #define CORE_LANE_CFG_REFCLK0ACK BIT(2) +#define CORE_LANE_CFG_REFCLK1ACK BIT(3) #define CORE_LANE_CFG_REFCLKEN (BIT(9) | BIT(10)) #define CORE_LANE_CTL(port) (0x84004 + 0x4000 * (port)) #define CORE_LANE_CTL_CFGACC BIT(15) @@ -482,9 +483,9 @@ static int apple_pcie_setup_refclk(struct apple_pcie *pcie, if (res < 0) return res; - rmw_set(CORE_LANE_CFG_REFCLK1, pcie->base + CORE_LANE_CFG(port->idx)); + rmw_set(CORE_LANE_CFG_REFCLK1REQ, pcie->base + CORE_LANE_CFG(port->idx)); res = readl_relaxed_poll_timeout(pcie->base + CORE_LANE_CFG(port->idx), - stat, stat & CORE_LANE_CFG_REFCLK1, + stat, stat & CORE_LANE_CFG_REFCLK1ACK, 100, 50000); if (res < 0) -- 2.34.1