diff mbox series

[net,v2,2/2] net: ravb: Fix possible hang if RIS2_QFF1 happen

Message ID 20230123131331.1425648-3-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: ravb: Fix potential issues | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 2 blamed authors not CCed: sergei.shtylyov@cogentembedded.com mitsuhiro.kimura.kc@renesas.com; 4 maintainers not CCed: phil.edworthy@renesas.com biju.das.jz@bp.renesas.com sergei.shtylyov@cogentembedded.com mitsuhiro.kimura.kc@renesas.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: line length of 86 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yoshihiro Shimoda Jan. 23, 2023, 1:13 p.m. UTC
Since this driver enables the interrupt by RIC2_QFE1, this driver
should clear the interrupt flag if it happens. Otherwise, the interrupt
causes to hang the system.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/ravb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sergey Shtylyov Jan. 23, 2023, 7:41 p.m. UTC | #1
Hello!

On 1/23/23 4:13 PM, Yoshihiro Shimoda wrote:

> Since this driver enables the interrupt by RIC2_QFE1, this driver
> should clear the interrupt flag if it happens. Otherwise, the interrupt
> causes to hang the system.
> 
> Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 3f61100c02f4..0f54849a3823 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1101,14 +1101,14 @@ static void ravb_error_interrupt(struct net_device *ndev)
>  	ravb_write(ndev, ~(EIS_QFS | EIS_RESERVED), EIS);
>  	if (eis & EIS_QFS) {
>  		ris2 = ravb_read(ndev, RIS2);
> -		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_RFFF | RIS2_RESERVED),
> +		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_QFF1 | RIS2_RFFF | RIS2_RESERVED),
>  			   RIS2);
>  
>  		/* Receive Descriptor Empty int */
>  		if (ris2 & RIS2_QFF0)
>  			priv->stats[RAVB_BE].rx_over_errors++;
>  
> -		    /* Receive Descriptor Empty int */
> +		/* Receive Descriptor Empty int */

   Well, that should've been noted in the commit log...

[...]

MBR, Sergey
Yoshihiro Shimoda Jan. 23, 2023, 11:47 p.m. UTC | #2
Hello!

> From: Sergey Shtylyov, Sent: Tuesday, January 24, 2023 4:41 AM
> 
> On 1/23/23 4:13 PM, Yoshihiro Shimoda wrote:
> 
> > Since this driver enables the interrupt by RIC2_QFE1, this driver
> > should clear the interrupt flag if it happens. Otherwise, the interrupt
> > causes to hang the system.
> >
> > Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Thank you for your review!

> [...]
> > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> > index 3f61100c02f4..0f54849a3823 100644
> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -1101,14 +1101,14 @@ static void ravb_error_interrupt(struct net_device *ndev)
> >  	ravb_write(ndev, ~(EIS_QFS | EIS_RESERVED), EIS);
> >  	if (eis & EIS_QFS) {
> >  		ris2 = ravb_read(ndev, RIS2);
> > -		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_RFFF | RIS2_RESERVED),
> > +		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_QFF1 | RIS2_RFFF | RIS2_RESERVED),
> >  			   RIS2);
> >
> >  		/* Receive Descriptor Empty int */
> >  		if (ris2 & RIS2_QFF0)
> >  			priv->stats[RAVB_BE].rx_over_errors++;
> >
> > -		    /* Receive Descriptor Empty int */
> > +		/* Receive Descriptor Empty int */
> 
>    Well, that should've been noted in the commit log...

Oops. I think so. So, I'll send v3 patch.

Best regards,
Yoshihiro Shimoda
diff mbox series

Patch

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 3f61100c02f4..0f54849a3823 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1101,14 +1101,14 @@  static void ravb_error_interrupt(struct net_device *ndev)
 	ravb_write(ndev, ~(EIS_QFS | EIS_RESERVED), EIS);
 	if (eis & EIS_QFS) {
 		ris2 = ravb_read(ndev, RIS2);
-		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_RFFF | RIS2_RESERVED),
+		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_QFF1 | RIS2_RFFF | RIS2_RESERVED),
 			   RIS2);
 
 		/* Receive Descriptor Empty int */
 		if (ris2 & RIS2_QFF0)
 			priv->stats[RAVB_BE].rx_over_errors++;
 
-		    /* Receive Descriptor Empty int */
+		/* Receive Descriptor Empty int */
 		if (ris2 & RIS2_QFF1)
 			priv->stats[RAVB_NC].rx_over_errors++;