Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Måns Rullgård
Andy Shevchenko writes: + nb8800_writel(priv, NB8800_MDIO_CMD, val | MDIO_CMD_GO); + + if (!nb8800_mdio_wait(bus)) + return -ETIMEDOUT; + + val = nb8800_readl(priv, NB8800_MDIO_STS); + if (val & MDIO_STS_ERR) +

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Andy Shevchenko
On Sat, Oct 31, 2015 at 8:41 PM, Måns Rullgård wrote: > Andy Shevchenko writes: > >>> +static int nb8800_mdio_read(struct mii_bus *bus, int phy_id, int reg) >>> +{ >>> + struct nb8800_priv *priv = bus->priv; >>> + int val; >>> + >>> + if (!nb8800_mdio_wait(bus)) >>> +

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Måns Rullgård
Francois Romieu writes: > Måns Rullgård : >> Francois Romieu writes: > [...] >> > It looks like it receives, then tries to allocate new resources. If so >> > it may deplete the ring and you should instead consider allocating new >> > resources first, then receive data if alloc + map suceeded. >

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Måns Rullgård
Andy Shevchenko writes: >> +static int nb8800_mdio_read(struct mii_bus *bus, int phy_id, int reg) >> +{ >> + struct nb8800_priv *priv = bus->priv; >> + int val; >> + >> + if (!nb8800_mdio_wait(bus)) >> + return -ETIMEDOUT; >> + >> + val = MIIAR_ADDR(phy_id) |

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Francois Romieu
Måns Rullgård : > Francois Romieu writes: [...] > > It looks like it receives, then tries to allocate new resources. If so > > it may deplete the ring and you should instead consider allocating new > > resources first, then receive data if alloc + map suceeded. > > The hardware receives a frame

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Andy Shevchenko
On Thu, Oct 29, 2015 at 6:48 PM, Mans Rullgard wrote: > This adds a driver for the Aurora VLSI NB8800 Ethernet controller. > It is an almost complete rewrite of a driver originally found in > a Sigma Designs 2.6.22 tree. > > Signed-off-by: Mans Rullgard > +++ b/drivers/net/ethernet/aurora/nb880

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-31 Thread Måns Rullgård
Francois Romieu writes: >> +static int nb8800_poll(struct napi_struct *napi, int budget) >> +{ >> +struct net_device *dev = napi->dev; >> +struct nb8800_priv *priv = netdev_priv(dev); >> +struct nb8800_dma_desc *rx; >> +int work = 0; >> +int last = priv->rx_eoc; >> +int ne

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-30 Thread Francois Romieu
Mans Rullgard : [...] > diff --git a/drivers/net/ethernet/aurora/nb8800.c > b/drivers/net/ethernet/aurora/nb8800.c > new file mode 100644 > index 000..ce61439 > --- /dev/null > +++ b/drivers/net/ethernet/aurora/nb8800.c [...] > +static int nb8800_mdio_read(struct mii_bus *bus, int phy_id, int

[PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

2015-10-29 Thread Mans Rullgard
This adds a driver for the Aurora VLSI NB8800 Ethernet controller. It is an almost complete rewrite of a driver originally found in a Sigma Designs 2.6.22 tree. Signed-off-by: Mans Rullgard --- Changes: - Make ethtool_ops const - Fix race in tx path on smp systems - Use different interrupt method