linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Torin Cooper-Bennun <torin@maxiluxsystems.com>
To: Mariusz Madej <mariusz.madej@xtrack.com>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: m_can: a lot of 'Rx FIFO 0 Message Lost' in dmesg
Date: Mon, 1 Mar 2021 14:14:06 +0000	[thread overview]
Message-ID: <20210301141406.bnrqqkbfnq523ofb@bigthink> (raw)
In-Reply-To: <d0ebed81-3f7a-1e82-e16b-85e242d1ddca@xtrack.com>

Thank you Mariusz, you've helped me understand this driver better - I
had missed some of the logic. I agree that this is a bug.

On Sat, Feb 27, 2021 at 05:03:14AM +0100, Mariusz Madej wrote:
> I changed m_can_do_rx_poll:
> 
> static int m_can_do_rx_poll(struct net_device *dev, int quota)
> {
>         struct m_can_classdev *cdev = netdev_priv(dev);
>         u32 pkts = 0;
>         u32 rxfs;
> 
>         rxfs = m_can_read(cdev, M_CAN_RXF0S);
>         if (!(rxfs & RXFS_FFL_MASK)) {
>                 netdev_dbg(dev, "no messages in fifo0\n");
>                 return 0;
>         }
> 
>         while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) {
>                 if (rxfs & RXFS_RFL) {
>                         netdev_warn(dev, "Rx FIFO 0 Message Lost\n");
>                         m_can_write(cdev, M_CAN_IR, IR_RF0L);
>                 }
> 
>                 m_can_read_fifo(dev, rxfs);
> 
>                 quota--;
>                 pkts++;
>                 rxfs = m_can_read(cdev, M_CAN_RXF0S);
>         }
> 
>         if (pkts)
>                 can_led_event(dev, CAN_LED_EVENT_RX);
> 
>         return pkts;
> }

Your fix makes sense to me. If you submit a patch to the linux-can list,
it will probably be reviewed quickly. (Don't bother to CC Dan Murphy
though, as his address listed in MAINTAINERS bounces mail.)

--
Regards,

Torin Cooper-Bennun
Software Engineer | maxiluxsystems.com


  reply	other threads:[~2021-03-01 14:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 14:27 m_can: a lot of 'Rx FIFO 0 Message Lost' in dmesg Mariusz Madej
2021-02-26 13:37 ` Torin Cooper-Bennun
2021-02-27  4:03   ` Mariusz Madej
2021-03-01 14:14     ` Torin Cooper-Bennun [this message]
2021-03-01 21:31       ` Mariusz Madej
  -- strict thread matches above, loose matches on Subject: below --
2021-02-24 11:24 Mariusz Madej

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=20210301141406.bnrqqkbfnq523ofb@bigthink \
    --to=torin@maxiluxsystems.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mariusz.madej@xtrack.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 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).