From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB3511E485; Mon, 14 Apr 2025 05:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.235 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744608725; cv=none; b=qM0IT1OJq3MlsTG3dFKrPxWIaYyNUnsfAnZTBi/Ap3S5mAup6s7EkWxD9/zVAs4f0bMRG+fMOVneN5LvZFKz1acMQ8huNDsXu4++uMTmLqQ7a7b+WTBhLDbpBk06omO3YoI9xeF9UJQFLMI16quRYyMv8PLD3IPdOL8yAth8nDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744608725; c=relaxed/simple; bh=nvmRlBZP6S0aHngR3raZ8sTFvf7lhW6vpQiWIB1PnwY=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=isbySAln3ERDOacXa2m1RIGW9jK0Q1ohtMeK+yAPjd35ZpJ4IyuIgOmaawhnFQ3pZTedFSyVRq13YKZeZS3GTx0KQCWuMTGLT42HbfXS50SVdnin7Mj+dcroDiS2b56IpLbcYBwuKXkXqsA4KYm9J+zzsKuE36bmX5kBKXg/Ex0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=Rb9kpBMw; arc=none smtp.client-ip=198.47.23.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Rb9kpBMw" Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 53E5Vbku2588222 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Apr 2025 00:31:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1744608697; bh=RNrzo4vxBhguvLaEudcl+hrEkS66Htf3Q3iVSvUxxHI=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=Rb9kpBMwY2iU0AS1qtyp8CkhsHAuIdwkJRPLyX9Pc98pdRU2s5thC1agINLkvczzQ Crpp4gF7CGFGBNaXZmqiOOZecor1MDffWNlpM+pC5/Dyu/igmGLWrRg9YxOArFDo5A j49mQIqvEykN5kdVgmaiCbhSEtNAk5Qvwx+Empk8= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 53E5VblY055152 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 14 Apr 2025 00:31:37 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 14 Apr 2025 00:31:36 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 14 Apr 2025 00:31:36 -0500 Received: from localhost (uda0492258.dhcp.ti.com [10.24.72.113]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 53E5VZog118605; Mon, 14 Apr 2025 00:31:36 -0500 Date: Mon, 14 Apr 2025 11:01:35 +0530 From: Siddharth Vadapalli To: , , , , , , , <18255117159@163.com>, , , , CC: , , , , , Subject: Re: [PATCH v3 4/4] PCI: j721e: Add support to build as a loadable module Message-ID: <964616c8-be22-40cb-aa52-cc5e8f72dd19@ti.com> References: <20250410104426.463453-1-s-vadapalli@ti.com> <20250410104426.463453-5-s-vadapalli@ti.com> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20250410104426.463453-5-s-vadapalli@ti.com> X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea On Thu, Apr 10, 2025 at 04:14:26PM +0530, Siddharth Vadapalli wrote: > The 'pci-j721e.c' driver is the application/glue/wrapper driver for the > Cadence PCIe Controllers on TI SoCs. Implement support for building it as a > loadable module. > > Signed-off-by: Siddharth Vadapalli > --- > > v2 of this patch is at: > https://lore.kernel.org/r/20250330083914.529222-5-s-vadapalli@ti.com/ > Change since v2: > - Dropped a delay before PERST assertion in the driver's remove callback > based on Mani's feedback at: > https://lore.kernel.org/r/zsxnx7biwogov5dw5yiafkgk6tsrtspac75bjbrca5uevweaim@ly67hwfyk7qh/ > > drivers/pci/controller/cadence/Kconfig | 6 ++--- > drivers/pci/controller/cadence/pci-j721e.c | 31 +++++++++++++++++++++- > 2 files changed, 33 insertions(+), 4 deletions(-) > [...] > diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c > index ef1cfdae33bb..51b09f70000c 100644 > --- a/drivers/pci/controller/cadence/pci-j721e.c > +++ b/drivers/pci/controller/cadence/pci-j721e.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -27,6 +28,7 @@ > #define cdns_pcie_to_rc(p) container_of(p, struct cdns_pcie_rc, pcie) > > #define ENABLE_REG_SYS_2 0x108 > +#define ENABLE_CLR_REG_SYS_2 0x308 > #define STATUS_REG_SYS_2 0x508 > #define STATUS_CLR_REG_SYS_2 0x708 > #define LINK_DOWN BIT(1) > @@ -116,6 +118,15 @@ static irqreturn_t j721e_pcie_link_irq_handler(int irq, void *priv) > return IRQ_HANDLED; > } > > +static void j721e_pcie_disable_link_irq(struct j721e_pcie *pcie) > +{ > + u32 reg; > + > + reg = j721e_pcie_intd_readl(pcie, ENABLE_CLR_REG_SYS_2); > + reg |= pcie->linkdown_irq_regfield; > + j721e_pcie_intd_writel(pcie, ENABLE_CLR_REG_SYS_2, reg); > +} > + > static void j721e_pcie_config_link_irq(struct j721e_pcie *pcie) > { > u32 reg; > @@ -633,9 +644,23 @@ static void j721e_pcie_remove(struct platform_device *pdev) > struct j721e_pcie *pcie = platform_get_drvdata(pdev); > struct cdns_pcie *cdns_pcie = pcie->cdns_pcie; > struct device *dev = &pdev->dev; > + struct cdns_pcie_ep *ep; > + struct cdns_pcie_rc *rc; > + > + if (pcie->mode == PCI_MODE_RC) { > + rc = container_of(cdns_pcie, struct cdns_pcie_rc, pcie); > + cdns_pcie_host_disable(rc); > + } else { > + ep = container_of(cdns_pcie, struct cdns_pcie_ep, pcie); > + cdns_pcie_ep_disable(ep); > + } > + > + if (pcie->reset_gpio) > + gpiod_set_value_cansleep(pcie->reset_gpio, 1); As Mani pointed out in the v2 series at: https://lore.kernel.org/r/6bi5gul3sqvycmkf6cwokkvownjffaf2tkonjlefo2d7cautwx@uhfexzgz3okp/ for PERST# assert in the .remove callback, it should have been a 0 instead of a 1. I will fix this in the v4 series. Regards, Siddharth.