Subject: RE: [PATCH net v2 1/2] net: txgbe: remove separate irq request for MSI and INTx

From: Jiawen Wu <[email-masked]>
Date: Fri, 28 Jun 2024 09:47:04 +0800

On Fri, Jun 28, 2024 7:42 AM, Jakub Kicinski wrote:
> On Wed, 26 Jun 2024 14:07:02 +0800 Jiawen Wu wrote:
> > When using MSI or INTx interrupts, request_irq() for pdev->irq will
> > conflict with request_threaded_irq() for txgbe->misc.irq, to cause
> > system crash. So remove txgbe_request_irq() for MSI/INTx case, and
> > rename txgbe_request_msix_irqs() since it only request for queue irqs.
> 
> Do you have any users who need INTx support? Maybe you could drop
> the support and simplify the code?

Yes, some domestic platforms use it.

> 
> > Fixes: aefd013624a1 ("net: txgbe: use irq_domain for interrupt controller")
> > Signed-off-by: Jiawen Wu <[email-masked]>
> > ---
> >  drivers/net/ethernet/wangxun/libwx/wx_lib.c   |  3 +-
> >  .../net/ethernet/wangxun/txgbe/txgbe_irq.c    | 78 ++-----------------
> >  .../net/ethernet/wangxun/txgbe/txgbe_irq.h    |  2 +-
> >  .../net/ethernet/wangxun/txgbe/txgbe_main.c   |  2 +-
> >  4 files changed, 10 insertions(+), 75 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> > index 68bde91b67a0..99f55a3573c8 100644
> > --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> > +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> > @@ -1996,7 +1996,8 @@ void wx_free_irq(struct wx *wx)
> >  	int vector;
> >
> >  	if (!(pdev->msix_enabled)) {
> > -		free_irq(pdev->irq, wx);
> > +		if (wx->mac.type == wx_mac_em)
> > +			free_irq(pdev->irq, wx);
> 
> It seems strange to match on type to decide whether to free an IRQ.
> Isn't there or shouldn't there be some IRQ related flag informing
> the library how to manage the IRQs?

My intention is not to change the IRQ structure of ngbe driver. So it
simply match the mac type. I would consider use a flag.