Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3707842rdg; Wed, 18 Oct 2023 03:54:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnjYmpU0sV2MQ0dfGBfE0NG66nu919wSvYP8S+zjt3UYkvsPF0cqzM+oR4c2lfZTqCroNr X-Received: by 2002:a05:6359:1a47:b0:157:a791:53cc with SMTP id ru7-20020a0563591a4700b00157a79153ccmr4479471rwb.32.1697626480591; Wed, 18 Oct 2023 03:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697626480; cv=none; d=google.com; s=arc-20160816; b=rP6cwIEybec0yd730RZgahv7JCtwmD8PG7VZf/gYaqAj/YgDCLgfIxChsygF0lmwzk cHWh/KDQw5+dsIO6JxPtTCpF0fTQ9ZNHOYYtogARsyegqmbEkCrk7HAdTyKfM1RZ3Xn8 25QEa1N7PT5cVWOEP2cZbzZtuptew+L2O+YQ4/R4LKpOxX8xMbnIYBug9JyAmyaAATxu Ese1YCNh/Y/KGx5w4ZysCKZmxU9223Epw94M5q1cOvgKT1Rf2Xvf2Dg/S2q8PxKo9ngi FjJ14dlyYNI3ClbzYkuUGmyjFUVaRcuwNlDVJ8T5u73z5wYlHJQwfIfbr41LFojTM0a2 flhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zu7cl5iHNY4Ex9loFaoJndYjeOpxHmVktg4bClvjfmc=; fh=UwJF0cmN4EbbbJQYNeQBi16R6caNIm1BUmE7y7GO72w=; b=mXVmglWflJOBlTxUfd9uPdvcaf6/CNx9OZ8C40EfIsZ7UAAVG/yAEvD5uUplbngJ0o MPEVt0CyJFri3Kdg9eLT9dkeZJ4cUdLUlgBT6KonN8VqhfhDt+XrNj1FbH50VmI0wX1O 6mbo9QHfthHHhnfTIlDQ0FpOuv839Zw+BNXgKWr3wKp0nyj4ptEH/rgTe2EcnWd7bsYC r0n8pfz6b/aMles+WHTjBn6fL/hM16U7kMTaEkv+/MW1wF7K4jfDHHm1p4PAMUWQWtF1 0M3eI7cPW4jpPz10/V3k/6MKDgwe3fz9ngPl1E4ZQ3OjfNjkvcA7MARSgG1ch2S03av7 3CAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ptB7eWte; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i11-20020a63d44b000000b0055fd1bfb109si1865391pgj.679.2023.10.18.03.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 03:54:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ptB7eWte; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8AD2380239D9; Wed, 18 Oct 2023 03:54:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230454AbjJRKyI (ORCPT + 99 others); Wed, 18 Oct 2023 06:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbjJRKyD (ORCPT ); Wed, 18 Oct 2023 06:54:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F13392; Wed, 18 Oct 2023 03:54:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CAC0C433C7; Wed, 18 Oct 2023 10:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697626441; bh=kPo92beMbcDHObVUx/Dna9HOyefjTTwxCVHbGGY3vZs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ptB7eWteOf6TVqYaaMwzLtLXauLOuacgxglnupzHEC+KmzweMmY6GMsfOnmSFjSW+ pL/7Sng2CGb5BO4ZQ+eo0gXDs+7z/m9QsfRaW+NGsD2Ia3CTrSkHZm8Z6HkUOHF1Uc HOIyDtYHXTbdDdIwXnTSk6xDkaM9+Ep20MRBlFC2meF3vcFc6TYrRUt7th5pDQIsnv 5Kl9N3fYR2f1EHoZ6caIbREGO0A7LsjU/3b7qUVu+yu+DIOVdIQHD040uabfT6Clsr QA8iSPYVLWqYVM9MUqOLKVMYH1H/DW9NWFW5S6pZuvJkf8GgAzp7oX7oGXebIzYB2U cRq9UFxkEIeMw== Date: Wed, 18 Oct 2023 11:53:55 +0100 From: Conor Dooley To: Minda Chen Cc: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Daire McNamara , Emil Renner Berthing , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie Subject: Re: [PATCH v8 13/22] PCI: microchip: Add request_event_irq() callback function Message-ID: <20231018-retainer-unclip-074b81a76767@spud> References: <20231011110514.107528-1-minda.chen@starfivetech.com> <20231011110514.107528-14-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RkOo+3SMiOK1PVg2" Content-Disposition: inline In-Reply-To: <20231011110514.107528-14-minda.chen@starfivetech.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 03:54:37 -0700 (PDT) --RkOo+3SMiOK1PVg2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 11, 2023 at 07:05:05PM +0800, Minda Chen wrote: > PolarFire implements specific interrupts besides PLDA local > interrupt and register their interrupt symbol name. > (Total 28 > interrupts while PLDA contain 13 local interrupts). and > interrupt to event mapping is different. Nit: drop the ()s & the first . Daire would have to speak to why this is the case, but these commit message appears to better explain why the patch is needed. Acked-by: Conor Dooley > So add a callback function to support different IRQ register > function. >=20 > Signed-off-by: Minda Chen > --- > .../pci/controller/plda/pcie-microchip-host.c | 25 ++++++++++++++++--- > drivers/pci/controller/plda/pcie-plda.h | 5 ++++ > 2 files changed, 26 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/= pci/controller/plda/pcie-microchip-host.c > index 1799455989ac..104332603e25 100644 > --- a/drivers/pci/controller/plda/pcie-microchip-host.c > +++ b/drivers/pci/controller/plda/pcie-microchip-host.c > @@ -799,6 +799,17 @@ static int mc_pcie_init_clks(struct device *dev) > return 0; > } > =20 > +static int mc_request_event_irq(struct plda_pcie_rp *plda, int event_irq, > + int event) > +{ > + return devm_request_irq(plda->dev, event_irq, mc_event_handler, > + 0, event_cause[event].sym, plda); > +} > + > +static const struct plda_event mc_event =3D { > + .request_event_irq =3D mc_request_event_irq, nit: these spaces for alignment look pointless when there's just one element. Cheers, Conor. > +}; > + > static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) > { > struct device *dev =3D port->dev; > @@ -898,7 +909,9 @@ static void mc_disable_interrupts(struct mc_pcie *por= t) > writel_relaxed(GENMASK(31, 0), bridge_base_addr + ISTATUS_HOST); > } > =20 > -static int plda_init_interrupts(struct platform_device *pdev, struct pld= a_pcie_rp *port) > +static int plda_init_interrupts(struct platform_device *pdev, > + struct plda_pcie_rp *port, > + const struct plda_event *event) > { > struct device *dev =3D &pdev->dev; > int irq; > @@ -922,8 +935,12 @@ static int plda_init_interrupts(struct platform_devi= ce *pdev, struct plda_pcie_r > return -ENXIO; > } > =20 > - ret =3D devm_request_irq(dev, event_irq, mc_event_handler, > - 0, event_cause[i].sym, port); > + if (event->request_event_irq) > + ret =3D event->request_event_irq(port, event_irq, i); > + else > + ret =3D devm_request_irq(dev, event_irq, plda_event_handler, > + 0, NULL, port); > + > if (ret) { > dev_err(dev, "failed to request IRQ %d\n", event_irq); > return ret; > @@ -977,7 +994,7 @@ static int mc_platform_init(struct pci_config_window = *cfg) > return ret; > =20 > /* Address translation is up; safe to enable interrupts */ > - ret =3D plda_init_interrupts(pdev, &port->plda); > + ret =3D plda_init_interrupts(pdev, &port->plda, &mc_event); > if (ret) > return ret; > =20 > diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/contro= ller/plda/pcie-plda.h > index b439160448b1..907ad40f3188 100644 > --- a/drivers/pci/controller/plda/pcie-plda.h > +++ b/drivers/pci/controller/plda/pcie-plda.h > @@ -121,6 +121,11 @@ struct plda_pcie_rp { > int num_events; > }; > =20 > +struct plda_event { > + int (*request_event_irq)(struct plda_pcie_rp *pcie, > + int event_irq, int event); > +}; > + > irqreturn_t plda_event_handler(int irq, void *dev_id); > void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index, > phys_addr_t axi_addr, phys_addr_t pci_addr, > --=20 > 2.17.1 >=20 --RkOo+3SMiOK1PVg2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZS+5QgAKCRB4tDGHoIJi 0o/zAQCSuM8uqzd0VAzZZCthQE4n12TT0kuF0sYDMlv9Uer9XgD/SE5oGnnsSm82 Knu+CSUhdikuXNgt+Z0Co3f7k3Cenw4= =X4oS -----END PGP SIGNATURE----- --RkOo+3SMiOK1PVg2--