linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net resend] net: qca_spi: Avoid high load if QCA7000 is not available
@ 2023-06-14 11:17 Stefan Wahren
  2023-06-14 16:58 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2023-06-14 11:17 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Stefan Wahren, netdev, linux-kernel, Stefan Wahren

In case the QCA7000 is not available via SPI (e.g. in reset),
the driver will cause a high load. The reason for this is
that the synchronization is never finished and schedule()
is never called. Since the synchronization is not timing
critical, it's safe to drop this from the scheduling condition.

Signed-off-by: Stefan Wahren <stefan.wahren@chargebyte.com>
Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for
 QCA7000")
---
 drivers/net/ethernet/qualcomm/qca_spi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c
 b/drivers/net/ethernet/qualcomm/qca_spi.c
index bba1947792ea16..90f18ea4c28ba1 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -582,8 +582,7 @@ qcaspi_spi_thread(void *data)
 	while (!kthread_should_stop()) {
 		set_current_state(TASK_INTERRUPTIBLE);
 		if ((qca->intr_req == qca->intr_svc) &&
-		    (qca->txr.skb[qca->txr.head] == NULL) &&
-		    (qca->sync == QCASPI_SYNC_READY))
+		    !qca->txr.skb[qca->txr.head])
 			schedule();
 
 		set_current_state(TASK_RUNNING);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net resend] net: qca_spi: Avoid high load if QCA7000 is not available
  2023-06-14 11:17 [PATCH net resend] net: qca_spi: Avoid high load if QCA7000 is not available Stefan Wahren
@ 2023-06-14 16:58 ` Simon Horman
  2023-06-14 20:40   ` Stefan Wahren
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2023-06-14 16:58 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Stefan Wahren, netdev, linux-kernel

On Wed, Jun 14, 2023 at 01:17:14PM +0200, Stefan Wahren wrote:
> In case the QCA7000 is not available via SPI (e.g. in reset),
> the driver will cause a high load. The reason for this is
> that the synchronization is never finished and schedule()
> is never called. Since the synchronization is not timing
> critical, it's safe to drop this from the scheduling condition.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@chargebyte.com>
> Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for
>  QCA7000")

Hi Stefan,

the Fixes should be on a single line.

Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")

> ---
>  drivers/net/ethernet/qualcomm/qca_spi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c
>  b/drivers/net/ethernet/qualcomm/qca_spi.c

Likewise, the above two lines should be a single line.
Unfortunately it seems that because it is not git doesn't apply
this patch, which creates problems for automation linked to patchwork.

I think it would be best to repost after resolving these minor issues.

> index bba1947792ea16..90f18ea4c28ba1 100644
> --- a/drivers/net/ethernet/qualcomm/qca_spi.c
> +++ b/drivers/net/ethernet/qualcomm/qca_spi.c
> @@ -582,8 +582,7 @@ qcaspi_spi_thread(void *data)
>  	while (!kthread_should_stop()) {
>  		set_current_state(TASK_INTERRUPTIBLE);
>  		if ((qca->intr_req == qca->intr_svc) &&
> -		    (qca->txr.skb[qca->txr.head] == NULL) &&
> -		    (qca->sync == QCASPI_SYNC_READY))
> +		    !qca->txr.skb[qca->txr.head])
>  			schedule();
>  
>  		set_current_state(TASK_RUNNING);
> 

-- 
pw-bot: cr


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net resend] net: qca_spi: Avoid high load if QCA7000 is not available
  2023-06-14 16:58 ` Simon Horman
@ 2023-06-14 20:40   ` Stefan Wahren
  2023-06-15  7:53     ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2023-06-14 20:40 UTC (permalink / raw)
  To: Simon Horman, Stefan Wahren
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel

Hi Simon,

Am 14.06.23 um 18:58 schrieb Simon Horman:
> On Wed, Jun 14, 2023 at 01:17:14PM +0200, Stefan Wahren wrote:
>> In case the QCA7000 is not available via SPI (e.g. in reset),
>> the driver will cause a high load. The reason for this is
>> that the synchronization is never finished and schedule()
>> is never called. Since the synchronization is not timing
>> critical, it's safe to drop this from the scheduling condition.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@chargebyte.com>
>> Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for
>>   QCA7000")
> 
> Hi Stefan,
> 
> the Fixes should be on a single line.
> 
> Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")

thanks for pointing out. Unfortunately this comes from the mail server, 
which line warp here. I will try to use a different account. Sorry about 
this mess :-(

> 
>> ---
>>   drivers/net/ethernet/qualcomm/qca_spi.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c
>>   b/drivers/net/ethernet/qualcomm/qca_spi.c
> 
> Likewise, the above two lines should be a single line.
> Unfortunately it seems that because it is not git doesn't apply
> this patch, which creates problems for automation linked to patchwork.
> 
> I think it would be best to repost after resolving these minor issues.
> 
>> index bba1947792ea16..90f18ea4c28ba1 100644
>> --- a/drivers/net/ethernet/qualcomm/qca_spi.c
>> +++ b/drivers/net/ethernet/qualcomm/qca_spi.c
>> @@ -582,8 +582,7 @@ qcaspi_spi_thread(void *data)
>>   	while (!kthread_should_stop()) {
>>   		set_current_state(TASK_INTERRUPTIBLE);
>>   		if ((qca->intr_req == qca->intr_svc) &&
>> -		    (qca->txr.skb[qca->txr.head] == NULL) &&
>> -		    (qca->sync == QCASPI_SYNC_READY))
>> +		    !qca->txr.skb[qca->txr.head])
>>   			schedule();
>>   
>>   		set_current_state(TASK_RUNNING);
>>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net resend] net: qca_spi: Avoid high load if QCA7000 is not available
  2023-06-14 20:40   ` Stefan Wahren
@ 2023-06-15  7:53     ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-06-15  7:53 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Stefan Wahren, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Wed, Jun 14, 2023 at 10:40:57PM +0200, Stefan Wahren wrote:
> Hi Simon,
> 
> Am 14.06.23 um 18:58 schrieb Simon Horman:
> > On Wed, Jun 14, 2023 at 01:17:14PM +0200, Stefan Wahren wrote:
> > > In case the QCA7000 is not available via SPI (e.g. in reset),
> > > the driver will cause a high load. The reason for this is
> > > that the synchronization is never finished and schedule()
> > > is never called. Since the synchronization is not timing
> > > critical, it's safe to drop this from the scheduling condition.
> > > 
> > > Signed-off-by: Stefan Wahren <stefan.wahren@chargebyte.com>
> > > Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for
> > >   QCA7000")
> > 
> > Hi Stefan,
> > 
> > the Fixes should be on a single line.
> > 
> > Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
> 
> thanks for pointing out. Unfortunately this comes from the mail server,
> which line warp here. I will try to use a different account. Sorry about
> this mess :-(

Thanks Stefan,

I thought it might be something annoying like that.

I see v2 and it seems clean wrt the issues I've raised here :)

> 
> > 
> > > ---
> > >   drivers/net/ethernet/qualcomm/qca_spi.c | 3 +--
> > >   1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c
> > >   b/drivers/net/ethernet/qualcomm/qca_spi.c
> > 
> > Likewise, the above two lines should be a single line.
> > Unfortunately it seems that because it is not git doesn't apply
> > this patch, which creates problems for automation linked to patchwork.
> > 
> > I think it would be best to repost after resolving these minor issues.
> > 
> > > index bba1947792ea16..90f18ea4c28ba1 100644
> > > --- a/drivers/net/ethernet/qualcomm/qca_spi.c
> > > +++ b/drivers/net/ethernet/qualcomm/qca_spi.c
> > > @@ -582,8 +582,7 @@ qcaspi_spi_thread(void *data)
> > >   	while (!kthread_should_stop()) {
> > >   		set_current_state(TASK_INTERRUPTIBLE);
> > >   		if ((qca->intr_req == qca->intr_svc) &&
> > > -		    (qca->txr.skb[qca->txr.head] == NULL) &&
> > > -		    (qca->sync == QCASPI_SYNC_READY))
> > > +		    !qca->txr.skb[qca->txr.head])
> > >   			schedule();
> > >   		set_current_state(TASK_RUNNING);
> > > 
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-15  7:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 11:17 [PATCH net resend] net: qca_spi: Avoid high load if QCA7000 is not available Stefan Wahren
2023-06-14 16:58 ` Simon Horman
2023-06-14 20:40   ` Stefan Wahren
2023-06-15  7:53     ` Simon Horman

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).