Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1864495rwb; Fri, 19 Aug 2022 10:39:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR73HOriFL07kSvEbMBUYUL1WzbSVEka7VLWP7SrmFZBRiZMy3bcQC2oPpv0Uuls+cDaWIC/ X-Received: by 2002:a17:90a:62cc:b0:1fa:c17d:de02 with SMTP id k12-20020a17090a62cc00b001fac17dde02mr9662358pjs.26.1660930771203; Fri, 19 Aug 2022 10:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930771; cv=none; d=google.com; s=arc-20160816; b=jc7fYx3b9GprwQhwiS3Mlgxv/ehEhLF8KWJIlxMqs1WlN53Kj/O5PAqz8bacD2tu+a Q1WFvnPaQt5Ctq58a+ph+aKmZKgaHuYPHgGD3iGnXZXRXS8rZMwvexYzxD8O+HGl2BvT 9uuNDqKHAVaWx3FLkLriiBj44x3+yZ433FB8k1yvBObS2kg0oWbGlZ9CqUbWodXhqlax YYapOe25b3bsyCj/9YFTVPm6Nm9XvW87/snNp+ulCyGVxABmQ+Yu3RQsOMVAfK2iTzGN M1tXQ+gbWqWIWshv0brEFHrVxkPJNEY8bYdp91LhW7CNfWeZ8KfPq+tLu+r2/TQjYtJD azdg== 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=zz0suc8xZmer/Onwh1BVQnGgq0tweWyXma0k8WhALhA=; b=PSwtVqQqA6B38825WyiPBp8Bnn6cVGxf/4rnC1vgK38qWv/Lzo7J/Ox/Nm+yB7WyMR iqm7M9hpu9A8iataUqxwUMiMGZM4ednALpuKZSqALLogGyE2o4dvC6t3HIBT3aAQH91x 0I4RcQky9nfiUCTzKXUvu1IyWPZlzxXAcf6J87FaJMNgSBlBG6dEHOcT04r9o8/3Yl9l KMfm5OfXXV9+suIm76yd4cpJaidfRU+rEbufgTULk95vhK+ARdzAVjhaWn/fTKo5vxnt NvQ2MS/EAIswG+ERWHy6ByIcLmg4h0hkZjoJBLjbtpzG1yrXZaaRL3Uz120fNx+zcxJu 9/Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vv0pPc+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo17-20020a17090b1c9100b001ef69a94be2si8344487pjb.134.2022.08.19.10.39.19; Fri, 19 Aug 2022 10:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vv0pPc+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1352214AbiHSQXc (ORCPT + 99 others); Fri, 19 Aug 2022 12:23:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352887AbiHSQSC (ORCPT ); Fri, 19 Aug 2022 12:18:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 026EC109A28; Fri, 19 Aug 2022 09:01:04 -0700 (PDT) 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 2AAEFB827F8; Fri, 19 Aug 2022 16:00:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9030FC433C1; Fri, 19 Aug 2022 16:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924852; bh=oHE8NdQs2C19dr7h8yVkyh2h8g6uL/b9qy2FrVV/yzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vv0pPc+mUpQ5HC/c/4sGdMfmhJf7BPAxozlloVx3Ci+h44JM51GLgAkONnTtfRSKK m/J2zmtwV3f6Mul/eXLZwg/KLM6wbOypyE2XbvZf/wzIb+mP+YZOpBnTxHsAHTs8ip uAuUSl4iCtGxBFv0ywI0NNBP7N6tAr7tsb82AQFY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Serge Semin , Bjorn Helgaas , Vidya Sagar , Rob Herring , Manivannan Sadhasivam , Sasha Levin Subject: [PATCH 5.10 303/545] PCI: dwc: Always enable CDM check if "snps,enable-cdm-check" exists Date: Fri, 19 Aug 2022 17:41:13 +0200 Message-Id: <20220819153842.894243190@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Serge Semin [ Upstream commit ec7b952f453ce7eabe7e1bea584626934d44f668 ] If the "snps,enable-cdm-check" property exists, we should enable the CDM check. But previously dw_pcie_setup() could exit before doing so if the "num-lanes" property was absent or invalid. Move the CDM enable earlier so we do it regardless of whether "num-lanes" is present. [bhelgaas: commit log] Fixes: 07f123def73e ("PCI: dwc: Add support to enable CDM register check") Link: https://lore.kernel.org/r/20220624143428.8334-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin Signed-off-by: Bjorn Helgaas Reviewed-by: Vidya Sagar Reviewed-by: Rob Herring Reviewed-by: Manivannan Sadhasivam Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pcie-designware.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 69651c6ae6c6..2b74ff88c5c5 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -598,6 +598,13 @@ void dw_pcie_setup(struct dw_pcie *pci) val |= PORT_LINK_DLL_LINK_EN; dw_pcie_writel_dbi(pci, PCIE_PORT_LINK_CONTROL, val); + if (of_property_read_bool(np, "snps,enable-cdm-check")) { + val = dw_pcie_readl_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS); + val |= PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS | + PCIE_PL_CHK_REG_CHK_REG_START; + dw_pcie_writel_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS, val); + } + of_property_read_u32(np, "num-lanes", &pci->num_lanes); if (!pci->num_lanes) { dev_dbg(pci->dev, "Using h/w default number of lanes\n"); @@ -644,11 +651,4 @@ void dw_pcie_setup(struct dw_pcie *pci) break; } dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, val); - - if (of_property_read_bool(np, "snps,enable-cdm-check")) { - val = dw_pcie_readl_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS); - val |= PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS | - PCIE_PL_CHK_REG_CHK_REG_START; - dw_pcie_writel_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS, val); - } } -- 2.35.1