[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e1197f9-22f6-4189-8c16-f9bff897d567@lunn.ch>
Date: Sat, 11 Nov 2023 21:07:08 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Yanteng Si <siyanteng@...ngson.cn>
Cc: hkallweit1@...il.com, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com,
fancer.lancer@...il.com, Jose.Abreu@...opsys.com,
chenhuacai@...ngson.cn, linux@...linux.org.uk, dongbiao@...ngson.cn,
guyinggang@...ngson.cn, netdev@...r.kernel.org,
loongarch@...ts.linux.dev, chris.chenfeiyang@...il.com
Subject: Re: [PATCH v5 3/9] net: stmmac: Add Loongson DWGMAC definitions
> +#ifdef CONFIG_DWMAC_LOONGSON
> +#define DMA_INTR_ABNORMAL (DMA_INTR_ENA_AIE_LOONGSON | DMA_INTR_ENA_AIE | \
> + DMA_INTR_ENA_FBE | DMA_INTR_ENA_UNE)
> +#else
> #define DMA_INTR_ABNORMAL (DMA_INTR_ENA_AIE | DMA_INTR_ENA_FBE | \
> DMA_INTR_ENA_UNE)
> +#endif
The aim is to produce one kernel which runs on all possible
variants. So we don't like to see this sort of #ifdef. Please try to
remove them.
> @@ -167,7 +167,7 @@ int dwmac_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr,
> struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[chan];
> int ret = 0;
> /* read the status register (CSR5) */
> - u32 intr_status = readl(ioaddr + DMA_STATUS);
> + u32 intr_status = readl(ioaddr + DMA_CHAN_STATUS(chan));
>
Please break this patch up. Changes like the above are simple to
understand. So have one patch which just adds these macros and makes
use of them.
> #ifdef DWMAC_DMA_DEBUG
> /* Enable it to monitor DMA rx/tx status in case of critical problems */
> @@ -182,7 +182,7 @@ int dwmac_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr,
> intr_status &= DMA_STATUS_MSK_TX;
>
> /* ABNORMAL interrupts */
> - if (unlikely(intr_status & DMA_STATUS_AIS)) {
> + if (unlikely(intr_status & DMA_ABNOR_INTR_STATUS)) {
However, this is not obviously correct. You need to explain in the
commit message why this change is needed.
Lots of small patches make the understanding easier.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 7371713c116d..aafc75fa14a0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7062,6 +7062,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
> /* dwmac-sun8i only work in chain mode */
> if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I)
> chain_mode = 1;
> +
> priv->chain_mode = chain_mode;
Please avoid white space changes.
Andrew
Powered by blists - more mailing lists