From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754752AbcGELAL (ORCPT ); Tue, 5 Jul 2016 07:00:11 -0400 Received: from mail-db5eur01on0067.outbound.protection.outlook.com ([104.47.2.67]:42952 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751835AbcGELAH convert rfc822-to-8bit (ORCPT ); Tue, 5 Jul 2016 07:00:07 -0400 From: Qiang Zhao To: Jason Cooper CC: "oss@buserror.net" , "tglx@linutronix.de" , "marc.zyngier@arm.com" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , Xiaobo Xie Subject: RE: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip Thread-Topic: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip Thread-Index: AQHR1mChBbs6JpdQKEusC8kYaxYEXqAJKxQAgAA6EqA= Date: Tue, 5 Jul 2016 07:27:21 +0000 Message-ID: References: <1467683219-29326-1-git-send-email-qiang.zhao@nxp.com> <20160705031836.GA3348@io.lakedaemon.net> In-Reply-To: <20160705031836.GA3348@io.lakedaemon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=qiang.zhao@nxp.com; x-originating-ip: [192.158.241.86] x-ms-office365-filtering-correlation-id: f8d1efe7-11e9-4197-f3f9-08d3a4a5cd70 x-microsoft-exchange-diagnostics: 1;DB6PR0401MB2423;6:M/k1JhrEJnaryXXh0A4cwkqTgSTuTcSojjPGgOpzEnqRlAhGSU+pVvaoVRwAOWamUIc8eV1D2Unu81IAHJygPf3hn+PvW8qE03xMfc5gN0ORMi+L4w3tnfiBpL6A/lp9G/qdp7jLxTZZ1HuIlRe8ibIqGAcndcNI2LUL8TTRWMZAuUzoaCplNjVBGZx8ZLF3tNdLkbVKyqGIPgZmEJiDsmwYb9zKL/TVBJVX11Y/UqxNHcmXgWzW3FGSLB8dNEpBLVqBNOHMbCxdVJ6tF86fCJxKJlB4Fzy7oohGMNuRd71KS4tv9lxkjETLN4oMtfk9I5SLQ4JCBxofclEkuMy9Vw==;5:uL83wsgkq/jkKb3GkEtOIQo/mPfuBef9503Him5ZhChrzng4uWsBKEB7QHwgtK+z0Wz9oFVUH3172d2DZpIxobkYANt9JFjNd9mkoIABdF+DcA8IJ5U5gCsbIx7Ther38gRY8G9echMCdwX0Joe+4Q==;24:nUSU49vlnl5g0+aCfRYWEBk/XUXUg7BBYDjsLcevYAVNCrL0YH1meI17CAVJSmOX2sHJL4nlOtubD8VZYo1Z73wLG3GG/IPwZZylPmvAFdM=;7:d5Ib4MdTcboty2rs+lWQE3nVLgzZN7kIkrtHjPoSwxsW6xSg1/45ARENDPY2SfeXuaILiKt1xMpWryUfMY+i2lL6BYh8JMQUXSLXNeUdHj4ylB8kGmOVNExGkHu13PPGnF/cqSfbQFYZBP486E+1kJS/1uNln8HZNXFGWyeTxLasvI62kTQVnwjWV6BDGjpsAxJvoALsqSd2mrhL8vJVsvnrqT4AFUvgEvlP/KxFIh8744Pafmo1UBMIjxuxT8m3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2423; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(9452136761055)(65623756079841)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:DB6PR0401MB2423;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2423; x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(377454003)(13464003)(199003)(24454002)(5002640100001)(345774005)(3280700002)(2906002)(3660700001)(106116001)(110136002)(4326007)(76576001)(586003)(3846002)(92566002)(6116002)(102836003)(11100500001)(97736004)(76176999)(7846002)(50986999)(101416001)(68736007)(106356001)(189998001)(5250100002)(8676002)(87936001)(66066001)(2900100001)(575784001)(74316002)(86362001)(105586002)(9686002)(305945005)(19580395003)(19580405001)(54356999)(5003600100003)(7736002)(7696003)(81156014)(81166006)(8936002)(33656002)(2950100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0401MB2423;H:AM3PR04MB1185.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2016 07:27:21.0640 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2423 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/05/2016 11:19 AM, Jason Cooper wrote: > -----Original Message----- > From: Jason Cooper [mailto:jason@lakedaemon.net] > Sent: Tuesday, July 05, 2016 11:19 AM > To: Qiang Zhao > Cc: oss@buserror.net; tglx@linutronix.de; marc.zyngier@arm.com; linuxppc- > dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Xiaobo Xie > > Subject: Re: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip > > Hi Zhao Qiang, > > Please reword your subject line to conform to the standard in irqchip (since > that's where the code is added). Also, please adjust the subject line to express > *why* the change is being made. > > On Tue, Jul 05, 2016 at 09:46:58AM +0800, Zhao Qiang wrote: > > The codes of qe_ic_init in platforms are redundant, move them to qe_ic > > under irqchip > > This needs to be a lot more clear. How is backwards compatibility preserved? > Why is lookup by type "qeic" dropped? In short, please explain everything that > looks funny so we don't have to guess. Thank you for your review and feedback. > > > Signed-off-by: Zhao Qiang > > --- > > arch/powerpc/platforms/83xx/misc.c | 15 --------------- > > arch/powerpc/platforms/85xx/corenet_generic.c | 9 --------- > > arch/powerpc/platforms/85xx/mpc85xx_mds.c | 14 -------------- > > arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 16 ---------------- > > arch/powerpc/platforms/85xx/twr_p102x.c | 14 -------------- > > drivers/irqchip/qe_ic.c | 14 ++++++++++++++ > > 6 files changed, 14 insertions(+), 68 deletions(-) > > > > diff --git a/arch/powerpc/platforms/83xx/misc.c > > b/arch/powerpc/platforms/83xx/misc.c > > index 7e923ca..9431fc7 100644 > > --- a/arch/powerpc/platforms/83xx/misc.c > > +++ b/arch/powerpc/platforms/83xx/misc.c > > @@ -93,24 +93,9 @@ void __init mpc83xx_ipic_init_IRQ(void) } > > > > #ifdef CONFIG_QUICC_ENGINE > > -void __init mpc83xx_qe_init_IRQ(void) -{ > > - struct device_node *np; > > - > > - np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); > > - if (!np) { > > - np = of_find_node_by_type(NULL, "qeic"); > > - if (!np) > > - return; > > - } > > This block isn't preserved in the irqchip driver. Why not? I grep qeic in arch/powerpc/boot/dts/*, doesn't find which board use qeic as type. > > > - qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); > > - of_node_put(np); > > -} > > - > > void __init mpc83xx_ipic_and_qe_init_IRQ(void) > > { > > mpc83xx_ipic_init_IRQ(); > > - mpc83xx_qe_init_IRQ(); > > } > > #endif /* CONFIG_QUICC_ENGINE */ > > > > diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c > > b/arch/powerpc/platforms/85xx/corenet_generic.c > > index a2b0bc8..526fc2b 100644 > > --- a/arch/powerpc/platforms/85xx/corenet_generic.c > > +++ b/arch/powerpc/platforms/85xx/corenet_generic.c > > @@ -41,8 +41,6 @@ void __init corenet_gen_pic_init(void) > > unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU | > > MPIC_NO_RESET; > > > > - struct device_node *np; > > - > > if (ppc_md.get_irq == mpic_get_coreint_irq) > > flags |= MPIC_ENABLE_COREINT; > > > > @@ -50,13 +48,6 @@ void __init corenet_gen_pic_init(void) > > BUG_ON(mpic == NULL); > > > > mpic_init(mpic); > > - > > - np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); > > - if (np) { > > - qe_ic_init(np, 0, qe_ic_cascade_low_mpic, > > - qe_ic_cascade_high_mpic); > > - of_node_put(np); > > - } > > } > > > > /* > > diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c > > b/arch/powerpc/platforms/85xx/mpc85xx_mds.c > > index f61cbe2..7ae4901 100644 > > --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c > > +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c > > @@ -279,20 +279,6 @@ static void __init mpc85xx_mds_qeic_init(void) > > of_node_put(np); > > return; > > } > > - > > - np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); > > - if (!np) { > > - np = of_find_node_by_type(NULL, "qeic"); > > - if (!np) > > - return; > > - } > > - > > - if (machine_is(p1021_mds)) > > - qe_ic_init(np, 0, qe_ic_cascade_low_mpic, > > - qe_ic_cascade_high_mpic); > > - else > > - qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); > > This block is also not preserved. Nor explained in the commit log. Is it really ok > to drop it? If so, why? on non-p1021_mds mpc85xx_mds boards(mpc8568 and mpc8569). The qeic has the same interrupt number for low and high. So use qe_ic_cascade_muxed_mpic for this situation. qeic: interrupt-controller@80 { interrupt-controller; compatible = "fsl,qe-ic"; #address-cells = <0>; #interrupt-cells = <1>; reg = <0x80 0x80>; interrupts = <46 2 0 0 46 2 0 0>; //high:30 low:30 interrupt-parent = <&mpic>; }; In qe_ic_init, the code(as below) can handle this situation. If " qe_ic->virq_high != qe_ic->virq_low ", then set chaned handler for high handler. if (qe_ic->virq_high != NO_IRQ && qe_ic->virq_high != qe_ic->virq_low) { irq_set_handler_data(qe_ic->virq_high, qe_ic); irq_set_chained_handler(qe_ic->virq_high, high_handler); } > > > - of_node_put(np); > > } > > #else > > static void __init mpc85xx_mds_qe_init(void) { } diff --git > > a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > > b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > > index 3f4dad1..779f54f 100644 > > --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > > +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > > @@ -49,10 +49,6 @@ void __init mpc85xx_rdb_pic_init(void) > > struct mpic *mpic; > > unsigned long root = of_get_flat_dt_root(); > > > > -#ifdef CONFIG_QUICC_ENGINE > > - struct device_node *np; > > -#endif > > - > > if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { > > mpic = mpic_alloc(NULL, 0, MPIC_NO_RESET | > > MPIC_BIG_ENDIAN | > > @@ -67,18 +63,6 @@ void __init mpc85xx_rdb_pic_init(void) > > > > BUG_ON(mpic == NULL); > > mpic_init(mpic); > > - > > -#ifdef CONFIG_QUICC_ENGINE > > - np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); > > - if (np) { > > - qe_ic_init(np, 0, qe_ic_cascade_low_mpic, > > - qe_ic_cascade_high_mpic); > > - of_node_put(np); > > - > > - } else > > - pr_err("%s: Could not find qe-ic node\n", __func__); > > -#endif > > - > > } > > > > /* > > diff --git a/arch/powerpc/platforms/85xx/twr_p102x.c > > b/arch/powerpc/platforms/85xx/twr_p102x.c > > index 71bc255..603e244 100644 > > --- a/arch/powerpc/platforms/85xx/twr_p102x.c > > +++ b/arch/powerpc/platforms/85xx/twr_p102x.c > > @@ -35,26 +35,12 @@ static void __init twr_p1025_pic_init(void) { > > struct mpic *mpic; > > > > -#ifdef CONFIG_QUICC_ENGINE > > - struct device_node *np; > > -#endif > > - > > mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | > > MPIC_SINGLE_DEST_CPU, > > 0, 256, " OpenPIC "); > > > > BUG_ON(mpic == NULL); > > mpic_init(mpic); > > - > > -#ifdef CONFIG_QUICC_ENGINE > > - np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); > > - if (np) { > > - qe_ic_init(np, 0, qe_ic_cascade_low_mpic, > > - qe_ic_cascade_high_mpic); > > - of_node_put(np); > > - } else > > - pr_err("Could not find qe-ic node\n"); > > -#endif > > } > > > > /* > > > ************************************************************ > ********** > > ** diff --git a/drivers/irqchip/qe_ic.c b/drivers/irqchip/qe_ic.c > > index ec2ca86..f7f9a81 100644 > > --- a/drivers/irqchip/qe_ic.c > > +++ b/drivers/irqchip/qe_ic.c > > @@ -509,4 +509,18 @@ static int __init init_qe_ic_sysfs(void) > > return 0; > > } > > > > +static int __init qeic_of_init(void) > > +{ > > + struct device_node *np; > > + > > + np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); > > + if (np) { > > + qe_ic_init(np, 0, qe_ic_cascade_low_mpic, > > + qe_ic_cascade_high_mpic); > > + of_node_put(np); > > + } > > + return 0; > > +} > > + > > +subsys_initcall(qeic_of_init); > > subsys_initcall(init_qe_ic_sysfs); > > Was this tested on systems with dtbs containing type "qeic" but missing "fsl,qe- > ic"? What about non-p1021_mds mpc85xx_mds boards? In kernel, there are no boards containing type "qeic" in dtb. -Zhao Qiang BR