From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbdJDNXl (ORCPT ); Wed, 4 Oct 2017 09:23:41 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:39449 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229AbdJDNO4 (ORCPT ); Wed, 4 Oct 2017 09:14:56 -0400 Date: Wed, 4 Oct 2017 14:14:53 +0100 From: James Hogan To: Ed Blake CC: , , , Subject: Re: [PATCH 3/4] irqchip: imgpdc: Set sys wake polarities to active high Message-ID: <20171004131453.GF25320@jhogan-linux.le.imgtec.org> References: <1506938159-466-1-git-send-email-ed.blake@sondrel.com> <1506938159-466-4-git-send-email-ed.blake@sondrel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="f2QGlHpHGjS2mn6Y" Content-Disposition: inline In-Reply-To: <1506938159-466-4-git-send-email-ed.blake@sondrel.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [192.168.154.110] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --f2QGlHpHGjS2mn6Y Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ed, On Mon, Oct 02, 2017 at 10:55:58AM +0100, Ed Blake wrote: >=20 > Set all sys wake polarities to active high during initial setup. The > default is active low, which currently causes the 'flow_type' passed > into the set_type function to be effectively inverted. >=20 > Signed-off-by: Ed Blake > --- > drivers/irqchip/irq-imgpdc.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/irqchip/irq-imgpdc.c b/drivers/irqchip/irq-imgpdc.c > index 22d8f8a..d1bcfef 100644 > --- a/drivers/irqchip/irq-imgpdc.c > +++ b/drivers/irqchip/irq-imgpdc.c > @@ -49,6 +49,8 @@ > #define PDC_IRQ_ROUTE_EXT_EN_WD 0x00000004 > #define PDC_IRQ_ROUTE_EXT_EN_IR 0x00000002 > #define PDC_IRQ_ROUTE_EXT_EN_RTC 0x00000001 > +#define PDC_SYS_WAKE_POL 0x00000020 > +#define PDC_SYS_WAKE_POL_SHIFT 5 I don't see this bit in the documentation for the PDC in TZ1090, so it must be new in later versions of the IP. Maybe that can be mentioned in the commit message or a code comment. Does it need backporting to any stable branches (presumably v4.1+ for Pistachio's sake)? > #define PDC_SYS_WAKE_RESET 0x00000010 > #define PDC_SYS_WAKE_INT_MODE 0x0000000e > #define PDC_SYS_WAKE_INT_MODE_SHIFT 1 > @@ -63,6 +65,9 @@ > #define PDC_SYS_WAKE_INT_CHANGE 0x6 > #define PDC_SYS_WAKE_INT_NONE 0x4 > =20 > +#define PDC_SYS_WAKE_ACTIVE_LOW 0x0 > +#define PDC_SYS_WAKE_ACTIVE_HIGH 0x1 Its a pity this HW isn't compatible with the older version which I presume treated the INT_MODEs as active high but would have reported 0 in this bit. Never mind. > + > /** > * struct pdc_intc_priv - private pdc interrupt data. > * @nr_perips: Number of peripheral interrupt signals. > @@ -335,8 +340,9 @@ static void pdc_intc_setup(struct pdc_intc_priv *priv) > for (i =3D 0; i < priv->nr_syswakes; ++i) { > /* set the IRQ mode to none */ > soc_sys_wake_regoff =3D PDC_SYS_WAKE_BASE + i*PDC_SYS_WAKE_STRIDE; > - soc_sys_wake =3D PDC_SYS_WAKE_INT_NONE > - << PDC_SYS_WAKE_INT_MODE_SHIFT; > + soc_sys_wake =3D > + PDC_SYS_WAKE_ACTIVE_HIGH << PDC_SYS_WAKE_POL_SHIFT | > + PDC_SYS_WAKE_INT_NONE << PDC_SYS_WAKE_INT_MODE_SHIFT; Looks reasonable. With a tweaked commit message or comment as mentioned above: Acked-by: James Hogan Cheers James > pdc_write(priv, soc_sys_wake_regoff, soc_sys_wake); > } > } > --=20 > 1.9.1 >=20 --f2QGlHpHGjS2mn6Y Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd80NauSabkiESfLYbAtpk944dnoFAlnU3p8ACgkQbAtpk944 dnqwLRAAmigfgUZoj4/iP6ZcQYCdmLpBTGPR14eap1803uUXGB3E0KCYZyF62obw KNQHY/5Qujo0lNXZYkBdbl1V2jXNXIM9TG+qYTbGcZGesMtkZik2yKt0zGdBQhzU VY1F0EsqlTPhComlPDyd5K00T+7sV9N1GPL1gI8nrT0RquYt4HcbFmd6gsVv4ppF J6B9V0i+165yesTJo6Fukp574eHt61NkDuGXKWhkWx0+6CxMdCxVEaXStuZudtTq 5QPz/Fd/JvhhgTuoUe/dDQMNkGyviE2/5ZUXC7SHuPqryVAwr8JC0lOeKfa+gErU aUpx5emETYH/qGKqrahLlYvDHmmh1ARol4rb2B79i202TyV8rTSG1sFtB9jlvFuT 1ZVrcpGGFt0aH/X3zqCHfUuf2RafB7E8CbiCyquXwaOCqUc17N8iZCfHePwQiyC+ C7PRKmHtgAXmR1z3LMkUTPV9eqonehlRgt9x3PL4Vn7B78ka81mNgsg70JWSzIAO ZcuM4Dnn2nPoUUV764XsKOwRe18+8JjCb2qtu6O+Vazw/GyWwJ7PgX93UDK92TgM u1s8kxLBA9pD5F8UC+NOQ4j5Ug+YHqV81drxPLB03gin7jMOv/ANChW9Lp7e8hAr tIKG8Di9bEkvmNLjWVmY4d5LD0SzRMRTgM4L+vamzqPW6hTex3U= =1BpK -----END PGP SIGNATURE----- --f2QGlHpHGjS2mn6Y--