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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60506C7EE2C for ; Fri, 25 Aug 2023 12:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242624AbjHYMK4 (ORCPT ); Fri, 25 Aug 2023 08:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244418AbjHYMKr (ORCPT ); Fri, 25 Aug 2023 08:10:47 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A69E6B; Fri, 25 Aug 2023 05:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1692965445; x=1724501445; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=7WOd2tGjgKOiq0ZivZVRqSVMJmTMZHLUBWKTtr0MnyE=; b=iE9V7ajmWHoCs9GnNPVglRdzYJVwr3MgsLV7nyY3Cauj5yaSgCK4Mr/U KNq51KkZ3vVjU6rvGxQVHRx6sH0X3ucknVER0J7o/qT3X0UkLpqhoBXzA cZhVMgm6pVI83XCgtQU39FpWl031htxEhobE/U37W62x2xwI3yssR8HjP waqfqLckQzejT/BXuUsLKtkdp0snJkLIJscz49nrUBFba1nqhXuioxKo9 ORqo0QZqeymT1IfVVH7243SPkbGVuVV8gPkDFoEuD5TxZ+wf+I7Newlxr OI0sGDqSgDHE/W0h4XU8+VMbxyCioGFn6T0472OccvuhwPyrKFjFNq8Wi w==; X-IronPort-AV: E=Sophos;i="6.02,195,1688454000"; d="asc'?scan'208";a="231709314" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Aug 2023 05:10:44 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 25 Aug 2023 05:09:57 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Fri, 25 Aug 2023 05:09:54 -0700 Date: Fri, 25 Aug 2023 13:09:13 +0100 From: Conor Dooley To: Minda Chen CC: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Emil Renner Berthing , , , , , Pali =?iso-8859-1?Q?Roh=E1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie Subject: Re: [PATCH v4 08/11] PCI: microchip: Move IRQ init functions to pcie-plda-host.c Message-ID: <20230825-sip-pentagon-e1760dcfce58@wendy> References: <20230825090129.65721-1-minda.chen@starfivetech.com> <20230825090129.65721-9-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3Mzadswy/UgLR3pW" Content-Disposition: inline In-Reply-To: <20230825090129.65721-9-minda.chen@starfivetech.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org --3Mzadswy/UgLR3pW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Daire, can you look at this one too please? On Fri, Aug 25, 2023 at 05:01:26PM +0800, Minda Chen wrote: > Move IRQ init functions to pcie-plda-host.c. > mc_handle_event() is merged to plda_handle_event(). > Set most of the IRQ functions to static in pcie-plda-host.c >=20 > Signed-off-by: Minda Chen > -void plda_handle_event(struct irq_desc *desc) > +static void plda_handle_event(struct irq_desc *desc) > { > struct plda_pcie_rp *port =3D irq_desc_get_handler_data(desc); > struct irq_chip *chip =3D irq_desc_get_chip(desc); > @@ -264,14 +268,18 @@ void plda_handle_event(struct irq_desc *desc) > =20 > chained_irq_enter(chip, desc); > =20 > - val =3D readl_relaxed(port->bridge_addr + ISTATUS_LOCAL); > - origin =3D val; > - val =3D val >> A_ATR_EVT_POST_ERR_SHIFT; > - events |=3D val & 0xff; > - if (origin & PM_MSI_INT_INTX_MASK) > - events |=3D BIT(EVENT_PM_MSI_INT_INTX); > - val =3D (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf; > - events |=3D val << EVENT_PM_MSI_INT_MSI; > + if (port->ops && port->ops->get_events) { I still don't love the dancing here. Can you just always register a callback? Thanks, Conor. > + events =3D port->ops->get_events(port); > + } else { > + val =3D readl_relaxed(port->bridge_addr + ISTATUS_LOCAL); > + origin =3D val; > + val =3D val >> A_ATR_EVT_POST_ERR_SHIFT; > + events |=3D val & 0xff; > + if (origin & PM_MSI_INT_INTX_MASK) > + events |=3D BIT(EVENT_PM_MSI_INT_INTX); > + val =3D (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf; > + events |=3D val << EVENT_PM_MSI_INT_MSI; > + } > =20 > for_each_set_bit(bit, &events, port->num_events) > generic_handle_domain_irq(port->event_domain, bit); --3Mzadswy/UgLR3pW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZOiZ6QAKCRB4tDGHoIJi 0vy8AQCbzdPqfIsg4Rb+K+nCGb0DwA4IC2wBkiUhYzZPvjqQLQEApoBsItvyi8Rf Ge4Jyp0msR/nVvWuYP8BEVG8nnZTgQI= =zD2O -----END PGP SIGNATURE----- --3Mzadswy/UgLR3pW--