* [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro
@ 2013-06-18 22:07 Sergei Shtylyov
2013-06-19 6:47 ` Magnus Damm
0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2013-06-18 22:07 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
sh_eth_interrupt() uses the same Rx interrupt mask twice to check the interrupt
status register -- #define EESR_RX_CHECK and use it instead.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the Dave Miller's 'net-next.git' repo.
drivers/net/ethernet/renesas/sh_eth.c | 13 ++-----------
drivers/net/ethernet/renesas/sh_eth.h | 8 ++++++++
2 files changed, 10 insertions(+), 11 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1497,23 +1497,14 @@ static irqreturn_t sh_eth_interrupt(int
*/
intr_status &= sh_eth_read(ndev, EESIPR) | DMAC_M_ECI;
/* Clear interrupt */
- if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
- EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
- cd->tx_check | cd->eesr_err_check)) {
+ if (intr_status & (EESR_RX_CHECK | cd->tx_check | cd->eesr_err_check)) {
sh_eth_write(ndev, intr_status, EESR);
ret = IRQ_HANDLED;
} else
goto other_irq;
- if (intr_status & (EESR_FRC | /* Frame recv*/
- EESR_RMAF | /* Multi cast address recv*/
- EESR_RRF | /* Bit frame recv */
- EESR_RTLF | /* Long frame recv*/
- EESR_RTSF | /* short frame recv */
- EESR_PRE | /* PHY-LSI recv error */
- EESR_CERF)){ /* recv frame CRC error */
+ if (intr_status & EESR_RX_CHECK)
sh_eth_rx(ndev, intr_status);
- }
/* Tx Check */
if (intr_status & cd->tx_check) {
Index: net-next/drivers/net/ethernet/renesas/sh_eth.h
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h
+++ net-next/drivers/net/ethernet/renesas/sh_eth.h
@@ -248,6 +248,14 @@ enum EESR_BIT {
EESR_CERF = 0x00000001,
};
+#define EESR_RX_CHECK (EESR_FRC | /* Frame recv */ \
+ EESR_RMAF | /* Multicast address recv */ \
+ EESR_RRF | /* Bit frame recv */ \
+ EESR_RTLF | /* Long frame recv */ \
+ EESR_RTSF | /* Short frame recv */ \
+ EESR_PRE | /* PHY-LSI recv error */ \
+ EESR_CERF) /* Recv frame CRC error */
+
#define DEFAULT_TX_CHECK (EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | \
EESR_RTO)
#define DEFAULT_EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | \
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro
2013-06-18 22:07 [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro Sergei Shtylyov
@ 2013-06-19 6:47 ` Magnus Damm
2013-06-19 7:50 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Magnus Damm @ 2013-06-19 6:47 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, Nobuhiro Iwamatsu, SH-Linux
Hi Sergei,
On Wed, Jun 19, 2013 at 7:07 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> sh_eth_interrupt() uses the same Rx interrupt mask twice to check the interrupt
> status register -- #define EESR_RX_CHECK and use it instead.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thanks for the patch, nice to see that this driver is moving forward.
Can you please include information about which SoC / board this code
has been tested on? As you know, the actual hardware that this driver
is operating on is not very well documented, so at least having
information about the SoC together with the commit message or patch
may help in the future.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro
2013-06-19 6:47 ` Magnus Damm
@ 2013-06-19 7:50 ` David Miller
2013-06-19 18:27 ` Sergei Shtylyov
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2013-06-19 7:50 UTC (permalink / raw)
To: magnus.damm; +Cc: sergei.shtylyov, netdev, nobuhiro.iwamatsu.yj, linux-sh
From: Magnus Damm <magnus.damm@gmail.com>
Date: Wed, 19 Jun 2013 15:47:47 +0900
> Hi Sergei,
>
> On Wed, Jun 19, 2013 at 7:07 AM, Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
>> sh_eth_interrupt() uses the same Rx interrupt mask twice to check the interrupt
>> status register -- #define EESR_RX_CHECK and use it instead.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Thanks for the patch, nice to see that this driver is moving forward.
>
> Can you please include information about which SoC / board this code
> has been tested on? As you know, the actual hardware that this driver
> is operating on is not very well documented, so at least having
> information about the SoC together with the commit message or patch
> may help in the future.
Sergei, please make this suggested change and resubmit this series, thank you.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro
2013-06-19 7:50 ` David Miller
@ 2013-06-19 18:27 ` Sergei Shtylyov
2013-07-01 12:12 ` Magnus Damm
0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2013-06-19 18:27 UTC (permalink / raw)
To: magnus.damm; +Cc: David Miller, netdev, nobuhiro.iwamatsu.yj, linux-sh
Hello.
On 06/19/2013 11:50 AM, David Miller wrote:
>> On Wed, Jun 19, 2013 at 7:07 AM, Sergei Shtylyov
>> <sergei.shtylyov@cogentembedded.com> wrote:
>>> sh_eth_interrupt() uses the same Rx interrupt mask twice to check the interrupt
>>> status register -- #define EESR_RX_CHECK and use it instead.
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> Thanks for the patch, nice to see that this driver is moving forward.
Magnus, BTW, are you content with the amount of cleanup that is
currently queued in the Dave Miller's 'net-next.git' repo, or should I
move further: e.g., move the SoC specific fields like 'register_type'
from the platform data to the driver's internal data structure?
>> Can you please include information about which SoC / board this code
>> has been tested on? As you know, the actual hardware that this driver
>> is operating on is not very well documented, so at least having
>> information about the SoC together with the commit message or patch
>> may help in the future.
> Sergei, please make this suggested change and resubmit this series, thank you.
Hm, I guess Magnus didn't really mean patch #1 which doesn't change
anything in the driver's behavior but only the actual NAPI support. OK,
it was tested on R8A7778 BOCK-W board and I'll add that to the changelog.
WBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro
2013-06-19 18:27 ` Sergei Shtylyov
@ 2013-07-01 12:12 ` Magnus Damm
2013-07-01 12:58 ` Sergei Shtylyov
0 siblings, 1 reply; 6+ messages in thread
From: Magnus Damm @ 2013-07-01 12:12 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: David Miller, netdev, Nobuhiro Iwamatsu, SH-Linux
Hi Sergei,
On Thu, Jun 20, 2013 at 3:27 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 06/19/2013 11:50 AM, David Miller wrote:
>>> On Wed, Jun 19, 2013 at 7:07 AM, Sergei Shtylyov
>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>>
>>>> sh_eth_interrupt() uses the same Rx interrupt mask twice to check the
>>>> interrupt
>>>> status register -- #define EESR_RX_CHECK and use it instead.
>
>
>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
>
>>> Thanks for the patch, nice to see that this driver is moving forward.
>
>
> Magnus, BTW, are you content with the amount of cleanup that is currently
> queued in the Dave Miller's 'net-next.git' repo, or should I move further:
> e.g., move the SoC specific fields like 'register_type' from the platform
> data to the driver's internal data structure?
I just had a look at this particular driver in net-next.git and I
think it looks very good. Thanks a lot for your efforts!
Regarding moving further with cleanups, it looks to me that it is now
possible to build a single kernel image with this driver included and
use it on multiple SoCs without #ifdef causing trouble. This recent
development has been needed for mach-shmobile to play well with the
multiplatform work going on in the ARM architecture. So since that
seems solved then I'm quite happy with the driver state from a
cleanliness point of view.
As for this driver in general, I'd be very happy to see future
development in these areas:
- DT support
- PHY support for r8a7790 Lager
- PHY IRQ support for r8a7790 Lager
Let me know if I can help you with remote board access.
>>> Can you please include information about which SoC / board this code
>>> has been tested on? As you know, the actual hardware that this driver
>>> is operating on is not very well documented, so at least having
>>> information about the SoC together with the commit message or patch
>>> may help in the future.
>
>
>> Sergei, please make this suggested change and resubmit this series, thank
>> you.
>
>
> Hm, I guess Magnus didn't really mean patch #1 which doesn't change
> anything in the driver's behavior but only the actual NAPI support. OK, it
> was tested on R8A7778 BOCK-W board and I'll add that to the changelog.
Thanks for updating your code.
In this particular case it may not matter very much, but in general I
believe it is good to include which hardware the code as been tested
on.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro
2013-07-01 12:12 ` Magnus Damm
@ 2013-07-01 12:58 ` Sergei Shtylyov
0 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2013-07-01 12:58 UTC (permalink / raw)
To: Magnus Damm; +Cc: David Miller, netdev, Nobuhiro Iwamatsu, SH-Linux
Hello.
On 01-07-2013 16:12, Magnus Damm wrote:
>>>>> sh_eth_interrupt() uses the same Rx interrupt mask twice to check the
>>>>> interrupt
>>>>> status register -- #define EESR_RX_CHECK and use it instead.
>>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>>> Thanks for the patch, nice to see that this driver is moving forward.
>> Magnus, BTW, are you content with the amount of cleanup that is currently
>> queued in the Dave Miller's 'net-next.git' repo, or should I move further:
>> e.g., move the SoC specific fields like 'register_type' from the platform
>> data to the driver's internal data structure?
> I just had a look at this particular driver in net-next.git and I
> think it looks very good. Thanks a lot for your efforts!
> Regarding moving further with cleanups, it looks to me that it is now
> possible to build a single kernel image with this driver included and
> use it on multiple SoCs without #ifdef causing trouble. This recent
> development has been needed for mach-shmobile to play well with the
> multiplatform work going on in the ARM architecture. So since that
> seems solved then I'm quite happy with the driver state from a
> cleanliness point of view.
> As for this driver in general, I'd be very happy to see future
> development in these areas:
> - DT support
Full DT support won't be possible due to the driver using procedural
platform data. Partial support will be possible using OF_DEV_AUXDATA()
to assign the platform data to a device.
> - PHY support for r8a7790 Lager
Simon seems to be working on this. AFAIK, we don't yet have R8A7790
based board in our inventory (neither the board manual).
> - PHY IRQ support for r8a7790 Lager
> Let me know if I can help you with remote board access.
Yes, you can.
> Cheers,
> / magnus
WBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-07-01 12:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 22:07 [PATCH 1/2] sh_eth: define/use EESR_RX_CHECK macro Sergei Shtylyov
2013-06-19 6:47 ` Magnus Damm
2013-06-19 7:50 ` David Miller
2013-06-19 18:27 ` Sergei Shtylyov
2013-07-01 12:12 ` Magnus Damm
2013-07-01 12:58 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).