From: Wolfgang Grandegger <wg@grandegger.com>
To: Michael Pellegrini <mikep86@gmail.com>
Cc: linux-can@vger.kernel.org
Subject: Re: pch_can: Data transmission stops after dropped packet
Date: Mon, 26 Nov 2012 19:13:54 +0100 [thread overview]
Message-ID: <50B3B162.9020905@grandegger.com> (raw)
In-Reply-To: <loom.20121126T181452-657@post.gmane.org>
On 11/26/2012 06:30 PM, Michael Pellegrini wrote:
> Wolfgang Grandegger <wg <at> grandegger.com> writes:
>
>> Not too bad! The return does only happen at high load. When you
>> "ifconfig up" the device some kernel messages are printed. Could you
>> please show them. I want to understand if the reset really occurs by
>> checking some register values.
>
> "ifconfig can0 down" followed by "ifconfig can0 up" produces the following dmesg
> output:
>
> [10113.228189] CTRL_REG=0x1
> [10113.228213] BTR_REG =0x2301
> [10113.228230] TEST_REG =0x80
These are the correct reset values. Therefore, a reset did occur.
> Note that I used v7 of the driver to get this data.
>
>>> I tried the PCH driver and hit the transmission failure within a minute.
>>
>> Ah. In the function pch_xmit(), could you please move
>>
>> spin_unlock_irqrestore(&priv->lock, flags);
>>
>> to the end of the function just before
>>
>> return NETDEV_TX_OK;
>>
>> and then retry. This would fix races with accessing the message ram as
>> well (via pch_can_rw_msg_obj). I missed that.
>
> Alright, I applied the following patch:
>
> *** ../c-can-pci-v7/pch_can.c 2012-11-25 05:09:13.000000000 -0500
> --- ./pch_can.c 2012-11-26 11:29:11.350012074 -0500
> *************** static netdev_tx_t pch_xmit(struct sk_bu
> *** 921,928 ****
> priv->tx_obj++;
> }
>
> - spin_unlock_irqrestore(&priv->lock, flags);
> -
> /* Setting the CMASK register. */
> pch_can_bit_set(&priv->regs->ifregs[1].cmask, PCH_CMASK_ALL);
>
> --- 921,926 ----
> *************** static netdev_tx_t pch_xmit(struct sk_bu
> *** 957,962 ****
> --- 955,962 ----
>
> pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, tx_obj_no);
>
> + spin_unlock_irqrestore(&priv->lock, flags);
> +
> return NETDEV_TX_OK;
> }
>
> The patched driver did not fail in the first few minutes, so that's a good sign.
> I will run this driver overnight.
OK, thank. I think the problem is fixed.
>>> I'm happy to test out more changes to this driver if you think it is worth
>>> pursuing.
>>
>> Remote debugging is slow, unfortunately. Thanks for your patience.
>
> No problem. I'm just thankful that the problem is getting addressed.
>
>>> I started a test with the new c_can driver. I'll check on it throughout
>>> the day and let it run overnight as well.
>>
>> OK, apart from the return issue above the driver has not changed from
>> the functional point of view.
>
> Alright, I will wait until more substantial changes are implemented before
> re-running the long-term test on this driver.
Yes, maybe we can come up with an even better solution.
Wolfgang.
next prev parent reply other threads:[~2012-11-26 18:13 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 15:39 pch_can: Data transmission stops after dropped packet Michael Pellegrini
2012-11-14 21:40 ` Michael Pellegrini
2012-11-15 7:18 ` Oliver Hartkopp
2012-11-15 13:13 ` Wolfgang Grandegger
2012-11-15 16:23 ` Michael Pellegrini
2012-11-15 21:19 ` Wolfgang Grandegger
2012-11-15 21:34 ` Michael Pellegrini
2012-11-15 21:51 ` Wolfgang Grandegger
2012-11-18 22:22 ` Wolfgang Grandegger
2012-11-19 15:10 ` Michael Pellegrini
2012-11-19 15:26 ` Wolfgang Grandegger
2012-11-19 16:20 ` Michael Pellegrini
2012-11-19 16:31 ` Wolfgang Grandegger
2012-11-19 17:39 ` Michael Pellegrini
2012-11-19 19:22 ` Wolfgang Grandegger
2012-11-19 20:19 ` Michael Pellegrini
2012-11-19 21:46 ` Wolfgang Grandegger
2012-11-20 14:25 ` Michael Pellegrini
2012-11-20 16:12 ` Wolfgang Grandegger
2012-11-20 19:12 ` Michael Pellegrini
2012-11-20 21:05 ` Wolfgang Grandegger
2012-11-21 10:24 ` Wolfgang Grandegger
[not found] ` <loom.20121121T160744-278@post.gmane.or g>
2012-11-21 15:15 ` Michael Pellegrini
[not found] ` <loom.20121121T160744-278@post.gmane.or g>
2012-11-21 15:25 ` Michael Pellegrini
2012-11-21 15:32 ` Marc Kleine-Budde
2012-11-21 16:11 ` Michael Pellegrini
2012-11-21 15:41 ` Michael Pellegrini
2012-11-21 15:56 ` Wolfgang Grandegger
2012-11-21 16:09 ` Michael Pellegrini
2012-11-21 16:41 ` Wolfgang Grandegger
2012-11-21 16:58 ` Casper Mogensen
2012-11-21 19:48 ` Wolfgang Grandegger
2012-11-21 17:43 ` Michael Pellegrini
2012-11-21 19:55 ` Wolfgang Grandegger
2012-11-21 21:00 ` Michael Pellegrini
2012-11-23 14:27 ` Michael Pellegrini
2012-11-23 14:45 ` Wolfgang Grandegger
2012-11-23 14:47 ` Wolfgang Grandegger
2012-11-23 15:14 ` Michael Pellegrini
2012-11-23 15:04 ` Michael Pellegrini
2012-11-23 17:00 ` Wolfgang Grandegger
2012-11-23 17:18 ` Wolfgang Grandegger
2012-11-23 17:52 ` Michael Pellegrini
2012-11-25 16:17 ` Wolfgang Grandegger
2012-11-26 14:54 ` Michael Pellegrini
2012-11-26 15:30 ` Wolfgang Grandegger
2012-11-26 17:30 ` Michael Pellegrini
2012-11-26 18:13 ` Wolfgang Grandegger [this message]
2012-11-29 12:15 ` Wolfgang Grandegger
2012-11-29 14:15 ` Michael Pellegrini
2012-12-06 14:20 ` Michael Pellegrini
2012-12-06 14:23 ` Marc Kleine-Budde
2012-12-06 14:41 ` Wolfgang Grandegger
2012-12-06 14:42 ` Marc Kleine-Budde
2012-12-06 14:42 ` Michael Pellegrini
2012-12-06 14:49 ` Wolfgang Grandegger
2012-12-06 17:05 ` Alexander Stein
2012-12-06 22:02 ` Wolfgang Grandegger
2012-12-06 23:24 ` Marc Kleine-Budde
2012-12-10 8:21 ` Alexander Stein
2012-12-11 20:24 ` Wolfgang Grandegger
2012-12-13 14:04 ` Alexander Stein
2012-12-11 14:46 ` Michael Pellegrini
2012-12-11 20:21 ` Wolfgang Grandegger
2012-12-12 13:35 ` Alexander Stein
2012-12-06 22:11 ` Michael Pellegrini
2012-12-06 23:23 ` Michael Pellegrini
2012-11-24 7:16 ` Wolfgang Grandegger
2012-11-26 3:33 ` Bhupesh SHARMA
2012-11-21 14:52 ` Michael Pellegrini
2012-11-21 15:02 ` Wolfgang Grandegger
2012-11-15 16:32 ` Casper Mogensen
2012-11-15 21:16 ` Wolfgang Grandegger
2012-11-16 19:39 ` Wolfgang Grandegger
2012-11-15 16:12 ` Michael Pellegrini
2012-11-20 18:59 ` Wolfgang Grandegger
2012-11-15 12:35 ` Steffen Rose
2012-11-15 18:26 ` Michael Pellegrini
2012-11-16 8:24 ` Steffen Rose
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=50B3B162.9020905@grandegger.com \
--to=wg@grandegger.com \
--cc=linux-can@vger.kernel.org \
--cc=mikep86@gmail.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.