mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Wei Fang <wei.fang@nxp.com>, Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: RE: RE: [PATCH net-next 07/13] net: fec: fec_probe(): update quirk: bring IRQs in correct order
Date: Fri, 18 Oct 2024 11:26:04 -0400	[thread overview]
Message-ID: <ZxJ+DAn7fRE3Aiqm@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20241018-black-dormouse-of-exercise-f7fed0-mkl@pengutronix.de>

On Fri, Oct 18, 2024 at 11:16:46AM +0200, Marc Kleine-Budde wrote:
> On 17.10.2024 11:30:45, Frank Li wrote:
> > On Thu, Oct 17, 2024 at 04:21:33PM +0200, Marc Kleine-Budde wrote:
> > > On 17.10.2024 10:03:51, Frank Li wrote:
> > > > > > > Yes, that is IMHO the correct description of the IP core, but the
> > > > > > > i.MX8M/N/Q DTS have the wrong order of IRQs. And for compatibility
> > > > > > > reasons (fixed DTS with old driver) it's IMHO not possible to change the
> > > > > > > DTS.
> > > > > > >
> > > > > >
> > > > > > I don't think it is a correct behavior for old drivers to use new DTBs or new
> > > > > > drivers to use old DTBs. Maybe you are correct, Frank also asked the same
> > > > > > question, let's see how Frank responded.
> > > > >
> > > > > DTBs should be considered stable ABI.
> > > > >
> > > >
> > > > ABI defined at binding doc.
> > > >   interrupt-names:
> > > >     oneOf:
> > > >       - items:
> > > >           - const: int0
> > > >       - items:
> > > >           - const: int0
> > > >           - const: pps
> > > >       - items:
> > > >           - const: int0
> > > >           - const: int1
> > > >           - const: int2
> > > >       - items:
> > > >           - const: int0
> > > >           - const: int1
> > > >           - const: int2
> > > >           - const: pps
> > > >
> > > > DTB should align binding doc. There are not 'descriptions' at 'interrupt',
> > > > which should match 'interrupt-names'. So IMX8MP dts have not match ABI,
> > > > which defined by binding doc. So it is DTS implement wrong.
> > >
> > > I follow your conclusion. But keep in mind, fixing the DTB would break
> > > compatibility. The wrong DTS looks like this:
> > >
> > > - const: int1
> > > - const: int2
> > > - const: int0
> > > - const: pps
> > >
> > > Currently we have broken DTS on the i.MX8M* and the
> > > FEC_QUIRK_WAKEUP_FROM_INT2 that "fixes" this.
> > >
> > > This patch uses this quirk to correct the IRQ <-> queue assignment in
> > > the driver.
> >
> > This current code
> >
> > for (i = 0; i < irq_cnt; i++) {
> >                 snprintf(irq_name, sizeof(irq_name), "int%d", i);
> >                 irq = platform_get_irq_byname_optional(pdev, irq_name);
> > 		      ^^^^^^^^^^^^^^^^^^^^^
> >
> > You just need add interrupt-names at imx8mp dts and reorder it to pass
> > DTB check.
>
> ACK
>
> >
> >                 if (irq < 0)
> >                         irq = platform_get_irq(pdev, i);
> >                 if (irq < 0) {
> >                         ret = irq;
> >                         goto failed_irq;
> >                 }
> >                 ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt,
> >                                        0, pdev->name, ndev);
> >                 if (ret)
> >                         goto failed_irq;
> >
> >                 fep->irq[i] = irq;
> >         }
> >
> > All irq handle by the same fec_enet_interrupt().  Change dts irq orders
> > doesn't broken compatiblity.
>
> I'm sorry, but this is not 100% correct. Changing the _order_ of IRQs
> does break compatibility. New DT (with changed IRQ order) with old
> driver breaks wakeup functionality.
>
> Have a look at b7cdc9658ac8 ("net: fec: add WoL support for i.MX8MQ"),
> but keep in mind the patch description is not 100% correct:
>
> | By default FEC driver treat irq[0] (i.e. int0 described in dt-binding)
> | as wakeup interrupt, but this situation changed on i.MX8M serials, SoC
> | integration guys mix wakeup interrupt signal into int2 interrupt line.
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> This statement is wrong. The SoC integration is correct, the DT is
> wrong.

We should fix wrong thing instead of continuing on the wrong path. No
much user use wakeup funcationlity. Actually you enable both int0 and int2
as wakeup source if try to keep compatility.

for example:
	fec->wake_irq = fep->irq[0];
	if (FEC_QUIRK_WAKEUP_FROM_INT2)
		fec->wake_irq2 = fep->irq[2];


...
	if (fep->wake_irq2 > 0) {
                                disable_irq(fep->wake_irq2);
                                enable_irq_wake(fep->wake_irq2);
                        }

I perfer fix dts and remove FEC_QUIRK_WAKEUP_FROM_INT2.


>
> | This patch introduces FEC_QUIRK_WAKEUP_FROM_INT2 to indicate int2 as
> | wakeup interrupt for i.MX8MQ.
>
> > "pre-equeue" irq is new features. You can enable this feature only
> > when "interrupt-names" exist in future.
>
> regards,
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde          |
> Embedded Linux                   | https://www.pengutronix.de |
> Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |



  reply	other threads:[~2024-10-18 15:26 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 21:51 [PATCH net-next 00/13] net: fec: cleanups, update quirk, update IRQ naming Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 01/13] net: fec: fix typos found by codespell Marc Kleine-Budde
2024-10-17  1:31   ` Wei Fang
2024-10-17  1:52   ` Frank Li
2024-11-15 14:40   ` Csókás Bence
2024-10-16 21:51 ` [PATCH net-next 02/13] net: fec: struct fec_enet_private: remove obsolete comment Marc Kleine-Budde
2024-10-17  1:37   ` Wei Fang
2024-10-17  1:55   ` Frank Li
2024-10-17  6:53     ` Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 03/13] net: fec: add missing header files Marc Kleine-Budde
2024-10-17  1:40   ` Wei Fang
2024-10-17  1:56   ` Frank Li
2024-10-17  6:53     ` Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 04/13] net: fec: rename struct fec_devinfo fec_imx6x_info -> fec_imx6sx_info Marc Kleine-Budde
2024-10-17  1:44   ` Wei Fang
2024-10-17  1:59   ` Frank Li
2024-10-17  6:54     ` Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 05/13] net: fec: fec_restart(): introduce a define for FEC_ECR_SPEED Marc Kleine-Budde
2024-10-17  1:47   ` Wei Fang
2024-10-17  2:05   ` Frank Li
2024-10-17  6:56     ` Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 06/13] net: fec: fec_restart(): make use of FEC_ECR_RESET Marc Kleine-Budde
2024-10-17  1:49   ` Wei Fang
2024-10-17  2:07   ` Frank Li
2024-10-17  6:56     ` Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 07/13] net: fec: fec_probe(): update quirk: bring IRQs in correct order Marc Kleine-Budde
2024-10-17  2:15   ` Frank Li
2024-10-17  6:13     ` Marc Kleine-Budde
2024-10-17  3:09   ` Wei Fang
2024-10-17  6:16     ` Marc Kleine-Budde
2024-10-17  7:43       ` Wei Fang
2024-10-17 10:21         ` Marc Kleine-Budde
2024-10-17 14:03           ` Frank Li
2024-10-17 14:21             ` Marc Kleine-Budde
2024-10-17 15:30               ` Frank Li
2024-10-18  9:16                 ` Marc Kleine-Budde
2024-10-18 15:26                   ` Frank Li [this message]
2024-10-16 21:51 ` [PATCH net-next 08/13] net: fec: fec_probe(): let IRQ name reflect its function Marc Kleine-Budde
2024-10-17  2:24   ` Frank Li
2024-10-17  3:12   ` Wei Fang
2024-10-16 21:51 ` [PATCH net-next 09/13] net: fec: fec_enet_rx_queue(): use same signature as fec_enet_tx_queue() Marc Kleine-Budde
2024-10-17  2:32   ` Frank Li
2024-10-17  7:02     ` Marc Kleine-Budde
2024-10-16 21:51 ` [PATCH net-next 10/13] net: fec: fec_enet_rx_queue(): replace open coded cast by skb_vlan_eth_hdr() Marc Kleine-Budde
2024-10-17  2:44   ` Frank Li
2024-10-17  7:04     ` Marc Kleine-Budde
2024-10-17  3:15   ` Wei Fang
2024-10-16 21:51 ` [PATCH net-next 11/13] net: fec: fec_enet_rx_queue(): reduce scope of data Marc Kleine-Budde
2024-10-17  2:49   ` Frank Li
2024-10-17  3:19   ` Wei Fang
2024-10-16 21:52 ` [PATCH net-next 12/13] net: fec: fec_enet_rx_queue(): move_call to _vlan_hwaccel_put_tag() Marc Kleine-Budde
2024-10-17  3:05   ` Frank Li
2024-10-17  7:05     ` Marc Kleine-Budde
2024-10-17  3:29   ` Wei Fang
2024-10-16 21:52 ` [PATCH net-next 13/13] net: fec: fec_enet_rx_queue(): factor out VLAN handling into separate function fec_enet_rx_vlan() Marc Kleine-Budde
2024-10-17  3:07   ` Frank Li
2024-10-17  3:33   ` Wei Fang
2024-10-17  7:09     ` Marc Kleine-Budde
2024-10-17  7:48       ` Wei Fang
2024-10-18  7:21         ` Marc Kleine-Budde

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=ZxJ+DAn7fRE3Aiqm@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®