All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Richard Weinberger <richard@sigma-star.at>,
	Andri Yngvason <andri.yngvason@marel.com>
Cc: linux-can@vger.kernel.org, mkl@pengutronix.de,
	sigurbjorn.narfason@marel.com, hrafnkell.eiriksson@marel.com,
	patric.thysell@br-automation.com
Subject: Re: [PATCH v2 2/3] can: cc770: Stop queue on NETDEV_TX_BUSY
Date: Mon, 12 Feb 2018 21:37:14 +0100	[thread overview]
Message-ID: <d62fdd54-4d06-db35-a0a0-b69759286bb5@grandegger.com> (raw)
In-Reply-To: <2260026.6LYqVhIflL@blindfold>

Hello,

Am 12.02.2018 um 20:40 schrieb Richard Weinberger:
> Andri,
> 
> Am Dienstag, 30. Januar 2018, 17:56:48 CET schrieb Andri Yngvason:
>> If the queue is not stopped, the start_xmit function will continue to be
>> called until the driver or the system is reset.
>>
>> Signed-off-by: Andri Yngvason <andri.yngvason@marel.com>
>> ---
>>   drivers/net/can/cc770/cc770.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
>> index 9fed163..12d3b89 100644
>> --- a/drivers/net/can/cc770/cc770.c
>> +++ b/drivers/net/can/cc770/cc770.c
>> @@ -405,6 +405,7 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb,
>> struct net_device *dev)
>>
>>   	if ((cc770_read_reg(priv,
>>   			    msgobj[mo].ctrl1) & TXRQST_UNC) == TXRQST_SET) {
>> +		netif_stop_queue(dev);
>>   		netdev_err(dev, "TX register is still occupied!\n");
>>   		return NETDEV_TX_BUSY;
>>   	}
> 
> I see that some can drivers stop the queue, others not.
> What exactly is the problem in this case?

Stopping the queue and returning NETDEV_TX_BUSY does make little sense. 
NETDEV_TX_BUSY will tell the upper layer to retry asap. In general that 
case should be avoided by stopping the queue earlier. Actually, 
netif_stop_queue(dev) is called directly after the if block above,
which means that "TX register is still occupied" indicates an error/bug. 
I think there is a race somewhere.

Wolfgang.

  reply	other threads:[~2018-02-12 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 16:56 [PATCH v2 1/3] can: cc770: Remove redundant IRQ ack Andri Yngvason
2018-01-30 16:56 ` [PATCH v2 2/3] can: cc770: Stop queue on NETDEV_TX_BUSY Andri Yngvason
2018-02-12 19:40   ` Richard Weinberger
2018-02-12 20:37     ` Wolfgang Grandegger [this message]
2018-02-12 20:44       ` Wolfgang Grandegger
2018-02-12 20:55         ` Richard Weinberger
2018-02-12 21:28           ` Wolfgang Grandegger
2018-02-12 21:36             ` Wolfgang Grandegger
2018-02-13 10:32               ` Andri Yngvason
2018-02-13 16:30                 ` Wolfgang Grandegger
2018-02-16 14:22               ` Marc Kleine-Budde
2018-02-16 15:20                 ` Wolfgang Grandegger
2018-01-30 16:56 ` [PATCH v2 3/3] can: cc770: Fix queue stall & dropped RTR reply Andri Yngvason
2018-02-12 19:45   ` Richard Weinberger
2018-02-12 19:41 ` [PATCH v2 1/3] can: cc770: Remove redundant IRQ ack Richard Weinberger
     [not found]   ` <151851733257.10946.11726494714017260046@maxwell>
2018-02-13 10:35     ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d62fdd54-4d06-db35-a0a0-b69759286bb5@grandegger.com \
    --to=wg@grandegger.com \
    --cc=andri.yngvason@marel.com \
    --cc=hrafnkell.eiriksson@marel.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=patric.thysell@br-automation.com \
    --cc=richard@sigma-star.at \
    --cc=sigurbjorn.narfason@marel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.