LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH net-next 1/3] dt-bindings: net: fsl, fec: add "fsl, wakeup-irq" property
Date: Fri, 13 Aug 2021 13:22:59 -0500	[thread overview]
Message-ID: <YRa4g8cjGrQ979pQ@robh.at.kernel.org> (raw)
In-Reply-To: <VI1PR04MB6800EE08F70CC3F0DD53C991E6F89@VI1PR04MB6800.eurprd04.prod.outlook.com>

On Wed, Aug 11, 2021 at 07:57:46AM +0000, Joakim Zhang wrote:
> 
> Hi Andrew,
> 
> > -----Original Message-----
> > From: Andrew Lunn <andrew@lunn.ch>
> > Sent: 2021年8月10日 22:33
> > To: Joakim Zhang <qiangqing.zhang@nxp.com>
> > Cc: Florian Fainelli <f.fainelli@gmail.com>; davem@davemloft.net;
> > kuba@kernel.org; robh+dt@kernel.org; shawnguo@kernel.org;
> > s.hauer@pengutronix.de; festevam@gmail.com; kernel@pengutronix.de;
> > dl-linux-imx <linux-imx@nxp.com>; netdev@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> > linux-arm-kernel@lists.infradead.org
> > Subject: Re: [PATCH net-next 1/3] dt-bindings: net: fsl, fec: add "fsl,
> > wakeup-irq" property
> > 
> > > > > 1) FEC controller has up to 4 interrupt lines and all of these are
> > > > > routed to GIC
> > > > interrupt controller.
> > > > > 2) FEC has a wakeup interrupt signal and always are mixed with
> > > > > other
> > > > interrupt signals, and then output to one interrupt line.
> > > > > 3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but
> > > > > for i.MX8M
> > > > serials, are mixed to int2 line.
> > 
> > So you need to know which of the interrupts listed is the wake up interrupt.

We already have a way to do this by using 'wakeup' for the 
interrupt-names entry. But I guess that ship has sailed here and that 
wouldn't work well if not just a wakeup source (though you could repeat 
an interrupt line that's the wakeup source).

> > 
> > I can see a few ways to do this:
> > 
> > The FEC driver already has quirks. Add a quirk to fec_imx8mq_info and
> > fec_imx8qm_info to indicate these should use int2.

Bingo!

Note that if the device is wakeup capable, it should have a 
'wakeup-source' property in this case.

> > 
> > or
> > 
> > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> > 
> >   b) two cells
> >   ------------
> >   The #interrupt-cells property is set to 2 and the first cell defines the
> >   index of the interrupt within the controller, while the second cell is used
> >   to specify any of the following flags:
> >     - bits[3:0] trigger type and level flags
> >         1 = low-to-high edge triggered
> >         2 = high-to-low edge triggered
> >         4 = active high level-sensitive
> >         8 = active low level-sensitive
> > 
> > You could add
> > 
> >        18 = wakeup source

I'd be okay with this (though it should be a power of 2 number).

> > 
> > and extend to core to either do all the work for you, or tell you this interrupt is
> > flagged as being a wakeup source. This solution has the advantage of it should
> > be usable in other drivers.

Another option is couldn't you just enable all the interrupts as wakeup 
sources? Presumably, only one of them would trigger a wakeup.

> 
> Thanks a lot for your comments first!
> 
> I just look into the irq code, if we extend bit[5] to carry wakeup info ( due to bit[4] is used for IRQ_TYPE_PROBE), 
> then configure it in the TYPE field of 'interrupts' property, so that interrupt controller would know which interrupt
> is wakeup capable. 
> I think there is no much work core would do, may just set this interrupt wakup capable. Another functionality is
> driver side get this info to identify which mixed interrupt has wakeup capability, we can export symbol from kernel/irq/irqdomain.c.
> 
> The intention is to let driver know which interrupt is wakeup capable, I would choose to provider this in specific driver,
> instead of interrupt controller, it seems to me that others may all choose this solution for wakeup mixed interrupt.
> 
> So I would prefer solution 1, it's easier and under-control. I can have a try if you strongly recommend solution 2.
> 
> Best Regards,
> Joakim Zhang
> > 	  Andrew

  parent reply	other threads:[~2021-08-13 18:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05  7:46 [PATCH net-next 0/3] net: fec: add support to select wakeup irq source Joakim Zhang
2021-08-05  7:46 ` [PATCH net-next 1/3] dt-bindings: net: fsl,fec: add "fsl,wakeup-irq" property Joakim Zhang
2021-08-05  9:18   ` [PATCH net-next 1/3] dt-bindings: net: fsl, fec: add "fsl, wakeup-irq" property Florian Fainelli
2021-08-09  5:08     ` Joakim Zhang
2021-08-09 18:39       ` Florian Fainelli
2021-08-10  2:21         ` Joakim Zhang
2021-08-10 14:32           ` Andrew Lunn
2021-08-11  7:57             ` Joakim Zhang
2021-08-11 16:16               ` Andrew Lunn
2021-08-13 18:22               ` Rob Herring [this message]
2021-08-16  6:48                 ` Joakim Zhang
2021-08-10 17:45           ` Florian Fainelli
2021-08-11  8:06             ` Joakim Zhang
2021-08-12  9:46               ` Florian Fainelli
2021-08-05  7:46 ` [PATCH net-next 2/3] net: fec: add support to select wakeup irq source Joakim Zhang
2021-08-05  7:46 ` [PATCH net-next 3/3] arm64: dts: imx8m: add "fsl,wakeup-irq" property for FEC Joakim Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YRa4g8cjGrQ979pQ@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qiangqing.zhang@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --subject='Re: [PATCH net-next 1/3] dt-bindings: net: fsl, fec: add "fsl, wakeup-irq" property' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).