netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: "Mosler, Martin" <mmo@zuehlke.com>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"socketcan@hartkopp.net" <socketcan@hartkopp.net>,
	"lucas.demarchi@profusion.mobi" <lucas.demarchi@profusion.mobi>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"mkl@pengutronix.de" <mkl@pengutronix.de>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: AW: AW: [PATCH] net/can/mscan: Enable interrupts when all TX buffers are occupied to get notified when they are available again
Date: Mon, 28 Nov 2011 15:31:02 +0100	[thread overview]
Message-ID: <4ED39B26.1070608@grandegger.com> (raw)
In-Reply-To: <C3745E3C7FD07D429C54EB3D7606A5A7677EDE@ZRHEX021.ads.zuehlke.com>

On 11/28/2011 03:13 PM, Mosler, Martin wrote:
>>>>> When all TX buffers of the mscan are occupied the network layer is told to stop sending further packets. However the TX interrupts are not enabled and therefore the driver has no chance to tell the network layer when it is ready to accept further packets.
>>>>>
>>>>> Signed-off-by: Martin Mosler <mmo@zuehlke.com>
>>>>>
>>>>> --- linux-2.6/drivers/net/can/mscan/mscan.c.orig    2011-11-28 13:54:29.547850661 +0100
>>>>> +++ linux-2.6/drivers/net/can/mscan/mscan.c 2011-11-28 13:55:52.427849601 +0100
>>>>> @@ -214,6 +214,7 @@ static netdev_tx_t mscan_start_xmit(stru
>>>>>     case 0:
>>>>>         netif_stop_queue(dev);
>>>>>         dev_err(dev->dev.parent, "Tx Ring full when queue awake!\n");
>>>>> +       out_8(&regs->cantier, priv->tx_active);
>>>>>         return NETDEV_TX_BUSY;
>>>>>     case 1:
>>>>>         /*
>>>>
>>>> Hm, did you see the error message. Actually, it should never happen, IIRC.
>>>>
>>>> Wolfgang.
>>>
>>> It is in fact a very rare condition, but it was triggered during testing when pulling CAN-HI and CAN-LO lines
>>> to GND and VCC in various combinations to verify how the system is recovering. I am working with a MPC5125
>>> if this is valuable information. (This was only one issue I ran into, I had to do other modifications for other
>>> issues as well, but I think they are chip specific, I'll share them in a separate thread if you like).
>>
>> Sounds like a problem with bus-off recovery. The software has restarted
>> the queue but the TX objects are still active. How do you handle
>> bus-offs? Manually? restart-ms = ?
>>
>> Would be great if you post patches for your other issues.
>>
>> Wolfgang.
> 
> We are using restart-ms = 500 for now.

OK. How the hardware recovers on bus-off on the MPC51xx and especially
on the MPC51xx is still a mystery to me. I think the real problem is
that the software does not wait until the hardware has fully recovered
from bus-off by going to error active. Do you have a kernel log (dmesg
output) with CONFIG_CAN_DEBUG_DEVICES=y and CONFIG_PRINTK_TIME=y?

> I'll post the other patches after I know I did the submit process correctly for this one and when I reviewed 
> them more closely, as it is my first submission to the kernel.

I just commented on that.

Thanks.

Wolfgang.

  reply	other threads:[~2011-11-28 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 13:25 [PATCH] net/can/mscan: Enable interrupts when all TX buffers are occupied to get notified when they are available again Mosler, Martin
2011-11-28 13:37 ` Wolfgang Grandegger
2011-11-28 13:59   ` AW: " Mosler, Martin
2011-11-28 14:08     ` Wolfgang Grandegger
2011-11-28 14:13       ` AW: " Mosler, Martin
2011-11-28 14:31         ` Wolfgang Grandegger [this message]
2011-11-28 14:22 ` Wolfgang Grandegger

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=4ED39B26.1070608@grandegger.com \
    --to=wg@grandegger.com \
    --cc=davem@davemloft.net \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mkl@pengutronix.de \
    --cc=mmo@zuehlke.com \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    /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 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).