Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-10 Thread Philippe Reynes
Hi david, On 10/05/15 03:01, David Miller wrote: From: Philippe Reynes Date: Sun, 10 May 2015 00:16:21 +0200 Hi Fabio, On 09/05/15 23:59, Fabio Estevam wrote: Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux wrote: Using memcpy_fromio() to copy device registers is

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-10 Thread Philippe Reynes
Hi david, On 10/05/15 03:01, David Miller wrote: From: Philippe Reynestrem...@gmail.com Date: Sun, 10 May 2015 00:16:21 +0200 Hi Fabio, On 09/05/15 23:59, Fabio Estevam wrote: Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: Using

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread David Miller
From: Philippe Reynes Date: Sun, 10 May 2015 00:16:21 +0200 > Hi Fabio, > > On 09/05/15 23:59, Fabio Estevam wrote: >> Philippe, >> >> On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux >> wrote: >> >>> Using memcpy_fromio() to copy device registers is not a good idea - >>> it can use a

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Philippe Reynes
Hi Fabio, On 09/05/15 23:59, Fabio Estevam wrote: Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux wrote: Using memcpy_fromio() to copy device registers is not a good idea - it can use a variable access size which can cause bus faults. An example on how memcpy_fromio()

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Fabio Estevam
Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux wrote: > Using memcpy_fromio() to copy device registers is not a good idea - > it can use a variable access size which can cause bus faults. An example on how memcpy_fromio() can be avoided in get_regs:

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread David Miller
From: Russell King - ARM Linux Date: Sat, 9 May 2015 22:17:46 +0100 > On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: >> +static void fec_enet_get_regs(struct net_device *ndev, >> + struct ethtool_regs *regs, void *regbuf) >> +{ >> +struct

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Russell King - ARM Linux
On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: > +static void fec_enet_get_regs(struct net_device *ndev, > + struct ethtool_regs *regs, void *regbuf) > +{ > + struct fec_enet_private *fep = netdev_priv(ndev); > + > + memcpy_fromio(regbuf,

[PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Philippe Reynes
This enables the ethtool's "-d" and "--register-dump" options for fec devices. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/freescale/fec_main.c | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Russell King - ARM Linux
On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: +static void fec_enet_get_regs(struct net_device *ndev, + struct ethtool_regs *regs, void *regbuf) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + + memcpy_fromio(regbuf, fep-hwp,

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread David Miller
From: Philippe Reynes trem...@gmail.com Date: Sun, 10 May 2015 00:16:21 +0200 Hi Fabio, On 09/05/15 23:59, Fabio Estevam wrote: Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: Using memcpy_fromio() to copy device registers is not a good

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Philippe Reynes
Hi Fabio, On 09/05/15 23:59, Fabio Estevam wrote: Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: Using memcpy_fromio() to copy device registers is not a good idea - it can use a variable access size which can cause bus faults. An example

[PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Philippe Reynes
This enables the ethtool's -d and --register-dump options for fec devices. Signed-off-by: Philippe Reynes trem...@gmail.com --- drivers/net/ethernet/freescale/fec_main.c | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread David Miller
From: Russell King - ARM Linux li...@arm.linux.org.uk Date: Sat, 9 May 2015 22:17:46 +0100 On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: +static void fec_enet_get_regs(struct net_device *ndev, + struct ethtool_regs *regs, void *regbuf) +{ +

Re: [PATCH] net: fec: add support of ethtool get_regs

2015-05-09 Thread Fabio Estevam
Philippe, On Sat, May 9, 2015 at 6:17 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: Using memcpy_fromio() to copy device registers is not a good idea - it can use a variable access size which can cause bus faults. An example on how memcpy_fromio() can be avoided in get_regs: