Subject: Re: [PATCH RESEND net-next v6 2/3] net: stmmac: Add glue driver for Motorcomm YT6801 ethernet controller

From: Yao Zi <[email-masked]>
Date: Mon, 12 Jan 2026 07:51:35 +0000

On Mon, Jan 12, 2026 at 06:10:26AM +0000, Sai Krishna Gajula wrote:
> 
> 
> > -----Original Message-----
> > From: Yao Zi <[email-masked]>
> > Sent: Friday, January 9, 2026 3:05 PM
> > To: Andrew Lunn <[email-masked]>; David S. Miller
> > <[email-masked]>; Eric Dumazet <[email-masked]>; Jakub
> > Kicinski <[email-masked]>; Paolo Abeni <[email-masked]>; Frank
> > <[email-masked]>; Heiner Kallweit <[email-masked]>;
> > Russell King <[email-masked]>; Russell King (Oracle)
> > <[email-masked]>; Vladimir Oltean
> > <[email-masked]>; Chen-Yu Tsai <[email-masked]>; Jisheng Zhang
> > <[email-masked]>; Furong Xu <[email-masked]>
> > Cc: [email-masked]; [email-masked]; Mingcong Bai
> > <[email-masked]>; Kexy Biscuit <[email-masked]>; Yao Zi <[email-masked]>;
> > Runhua He <[email-masked]>; Xi Ruoyao <[email-masked]>
> > Subject: [PATCH RESEND net-next v6 2/3] net: stmmac: Add glue
> > driver for Motorcomm YT6801 ethernet controller
> > 
> > Motorcomm YT6801 is a PCIe ethernet controller based on DWMAC4 IP. It
> > integrates an GbE phy, supporting WOL, VLAN tagging and various types of
> > offloading. It ships an on-chip eFuse for storing various vendor configuration,
> > including MAC address.
> > Motorcomm YT6801 is a PCIe ethernet controller based on DWMAC4 IP. It
> > integrates an GbE phy, supporting WOL, VLAN tagging and various types of
> > offloading. It ships an on-chip eFuse for storing various vendor configuration,
> > including MAC address.
> > 
> > This patch adds basic glue code for the controller, allowing it to be set up and
> > transmit data at a reasonable speed. Features like WOL could be implemented
> > in the future.
> > 
> > Signed-off-by: Yao Zi <[email-masked]>
> > Tested-by: Mingcong Bai <[email-masked]>
> > Tested-by: Runhua He <[email-masked]>
> > Tested-by: Xi Ruoyao <[email-masked]>
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/Kconfig   |   9 +
> >  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
> >  .../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 384
> > ++++++++++++++++++
> >  3 files changed, 394 insertions(+)

...

> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
> > new file mode 100644
> > index 000000000000..8b45b9cf7202
> > --- /dev/null
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c

...

> > +static int motorcomm_efuse_read_patch(struct dwmac_motorcomm_priv
> > *priv,
> > +				      u8 index,
> > +				      struct motorcomm_efuse_patch *patch) {
> Minor nit
> This format breaks  kernel style function definition, use as below ( "{" in next line)
> static int motorcomm_efuse_read_patch(struct dwmac_motorcomm_priv
>                                                                           *priv,
> 				                 u8 index,
> 				                 struct motorcomm_efuse_patch *patch) 
> {

This is strange, I didn't put the left curly brace in the same line as
the argument list. You could confirm this in the mbox archived by
lore[1]. Same for other functions.

I've talked to other recipients of the patch, and one uses Outlook as
MTA reported similar issues. It seems Outlook MTA (not the server)
automatically removes the line break and the plus sign before the curly
brace.

I checked your Message-ID and found you're also using Outlook as service
provider, if Outlook is also your MTA, could you try turn off option
"Remove extra line breaks in plain text messages" and see whether the
problem gets fixed?

...

> > +static int motorcomm_setup_irq(struct pci_dev *pdev,
> > +			       struct stmmac_resources *res,
> > +			       struct plat_stmmacenet_data *plat) {
> > +	int ret;
> > +
> > +	ret = pci_alloc_irq_vectors(pdev, 6, 6, PCI_IRQ_MSIX);
> > +	if (ret > 0) {
> > +		res->rx_irq[0]	= pci_irq_vector(pdev, 0);
> > +		res->tx_irq[0]	= pci_irq_vector(pdev, 4);
> > +		res->irq	= pci_irq_vector(pdev, 5);
> > +
> > +		plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
> > +	} else {
> > +		dev_info(&pdev->dev, "failed to allocate MSI-X vector: %d\n",
> > +			 ret);
> > +		dev_info(&pdev->dev, "try MSI instead\n");
> > +
> > +		ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
> > +		if (ret < 0)
> > +			return dev_err_probe(&pdev->dev, ret,
> > +					     "failed to allocate MSI\n");
> > +
> > +		res->irq = pci_irq_vector(pdev, 0);
> > +	}
> 
> If possible, add enum for MAX MSIX count (in this case 6 ), or dynamic values as per hardware. 

The only Motorcomm PCIe ethernet controller I could find is YT6801, so
I don't think there's a need for per-hardware values (at least for now).
Will add a constant to represent MSI-X count in the next version.

...

> Reviewed-by: Sai Krishna <[email-masked]>

Thanks for reviewing.

Best regards,
Yao Zi

[1]: https://lore.kernel.org/all/[email-masked]/raw