2022-02-09 09:51:02

by Srinivas Neeli

[permalink] [raw]
Subject: [PATCH] can: xilinx_can: Add check for NAPI Poll function

Add check for NAPI poll function to avoid enabling interrupts
with out completing the NAPI call.

Signed-off-by: Srinivas Neeli <[email protected]>
---
drivers/net/can/xilinx_can.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 1674b561c9a2..e562c5ab1149 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -1215,10 +1215,11 @@ static int xcan_rx_poll(struct napi_struct *napi, int quota)
}

if (work_done < quota) {
- napi_complete_done(napi, work_done);
- ier = priv->read_reg(priv, XCAN_IER_OFFSET);
- ier |= xcan_rx_int_mask(priv);
- priv->write_reg(priv, XCAN_IER_OFFSET, ier);
+ if (napi_complete_done(napi, work_done)) {
+ ier = priv->read_reg(priv, XCAN_IER_OFFSET);
+ ier |= xcan_rx_int_mask(priv);
+ priv->write_reg(priv, XCAN_IER_OFFSET, ier);
+ }
}
return work_done;
}
--
2.17.1



2022-02-09 12:49:58

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function

On 08.02.2022 21:50:53, Srinivas Neeli wrote:
> Add check for NAPI poll function to avoid enabling interrupts
> with out completing the NAPI call.

Thanks for the patch. Does this fix a bug? If so, please add a Fixes:
tag that lists the patch that introduced that bug.

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
(No filename) (564.00 B)
signature.asc (499.00 B)
Download all attachments

2022-02-09 12:55:33

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function

On 09.02.2022 08:29:55, Srinivas Neeli wrote:
> > On 08.02.2022 21:50:53, Srinivas Neeli wrote:
> > > Add check for NAPI poll function to avoid enabling interrupts with out
> > > completing the NAPI call.
> >
> > Thanks for the patch. Does this fix a bug? If so, please add a Fixes:
> > tag that lists the patch that introduced that bug.
>
> It is not a bug. I am adding additional safety check( Validating the
> return value of "napi_complete_done" call).

Thanks for your feedback. Should this go into can or can-next?

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
(No filename) (824.00 B)
signature.asc (499.00 B)
Download all attachments

2022-02-09 12:56:49

by Srinivas Neeli

[permalink] [raw]
Subject: RE: [PATCH] can: xilinx_can: Add check for NAPI Poll function

Hi Marc,

> -----Original Message-----
> From: Marc Kleine-Budde <[email protected]>
> Sent: Wednesday, February 9, 2022 1:20 PM
> To: Srinivas Neeli <[email protected]>
> Cc: [email protected]; [email protected]; [email protected]; Michal
> Simek <[email protected]>; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; Appana Durga Kedareswara Rao
> <[email protected]>; Srinivas Goud <[email protected]>; git
> <[email protected]>
> Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function
>
> On 08.02.2022 21:50:53, Srinivas Neeli wrote:
> > Add check for NAPI poll function to avoid enabling interrupts with out
> > completing the NAPI call.
>
> Thanks for the patch. Does this fix a bug? If so, please add a Fixes:
> tag that lists the patch that introduced that bug.

It is not a bug. I am adding additional safety check( Validating the return value of "napi_complete_done" call).

Thanks
Srinivas Neeli

>
> regards,
> Marc
>
> --
> Pengutronix e.K. | Marc Kleine-Budde |
> Embedded Linux | https://www.pengutronix.de |
> Vertretung West/Dortmund | Phone: +49-231-2826-924 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

2022-02-09 12:58:40

by Srinivas Neeli

[permalink] [raw]
Subject: RE: [PATCH] can: xilinx_can: Add check for NAPI Poll function

Hi Marc,

> -----Original Message-----
> From: Marc Kleine-Budde <[email protected]>
> Sent: Wednesday, February 9, 2022 2:02 PM
> To: Srinivas Neeli <[email protected]>
> Cc: [email protected]; [email protected]; [email protected]; Michal
> Simek <[email protected]>; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; Appana Durga Kedareswara Rao
> <[email protected]>; Srinivas Goud <[email protected]>; git
> <[email protected]>
> Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function
>
> On 09.02.2022 08:29:55, Srinivas Neeli wrote:
> > > On 08.02.2022 21:50:53, Srinivas Neeli wrote:
> > > > Add check for NAPI poll function to avoid enabling interrupts with
> > > > out completing the NAPI call.
> > >
> > > Thanks for the patch. Does this fix a bug? If so, please add a Fixes:
> > > tag that lists the patch that introduced that bug.
> >
> > It is not a bug. I am adding additional safety check( Validating the
> > return value of "napi_complete_done" call).
>
> Thanks for your feedback. Should this go into can or can-next?

If possible please apply on both branches.

>
> regards,
> Marc
>
> --
> Pengutronix e.K. | Marc Kleine-Budde |
> Embedded Linux | https://www.pengutronix.de |
> Vertretung West/Dortmund | Phone: +49-231-2826-924 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

2022-02-09 12:59:01

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function

On 09.02.2022 08:40:48, Srinivas Neeli wrote:
> Hi Marc,
>
> > -----Original Message-----
> > From: Marc Kleine-Budde <[email protected]>
> > Sent: Wednesday, February 9, 2022 2:02 PM
> > To: Srinivas Neeli <[email protected]>
> > Cc: [email protected]; [email protected]; [email protected]; Michal
> > Simek <[email protected]>; [email protected];
> > [email protected]; [email protected]; linux-
> > [email protected]; Appana Durga Kedareswara Rao
> > <[email protected]>; Srinivas Goud <[email protected]>; git
> > <[email protected]>
> > Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function
> >
> > On 09.02.2022 08:29:55, Srinivas Neeli wrote:
> > > > On 08.02.2022 21:50:53, Srinivas Neeli wrote:
> > > > > Add check for NAPI poll function to avoid enabling interrupts with
> > > > > out completing the NAPI call.
> > > >
> > > > Thanks for the patch. Does this fix a bug? If so, please add a Fixes:
> > > > tag that lists the patch that introduced that bug.
> > >
> > > It is not a bug. I am adding additional safety check( Validating the
> > > return value of "napi_complete_done" call).
> >
> > Thanks for your feedback. Should this go into can or can-next?
>
> If possible please apply on both branches.

That's not an option. Going for can-next as Michal Simek suggested.

Adding to linux-can-next/testing.

Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
(No filename) (1.65 kB)
signature.asc (499.00 B)
Download all attachments

2022-02-09 13:53:45

by Michal Simek

[permalink] [raw]
Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function

Hi,

On 2/9/22 09:40, Srinivas Neeli wrote:
> Hi Marc,
>
>> -----Original Message-----
>> From: Marc Kleine-Budde <[email protected]>
>> Sent: Wednesday, February 9, 2022 2:02 PM
>> To: Srinivas Neeli <[email protected]>
>> Cc: [email protected]; [email protected]; [email protected]; Michal
>> Simek <[email protected]>; [email protected];
>> [email protected]; [email protected]; linux-
>> [email protected]; Appana Durga Kedareswara Rao
>> <[email protected]>; Srinivas Goud <[email protected]>; git
>> <[email protected]>
>> Subject: Re: [PATCH] can: xilinx_can: Add check for NAPI Poll function
>>
>> On 09.02.2022 08:29:55, Srinivas Neeli wrote:
>>>> On 08.02.2022 21:50:53, Srinivas Neeli wrote:
>>>>> Add check for NAPI poll function to avoid enabling interrupts with
>>>>> out completing the NAPI call.
>>>>
>>>> Thanks for the patch. Does this fix a bug? If so, please add a Fixes:
>>>> tag that lists the patch that introduced that bug.
>>>
>>> It is not a bug. I am adding additional safety check( Validating the
>>> return value of "napi_complete_done" call).
>>
>> Thanks for your feedback. Should this go into can or can-next?
>
> If possible please apply on both branches.

New feature should come to next. It means can-next please.

Thanks,
Michal