All of lore.kernel.org
 help / color / mirror / Atom feed
From: Torin Cooper-Bennun <torin@maxiluxsystems.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-rpi-kernel@lists.infradead.org, linux-can@vger.kernel.org
Subject: Re: can, tcan4x5x: look to merge rpi support into rpi kernel tree
Date: Tue, 16 Feb 2021 09:06:52 +0000	[thread overview]
Message-ID: <CAALJrqj=QC1to9ja0CeL76JxVF1iwjsW7YJHs18VbXea=PvBGg@mail.gmail.com> (raw)
In-Reply-To: <20210215174408.eea3okssfzjsqrly@hardanger.blackshift.org>

On Mon, 15 Feb 2021 at 17:44, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> Do you have the wake-gpio in your DT? This one works for me:

We actually don't break out WAKE on our board, and using this board
I've written a TCAN4550 driver for MCUs and haven't required device
wake-up via WAKE or other means.

My DT:

|            tcan4x5x: tcan4x5x@0 {
|                reg = <0>;
|                compatible = "ti,tcan4x5x";
|                pinctrl-names = "default";
|                pinctrl-0 = <&tcan4x5x_pins>;
|                spi-max-frequency = <4000000>;
|                bosch,mram-cfg = <0x0 0 0 10 0 0 0 10>;
|                interrupt-parent = <&gpio>;
|                interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
|                clock-names = "cclk";
|                clocks = <&clk_tcan4x5x_osc>;
|            };

> You mean something like these...
>
> | [  543.116807] WARNING: CPU: 0 PID: 11 at lib/refcount.c:25 refcount_warn_saturate+0x108/0x174
> | [  543.116820] refcount_t: addition on 0; use-after-free.
>
> with can_put_echo_skb() in the call stack?
>
> | [  543.117745] [<bf186edc>] (can_put_echo_skb [can_dev]) from [<bf1d67ec>] (mcp251xfd_start_xmit+0x2b0/0x3bc [mcp251xfd])

Yes, exactly. I have also seen, when putting the interface down...

[   69.378407] WARNING: CPU: 3 PID: 740 at lib/refcount.c:28
refcount_warn_saturate+0x13c/0x174
[   69.378413] refcount_t: underflow; use-after-free.

...with can_flush_echo_skb() in the stack this time:

[   69.378857] [<7f1de528>] (can_flush_echo_skb [can_dev]) from
[<7f1de5c8>] (close_candev+0x2c/0x30 [can_dev])

> > This is a Raspberry Pi 3 Model B v1.2, hosting a TCAN4550 on spi0. The
> > external oscillator for the TCAN4550 is 20 MHz.
>
> Is that a custom tcan pi hat, or is it officially sold somewhere?

It's a custom board, jerry-rigged to a Pi.

> First thing I'd do is to rewrite the RX function and IRQ handler for the
> "peripheral", that's the code path used for the SPI attached m-can
> core. TX doesn't look efficient, but it should work at least.

Thanks, I'll take a look. I am concerned about this weird behaviour
when trying to TX, though. I'll walk through the chip config and
compare with my known working process.

-- 
Regards,

Torin Cooper-Bennun
www.maxiluxsystems.com | Software Engineer

  reply	other threads:[~2021-02-16  9:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <602651f9.1c69fb81.302a5.647d@mx.google.com>
     [not found] ` <20210215144509.rhds7oybzat6u27w@hardanger.blackshift.org>
     [not found]   ` <CAALJrqgrmzGHZX+iiMYwMkVMpxtf_3fWYkVA-iMdPOxpGzrCRQ@mail.gmail.com>
2021-02-15 17:44     ` can, tcan4x5x: look to merge rpi support into rpi kernel tree Marc Kleine-Budde
2021-02-16  9:06       ` Torin Cooper-Bennun [this message]
2021-02-16  9:13         ` Marc Kleine-Budde
2021-02-16  9:44           ` Torin Cooper-Bennun
2021-02-16 10:28             ` Marc Kleine-Budde
     [not found]               ` <CAALJrqiVdmLQr7q2ijbWq70RD6PTD8PtVX_zmLW9=uNdc57WqA@mail.gmail.com>
2021-02-16 11:19                 ` Marc Kleine-Budde
2021-02-16 11:38                   ` Torin Cooper-Bennun
2021-02-16 12:32                     ` Marc Kleine-Budde
2021-02-26 12:27                       ` Torin Cooper-Bennun
2021-02-26 12:28                         ` Marc Kleine-Budde
2021-02-26 12:18   ` Torin Cooper-Bennun
2021-02-26 12:22     ` Marc Kleine-Budde
2021-02-26 12:31       ` Torin Cooper-Bennun
2021-02-26 12:40         ` Marc Kleine-Budde
2021-02-26 13:26           ` Torin Cooper-Bennun
2021-02-26 13:39             ` Marc Kleine-Budde
2021-02-26 13:45               ` Torin Cooper-Bennun
2021-02-26 14:00                 ` Marc Kleine-Budde
2021-02-26 15:26                   ` Torin Cooper-Bennun
2021-02-26 16:01                     ` Marc Kleine-Budde
2021-02-26 16:14                       ` Torin Cooper-Bennun

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='CAALJrqj=QC1to9ja0CeL76JxVF1iwjsW7YJHs18VbXea=PvBGg@mail.gmail.com' \
    --to=torin@maxiluxsystems.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=mkl@pengutronix.de \
    /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.