Message ID | e18edf4ab0a83de235fa3475eee4ba8ac88ee651.1699533745.git.siyanteng@loongson.cn (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | stmmac: Add Loongson platform support | expand |
On Fri, Nov 10, 2023 at 05:25:41PM +0800, Yanteng Si wrote: > Some platforms need extra irq flags when request multi msi, add > irq_flags variable for them. It would be nice to document what flags are needed. You also seem to be pass the same flags to all instances of request_irq. However, the flags should be specific to one irq. So you need irq_irq_flags, wol_irq_flags, lpi_irq_flags, etc. Andrew --- pw-bot: cr
在 2023/11/12 03:51, Andrew Lunn 写道: > On Fri, Nov 10, 2023 at 05:25:41PM +0800, Yanteng Si wrote: >> Some platforms need extra irq flags when request multi msi, add >> irq_flags variable for them. > It would be nice to document what flags are needed. > > You also seem to be pass the same flags to all instances of > request_irq. However, the flags should be specific to one irq. So you > need irq_irq_flags, wol_irq_flags, lpi_irq_flags, etc. It is a trigger type. Thanks, Yanteng > > > Andrew > > --- > pw-bot: cr
On Tue, Nov 21, 2023 at 08:01:53PM +0800, Yanteng Si wrote: > > 在 2023/11/12 03:51, Andrew Lunn 写道: > > On Fri, Nov 10, 2023 at 05:25:41PM +0800, Yanteng Si wrote: > > > Some platforms need extra irq flags when request multi msi, add > > > irq_flags variable for them. > > It would be nice to document what flags are needed. > > > > You also seem to be pass the same flags to all instances of > > request_irq. However, the flags should be specific to one irq. So you > > need irq_irq_flags, wol_irq_flags, lpi_irq_flags, etc. > > It is a trigger type. Yes, i figure that out eventually. But it would be good to state it here. And trigger type, edge verses level, rising vs falling, is a per interrupt property. So you do need the flag per interrupt. Andrew
在 2023/11/21 21:59, Andrew Lunn 写道: > Yes, i figure that out eventually. But it would be good to state it > here. > > And trigger type, edge verses level, rising vs falling, is a per > interrupt property. So you do need the flag per interrupt. I see. We decided to remove it in the next patch version, and to be honest, the flag is not being used at the moment, I have test it on the machine in the last two days. Thanks to this, I was able to make the first patch a bit smaller as well. Thanks for your review! Thanks, Yanteng
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 132d4f679b95..7371713c116d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3552,7 +3552,7 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) int_name = priv->int_name_mac; sprintf(int_name, "%s:%s", dev->name, "mac"); ret = request_irq(dev->irq, stmmac_mac_interrupt, - 0, int_name, dev); + priv->plat->irq_flags, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc mac MSI %d (error: %d)\n", @@ -3569,7 +3569,7 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) sprintf(int_name, "%s:%s", dev->name, "wol"); ret = request_irq(priv->wol_irq, stmmac_mac_interrupt, - 0, int_name, dev); + priv->plat->irq_flags, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc wol MSI %d (error: %d)\n", @@ -3587,7 +3587,7 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) sprintf(int_name, "%s:%s", dev->name, "lpi"); ret = request_irq(priv->lpi_irq, stmmac_mac_interrupt, - 0, int_name, dev); + priv->plat->irq_flags, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc lpi MSI %d (error: %d)\n", @@ -3605,7 +3605,7 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) sprintf(int_name, "%s:%s", dev->name, "safety-ce"); ret = request_irq(priv->sfty_ce_irq, stmmac_safety_interrupt, - 0, int_name, dev); + priv->plat->irq_flags, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc sfty ce MSI %d (error: %d)\n", @@ -3623,7 +3623,7 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) sprintf(int_name, "%s:%s", dev->name, "safety-ue"); ret = request_irq(priv->sfty_ue_irq, stmmac_safety_interrupt, - 0, int_name, dev); + priv->plat->irq_flags, int_name, dev); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc sfty ue MSI %d (error: %d)\n", @@ -3644,7 +3644,8 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) sprintf(int_name, "%s:%s-%d", dev->name, "rx", i); ret = request_irq(priv->rx_irq[i], stmmac_msi_intr_rx, - 0, int_name, &priv->dma_conf.rx_queue[i]); + priv->plat->irq_flags, int_name, + &priv->dma_conf.rx_queue[i]); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc rx-%d MSI %d (error: %d)\n", @@ -3669,7 +3670,8 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev) sprintf(int_name, "%s:%s-%d", dev->name, "tx", i); ret = request_irq(priv->tx_irq[i], stmmac_msi_intr_tx, - 0, int_name, &priv->dma_conf.tx_queue[i]); + priv->plat->irq_flags, int_name, + &priv->dma_conf.tx_queue[i]); if (unlikely(ret < 0)) { netdev_err(priv->dev, "%s: alloc tx-%d MSI %d (error: %d)\n", diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 0b4658a7eceb..664a0e1cefc2 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -312,5 +312,6 @@ struct plat_stmmacenet_data { int msi_tx_base_vec; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; + unsigned int irq_flags; }; #endif