Message ID | 20230313200816.30105-2-Sergey.Semin@baikalelectronics.ru |
---|---|
State | New |
Headers | show
Return-Path: <linux-pci-owner@vger.kernel.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=baikalelectronics.ru header.i=@baikalelectronics.ru header.a=rsa-sha256 header.s=post header.b=AZJoDYQZ; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Pb75k4rp0z1yWr for <incoming@patchwork.ozlabs.org>; Tue, 14 Mar 2023 07:08:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbjCMUIy (ORCPT <rfc822;incoming@patchwork.ozlabs.org>); Mon, 13 Mar 2023 16:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjCMUIx (ORCPT <rfc822;linux-pci@vger.kernel.org>); Mon, 13 Mar 2023 16:08:53 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 167E7234D4; Mon, 13 Mar 2023 13:08:50 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 2A837E0EB2; Mon, 13 Mar 2023 23:08:49 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=c/LX19LYqNghHlF8MeTyEn1bCVcX9wxhnRB6cKrr+vE=; b=AZJoDYQZTj5J /TTsHaVNhsZdsi6JHY/TBdN40YztXLKNwNj7+m8Pc47fnekHUhSnU/7mZGXxiVxv mF3SIr4M+rInP/StFSe7+NOnDeiHH4wrr2Ywnk+aoEi+wa79dm2KxbjIp7naof0B FUlyzZdW5tElCRuANI5wIr4hkrt6xzQ= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 19B25E0E1C; Mon, 13 Mar 2023 23:08:49 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 13 Mar 2023 23:08:48 +0300 From: Serge Semin <Sergey.Semin@baikalelectronics.ru> To: Bjorn Helgaas <bhelgaas@google.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Cai Huoqing <cai.huoqing@linux.dev>, Jingoo Han <jingoohan1@gmail.com>, Gustavo Pimentel <gustavo.pimentel@synopsys.com>, Vinod Koul <vkoul@kernel.org>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>, Rob Herring <robh@kernel.org>, Serge Semin <fancer.lancer@gmail.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= <kw@linux.com>, Vidya Sagar <vidyas@nvidia.com>, Manivannan Sadhasivam <mani@kernel.org> CC: Serge Semin <Sergey.Semin@baikalelectronics.ru>, Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>, Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>, <linux-pci@vger.kernel.org>, <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH RESEND v2 01/11] PCI: dwc: Fix port link CSR improper init if CDM check enabled Date: Mon, 13 Mar 2023 23:08:05 +0300 Message-ID: <20230313200816.30105-2-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313200816.30105-1-Sergey.Semin@baikalelectronics.ru> References: <20230313200816.30105-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.10] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-pci.vger.kernel.org> X-Mailing-List: linux-pci@vger.kernel.org |
Series |
PCI: dwc: Relatively simple fixes and cleanups
|
expand
|
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 53a16b8b6ac2..04fedd257ef1 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -1019,6 +1019,7 @@ void dw_pcie_setup(struct dw_pcie *pci) } /* Set the number of lanes */ + val = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL); val &= ~PORT_LINK_FAST_LINK_MODE; val &= ~PORT_LINK_MODE_MASK; switch (pci->num_lanes) {
If CDM_CHECK capability is set then the local variable 'val' will be overwritten in the dw_pcie_setup() method in the PL_CHK register initialization procedure. Thus further variable usage in the framework of the PCIE_PORT_LINK_CONTROL register initialization must imply the variable re-initialization. Alas it hasn't been taken into account in the commit ec7b952f453c ("PCI: dwc: Always enable CDM check if "snps,enable-cdm-check" exists"). Due to that the PCIE_PORT_LINK_CONTROL register will be written with improper value in case if the CDM-check is enabled. Let's fix this by re-initializing the 'val' variable with the PCIE_PORT_LINK_CONTROL CSR content before link-mode initialization. Fixes: ec7b952f453c ("PCI: dwc: Always enable CDM check if "snps,enable-cdm-check" exists") Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> --- drivers/pci/controller/dwc/pcie-designware.c | 1 + 1 file changed, 1 insertion(+)