Re: [PATCH net-next v4 2/2] of: net: fix of_get_mac_addr_nvmem() for non-platform devices

2021-04-15 Thread Benjamin Herrenschmidt
On Mon, 2021-04-12 at 19:47 +0200, Michael Walle wrote: > > /** > * of_get_phy_mode - Get phy mode for given device_node > @@ -59,15 +60,39 @@ static int of_get_mac_addr(struct device_node *np, const > char *name, u8 *addr) > static int of_get_mac_addr_nvmem(struct device_node *np, u8 *addr)

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

2020-10-26 Thread Benjamin Herrenschmidt
On Fri, 2020-10-23 at 13:08 +, Dylan Hung wrote: > The issue was found on our test chip (ast2600 version A0) which is > just for testing and won't be mass-produced. This HW bug has been > fixed on ast2600 A1 and later versions. > > To verify the HW fix, I run overnight iperf and kvm tests on

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

2020-10-22 Thread Benjamin Herrenschmidt
Oct 21, 2020 at 12:10 AM Benjamin Herrenschmidt > > wrote: > > > On Tue, 2020-10-20 at 21:49 +0200, Arnd Bergmann wrote: > > > > On Tue, Oct 20, 2020 at 11:37 AM Dylan Hung > > > > wrote: > > > > > > +1 @first is system memory from dma_al

Re: [PATCH] net: ftgmac100: Ensure tx descriptor updates are visible

2020-10-22 Thread Benjamin Herrenschmidt
On Wed, 2020-10-21 at 14:40 +0200, Arnd Bergmann wrote: > On Wed, Oct 21, 2020 at 12:39 PM Joel Stanley wrote: > > > > > diff --git a/drivers/net/ethernet/faraday/ftgmac100.c > > b/drivers/net/ethernet/faraday/ftgmac100.c > > index 331d4bdd4a67..15cdfeb135b0 100644 > > --- a/drivers/net/etherne

Re: [PATCH] net: ftgmac100: Ensure tx descriptor updates are visible

2020-10-22 Thread Benjamin Herrenschmidt
On Wed, 2020-10-21 at 08:18 +, David Laight wrote: > From: Benjamin Herrenschmidt > > Sent: 21 October 2020 01:00 > > > > On Wed, 2020-10-21 at 08:36 +1030, Joel Stanley wrote: > > > We must ensure the tx descriptor updates are visible before updating > >

Re: [PATCH] net: ftgmac100: Ensure tx descriptor updates are visible

2020-10-20 Thread Benjamin Herrenschmidt
On Wed, 2020-10-21 at 08:36 +1030, Joel Stanley wrote: > We must ensure the tx descriptor updates are visible before updating > the tx pointer. > > This resolves the tx hangs observed on the 2600 when running iperf: To clarify the comment here. This doesn't ensure they are visible to the hardware

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

2020-10-20 Thread Benjamin Herrenschmidt
On Tue, 2020-10-20 at 21:49 +0200, Arnd Bergmann wrote: > On Tue, Oct 20, 2020 at 11:37 AM Dylan Hung wrote: > > > +1 @first is system memory from dma_alloc_coherent(), right? > > > > > > You shouldn't have to do this. Is coherent DMA memory broken on your > > > platform? > > > > It is about the

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

2020-10-20 Thread Benjamin Herrenschmidt
On Tue, 2020-10-20 at 13:15 +, David Laight wrote: > That rather depends where the data is 'stuck'. > > An old sparc cpu would flush the cpu store buffer before the read. > But a modern x86 cpu will satisfy the read from the store buffer > for cached data. > > If the write is 'posted' on a PC

Re: [PATCH 1/4] ftgmac100: Fix race issue on TX descriptor[0]

2020-10-19 Thread Benjamin Herrenschmidt
On Tue, 2020-10-20 at 04:13 +, Joel Stanley wrote: > On Mon, 19 Oct 2020 at 23:20, Benjamin Herrenschmidt > wrote: > > > > On Mon, 2020-10-19 at 16:57 +0800, Dylan Hung wrote: > > > These rules must be followed when accessing the TX descriptor: > > > &g

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

2020-10-19 Thread Benjamin Herrenschmidt
On Mon, 2020-10-19 at 19:57 -0700, Jakub Kicinski wrote: > > I suspect the problem is that the HW (and yes this would be a HW bug) > > doesn't order the CPU -> memory and the CPU -> MMIO path. > > > > What I think happens is that the store to txde0 is potentially still in > > a buffer somewhere on

Re: [PATCH v1 1/2] net: ftgmac100: move phy connect out from ftgmac100_setup_mdio

2020-10-19 Thread Benjamin Herrenschmidt
On Thu, 2020-10-15 at 15:49 +0300, Ivan Mikhaylov wrote: > Split MDIO registration and PHY connect into ftgmac100_setup_mdio and > ftgmac100_mii_probe. Please keep me CCod on ftgmac100 patches. > Signed-off-by: Ivan Mikhaylov Acked-by: Benjamin Herrenschmidt > --- > drive

Re: [PATCH 1/4] ftgmac100: Fix race issue on TX descriptor[0]

2020-10-19 Thread Benjamin Herrenschmidt
On Mon, 2020-10-19 at 16:57 +0800, Dylan Hung wrote: > These rules must be followed when accessing the TX descriptor: > > 1. A TX descriptor is "cleanable" only when its value is non-zero > and the owner bit is set to "software" Can you elaborate ? What is the point of that change ? The owner bit

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

2020-10-19 Thread Benjamin Herrenschmidt
On Mon, 2020-10-19 at 12:00 -0700, Jakub Kicinski wrote: > On Mon, 19 Oct 2020 08:57:03 + Joel Stanley wrote: > > > diff --git a/drivers/net/ethernet/faraday/ftgmac100.c > > > b/drivers/net/ethernet/faraday/ftgmac100.c > > > index 00024dd41147..9a99a87f29f3 100644 > > > --- a/drivers/net/ethern

Re: [PATCH 4/4] ftgmac100: Restart MAC HW once

2020-10-19 Thread Benjamin Herrenschmidt
ned-off-by: Dylan Hung > Signed-off-by: Joel Stanley Acked-by: Benjamin Herrenschmidt > --- > drivers/net/ethernet/faraday/ftgmac100.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/faraday/ftgmac100.c > b/drivers/net/ethernet/faraday/

Re: [PATCH 3/4] ftgmac100: Add a dummy read to ensure running sequence

2020-10-19 Thread Benjamin Herrenschmidt
On Mon, 2020-10-19 at 16:57 +0800, Dylan Hung wrote: > On the AST2600 care must be taken to ensure writes appear correctly when > modifying the interrupt reglated registers. > > Add a function to perform a read after all writes to the IER and ISR > registers. You need to elaborate here. MMIO wri

Re: [PATCH] net: bmac: Fix stack corruption panic in bmac_probe()

2020-05-19 Thread Benjamin Herrenschmidt
On Tue, 2020-05-19 at 08:59 +0800, Jeremy Kerr wrote: > Hi Stan, > > > The new kernel compiled and booted with no errors, with these > > STACKPROTECTOR options in .config (the last two revealed the bug): > > > > CONFIG_HAVE_STACKPROTECTOR=y > > CONFIG_CC_HAS_STACKPROTECTOR_NONE=y > > CONFIG_STACK

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-08 Thread Benjamin Herrenschmidt
On Wed, 2019-01-09 at 15:53 +1100, Alexey Kardashevskiy wrote: > "A PCI completion timeout occurred for an outstanding PCI-E transaction" > it is. > > This is how I bind the device to vfio: > > echo vfio-pci > '/sys/bus/pci/devices/:01:00.0/driver_override' > echo vfio-pci > '/sys/bus/pci/dev

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-08 Thread Benjamin Herrenschmidt
On Wed, 2019-01-09 at 17:32 +1100, Alexey Kardashevskiy wrote: > I have just moved the "Mellanox Technologies MT27700 Family > [ConnectX-4]" from garrison to firestone machine and there it does not > produce an EEH, with the same kernel and skiboot (both upstream + my > debug). Hm. I cannot really

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-08 Thread Benjamin Herrenschmidt
On Mon, 2019-01-07 at 21:01 -0700, Jason Gunthorpe wrote: > > > In a very cryptic way that requires manual parsing using non-public > > docs sadly but yes. From the look of it, it's a completion timeout. > > > > Looks to me like we don't get a response to a config space access > > during the chan

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-05 Thread Benjamin Herrenschmidt
On Sat, 2019-01-05 at 10:51 -0700, Jason Gunthorpe wrote: > > > Interesting. I've investigated this further, though I don't have as > > many new clues as I'd like. The problem occurs reliably, at least on > > one particular type of machine (a POWER8 "Garrison" with ConnectX-4). > > I don't yet k

Re: [PATCH] Revert "net/ibm/emac: wrong bit is used for STA control"

2018-12-06 Thread Benjamin Herrenschmidt
On Fri, 2018-12-07 at 14:20 +1100, Benjamin Herrenschmidt wrote: > Apologies for the empty email, not too sure what happened, I did a resend and the second one worked. Cheers Ben.

[PATCH] Revert "net/ibm/emac: wrong bit is used for STA control"

2018-12-06 Thread Benjamin Herrenschmidt
used on his board. Signed-off-by: Benjamin Herrenschmidt --- Found while setting up some old ppc440 boxes for test/CI drivers/net/ethernet/ibm/emac/emac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/emac/emac.h b/drivers/net/ethernet/ibm/emac/e

[PATCH] Revert "net/ibm/emac: wrong bit is used for STA control"

2018-12-06 Thread Benjamin Herrenschmidt

Re: RFC on writel and writel_relaxed

2018-03-29 Thread Benjamin Herrenschmidt
On Thu, 2018-03-29 at 09:56 -0400, Sinan Kaya wrote: > On 3/28/2018 11:55 AM, David Miller wrote: > > From: Benjamin Herrenschmidt > > Date: Thu, 29 Mar 2018 02:13:16 +1100 > > > > > Let's fix all archs, it's way easier than fixing all drivers. Half of &

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Thu, 2018-03-29 at 02:23 +1000, Nicholas Piggin wrote: > On Wed, 28 Mar 2018 11:55:09 -0400 (EDT) > David Miller wrote: > > > From: Benjamin Herrenschmidt > > Date: Thu, 29 Mar 2018 02:13:16 +1100 > > > > > Let's fix all archs, it's way eas

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 07:41 -0400, ok...@codeaurora.org wrote: > Yes, we want to get there indeed. It is because of some arch not > implementing writel properly. Maintainers want to play safe. > > That is why I asked if IA64 and other well known archs follow the > strongly ordered rule at this m

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 11:30 +, David Laight wrote: > From: Benjamin Herrenschmidt > > Sent: 28 March 2018 10:56 > > ... > > For example, let's say I have a device with a reset bit and the spec > > says the reset bit needs to be set for at le

Re: Aw: Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 12:13 +0200, Lino Sanfilippo wrote: > Hi, > > > > > > Yeah so that other trick I'm talking about is also used for timing > > accuracy. > > > > For example, let's say I have a device with a reset bit and the spec > > says the reset bit needs to be set for at least 10us. > >

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 10:07 +0100, Will Deacon wrote: > > For arm/arm64 we guarantee ordering for (1) but not for (2) -- you'd need to > add an mb() to make it work. > > Do both of these work on power? Yes. There's even another quirk, see further down ;-) > If so, I guess I can make readl even

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 09:11 +0200, Arnd Bergmann wrote: > On Wed, Mar 28, 2018 at 8:56 AM, Benjamin Herrenschmidt > wrote: > > On Wed, 2018-03-28 at 06:53 +, Linus Torvalds wrote: > > > On Tue, Mar 27, 2018, 20:43 Benjamin Herrenschmidt > > > wrote: > >

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 06:53 +, Linus Torvalds wrote: > > > On Tue, Mar 27, 2018, 20:43 Benjamin Herrenschmidt ing.org> wrote: > > > > > > Of course, you'd have to be pretty odd to want to start a DMA > > with a > > > read anyway - partly

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 20:26 -1000, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 6:33 PM, Benjamin Herrenschmidt > wrote: > > > > This is why, I want (with your agreement) to define clearly and once > > and for all, that the Linux semantics of writel are that it is o

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 23:24 -0400, Sinan Kaya wrote: > On 3/27/2018 10:51 PM, Linus Torvalds wrote: > > > The discussion at hand is about > > > > > > dma_buffer->foo = 1;/* WB */ > > > writel(KICK, DMA_KICK_REGISTER);/* UC */ > > > > Yes. That certainly

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 16:51 -1000, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 3:03 PM, Benjamin Herrenschmidt > wrote: > > > > The discussion at hand is about > > > > dma_buffer->foo = 1;/* WB */ > > writel

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 16:10 +0100, Will Deacon wrote: > To clarify: are you saying that on x86 you need a wmb() prior to a writel > if you want that writel to be ordered after prior writes to memory? Is this > specific to WC memory or some other non-standard attribute? > > The only reason we have

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 14:39 -1000, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 11:33 AM, Benjamin Herrenschmidt > wrote: > > > > Well, we need to clarify that once and for all, because as I wrote > > earlier, it was decreed by Linus more than a decade ago that w

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 14:54 -0700, Alexander Duyck wrote: > On Tue, Mar 27, 2018 at 2:35 PM, Benjamin Herrenschmidt > wrote: > > On Tue, 2018-03-27 at 10:46 -0400, Sinan Kaya wrote: > > > combined buffers. > > > > > > Alex: > > > "Don't

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 10:46 -0400, Sinan Kaya wrote: > combined buffers. > > Alex: > "Don't bother. I can tell you right now that for x86 you have to have a > wmb() before the writel(). No, this isn't the semantics of writel. You shouldn't need it unless something changed and we need to revisit

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 11:54 -0700, Alexander Duyck wrote: > As far as I know the code has been this way for a while, something > like 2002, when the barrier was already present in e1000. However > there it was calling out weakly ordered models "such as IA-64". Since > then pretty much all the hardw

Re: [PATCH v2] net: ibm: emac: support RGMII-[RX|TX]ID phymode

2017-12-20 Thread Benjamin Herrenschmidt
On Wed, 2017-12-20 at 22:07 +0100, Christian Lamparter wrote: > > > will read this and say "Oh the function tests against these weird > > PHY_MODE_* aliases, but the helper function phy_interface_mode_is_rgmii() > > tests against PHY_INTERFACE_MODE_*, what is going on?" > > > > I hate to do this

Re: [PATCH] ibmveth: Kernel crash LSO offload flag toggle

2017-11-15 Thread Benjamin Herrenschmidt
On Wed, 2017-11-15 at 10:45 -0600, Bryant G. Ly wrote: > This patch just closes the window, bad things can still happen. I wanted to > leave it > up to the people who actively develop in ibmveth to close the window, since > introducing > a lock can be expensive in tx. You don't need to instrodu

Re: [PATCH] ibmveth: Kernel crash LSO offload flag toggle

2017-11-14 Thread Benjamin Herrenschmidt
On Wed, 2017-11-15 at 13:47 +1100, Daniel Axtens wrote: > Hi Bryant, > > This looks a bit better, but... > > > The following patch ensures that the bounce_buffer is not null > > prior to using it within skb_copy_from_linear_data. > > How would this occur? > > Looking at ibmveth.c, I see bounce_

Re: [PATCH v2] net: ftgmac100: Request clock and set speed

2017-10-12 Thread Benjamin Herrenschmidt
On Thu, 2017-10-12 at 11:32 +0800, Joel Stanley wrote: > According to the ASPEED datasheet, gigabit speeds require a clock of > 100MHz or higher. Other speeds require 25MHz or higher. This patch > configures a 100MHz clock if the system has a direct-attached > PHY, or 25MHz if the system is running

Re: [PATCH] net: ftgmac100: Request clock and set speed

2017-10-10 Thread Benjamin Herrenschmidt
On Tue, 2017-10-10 at 15:19 +1030, Joel Stanley wrote: > According to the ASPEED datasheet, gigabit speeds require a clock of > 100MHz or higher. Other speeds require 25MHz or higher. Did you try "live" changing by either using ethtool or plugging into switches/hubs at different speed ? Also this

Re: [PATCH] net: ethernet: ibm-emac: Add 5482 PHY init for OpenBlocks 600

2017-09-01 Thread Benjamin Herrenschmidt
On Fri, 2017-09-01 at 17:35 -0700, Florian Fainelli wrote: > On 08/31/2017 09:44 PM, Benjamin Herrenschmidt wrote: > > The vendor patches initialize those registers to get the > > PHY working properly. > > > > Sadly I don't have that PHY spec and whatever Broad

[PATCH] net: ethernet: ibm-emac: Add 5482 PHY init for OpenBlocks 600

2017-08-31 Thread Benjamin Herrenschmidt
magic for that board". The vendor has long abandoned that product, but I find it handy to test ppc405 kernels and so would like to keep it alive upstream :-) Signed-off-by: Benjamin Herrenschmidt --- Note: Ideally, the whole driver should switch over to the generic PHY layer. Howe

Re: [PATCH net-next] net/ncsi: Define {add, kill}_vid callbacks for !CONFIG_NET_NCSI

2017-08-31 Thread Benjamin Herrenschmidt
On Thu, 2017-08-31 at 08:24 -0700, Vernon Mauery wrote: > +int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) > > +{ > > + return -ENOTTY; > > +} > > +int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) > > +{ > > + return -ENOTTY; > > +} > > Thes

Re: [PATCH] net: ftgmac100: Fix oops in probe on failure to find associated PHY

2017-08-22 Thread Benjamin Herrenschmidt
<8058b040>] (kernel_init_freeable) from [<803fd170>] > (kernel_init+0x18/0x104) > [ 2.810000] [<803fd170>] (kernel_init) from [<8000a5e8>] > (ret_from_fork+0x14/0x2c) >[ 2.81] Code: e594205c e5941058 e2843058 e3a05000 (e5812004) >[ 3

[PATCH 2/2] ftgmac100: Make the MDIO bus a child of the ethernet device

2017-07-24 Thread Benjamin Herrenschmidt
Populate mii_bus->parent with our own platform device before registering, which makes it easier to locate the MDIO bus in sysfs when trying to diagnose problems. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 1 + 1 file changed, 1 insertion(+) diff --

[PATCH 1/2] ftgmac100: Increase reset timeout

2017-07-23 Thread Benjamin Herrenschmidt
We had reports of 50us not being sufficient to reset the MAC, thus hitting the "Hardware reset failed" error bringing the interface up on some AST2400 based machines. This bumps the timeout to 200us. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c

Re: clean up and modularize arch dma_mapping interface V2

2017-06-24 Thread Benjamin Herrenschmidt
On Sat, 2017-06-24 at 09:18 +0200, Christoph Hellwig wrote: > On Wed, Jun 21, 2017 at 12:24:28PM -0700, tndave wrote: > > Thanks for doing this. > > So archs can still have their own definition for dma_set_mask() if > > HAVE_ARCH_DMA_SET_MASK is y? > > (and similarly for dma_set_coherent_mask() wh

Re: [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching

2017-06-18 Thread Benjamin Herrenschmidt
On Sun, 2017-06-18 at 00:13 -0700, Christoph Hellwig wrote: > On Sun, Jun 18, 2017 at 06:50:27AM +1000, Benjamin Herrenschmidt wrote: > > What is your rationale here ? (I have missed patch 0 it seems). > > Less code duplication, more modular dma_map_ops insteance. > >

Re: [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching

2017-06-17 Thread Benjamin Herrenschmidt
On Fri, 2017-06-16 at 20:10 +0200, Christoph Hellwig wrote: > Besides removing the last instance of the set_dma_mask method this also > reduced the code duplication. What is your rationale here ? (I have missed patch 0 it seems). dma_supported() was supposed to be pretty much a "const" function s

[PATCH v3 6/9] ftgmac100: Allow configuration of phy interface via device-tree

2017-04-17 Thread Benjamin Herrenschmidt
This uses the standard phy-mode property Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 42 +--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet

[PATCH v3 8/9] ftgmac100: Fix potential ordering issue in NAPI poll

2017-04-17 Thread Benjamin Herrenschmidt
will order subsequent accesses. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 45b8267..95bf5e8 100644 --- a/d

[PATCH v3 7/9] ftgmac100: Display the discovered PHY device info

2017-04-17 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 7721c2a..45b8267 100644 --- a/drivers/net/ethernet/faraday

[PATCH v3 9/9] ftgmac100: Document device-tree binding

2017-04-17 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt -- v3. - Update supported values for phy-mode --- .../devicetree/bindings/net/ftgmac100.txt | 37 ++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ftgmac100.txt diff --git a

[PATCH v3 5/9] ftgmac100: Add netpoll support

2017-04-17 Thread Benjamin Herrenschmidt
Just call the interrupt handler with interrupts locally disabled Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday

[PATCH v3 3/9] ftgmac100: Add ndo_set_rx_mode() and support for multicast & promisc

2017-04-17 Thread Benjamin Herrenschmidt
This adds the ndo_set_rx_mode() callback to configure the multicast filters, promisc and allmulti options. Signed-off-by: Benjamin Herrenschmidt -- v3. - Rebase to fix conflict with #include changes --- drivers/net/ethernet/faraday/ftgmac100.c | 52 1 file

[PATCH v3 4/9] ftgmac100: Add vlan HW offload

2017-04-17 Thread Benjamin Herrenschmidt
The chip supports HW vlan tag insertion and extraction. Add support for it. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/faraday

[PATCH v3 1/9] ftgmac100: Add ethtool n-way reset call

2017-04-17 Thread Benjamin Herrenschmidt
A non-wired up implementation accidentally made its way in a previous patch (Make ring sizes configurable via ethtool). This removes it and wires up the generic phy_ethtool_nway_reset instead. Signed-off-by: Benjamin Herrenschmidt -- v2. - Use phy_ethtool_nway_reset() instead of custom

[PATCH v3 2/9] ftgmac100: Add pause frames configuration and support

2017-04-17 Thread Benjamin Herrenschmidt
Hopefully my understanding of how the hardware works is correct, as the documentation isn't completely clear. So far I have seen no obvious issue. Pause seem to also work with NC-SI. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c

[PATCH v3 0/9] ftgmac100: Rework batch 5 - Features

2017-04-17 Thread Benjamin Herrenschmidt
This is the third spin of the fifth and last batch of updates to the ftgmac100 driver. This contains a few additional "features" such as: - Support for ethtool n-way reset - Multicast filtering & promisc support - Vlan offload - netpoll And a couple of misc bits. This also adds the device-tr

Re: [PATCH v2 0/9] ftgmac100: Rework batch 5 - Features

2017-04-17 Thread Benjamin Herrenschmidt
On Mon, 2017-04-17 at 11:11 -0400, David Miller wrote: > From: Benjamin Herrenschmidt > Date: Thu, 13 Apr 2017 14:39:07 +1000 > > > This is the second spin of the fifth and last batch of > > updates to the ftgmac100 driver. > > This series doesn't apply cleanly t

Re: [PATCH 8/8] ftgmac100: Document device-tree binding

2017-04-13 Thread Benjamin Herrenschmidt
On Thu, 2017-04-13 at 15:42 +0200, Andrew Lunn wrote: > > +- phy-mode: See ethernet.txt file in the same directory. If the > > property is > > +  absent, "rgmii" is assumed. Supported values are "rgmii" and > > "rmii" > > You might want to say rgmii*, or similar, it indicate the delayed > versions

[PATCH v2 6/9] ftgmac100: Allow configuration of phy interface via device-tree

2017-04-12 Thread Benjamin Herrenschmidt
This uses the standard phy-mode property Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 42 +--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet

[PATCH v2 9/9] ftgmac100: Document device-tree binding

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- .../devicetree/bindings/net/ftgmac100.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ftgmac100.txt diff --git a/Documentation/devicetree/bindings/net/ftgmac100.txt b

[PATCH v2 8/9] ftgmac100: Fix potential ordering issue in NAPI poll

2017-04-12 Thread Benjamin Herrenschmidt
will order subsequent accesses. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 71763e4..9b7a24e 100644 --- a/d

[PATCH v2 3/9] ftgmac100: Add ndo_set_rx_mode() and support for multicast & promisc

2017-04-12 Thread Benjamin Herrenschmidt
This adds the ndo_set_rx_mode() callback to configure the multicast filters, promisc and allmulti options. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 52 1 file changed, 52 insertions(+) diff --git a/drivers/net

[PATCH v2 5/9] ftgmac100: Add netpoll support

2017-04-12 Thread Benjamin Herrenschmidt
Just call the interrupt handler with interrupts locally disabled Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday

[PATCH v2 7/9] ftgmac100: Display the discovered PHY device info

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 7c607eb..71763e4 100644 --- a/drivers/net/ethernet/faraday

[PATCH v2 4/9] ftgmac100: Add vlan HW offload

2017-04-12 Thread Benjamin Herrenschmidt
The chip supports HW vlan tag insertion and extraction. Add support for it. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/faraday

[PATCH v2 2/9] ftgmac100: Add pause frames configuration and support

2017-04-12 Thread Benjamin Herrenschmidt
Hopefully my understanding of how the hardware works is correct, as the documentation isn't completely clear. So far I have seen no obvious issue. Pause seem to also work with NC-SI. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c

[PATCH v2 0/9] ftgmac100: Rework batch 5 - Features

2017-04-12 Thread Benjamin Herrenschmidt
This is the second spin of the fifth and last batch of updates to the ftgmac100 driver. This contains a few additional "features" such as: - Support for ethtool n-way reset - Multicast filtering & promisc support - Vlan offload - netpoll And a couple of misc bits. This also adds the device-t

[PATCH v2 1/9] ftgmac100: Add ethtool n-way reset call

2017-04-12 Thread Benjamin Herrenschmidt
A non-wired up implementation accidentally made its way in a previous patch (Make ring sizes configurable via ethtool). This removes it and wires up the generic phy_ethtool_nway_reset instead. Signed-off-by: Benjamin Herrenschmidt -- v2. - Use phy_ethtool_nway_reset() instead of custom

Re: [PATCH 1/8] ftgmac100: Add ethtool n-way reset call

2017-04-12 Thread Benjamin Herrenschmidt
On Wed, 2017-04-12 at 17:00 -0700, Florian Fainelli wrote: > > -static int ftgmac100_nway_reset(struct net_device *ndev) > > +static int ftgmac100_nway_reset(struct net_device *netdev) > >   { > > - if (!ndev->phydev) > > + if (!netdev->phydev) > >    return -ENXIO; > > - re

[PATCH 8/8] ftgmac100: Document device-tree binding

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- .../devicetree/bindings/net/ftgmac100.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ftgmac100.txt diff --git a/Documentation/devicetree/bindings/net/ftgmac100.txt b

[PATCH 5/8] ftgmac100: Add netpoll support

2017-04-12 Thread Benjamin Herrenschmidt
Just call the interrupt handler with interrupts locally disabled Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday

[PATCH 6/8] ftgmac100: Allow configuration of phy interface via device-tree

2017-04-12 Thread Benjamin Herrenschmidt
This uses the standard phy-mode property Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 42 +--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet

[PATCH 4/8] ftgmac100: Add vlan HW offload

2017-04-12 Thread Benjamin Herrenschmidt
The chip supports HW vlan tag insertion and extraction. Add support for it. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/faraday

[PATCH 7/8] ftgmac100: Display the discovered PHY device info

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index c1afda8..d04ad31 100644 --- a/drivers/net/ethernet/faraday

[PATCH 2/8] ftgmac100: Add pause frames configuration and support

2017-04-12 Thread Benjamin Herrenschmidt
Hopefully my understanding of how the hardware works is correct, as the documentation isn't completely clear. So far I have seen no obvious issue. Pause seem to also work with NC-SI. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c

[PATCH 3/8] ftgmac100: Add ndo_set_rx_mode() and support for multicast & promisc

2017-04-12 Thread Benjamin Herrenschmidt
This adds the ndo_set_rx_mode() callback to configure the multicast filters, promisc and allmulti options. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 52 1 file changed, 52 insertions(+) diff --git a/drivers/net

[PATCH 1/8] ftgmac100: Add ethtool n-way reset call

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 796b37e..bbeb8e7 100644 --- a/drivers/net

[PATCH 0/8] ftgmac100: Rework batch 5 - Features

2017-04-12 Thread Benjamin Herrenschmidt
This is fifth and last batch of updates to the ftgmac100 driver. This contains a few additional "features" such as: - Support for ethtool n-way reset - Multicast filtering & promisc support - Vlan offload - netpoll And a couple of misc bits. This also adds the device-tree binding documentati

Re: [PATCH v2 00/10] ftgmac100: Rework batch 4 - Misc

2017-04-12 Thread Benjamin Herrenschmidt
On Wed, 2017-04-12 at 10:19 -0400, David Miller wrote: > > > v2 Fixes patch 1/10 (NETIF_F_HW_CSUM conversion) > >  > > The next (and last) batch will add a few more "features" such > > as netpoll, multicast/promist, vlan offload... > >  > > Series applied, thanks Benjamin. > > I really like how

Re: Network driver "test suite"

2017-04-12 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 17:36 -0700, Florian Fainelli wrote: > > You could start with using LNST: > > https://github.com/jpirko/lnst > > and there is also Ostinato which is a great way to get access to > something IXIA-like, but all configurable in software through python > bindings. Andrew's dsa-

[PATCH v2 06/10] ftgmac100: Rename ftgmac100_setup_mac to ftgmac100_initial_mac

2017-04-11 Thread Benjamin Herrenschmidt
To remove more confusion. This function is about obtaining the initial MAC address at driver probe time. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/faraday

[PATCH v2 05/10] ftgmac100: Rename ftgmac100_set_mac to ftgmac100_write_mac_addr

2017-04-11 Thread Benjamin Herrenschmidt
To avoid confusion with the ndo callback and generally be clearer about the purpose of that function Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday

[PATCH v2 09/10] ftgmac100: Make ring sizes configurable via ethtool

2017-04-11 Thread Benjamin Herrenschmidt
We set an arbitrary max at 1024 since we pre-allocate the actual descriptor arrays and skb arrays to the full size to keep the code a bit simpler and avoid allocation failures in the reset task. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 204

[PATCH v2 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
The documentation describes NETIF_F_IP_CSUM as deprecated so let's switch to NETIF_F_HW_CSUM and use the helper to handle unhandled protocols. Signed-off-by: Benjamin Herrenschmidt -- v2. - Properly fallback on unknown IP protocols (side effect of fixing a reported coding style iss

[PATCH v2 10/10] ftgmac100: Set default ring sizes to 128 entries

2017-04-11 Thread Benjamin Herrenschmidt
I haven't seen any improvement above that size on the machines I've tested with. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/d

[PATCH v2 08/10] ftgmac100: Add more register inits in ftgmac100_init_hw()

2017-04-11 Thread Benjamin Herrenschmidt
Clear stale interrupts on entry, configure FIFO sizes, set FIFO thresholds, configure interrupt mitigation. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 36 1 file changed, 36 insertions(+) diff --git a/drivers/net

[PATCH v2 02/10] ftgmac100: Use device "compatible" property, not machine.

2017-04-11 Thread Benjamin Herrenschmidt
We test for aspeed chips to handle a couple of special cases, but we do that by checking the machine type which isn't right. Instead check the actual device compatible property. This also updates the dtsi files for the aspeed SoC to match. Signed-off-by: Benjamin Herrenschmidt --- arc

[PATCH v2 03/10] ftgmac100: Disable HW checksum generation on AST2400, enable on others

2017-04-11 Thread Benjamin Herrenschmidt
d to disable HW checksum generation and checking regardless of whether NC-SI is used or not in case other variants out there need this. Signed-off-by: Benjamin Herrenschmidt --- arch/arm/boot/dts/aspeed-g4.dtsi | 2 -- arch/arm/boot/dts/aspeed-g5.dtsi | 2 -- drivers/net/ethernet/fara

[PATCH v2 07/10] ftgmac100: Open code remaining register writes

2017-04-11 Thread Benjamin Herrenschmidt
The helpers just take space but don't provide much value. Simple one line comments are more explanatory. Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 53 1 file changed, 20 insertions(+), 33 deletions(-) diff --

[PATCH v2 04/10] ftgmac100: Set netdev->hw_features

2017-04-11 Thread Benjamin Herrenschmidt
So features can be turned on/off via ethtool Signed-off-by: Benjamin Herrenschmidt --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index

[PATCH v2 00/10] ftgmac100: Rework batch 4 - Misc

2017-04-11 Thread Benjamin Herrenschmidt
This is v2 of the fourth batch of updates to the ftgmac100 driver. This is a bunch of misc cleanups and fixes, such as properly disabling HW checksum generation on AST2400 where it's known to be broken and some chip init updates. This also adds the ability to turn HW checksum on/off and configure

Network driver "test suite"

2017-04-11 Thread Benjamin Herrenschmidt
Hi folks ! Does anybody knows of an existing kind of automated "test suite" for a network/ethernet driver ? IE. Something we could run both on the "tested" driver and a cross-over "known good" peer (possibly the latter set to promisc & no offload for proper analysis), that would out the driver t

Re: [PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 20:03 -0400, David Miller wrote: > > From: Benjamin Herrenschmidt > Date: Wed, 12 Apr 2017 09:36:05 +1000 > > > I should call the helper when I don't recognize the protocol type in > > the IP header, not just when the main skb protocol type i

  1   2   3   4   5   >