From nobody Wed Feb 11 02:26:54 2026 Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) (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 87961155354 for ; Mon, 22 Apr 2024 19:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815960; cv=none; b=VWlPv/XeIn8HrESgLz4UL5sxxQkV5Pk1ChOx8ypGJ2qBeORE4SAsznCGtS1tN2eM9DRXkkFmR1q/h57jKSS5AUKJt8Zcey+72+WJYesUprybilk8KxYBBcU59xXpncs+iY7Kx1n9UWLVkH2OGMjDHVlMeVn3gfuj8HuamNsTwrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815960; c=relaxed/simple; bh=1vNlEqox6uMgRn3Af21glmZB/Nwjhj2D/nnw+8Etiw0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rcuxfWRkSunYZ4eE+l0dELy7k/M/EvxthMDjj/BWMnA1MGaa56P+Ez1ud2ODzd80Jxo300X9h+wDGZtCf1E9l+jbWOKeBOvkngtr6zskISNOwC5bhALAMxKfQ7vbNKJeGC+Ru4fFlYPViYxuZC3/Xh4Kz2j6OwUwF5IjQEjtKso= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=uEIe/Tr0; arc=none smtp.client-ip=95.215.58.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uEIe/Tr0" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nYP4mxOavzB2qCcAfv7/Ktjba9PcHe+yH0s2PIMDZB8=; b=uEIe/Tr0sG+X3pEYz52rCl5ct5Jhk9nzexkpGCZQWsET51HmpeimmiF+Fsyf+/4p4qsHkS 9/Iy2JbaPb8pxfEI5/RwleQYqATXn392ST9a2XddVy6eK4QBi2r+OYM6QKcj6clWDJPIbz Lalxu2MGoR7KZWYcpNywIDJyp9V8PAo= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson , Conor Dooley , Krzysztof Kozlowski , devicetree@vger.kernel.org Subject: [PATCH 1/7] dt-bindings: pci: xilinx-nwl: Add phys Date: Mon, 22 Apr 2024 15:58:58 -0400 Message-Id: <20240422195904.3591683-2-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Add phys properties so Linux can power-on/configure the GTR transcievers. Signed-off-by: Sean Anderson --- Documentation/devicetree/bindings/pci/xlnx,nwl-pcie.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/xlnx,nwl-pcie.yaml b/Doc= umentation/devicetree/bindings/pci/xlnx,nwl-pcie.yaml index 426f90a47f35..02315669b831 100644 --- a/Documentation/devicetree/bindings/pci/xlnx,nwl-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/xlnx,nwl-pcie.yaml @@ -61,6 +61,14 @@ properties: interrupt-map: maxItems: 4 =20 + phys: + maxItems: 4 + + phy-names: + maxItems: 4 + items: + - pattern: '^pcie-phy[0-3]$' + power-domains: maxItems: 1 =20 --=20 2.35.1.1320.gc452695387.dirty From nobody Wed Feb 11 02:26:54 2026 Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) (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 879A615539E for ; Mon, 22 Apr 2024 19:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815958; cv=none; b=Y8Mz33VF2To1hfMuNqjaWJraajGe3uLlQs4hwjujsW3tc5mPIKb2OiK0/Lx8ddFTB8usjMBl3gpMRRHnUApTqBSKbVZl15Z51DWZBx59RP/PjN2lhYXh2YCVZmfTVEV8q9qUzHmckSVvzMgoDLWyZF1sZcAlk1YrLaWlaur6BRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815958; c=relaxed/simple; bh=LwPdmR8T/aH1kw3i4JjBM2eMK60qsGACKxgdXHID3TU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ravq6x2iAUnoYy8l7fZDHC0n3hH5rqEuk28HfU6x2MS8B40KMJg9VaYmDUfhBA7SItcaa96E53AEPOxi6VrnJRKz4ZEC330dbT2LshcimdPtM390pHW7ilA8nm46w2noLXCrKKIPIUUe6/mBn5CORrDYRlOul+xb9ZUfgx+shyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=KDrk3IC/; arc=none smtp.client-ip=95.215.58.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KDrk3IC/" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uxrzEwSyavPBOJlQAif9+5rStSFz6W1Ij1Eu/oUzLnc=; b=KDrk3IC/L4fgCZN/+vzk/pxjOzeiz0gYdiIHpjWJENRhHn8pIipO19ki11qyDlB8u34hio NF7rl9Pu5kg1b+4vqLwV1dxPUHh4nm0dOv1LQMmzw1Fvo3f9dJk/uAsKji5Ie0B+dwB47o NQ2SaLoRQrxUHYYLeQVokHsiz3pXmXI= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson , stable@vger.kernel.org, Bharat Kumar Gogada Subject: [PATCH 2/7] PCI: xilinx-nwl: Fix off-by-one Date: Mon, 22 Apr 2024 15:58:59 -0400 Message-Id: <20240422195904.3591683-3-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" IRQs start at 0, so we don't need to subtract 1. Fixes: 9a181e1093af ("PCI: xilinx-nwl: Modify IRQ chip for legacy interrupt= s") Cc: Signed-off-by: Sean Anderson --- drivers/pci/controller/pcie-xilinx-nwl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/control= ler/pcie-xilinx-nwl.c index 0408f4d612b5..437927e3bcca 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -371,7 +371,7 @@ static void nwl_mask_intx_irq(struct irq_data *data) u32 mask; u32 val; =20 - mask =3D 1 << (data->hwirq - 1); + mask =3D 1 << data->hwirq; raw_spin_lock_irqsave(&pcie->leg_mask_lock, flags); val =3D nwl_bridge_readl(pcie, MSGF_LEG_MASK); nwl_bridge_writel(pcie, (val & (~mask)), MSGF_LEG_MASK); @@ -385,7 +385,7 @@ static void nwl_unmask_intx_irq(struct irq_data *data) u32 mask; u32 val; =20 - mask =3D 1 << (data->hwirq - 1); + mask =3D 1 << data->hwirq; raw_spin_lock_irqsave(&pcie->leg_mask_lock, flags); val =3D nwl_bridge_readl(pcie, MSGF_LEG_MASK); nwl_bridge_writel(pcie, (val | mask), MSGF_LEG_MASK); --=20 2.35.1.1320.gc452695387.dirty From nobody Wed Feb 11 02:26:54 2026 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 2F951155A5F for ; Mon, 22 Apr 2024 19:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815962; cv=none; b=N2qZddGyEwnm/pYU0IwffiJFyPHXX8lCNTcDPd2kXtsfdTPev0qb5r9aM7tI/Bn2gwycd/jAWExnFoyKQmKFzvpEDTO7W/om/oeNumlliGZLiTHQNlJlQrUtp6nsTCPO0sA+FjvGLgBF+TKJe+Y5Z2G4nM3WYRAYFa3w38UxsOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815962; c=relaxed/simple; bh=r6b16mDDMFuq82AjOyykcb2xL4IHhLJ7biLZOvt9UPA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ka/s/yUMiApDBHLTWNmUfBfRYldiFlT9/3FHee7l20Jx35ieWwtrWdIuqlKZaRp0y+tAQouqdHxm+Ftn2oopMbfltW5xUmCi7qZry9jRN6ml2DsM+r1OEmIh2OCZ2AunfQpFCqUlzhRGzABbswU4XYupt1fOOYyhwr+1bxvHRz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FQmKB/c+; arc=none smtp.client-ip=95.215.58.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FQmKB/c+" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6V8c5ReH46b752BhVsgZv6GdakMtV/HYqhzSbUAbpX4=; b=FQmKB/c+07FCXxXyiJ7EWAiJP2b0n+jLSWJqexlq+NFaM12O6ZRBitjyNHCz05bm9NZ2Fz qJAqSWLvtRc0D+DM2mpyoIkYsgtw6OM935zn4fqFpclTxKzHCTTqee9Hoil0GZz0G+BhJ+ fVnils3bcjPytTJsPK8RTJ2ef96y+0g= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson Subject: [PATCH 3/7] PCI: xilinx-nwl: Fix register misspelling Date: Mon, 22 Apr 2024 15:59:00 -0400 Message-Id: <20240422195904.3591683-4-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" MSIC -> MISC Fixes: c2a7ff18edcd ("PCI: xilinx-nwl: Expand error logging") Signed-off-by: Sean Anderson --- drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/control= ler/pcie-xilinx-nwl.c index 437927e3bcca..ce881baac6d8 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -80,8 +80,8 @@ #define MSGF_MISC_SR_NON_FATAL_DEV BIT(22) #define MSGF_MISC_SR_FATAL_DEV BIT(23) #define MSGF_MISC_SR_LINK_DOWN BIT(24) -#define MSGF_MSIC_SR_LINK_AUTO_BWIDTH BIT(25) -#define MSGF_MSIC_SR_LINK_BWIDTH BIT(26) +#define MSGF_MISC_SR_LINK_AUTO_BWIDTH BIT(25) +#define MSGF_MISC_SR_LINK_BWIDTH BIT(26) =20 #define MSGF_MISC_SR_MASKALL (MSGF_MISC_SR_RXMSG_AVAIL | \ MSGF_MISC_SR_RXMSG_OVER | \ @@ -96,8 +96,8 @@ MSGF_MISC_SR_NON_FATAL_DEV | \ MSGF_MISC_SR_FATAL_DEV | \ MSGF_MISC_SR_LINK_DOWN | \ - MSGF_MSIC_SR_LINK_AUTO_BWIDTH | \ - MSGF_MSIC_SR_LINK_BWIDTH) + MSGF_MISC_SR_LINK_AUTO_BWIDTH | \ + MSGF_MISC_SR_LINK_BWIDTH) =20 /* Legacy interrupt status mask bits */ #define MSGF_LEG_SR_INTA BIT(0) @@ -299,10 +299,10 @@ static irqreturn_t nwl_pcie_misc_handler(int irq, voi= d *data) if (misc_stat & MSGF_MISC_SR_FATAL_DEV) dev_err(dev, "Fatal Error Detected\n"); =20 - if (misc_stat & MSGF_MSIC_SR_LINK_AUTO_BWIDTH) + if (misc_stat & MSGF_MISC_SR_LINK_AUTO_BWIDTH) dev_info(dev, "Link Autonomous Bandwidth Management Status bit set\n"); =20 - if (misc_stat & MSGF_MSIC_SR_LINK_BWIDTH) + if (misc_stat & MSGF_MISC_SR_LINK_BWIDTH) dev_info(dev, "Link Bandwidth Management Status bit set\n"); =20 /* Clear misc interrupt status */ --=20 2.35.1.1320.gc452695387.dirty From nobody Wed Feb 11 02:26:54 2026 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 7840C156232 for ; Mon, 22 Apr 2024 19:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815963; cv=none; b=DGOXd/KUNSbJRsYr3/XMLZRqvjKwJQ5oQqL9MO+aQT2d2qy5MG3O1V76ugsOdCbyEaFHSMwxPBii4uvu8gCqqRxzicLObgMOU6jpm5kSnxClOGV6HoUIjREP425xFcRNeCtMitMJTW8+esuVqpxCwrUGLvskNA25pn2Bs2vd5iU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815963; c=relaxed/simple; bh=QMu5xcgCLE+WCRDBWokoEKaAeDoOZmUPyXdxczaOxYs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tL1oIckIvQTXyefpwfrwtNuKygWVXYIkiIPjBHHOiSlRXrfs95cS6GBH7m3lKBollAUPlQ53U0/HwQUTZ4X8A5hyt+uzFRNn0/U4h45aUA9IJQwN6RQNmA+V8dsMvnAwVB0FEQKirGZxEF5bOj1I+cfIhvDHMfUa8OO+1wx3UyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=LDrKjlbM; arc=none smtp.client-ip=95.215.58.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LDrKjlbM" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nf7eZ3K3zp5B15WCzSEdzeiOvEohfOu0xeNNcWDApqk=; b=LDrKjlbMYR6zZSBwTR26bQPsghsLGT/CgKXTZdwN+VLqsvZoTa5FFzPzqxLn2ijVdDiHDk AsoywVLzwDhP9Iadpv5aXSQ45jk+6WkkAOnq4Y+csPn0OeYg1Gb2kX+Z26rfR5lwXDDFSX dGnXsafm+p/MuzQ/ViP1G6Q0knKmEc8= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson Subject: [PATCH 4/7] PCI: xilinx-nwl: Rate-limit misc interrupt messages Date: Mon, 22 Apr 2024 15:59:01 -0400 Message-Id: <20240422195904.3591683-5-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The conditions logged by the misc interrupt can occur repeatedly and continuously. Avoid rendering the console unusable by rate-limiting these messages. Signed-off-by: Sean Anderson --- drivers/pci/controller/pcie-xilinx-nwl.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/control= ler/pcie-xilinx-nwl.c index ce881baac6d8..c0a60cebdb2e 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -267,37 +267,37 @@ static irqreturn_t nwl_pcie_misc_handler(int irq, voi= d *data) return IRQ_NONE; =20 if (misc_stat & MSGF_MISC_SR_RXMSG_OVER) - dev_err(dev, "Received Message FIFO Overflow\n"); + dev_err_ratelimited(dev, "Received Message FIFO Overflow\n"); =20 if (misc_stat & MSGF_MISC_SR_SLAVE_ERR) - dev_err(dev, "Slave error\n"); + dev_err_ratelimited(dev, "Slave error\n"); =20 if (misc_stat & MSGF_MISC_SR_MASTER_ERR) - dev_err(dev, "Master error\n"); + dev_err_ratelimited(dev, "Master error\n"); =20 if (misc_stat & MSGF_MISC_SR_I_ADDR_ERR) - dev_err(dev, "In Misc Ingress address translation error\n"); + dev_err_ratelimited(dev, "In Misc Ingress address translation error\n"); =20 if (misc_stat & MSGF_MISC_SR_E_ADDR_ERR) - dev_err(dev, "In Misc Egress address translation error\n"); + dev_err_ratelimited(dev, "In Misc Egress address translation error\n"); =20 if (misc_stat & MSGF_MISC_SR_FATAL_AER) - dev_err(dev, "Fatal Error in AER Capability\n"); + dev_err_ratelimited(dev, "Fatal Error in AER Capability\n"); =20 if (misc_stat & MSGF_MISC_SR_NON_FATAL_AER) - dev_err(dev, "Non-Fatal Error in AER Capability\n"); + dev_err_ratelimited(dev, "Non-Fatal Error in AER Capability\n"); =20 if (misc_stat & MSGF_MISC_SR_CORR_AER) - dev_err(dev, "Correctable Error in AER Capability\n"); + dev_err_ratelimited(dev, "Correctable Error in AER Capability\n"); =20 if (misc_stat & MSGF_MISC_SR_UR_DETECT) - dev_err(dev, "Unsupported request Detected\n"); + dev_err_ratelimited(dev, "Unsupported request Detected\n"); =20 if (misc_stat & MSGF_MISC_SR_NON_FATAL_DEV) - dev_err(dev, "Non-Fatal Error Detected\n"); + dev_err_ratelimited(dev, "Non-Fatal Error Detected\n"); =20 if (misc_stat & MSGF_MISC_SR_FATAL_DEV) - dev_err(dev, "Fatal Error Detected\n"); + dev_err_ratelimited(dev, "Fatal Error Detected\n"); =20 if (misc_stat & MSGF_MISC_SR_LINK_AUTO_BWIDTH) dev_info(dev, "Link Autonomous Bandwidth Management Status bit set\n"); --=20 2.35.1.1320.gc452695387.dirty From nobody Wed Feb 11 02:26:54 2026 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 CE57A156880 for ; Mon, 22 Apr 2024 19:59:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815965; cv=none; b=PT64KXvXIep/FhvMcKnKxTdhguJzuieABXlGgIAeGRPJr/t2mYzsvxW+m1m8e3yqkhDCC9cJFYfL/dTJvJmju2SiWWpKfsJs3X2F4FT2OmpuiA6aNhjw/+aPtQuc6LafhtoCBhBWlq4A7+G7AQMXxDcAFdtjHgqT8mSuEyAshX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815965; c=relaxed/simple; bh=vphOzr8Gzrm0Mtd6tuz/ghBP/l1oLHvCCkKIgn3HRdQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DNMSqcQJsDAIA/2bkYbfBEiglCNdKiAsKcHqtH8hCw5EgYdsirzYFIcQWwaIlZEWyAgtwHLlQPJjsF5rUaw3c+jnGDwlkmQ0i0UMqsXsvoqI9mo/HtZMLN2zRGqkVe9iqRdcdr946xGw6+8W85REyHj2OzMaW9X+ZIOOWmzoie8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=GoyDGXsx; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="GoyDGXsx" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kHviSFwdOBLYgwwSdicj/gPbahxhmF/tyxdfNDVBa00=; b=GoyDGXsxudKSK1/x8Cjb/qP4f54UxhB5PcBFx71IbYEh1cSKW2CuLxs1z+gBefWJU2RYib 7FsUOEGK+MrVEayv0rDNNUvFVheYRaLEZoX6AtI23oy9JwBGCNnwG+2Yp9Ga6jKUeDrQab n/WgwKyXtV2z3wDarRdPCkvbCiJ3F1A= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson , Bharat Kumar Gogada , Hyun Kwon , Lorenzo Pieralisi , Michal Simek Subject: [PATCH 5/7] PCI: xilinx-nwl: Clean up clock on probe failure/removal Date: Mon, 22 Apr 2024 15:59:02 -0400 Message-Id: <20240422195904.3591683-6-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Make sure we turn off the clock on probe failure and device removal. Fixes: de0a01f52966 ("PCI: xilinx-nwl: Enable the clock through CCF") Signed-off-by: Sean Anderson --- drivers/pci/controller/pcie-xilinx-nwl.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/control= ler/pcie-xilinx-nwl.c index c0a60cebdb2e..424cc5a1b4d1 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -779,6 +779,7 @@ static int nwl_pcie_probe(struct platform_device *pdev) return -ENODEV; =20 pcie =3D pci_host_bridge_priv(bridge); + platform_set_drvdata(pdev, pcie); =20 pcie->dev =3D dev; =20 @@ -801,13 +802,13 @@ static int nwl_pcie_probe(struct platform_device *pde= v) err =3D nwl_pcie_bridge_init(pcie); if (err) { dev_err(dev, "HW Initialization failed\n"); - return err; + goto err_clk; } =20 err =3D nwl_pcie_init_irq_domain(pcie); if (err) { dev_err(dev, "Failed creating IRQ Domain\n"); - return err; + goto err_clk; } =20 bridge->sysdata =3D pcie; @@ -817,11 +818,23 @@ static int nwl_pcie_probe(struct platform_device *pde= v) err =3D nwl_pcie_enable_msi(pcie); if (err < 0) { dev_err(dev, "failed to enable MSI support: %d\n", err); - return err; + goto err_clk; } } =20 - return pci_host_probe(bridge); + err =3D pci_host_probe(bridge); + +err_clk: + if (err) + clk_disable_unprepare(pcie->clk); + return err; +} + +static void nwl_pcie_remove(struct platform_device *pdev) +{ + struct nwl_pcie *pcie =3D platform_get_drvdata(pdev); + + clk_disable_unprepare(pcie->clk); } =20 static struct platform_driver nwl_pcie_driver =3D { @@ -831,5 +844,6 @@ static struct platform_driver nwl_pcie_driver =3D { .of_match_table =3D nwl_pcie_of_match, }, .probe =3D nwl_pcie_probe, + .remove_new =3D nwl_pcie_remove, }; builtin_platform_driver(nwl_pcie_driver); --=20 2.35.1.1320.gc452695387.dirty From nobody Wed Feb 11 02:26:54 2026 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 8152A15698F for ; Mon, 22 Apr 2024 19:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815967; cv=none; b=AwBopsg+WflKZQyCL9QqyPBEGUVWVyYMP67o/uoxHL+tAsvyQoFZWELpilQyJJKEIWS6zL8Fk+VBBdG9Kvh8RTp0toDyaq/bB/F99tZjwBJw2Sn+FTrpH8+YRaBHffBLJGFa4NIwJHYBukMqVuSedIbl/XmPErgHqtiSWN5kyiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815967; c=relaxed/simple; bh=bKIRdcv+IsQ1KdaKP2rdYU5S61mJTyYBq22uBE/yjnM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SM0H7MGdTZjUxfnt/h8PbcVp5SCdupiPRScdDMDVxe0xzAQhvfeFFTFfARQHGzx++6ANtsEiogdFLHFtsv6a5ofOOKkrg64t+c+3KQhVIeq5FcEFxUYuSBfKEiXHnMAwyNrgQTmEjRtqG3ayRW8/JoLzrLm5xIwnpqwFGoVpbO4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=pSBfgAL1; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="pSBfgAL1" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ztQEUQ1VXVN/3kCcl2i+7uwX3vjmlv6H5lsYtuFHU80=; b=pSBfgAL127YmQuamNHkZgu6BDxmwJA8i/SI74qw8qczqUNhRfh6G+lQ2cRcZbQxaOFwPiD qJtXG8VTT0+2Po5SddgGQ+ljgrnKEmcYBCXFcX4ZqXx5BZx7KGhKDiNYRoIOMnyvKviuiu 7LpggJ864j7Gz0KmV/7omj+9wKMwgRE= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson Subject: [PATCH 6/7] PCI: xilinx-nwl: Add phy support Date: Mon, 22 Apr 2024 15:59:03 -0400 Message-Id: <20240422195904.3591683-7-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Add support for enabling/disabling PCIe phys. We can't really do anything about failures in the disable/remove path, so just warn. Signed-off-by: Sean Anderson --- drivers/pci/controller/pcie-xilinx-nwl.c | 70 +++++++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/control= ler/pcie-xilinx-nwl.c index 424cc5a1b4d1..19a0ff105401 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include =20 @@ -157,6 +158,7 @@ struct nwl_pcie { void __iomem *breg_base; void __iomem *pcireg_base; void __iomem *ecam_base; + struct phy *phy[4]; phys_addr_t phys_breg_base; /* Physical Bridge Register Base */ phys_addr_t phys_pcie_reg_base; /* Physical PCIe Controller Base */ phys_addr_t phys_ecam_base; /* Physical Configuration Base */ @@ -521,6 +523,43 @@ static int nwl_pcie_init_msi_irq_domain(struct nwl_pci= e *pcie) return 0; } =20 +static int nwl_pcie_phy_enable(struct nwl_pcie *pcie) +{ + int i, ret; + + for (i =3D 0; i < ARRAY_SIZE(pcie->phy); i++) { + ret =3D phy_init(pcie->phy[i]); + if (ret) + goto err; + + ret =3D phy_power_on(pcie->phy[i]); + if (ret) { + WARN_ON(phy_exit(pcie->phy[i])); + goto err; + } + } + + return 0; + +err: + while (--i) { + WARN_ON(phy_power_off(pcie->phy[i])); + WARN_ON(phy_exit(pcie->phy[i])); + } + + return ret; +} + +static void nwl_pcie_phy_disable(struct nwl_pcie *pcie) +{ + int i; + + for (i =3D 0; i < ARRAY_SIZE(pcie->phy); i++) { + WARN_ON(phy_power_off(pcie->phy[i])); + WARN_ON(phy_exit(pcie->phy[i])); + } +} + static int nwl_pcie_init_irq_domain(struct nwl_pcie *pcie) { struct device *dev =3D pcie->dev; @@ -732,6 +771,7 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie, { struct device *dev =3D pcie->dev; struct resource *res; + int i; =20 res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg"); pcie->breg_base =3D devm_ioremap_resource(dev, res); @@ -759,6 +799,20 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie, irq_set_chained_handler_and_data(pcie->irq_intx, nwl_pcie_leg_handler, pcie); =20 + for (i =3D 0; i < ARRAY_SIZE(pcie->phy); i++) { + char name[16]; + + snprintf(name, sizeof(name), "pcie-phy%d", i); + pcie->phy[i] =3D devm_phy_get(dev, name); + if (PTR_ERR(pcie->phy[i]) =3D=3D -ENODEV) { + pcie->phy[i] =3D NULL; + break; + } + + if (IS_ERR(pcie->phy[i])) + return PTR_ERR(pcie->phy[i]); + } + return 0; } =20 @@ -799,16 +853,22 @@ static int nwl_pcie_probe(struct platform_device *pde= v) return err; } =20 + err =3D nwl_pcie_phy_enable(pcie); + if (err) { + dev_err(dev, "could not enable PHYs\n"); + goto err_clk; + } + err =3D nwl_pcie_bridge_init(pcie); if (err) { dev_err(dev, "HW Initialization failed\n"); - goto err_clk; + goto err_phy; } =20 err =3D nwl_pcie_init_irq_domain(pcie); if (err) { dev_err(dev, "Failed creating IRQ Domain\n"); - goto err_clk; + goto err_phy; } =20 bridge->sysdata =3D pcie; @@ -818,12 +878,15 @@ static int nwl_pcie_probe(struct platform_device *pde= v) err =3D nwl_pcie_enable_msi(pcie); if (err < 0) { dev_err(dev, "failed to enable MSI support: %d\n", err); - goto err_clk; + goto err_phy; } } =20 err =3D pci_host_probe(bridge); =20 +err_phy: + if (err) + nwl_pcie_phy_disable(pcie); err_clk: if (err) clk_disable_unprepare(pcie->clk); @@ -834,6 +897,7 @@ static void nwl_pcie_remove(struct platform_device *pde= v) { struct nwl_pcie *pcie =3D platform_get_drvdata(pdev); =20 + nwl_pcie_phy_disable(pcie); clk_disable_unprepare(pcie->clk); } =20 --=20 2.35.1.1320.gc452695387.dirty From nobody Wed Feb 11 02:26:54 2026 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (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 7C489156C64 for ; Mon, 22 Apr 2024 19:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815968; cv=none; b=dXRBp5/kUaJtFyafKc4eKn4t0JduGNa8SniTwLRtXhnA4xdKObn5UQRwCA0nnPhqMXxyHrmRFhW0dpPZlYZpic+dhyeRsY7mMxq3ByaJGqOjFY+Sw5h+MgX3XEftDKMDi79kxu0vKs8KWVCpqh6P9yURVRfrw4s1dJzF8R3tJ9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815968; c=relaxed/simple; bh=q5dgckPWStwDbs/ciTx+/6dkgSSrmHIxfJYYBbAO7qU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=uiEiQ5eQ5Luo9oEBfPoyPxRqcVT2Zhekhzs0QUwnpfbyKF/E9IYrwmG9qxVGrIrAvIZKj5nVrkRY2zY7m42vHU8HaY1c6iupafM/ClpPNRJznC+Owh+TxNwr/ve0NDdC9JYXBQj9OxwqodJE//jiOUt9SN3kujM6t0oeXa8VYNQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gqYtkVZW; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gqYtkVZW" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713815965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=az+1RlpkpwvbFiQL8Y2JcSKU17oJBB1RPjU9RUMsFTI=; b=gqYtkVZWHVY3rUzWbcfnY5HaBZSffbPwuoIF8xPuls5Fo7ZVpdEvwNV4Trl2PCzP0rhqye Cavg7IKrCVjLtTsTJ9rDM3mhv0XSFNy4oQR/fN5dOgfUPZoZvRbHOVioF598noEWDBx4OT bDGJKE7nd5IASxTW55JpIkG0QrltLLg= From: Sean Anderson To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thippeswamy Havalige , Michal Simek , Bjorn Helgaas , Sean Anderson , Ashok Reddy Soma Subject: [PATCH 7/7] [RFT] arm64: zynqmp: Add PCIe phys Date: Mon, 22 Apr 2024 15:59:04 -0400 Message-Id: <20240422195904.3591683-8-sean.anderson@linux.dev> In-Reply-To: <20240422195904.3591683-1-sean.anderson@linux.dev> References: <20240422195904.3591683-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Add PCIe phy bindings for the ZCU102. Signed-off-by: Sean Anderson --- I don't have a ZCU102, so please test this. arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts b/arch/arm64= /boot/dts/xilinx/zynqmp-zcu102-revA.dts index ad8f23a0ec67..68fe53685351 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts @@ -941,6 +941,8 @@ conf-pull-none { =20 &pcie { status =3D "okay"; + phys =3D <&psgtr 0 PHY_TYPE_PCIE 0 0>; + phy-names =3D "pcie-phy0"; }; =20 &psgtr { --=20 2.35.1.1320.gc452695387.dirty