diff mbox series

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

Message ID 20230119043920.875280-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: masaru.nagai.vx@renesas.com sergei.shtylyov@cogentembedded.com; 4 maintainers not CCed: masaru.nagai.vx@renesas.com phil.edworthy@renesas.com biju.das.jz@bp.renesas.com sergei.shtylyov@cogentembedded.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. 19, 2023, 4:39 a.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: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/ravb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergey Shtylyov Jan. 20, 2023, 8:12 p.m. UTC | #1
On 1/19/23 7:39 AM, 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: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver")

   No, it's actually c156633f1353 ("Renesas Ethernet AVB driver proper|)!

> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[...]

> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 3f61100c02f4..bcbb62f90fb7 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1101,7 +1101,7 @@ 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),

   Might as well fix the QFF1 comment indentation below...

[...]

MBR, Sergey
Yoshihiro Shimoda Jan. 23, 2023, 12:59 p.m. UTC | #2
Hi Sergey-san,

> From: Sergey Shtylyov, Sent: Saturday, January 21, 2023 5:12 AM
> 
> On 1/19/23 7:39 AM, 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: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver")
> 
>    No, it's actually c156633f1353 ("Renesas Ethernet AVB driver proper|)!

I'll fix it on v2.

> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> [...]
> 
> > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> > index 3f61100c02f4..bcbb62f90fb7 100644
> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -1101,7 +1101,7 @@ 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),
> 
>    Might as well fix the QFF1 comment indentation below...

OK, I will also fix it.

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..bcbb62f90fb7 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1101,7 +1101,7 @@  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 */