From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no 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 29168C433E0 for ; Tue, 29 Dec 2020 21:33:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D611620867 for ; Tue, 29 Dec 2020 21:33:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D611620867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3JU7ACmiW2HfR5zUP2KdDT1oBdHQUfmAoXJ+4vMYsRE=; b=gsyoAqRG5kexi99jV0yywFECL Xc3m21uJ7vA7nZM7K7IgTTf3bEIl4VeFQERMxcf+GfBfgzIrdC/d9xqSnJHgOF0NDh9ziL54LuiDM f/SbQS6a4o6A9yO6E5abBUWuzjax8Afqa+BdSen9HyTHxpM2YbTavJ762ndHYcQ0TvO0W0kLcHWhy VyYTJr6etiT6a47Ot/ELU+5ND/LemCCGayk6QOKDtEOT2VpNt+yupavG8/kvXyHAxYmhFeAn78vWg o/8ppiu2rC3b2tFnZR5zcuAlkaoldQeaTodyI93XHVquV8Ofcatt5IO/cRh1Zz8Xx1OTCZupzbrVa rs2UWCX+Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuMay-0004aV-GR; Tue, 29 Dec 2020 21:31:56 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuMau-0004a5-R6 for linux-arm-kernel@lists.infradead.org; Tue, 29 Dec 2020 21:31:54 +0000 X-Originating-IP: 91.174.235.35 Received: from windsurf (unknown [91.174.235.35]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C8144240005; Tue, 29 Dec 2020 21:31:47 +0000 (UTC) Date: Tue, 29 Dec 2020 22:31:46 +0100 From: Thomas Petazzoni To: Nadeem Athani Subject: Re: [PATCH v6 2/2] PCI: cadence: Retrain Link to work around Gen2 training defect. Message-ID: <20201229223146.3081aa50@windsurf> In-Reply-To: <20201228140510.14641-3-nadeem@cadence.com> References: <20201228140510.14641-1-nadeem@cadence.com> <20201228140510.14641-3-nadeem@cadence.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201229_163153_377808_69A3300A X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, mparab@cadence.com, linux-pci@vger.kernel.org, pthombar@cadence.com, linux-kernel@vger.kernel.org, kishon@ti.com, tjoseph@cadence.com, sjakhade@cadence.com, bhelgaas@google.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 28 Dec 2020 15:05:10 +0100 Nadeem Athani wrote: > +static void cdns_pcie_retrain(struct cdns_pcie *pcie) Shouldn't this propagate a return value ? > +{ > + u32 lnk_cap_sls, pcie_cap_off = CDNS_PCIE_RP_CAP_OFFSET; > + u16 lnk_stat, lnk_ctl; > + > + /* > + * Set retrain bit if current speed is 2.5 GB/s, > + * but the PCIe root port support is > 2.5 GB/s. > + */ > + > + lnk_cap_sls = cdns_pcie_readl(pcie, (CDNS_PCIE_RP_BASE + pcie_cap_off + > + PCI_EXP_LNKCAP)); > + if ((lnk_cap_sls & PCI_EXP_LNKCAP_SLS) <= PCI_EXP_LNKCAP_SLS_2_5GB) > + return; > + > + lnk_stat = cdns_pcie_rp_readw(pcie, pcie_cap_off + PCI_EXP_LNKSTA); > + if ((lnk_stat & PCI_EXP_LNKSTA_CLS) == PCI_EXP_LNKSTA_CLS_2_5GB) { > + lnk_ctl = cdns_pcie_rp_readw(pcie, > + pcie_cap_off + PCI_EXP_LNKCTL); > + lnk_ctl |= PCI_EXP_LNKCTL_RL; > + cdns_pcie_rp_writew(pcie, pcie_cap_off + PCI_EXP_LNKCTL, > + lnk_ctl); > + > + if (cdns_pcie_host_wait_for_link(pcie)) > + return; Here, shouldn't you return the status of cdns_pcie_host_wait_for_link(), to propagate whether the PCIe link indeed came up after the retrain ? Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel