Message ID | 20221025145101.116393-3-manivannan.sadhasivam@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1057945wru; Tue, 25 Oct 2022 08:07:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5u0D1jTq0qvYgb+4wiNSOYD/ybhP8hKS/CVr+jbFXJ/5Pfn0RRy43uW1BD/aNG3KirpxgI X-Received: by 2002:a17:90b:3886:b0:213:1e8:b8a6 with SMTP id mu6-20020a17090b388600b0021301e8b8a6mr14339262pjb.225.1666710474305; Tue, 25 Oct 2022 08:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666710474; cv=none; d=google.com; s=arc-20160816; b=dIaajyyAXruiCihcSt8QYBhUW3mT2z+9OzodK10Z62tI1WRJxq966gVq0kFPW0JjfO d6OPSEZsWIf+bCcmc8MfAn6knlkCfxmz5q08qGA3fSbUxfOMFkt1WJexe7uisjr2Fof3 aZL0Oo/L/T5Jw4jFpOMHIkzzTmRZ6/Xe4SP1gecGBH37H0BDzq8nAZsR3OKZqpt6ws6R Nv4MeoivBuCiexpVRNW+U36WqxE6thqHHHdNa88hLjyfmqt5nMEh/wniBzRCtbQLoqUg IXJRD5SPGYOaQ16xPzdYeDle6Y5tJNr/y+ps04P1yK1h3zTusbOHXw/orLwGuJ6I23HS dcYA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xlR6S9guDT9sPWfcvESvWKmdq7t2wt4CcZ/x6tOD8xg=; b=eeI2p5bE0AVsvEggc61ZaYg2SxkKZSKqCxTJ/vaZ1GJrhd3Vj37bd+vfutDYIXr4N0 qdg3ieNFb+uwXqXfoZ+ztfF4YtKnFGh0ne+UrJ6aIS1ErE+9cLSTUhe8L/vIvPltZuUx RDiDZ8J5nbm+xhHaY0S/uuYHPNGE+bmGb3AEBd4KQPqeioSClRMBpJ9310VSbegfPy6I dO1i3yLrcfdArwFwtKi24napRgcT6zKADLpls3cbATqioDa3Ld6JY0sf9b7UoyGvByyX xT+HbKk74/cBfDWMSnFSwcuTvHaXV3uHZdjvZZYNPI3pc72fXL7DHd5byOlsNsNBS56i y82w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X8hhfHjP; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw6-20020a17090b4d0600b00212d63cd243si15255104pjb.109.2022.10.25.08.07.20; Tue, 25 Oct 2022 08:07:54 -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=@linaro.org header.s=google header.b=X8hhfHjP; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232850AbiJYOv2 (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Tue, 25 Oct 2022 10:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232860AbiJYOvZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 10:51:25 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A16819E00C for <linux-kernel@vger.kernel.org>; Tue, 25 Oct 2022 07:51:24 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id c24so11148129pls.9 for <linux-kernel@vger.kernel.org>; Tue, 25 Oct 2022 07:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xlR6S9guDT9sPWfcvESvWKmdq7t2wt4CcZ/x6tOD8xg=; b=X8hhfHjP0ZTomxWkO4/xuAcDDkxtY8PakMk51H+wqHBEn4jVYn2wMHVizShCttm02p RlSOodLMjzDprEhF00Y08hBCBy/rUHPuNPpvEVN7yoJLWsuEK0VKflDMgQTpNfPyZG8X NcoxL++w7sMiyvAv4n9x34NbvvOb2wwEB680t2KzQAXLHYf9W+gt8t3YBCS7/rX+TKAr ZFb/b+oxQajUVk5pOeGS94yP96EU93RgXWslI1p9TRbrCQzbFCiGPkk4iIBjjkUmUBIE /ykkGGBlkfe7C/6EiYpOx8jlUjzUOf3wSp215wI9ohcP8AFDRQlwOu2/Y328fv8p8aY6 0qqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xlR6S9guDT9sPWfcvESvWKmdq7t2wt4CcZ/x6tOD8xg=; b=jpJBbtKBVS6Q+aAaKOirhGdp/UNCdzXrjGRLYtXfvOvctrMdQDCdSC2NmIWnhui+BY /q1i134i7Hidlu3fqixwPDp1NwM7TLO/2sWCiF4y6M9itqDqBVtxJ2K1aKlqwDcgLwMf 1UkVz3SX9Zcbpkvxy9YyLiboLrEJrHV0EGB8mBA6RUOCCYklkqArrZ18h3P7c6FO20e5 oBq3WXeREkLJfQOa/hcY2FUUs7IrmAWM3bsJN85sFlhHlnHq3W7Ua+7gKYU+im7OW4Lu nPH3/c0s3g99LG9RHYi7+bDB8Qaoz4p86CmexbhpHNk5xy6r5jMhM0jBjZzRtW19qi7M PlnQ== X-Gm-Message-State: ACrzQf1EX85b7l3jIC2y5j1z7K0suus+pSFRPgRlP2z4YKYHd2y4SX4S wRI/UiF5YdteIBkjfS3teVzH X-Received: by 2002:a17:902:bd05:b0:179:bbad:acff with SMTP id p5-20020a170902bd0500b00179bbadacffmr38091051pls.170.1666709483815; Tue, 25 Oct 2022 07:51:23 -0700 (PDT) Received: from localhost.localdomain ([117.193.208.236]) by smtp.gmail.com with ESMTPSA id n14-20020a170903110e00b00180cf894b67sm1318765plh.130.2022.10.25.07.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 07:51:22 -0700 (PDT) From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> To: kishon@kernel.org, lpieralisi@kernel.org, bhelgaas@google.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kw@linux.com, robh@kernel.org, vidyas@nvidia.com, vigneshr@ti.com, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Subject: [PATCH v4 2/5] PCI: tegra194: Move dw_pcie_ep_linkup() to threaded IRQ handler Date: Tue, 25 Oct 2022 20:20:58 +0530 Message-Id: <20221025145101.116393-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025145101.116393-1-manivannan.sadhasivam@linaro.org> References: <20221025145101.116393-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747672602761563609?= X-GMAIL-MSGID: =?utf-8?q?1747672602761563609?= |
Series |
PCI: endpoint: Rework the EPC to EPF notification
|
|
Commit Message
Manivannan Sadhasivam
Oct. 25, 2022, 2:50 p.m. UTC
dw_pcie_ep_linkup() may take more time to execute depending on the EPF
driver implementation. Calling this API in the hard IRQ handler is not
encouraged since the hard IRQ handlers are supposed to complete quickly.
So move the dw_pcie_ep_linkup() call to threaded IRQ handler.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/controller/dwc/pcie-tegra194.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Comments
On Tue, Oct 25, 2022 at 08:20:58PM +0530, Manivannan Sadhasivam wrote: > dw_pcie_ep_linkup() may take more time to execute depending on the EPF > driver implementation. Calling this API in the hard IRQ handler is not > encouraged since the hard IRQ handlers are supposed to complete quickly. > > So move the dw_pcie_ep_linkup() call to threaded IRQ handler. > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> > --- > drivers/pci/controller/dwc/pcie-tegra194.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c > index 1b6b437823d2..a0d231b7a435 100644 > --- a/drivers/pci/controller/dwc/pcie-tegra194.c > +++ b/drivers/pci/controller/dwc/pcie-tegra194.c > @@ -287,6 +287,7 @@ struct tegra_pcie_dw { > struct gpio_desc *pex_refclk_sel_gpiod; > unsigned int pex_rst_irq; > int ep_state; > + long link_status; > }; > > static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci) > @@ -450,9 +451,13 @@ static void pex_ep_event_hot_rst_done(struct tegra_pcie_dw *pcie) > static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > { > struct tegra_pcie_dw *pcie = arg; > + struct dw_pcie_ep *ep = &pcie->pci.ep; > struct dw_pcie *pci = &pcie->pci; > u32 val, speed; > > + if (test_and_clear_bit(0, &pcie->link_status)) > + dw_pcie_ep_linkup(ep); > + > speed = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA) & > PCI_EXP_LNKSTA_CLS; > clk_set_rate(pcie->core_clk, pcie_gen_freq[speed - 1]); > @@ -499,7 +504,6 @@ static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > { > struct tegra_pcie_dw *pcie = arg; > - struct dw_pcie_ep *ep = &pcie->pci.ep; > int spurious = 1; > u32 status_l0, status_l1, link_status; > > @@ -515,7 +519,8 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > link_status = appl_readl(pcie, APPL_LINK_STATUS); > if (link_status & APPL_LINK_STATUS_RDLH_LINK_UP) { > dev_dbg(pcie->dev, "Link is up with Host\n"); > - dw_pcie_ep_linkup(ep); > + set_bit(0, &pcie->link_status); > + return IRQ_WAKE_THREAD; > } > } > > -- > 2.25.1 >
On Mon, Nov 14, 2022 at 04:37:00PM +0530, Manivannan Sadhasivam wrote: > On Tue, Oct 25, 2022 at 08:20:58PM +0530, Manivannan Sadhasivam wrote: > > dw_pcie_ep_linkup() may take more time to execute depending on the EPF > > driver implementation. Calling this API in the hard IRQ handler is not > > encouraged since the hard IRQ handlers are supposed to complete quickly. > > > > So move the dw_pcie_ep_linkup() call to threaded IRQ handler. > > > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Sorry for resending it (something messed up with my email client). Vidya, can you please review this patch? Thanks, Mani > > --- > > drivers/pci/controller/dwc/pcie-tegra194.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c > > index 1b6b437823d2..a0d231b7a435 100644 > > --- a/drivers/pci/controller/dwc/pcie-tegra194.c > > +++ b/drivers/pci/controller/dwc/pcie-tegra194.c > > @@ -287,6 +287,7 @@ struct tegra_pcie_dw { > > struct gpio_desc *pex_refclk_sel_gpiod; > > unsigned int pex_rst_irq; > > int ep_state; > > + long link_status; > > }; > > > > static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci) > > @@ -450,9 +451,13 @@ static void pex_ep_event_hot_rst_done(struct tegra_pcie_dw *pcie) > > static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > > { > > struct tegra_pcie_dw *pcie = arg; > > + struct dw_pcie_ep *ep = &pcie->pci.ep; > > struct dw_pcie *pci = &pcie->pci; > > u32 val, speed; > > > > + if (test_and_clear_bit(0, &pcie->link_status)) > > + dw_pcie_ep_linkup(ep); > > + > > speed = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA) & > > PCI_EXP_LNKSTA_CLS; > > clk_set_rate(pcie->core_clk, pcie_gen_freq[speed - 1]); > > @@ -499,7 +504,6 @@ static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > > static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > > { > > struct tegra_pcie_dw *pcie = arg; > > - struct dw_pcie_ep *ep = &pcie->pci.ep; > > int spurious = 1; > > u32 status_l0, status_l1, link_status; > > > > @@ -515,7 +519,8 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > > link_status = appl_readl(pcie, APPL_LINK_STATUS); > > if (link_status & APPL_LINK_STATUS_RDLH_LINK_UP) { > > dev_dbg(pcie->dev, "Link is up with Host\n"); > > - dw_pcie_ep_linkup(ep); > > + set_bit(0, &pcie->link_status); > > + return IRQ_WAKE_THREAD; > > } > > } > > > > -- > > 2.25.1 > > > > -- > மணிவண்ணன் சதாசிவம்
On Mon, Nov 14, 2022 at 04:38:20PM +0530, Manivannan Sadhasivam wrote: > On Mon, Nov 14, 2022 at 04:37:00PM +0530, Manivannan Sadhasivam wrote: > > On Tue, Oct 25, 2022 at 08:20:58PM +0530, Manivannan Sadhasivam wrote: > > > dw_pcie_ep_linkup() may take more time to execute depending on the EPF > > > driver implementation. Calling this API in the hard IRQ handler is not > > > encouraged since the hard IRQ handlers are supposed to complete quickly. > > > > > > So move the dw_pcie_ep_linkup() call to threaded IRQ handler. > > > > > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> > > Sorry for resending it (something messed up with my email client). > > Vidya, can you please review this patch? > Ping! Thanks, Mani > Thanks, > Mani > > > > --- > > > drivers/pci/controller/dwc/pcie-tegra194.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c > > > index 1b6b437823d2..a0d231b7a435 100644 > > > --- a/drivers/pci/controller/dwc/pcie-tegra194.c > > > +++ b/drivers/pci/controller/dwc/pcie-tegra194.c > > > @@ -287,6 +287,7 @@ struct tegra_pcie_dw { > > > struct gpio_desc *pex_refclk_sel_gpiod; > > > unsigned int pex_rst_irq; > > > int ep_state; > > > + long link_status; > > > }; > > > > > > static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci) > > > @@ -450,9 +451,13 @@ static void pex_ep_event_hot_rst_done(struct tegra_pcie_dw *pcie) > > > static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > > > { > > > struct tegra_pcie_dw *pcie = arg; > > > + struct dw_pcie_ep *ep = &pcie->pci.ep; > > > struct dw_pcie *pci = &pcie->pci; > > > u32 val, speed; > > > > > > + if (test_and_clear_bit(0, &pcie->link_status)) > > > + dw_pcie_ep_linkup(ep); > > > + > > > speed = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA) & > > > PCI_EXP_LNKSTA_CLS; > > > clk_set_rate(pcie->core_clk, pcie_gen_freq[speed - 1]); > > > @@ -499,7 +504,6 @@ static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > > > static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > > > { > > > struct tegra_pcie_dw *pcie = arg; > > > - struct dw_pcie_ep *ep = &pcie->pci.ep; > > > int spurious = 1; > > > u32 status_l0, status_l1, link_status; > > > > > > @@ -515,7 +519,8 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > > > link_status = appl_readl(pcie, APPL_LINK_STATUS); > > > if (link_status & APPL_LINK_STATUS_RDLH_LINK_UP) { > > > dev_dbg(pcie->dev, "Link is up with Host\n"); > > > - dw_pcie_ep_linkup(ep); > > > + set_bit(0, &pcie->link_status); > > > + return IRQ_WAKE_THREAD; > > > } > > > } > > > > > > -- > > > 2.25.1 > > > > > > > -- > > மணிவண்ணன் சதாசிவம் > > -- > மணிவண்ணன் சதாசிவம்
On Tue, Nov 22, 2022 at 07:19:41PM +0530, Manivannan Sadhasivam wrote: > On Mon, Nov 14, 2022 at 04:38:20PM +0530, Manivannan Sadhasivam wrote: > > On Mon, Nov 14, 2022 at 04:37:00PM +0530, Manivannan Sadhasivam wrote: > > > On Tue, Oct 25, 2022 at 08:20:58PM +0530, Manivannan Sadhasivam wrote: > > > > dw_pcie_ep_linkup() may take more time to execute depending on the EPF > > > > driver implementation. Calling this API in the hard IRQ handler is not > > > > encouraged since the hard IRQ handlers are supposed to complete quickly. > > > > > > > > So move the dw_pcie_ep_linkup() call to threaded IRQ handler. > > > > > > > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> > > > > Sorry for resending it (something messed up with my email client). > > > > Vidya, can you please review this patch? > > > > Ping! > Ping again. Vidya, only your t-b tag is missing to get this series merged. Can you please test and report back. There are few series that depends on this including a couple from you. Thanks, Mani > Thanks, > Mani > > > Thanks, > > Mani > > > > > > --- > > > > drivers/pci/controller/dwc/pcie-tegra194.c | 9 +++++++-- > > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c > > > > index 1b6b437823d2..a0d231b7a435 100644 > > > > --- a/drivers/pci/controller/dwc/pcie-tegra194.c > > > > +++ b/drivers/pci/controller/dwc/pcie-tegra194.c > > > > @@ -287,6 +287,7 @@ struct tegra_pcie_dw { > > > > struct gpio_desc *pex_refclk_sel_gpiod; > > > > unsigned int pex_rst_irq; > > > > int ep_state; > > > > + long link_status; > > > > }; > > > > > > > > static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci) > > > > @@ -450,9 +451,13 @@ static void pex_ep_event_hot_rst_done(struct tegra_pcie_dw *pcie) > > > > static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > > > > { > > > > struct tegra_pcie_dw *pcie = arg; > > > > + struct dw_pcie_ep *ep = &pcie->pci.ep; > > > > struct dw_pcie *pci = &pcie->pci; > > > > u32 val, speed; > > > > > > > > + if (test_and_clear_bit(0, &pcie->link_status)) > > > > + dw_pcie_ep_linkup(ep); > > > > + > > > > speed = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA) & > > > > PCI_EXP_LNKSTA_CLS; > > > > clk_set_rate(pcie->core_clk, pcie_gen_freq[speed - 1]); > > > > @@ -499,7 +504,6 @@ static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) > > > > static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > > > > { > > > > struct tegra_pcie_dw *pcie = arg; > > > > - struct dw_pcie_ep *ep = &pcie->pci.ep; > > > > int spurious = 1; > > > > u32 status_l0, status_l1, link_status; > > > > > > > > @@ -515,7 +519,8 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) > > > > link_status = appl_readl(pcie, APPL_LINK_STATUS); > > > > if (link_status & APPL_LINK_STATUS_RDLH_LINK_UP) { > > > > dev_dbg(pcie->dev, "Link is up with Host\n"); > > > > - dw_pcie_ep_linkup(ep); > > > > + set_bit(0, &pcie->link_status); > > > > + return IRQ_WAKE_THREAD; > > > > } > > > > } > > > > > > > > -- > > > > 2.25.1 > > > > > > > > > > -- > > > மணிவண்ணன் சதாசிவம் > > > > -- > > மணிவண்ணன் சதாசிவம் > > -- > மணிவண்ணன் சதாசிவம்
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 1b6b437823d2..a0d231b7a435 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -287,6 +287,7 @@ struct tegra_pcie_dw { struct gpio_desc *pex_refclk_sel_gpiod; unsigned int pex_rst_irq; int ep_state; + long link_status; }; static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci) @@ -450,9 +451,13 @@ static void pex_ep_event_hot_rst_done(struct tegra_pcie_dw *pcie) static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) { struct tegra_pcie_dw *pcie = arg; + struct dw_pcie_ep *ep = &pcie->pci.ep; struct dw_pcie *pci = &pcie->pci; u32 val, speed; + if (test_and_clear_bit(0, &pcie->link_status)) + dw_pcie_ep_linkup(ep); + speed = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA) & PCI_EXP_LNKSTA_CLS; clk_set_rate(pcie->core_clk, pcie_gen_freq[speed - 1]); @@ -499,7 +504,6 @@ static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg) static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) { struct tegra_pcie_dw *pcie = arg; - struct dw_pcie_ep *ep = &pcie->pci.ep; int spurious = 1; u32 status_l0, status_l1, link_status; @@ -515,7 +519,8 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) link_status = appl_readl(pcie, APPL_LINK_STATUS); if (link_status & APPL_LINK_STATUS_RDLH_LINK_UP) { dev_dbg(pcie->dev, "Link is up with Host\n"); - dw_pcie_ep_linkup(ep); + set_bit(0, &pcie->link_status); + return IRQ_WAKE_THREAD; } }