<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/can, branch linux-4.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.16.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2018-06-20T19:01:39Z</updated>
<entry>
<title>can: dev: increase bus-off message severity</title>
<updated>2018-06-20T19:01:39Z</updated>
<author>
<name>Jakob Unterwurzacher</name>
<email>jakob.unterwurzacher@theobroma-systems.com</email>
</author>
<published>2018-04-18T14:10:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b40b95fae4c7a4087c82024346b11ae8ce1b7d93'/>
<id>urn:sha1:b40b95fae4c7a4087c82024346b11ae8ce1b7d93</id>
<content type='text'>
[ Upstream commit 71c23a821c6bcacba71a094efe49ee689605906b ]

bus-off is usually caused by hardware malfunction or configuration error
(baud rate mismatch) and causes a complete loss of communication.

Increase the "bus-off" message's severity from netdev_dbg() to
netdev_info() to make it visible to the user.

A can interface going into bus-off is similar in severity to ethernet's
"Link is Down" message, which is also printed at info level.

It is debatable whether the the "restarted" message should also be
changed to netdev_info() to make the interface state changes
comprehensible from the kernel log. I have chosen to keep the
"restarted" message at dbg for now as the "bus-off" message should be
enough for the user to notice and investigate the problem.

Signed-off-by: Jakob Unterwurzacher &lt;jakob.unterwurzacher@theobroma-systems.com&gt;
Cc: linux-can@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>can: hi311x: Work around TX complete interrupt erratum</title>
<updated>2018-05-16T08:12:31Z</updated>
<author>
<name>Lukas Wunner</name>
<email>lukas@wunner.de</email>
</author>
<published>2018-05-09T12:43:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=37be6761ece7db918969b55a647d5265d0ae5cb0'/>
<id>urn:sha1:37be6761ece7db918969b55a647d5265d0ae5cb0</id>
<content type='text'>
commit 32bee8f48fa048a3198109de50e51c092507ff52 upstream.

When sending packets as fast as possible using "cangen -g 0 -i -x", the
HI-3110 occasionally latches the interrupt pin high on completion of a
packet, but doesn't set the TXCPLT bit in the INTF register.  The INTF
register contains 0x00 as if no interrupt has occurred.  Even waiting
for a few milliseconds after the interrupt doesn't help.

Work around this apparent erratum by instead checking the TXMTY bit in
the STATF register ("TX FIFO empty").  We know that we've queued up a
packet for transmission if priv-&gt;tx_len is nonzero.  If the TX FIFO is
empty, transmission of that packet must have completed.

Note that this is congruent with our handling of received packets, which
likewise gleans from the STATF register whether a packet is waiting in
the RX FIFO, instead of looking at the INTF register.

Cc: Mathias Duckeck &lt;m.duckeck@kunbus.de&gt;
Cc: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
Cc: Casey Fitzpatrick &lt;casey.fitzpatrick@timesys.com&gt;
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Acked-by: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>can: hi311x: Acquire SPI lock on -&gt;do_get_berr_counter</title>
<updated>2018-05-16T08:12:31Z</updated>
<author>
<name>Lukas Wunner</name>
<email>lukas@wunner.de</email>
</author>
<published>2018-05-09T12:38:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3cda1f6aed6463af0bbb0a3eca9815bd9f834cef'/>
<id>urn:sha1:3cda1f6aed6463af0bbb0a3eca9815bd9f834cef</id>
<content type='text'>
commit 5cec9425b41dcf834c3d48776900d6acb7e96f38 upstream.

hi3110_get_berr_counter() may run concurrently to the rest of the driver
but neglects to acquire the lock protecting access to the SPI device.
As a result, it and the rest of the driver may clobber each other's tx
and rx buffers.

We became aware of this issue because transmission of packets with
"cangen -g 0 -i -x" frequently hung.  It turns out that agetty executes
-&gt;do_get_berr_counter every few seconds via the following call stack:

    CPU: 2 PID: 1605 Comm: agetty
    [&lt;7f3f7500&gt;] (hi3110_get_berr_counter [hi311x])
    [&lt;7f130204&gt;] (can_fill_info [can_dev])
    [&lt;80693bc0&gt;] (rtnl_fill_ifinfo)
    [&lt;806949ec&gt;] (rtnl_dump_ifinfo)
    [&lt;806b4834&gt;] (netlink_dump)
    [&lt;806b4bc8&gt;] (netlink_recvmsg)
    [&lt;8065f180&gt;] (sock_recvmsg)
    [&lt;80660f90&gt;] (___sys_recvmsg)
    [&lt;80661e7c&gt;] (__sys_recvmsg)
    [&lt;80661ec0&gt;] (SyS_recvmsg)
    [&lt;80108b20&gt;] (ret_fast_syscall+0x0/0x1c)

agetty listens to netlink messages in order to update the login prompt
when IP addresses change (if /etc/issue contains \4 or \6 escape codes):
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=e36deb6424e8

It's a useful feature, though it seems questionable that it causes CAN
bit error statistics to be queried.

Be that as it may, if hi3110_get_berr_counter() is invoked while a frame
is sent by hi3110_hw_tx(), bogus SPI transfers like the following may
occur:

    =&gt; 12 00             (hi3110_get_berr_counter() wanted to transmit
                          EC 00 to query the transmit error counter,
                          but the first byte was overwritten by
                          hi3110_hw_tx_frame())

    =&gt; EA 00 3E 80 01 FB (hi3110_hw_tx_frame() wanted to transmit a
                          frame, but the first byte was overwritten by
                          hi3110_get_berr_counter() because it wanted
                          to query the receive error counter)

This sequence hangs the transmission because the driver believes it has
sent a frame and waits for the interrupt signaling completion, but in
reality the chip has never sent away the frame since the commands it
received were malformed.

Fix by acquiring the SPI lock in hi3110_get_berr_counter().

I've scrutinized the entire driver for further unlocked SPI accesses but
found no others.

Cc: Mathias Duckeck &lt;m.duckeck@kunbus.de&gt;
Cc: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
Cc: Casey Fitzpatrick &lt;casey.fitzpatrick@timesys.com&gt;
Cc: Stef Walter &lt;stefw@redhat.com&gt;
Cc: Karel Zak &lt;kzak@redhat.com&gt;
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Reviewed-by: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>can: kvaser_usb: Increase correct stats counter in kvaser_usb_rx_can_msg()</title>
<updated>2018-05-16T08:12:30Z</updated>
<author>
<name>Jimmy Assarsson</name>
<email>extja@kvaser.com</email>
</author>
<published>2018-04-20T12:38:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7828ab9addf0e9cbca3780165203d85403d18103'/>
<id>urn:sha1:7828ab9addf0e9cbca3780165203d85403d18103</id>
<content type='text'>
commit 6ee00865ffe4e8c8ba4a68d26db53c7ec09bbb89 upstream.

Increase rx_dropped, if alloc_can_skb() fails, not tx_dropped.

Signed-off-by: Jimmy Assarsson &lt;extja@kvaser.com&gt;
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>can: flexcan: fix endianess detection</title>
<updated>2018-05-16T08:12:30Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2018-04-25T14:50:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9f28874ccb2ff5b909d9b0c3a4736edf7e856cdf'/>
<id>urn:sha1:9f28874ccb2ff5b909d9b0c3a4736edf7e856cdf</id>
<content type='text'>
commit 0e030a373df3b8792b8991740fc31fe0629c6e58 upstream.

In commit 88462d2a7830 ("can: flexcan: Remodel FlexCAN register r/w APIs
for big endian FlexCAN controllers.") the following logic was
implemented:

	if the dt property "big-endian" is given or
	   the device is compatible to "fsl,p1010-flexcan":
		use big-endian mode;
	else
		use little-endian mode;

This relies on commit d50f4630c2e1 ("arm: dts: Remove p1010-flexcan
compatible from imx series dts") which was applied a few commits later.
Without this commit (or an old device tree used for booting a new
kernel) the flexcan devices on i.MX25, i.MX28, i.MX35 and i.MX53 match
the 'the device is compatible to "fsl,p1010-flexcan"' test and so are
switched erroneously to big endian mode.

Instead of the check above put a quirk in devtype data and rely on
of_match_device yielding the most compatible match

Fixes: 88462d2a7830 ("can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers.")
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Tested-by: Gavin Schenk &lt;g.schenk@eckelmann.de&gt;
Cc: linux-stable &lt;stable@vger.kernel.org&gt; # &gt;= v4.16
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>can: cc770: Fix use after free in cc770_tx_interrupt()</title>
<updated>2018-03-19T09:57:29Z</updated>
<author>
<name>Andri Yngvason</name>
<email>andri.yngvason@marel.com</email>
</author>
<published>2018-03-15T18:23:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9ffd7503944ec7c0ef41c3245d1306c221aef2be'/>
<id>urn:sha1:9ffd7503944ec7c0ef41c3245d1306c221aef2be</id>
<content type='text'>
This fixes use after free introduced by the last cc770 patch.

Signed-off-by: Andri Yngvason &lt;andri.yngvason@marel.com&gt;
Fixes: 746201235b3f ("can: cc770: Fix queue stall &amp; dropped RTR reply")
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: cc770: Fix queue stall &amp; dropped RTR reply</title>
<updated>2018-03-14T12:01:22Z</updated>
<author>
<name>Andri Yngvason</name>
<email>andri.yngvason@marel.com</email>
</author>
<published>2018-03-14T11:52:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=746201235b3f876792099079f4c6fea941d76183'/>
<id>urn:sha1:746201235b3f876792099079f4c6fea941d76183</id>
<content type='text'>
While waiting for the TX object to send an RTR, an external message with a
matching id can overwrite the TX data. In this case we must call the rx
routine and then try transmitting the message that was overwritten again.

The queue was being stalled because the RX event did not generate an
interrupt to wake up the queue again and the TX event did not happen
because the TXRQST flag is reset by the chip when new data is received.

According to the CC770 datasheet the id of a message object should not be
changed while the MSGVAL bit is set. This has been fixed by resetting the
MSGVAL bit before modifying the object in the transmit function and setting
it after. It is not enough to set &amp; reset CPUUPD.

It is important to keep the MSGVAL bit reset while the message object is
being modified. Otherwise, during RTR transmission, a frame with matching
id could trigger an rx-interrupt, which would cause a race condition
between the interrupt routine and the transmit function.

Signed-off-by: Andri Yngvason &lt;andri.yngvason@marel.com&gt;
Tested-by: Richard Weinberger &lt;richard@nod.at&gt;
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: cc770: Fix stalls on rt-linux, remove redundant IRQ ack</title>
<updated>2018-03-14T12:00:15Z</updated>
<author>
<name>Andri Yngvason</name>
<email>andri.yngvason@marel.com</email>
</author>
<published>2018-03-14T11:52:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f4353daf4905c0099fd25fa742e2ffd4a4bab26a'/>
<id>urn:sha1:f4353daf4905c0099fd25fa742e2ffd4a4bab26a</id>
<content type='text'>
This has been reported to cause stalls on rt-linux.

Suggested-by: Richard Weinberger &lt;richard@nod.at&gt;
Tested-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andri Yngvason &lt;andri.yngvason@marel.com&gt;
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: m_can: select pinctrl state in each suspend/resume function</title>
<updated>2018-03-12T09:38:20Z</updated>
<author>
<name>Bich HEMON</name>
<email>bich.hemon@st.com</email>
</author>
<published>2018-03-12T08:52:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c9b3bce18da4a0aebc27853052dea39aa64b7d75'/>
<id>urn:sha1:c9b3bce18da4a0aebc27853052dea39aa64b7d75</id>
<content type='text'>
Make sure to apply the correct pin state in suspend/resume callbacks.
Putting pins in sleep state saves power.

Signed-off-by: Bich Hemon &lt;bich.hemon@st.com&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: peak/pcie_fd: remove useless code when interface starts</title>
<updated>2018-03-12T08:55:12Z</updated>
<author>
<name>Stephane Grosjean</name>
<email>s.grosjean@peak-system.com</email>
</author>
<published>2018-03-08T08:30:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ffd137f7043cb30067e1bff6fe62a073ae190b23'/>
<id>urn:sha1:ffd137f7043cb30067e1bff6fe62a073ae190b23</id>
<content type='text'>
When an interface starts, the echo_skb array is empty and the network
queue should be started only. This patch replaces useless code and locks
when the internal RX_BARRIER message is received from the IP core, telling
the driver that tx may start.

Signed-off-by: Stephane Grosjean &lt;s.grosjean@peak-system.com&gt;
Cc: linux-stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
</feed>
