<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/can/flexcan.c, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-04-10T11:04:45Z</updated>
<entry>
<title>can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate</title>
<updated>2021-04-10T11:04:45Z</updated>
<author>
<name>Angelo Dureghello</name>
</author>
<published>2021-03-15T23:15:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cfc4cb76d9239c39bc0bfc4258e8ce0a8aa2f54'/>
<id>urn:sha1:9cfc4cb76d9239c39bc0bfc4258e8ce0a8aa2f54</id>
<content type='text'>
commit 47c5e474bc1e1061fb037d13b5000b38967eb070 upstream.

For cases when flexcan is built-in, bitrate is still not set at
registering. So flexcan_chip_freeze() generates:

[    1.860000] *** ZERO DIVIDE ***   FORMAT=4
[    1.860000] Current process id is 1
[    1.860000] BAD KERNEL TRAP: 00000000
[    1.860000] PC: [&lt;402e70c8&gt;] flexcan_chip_freeze+0x1a/0xa8

To allow chip freeze, using an hardcoded timeout when bitrate is still
not set.

Fixes: ec15e27cc890 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
Link: https://lore.kernel.org/r/20210315231510.650593-1-angelo@kernel-space.org
Signed-off-by: Angelo Dureghello &lt;angelo@kernel-space.org&gt;
[mkl: use if instead of ? operator]
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Cc: Koen Vandeputte &lt;koen.vandeputte@citymesh.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>can: flexcan: enable RX FIFO after FRZ/HALT valid</title>
<updated>2021-03-17T15:10:13Z</updated>
<author>
<name>Joakim Zhang</name>
</author>
<published>2021-02-18T11:00:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=057a5c50ad712045cc52916ba9f431625fec7d7c'/>
<id>urn:sha1:057a5c50ad712045cc52916ba9f431625fec7d7c</id>
<content type='text'>
commit ec15e27cc8904605846a354bb1f808ea1432f853 upstream.

RX FIFO enable failed could happen when do system reboot stress test:

[    0.303958] flexcan 5a8d0000.can: 5a8d0000.can supply xceiver not found, using dummy regulator
[    0.304281] flexcan 5a8d0000.can (unnamed net_device) (uninitialized): Could not enable RX FIFO, unsupported core
[    0.314640] flexcan 5a8d0000.can: registering netdev failed
[    0.320728] flexcan 5a8e0000.can: 5a8e0000.can supply xceiver not found, using dummy regulator
[    0.320991] flexcan 5a8e0000.can (unnamed net_device) (uninitialized): Could not enable RX FIFO, unsupported core
[    0.331360] flexcan 5a8e0000.can: registering netdev failed
[    0.337444] flexcan 5a8f0000.can: 5a8f0000.can supply xceiver not found, using dummy regulator
[    0.337716] flexcan 5a8f0000.can (unnamed net_device) (uninitialized): Could not enable RX FIFO, unsupported core
[    0.348117] flexcan 5a8f0000.can: registering netdev failed

RX FIFO should be enabled after the FRZ/HALT are valid. But the current
code enable RX FIFO and FRZ/HALT at the same time.

Fixes: e955cead03117 ("CAN: Add Flexcan CAN controller driver")
Link: https://lore.kernel.org/r/20210218110037.16591-3-qiangqing.zhang@nxp.com
Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.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: flexcan: assert FRZ bit in flexcan_chip_freeze()</title>
<updated>2021-03-17T15:10:13Z</updated>
<author>
<name>Joakim Zhang</name>
</author>
<published>2021-02-18T11:00:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=679f002ce370e943a3911901cc3d101c6f63bde8'/>
<id>urn:sha1:679f002ce370e943a3911901cc3d101c6f63bde8</id>
<content type='text'>
commit 449052cfebf624b670faa040245d3feed770d22f upstream.

Assert HALT bit to enter freeze mode, there is a premise that FRZ bit is
asserted. This patch asserts FRZ bit in flexcan_chip_freeze, although
the reset value is 1b'1. This is a prepare patch, later patch will
invoke flexcan_chip_freeze() to enter freeze mode, which polling freeze
mode acknowledge.

Fixes: b1aa1c7a2165b ("can: flexcan: fix transition from and to freeze mode in chip_{,un}freeze")
Link: https://lore.kernel.org/r/20210218110037.16591-2-qiangqing.zhang@nxp.com
Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.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: flexcan: disable completely the ECC mechanism</title>
<updated>2019-11-12T18:16:10Z</updated>
<author>
<name>Joakim Zhang</name>
</author>
<published>2019-08-15T08:00:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6b15585bca178ec6faec6a076e4b133ee3a010d'/>
<id>urn:sha1:d6b15585bca178ec6faec6a076e4b133ee3a010d</id>
<content type='text'>
[ Upstream commit 5e269324db5adb2f5f6ec9a93a9c7b0672932b47 ]

The ECC (memory error detection and correction) mechanism can be
activated or not, controlled by the ECCDIS bit in CAN_MECR. When
disabled, updates on indications and reporting registers are stopped.
So if want to disable ECC completely, had better assert ECCDIS bit, not
just mask the related interrupts.

Fixes: cdce844865be ("can: flexcan: add vf610 support for FlexCAN")
Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.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: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>can: flexcan: fix timeout when set small bitrate</title>
<updated>2019-07-10T07:55:33Z</updated>
<author>
<name>Joakim Zhang</name>
</author>
<published>2019-01-31T09:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50b1c5b57e4bafdea996e45e814cb11f13aacbec'/>
<id>urn:sha1:50b1c5b57e4bafdea996e45e814cb11f13aacbec</id>
<content type='text'>
commit 247e5356a709eb49a0d95ff2a7f07dac05c8252c upstream.

Current we can meet timeout issue when setting a small bitrate like
10000 as follows on i.MX6UL EVK board (ipg clock = 66MHZ, per clock =
30MHZ):

| root@imx6ul7d:~# ip link set can0 up type can bitrate 10000

A link change request failed with some changes committed already.
Interface can0 may have been left with an inconsistent configuration,
please check.

| RTNETLINK answers: Connection timed out

It is caused by calling of flexcan_chip_unfreeze() timeout.

Originally the code is using usleep_range(10, 20) for unfreeze
operation, but the patch (8badd65 can: flexcan: avoid calling
usleep_range from interrupt context) changed it into udelay(10) which is
only a half delay of before, there're also some other delay changes.

After double to FLEXCAN_TIMEOUT_US to 100 can fix the issue.

Meanwhile, Rasmus Villemoes reported that even with a timeout of 100,
flexcan_probe() fails on the MPC8309, which requires a value of at least
140 to work reliably. 250 works for everyone.

Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.com&gt;
Reviewed-by: Dong Aisheng &lt;aisheng.dong@nxp.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: flex_can: Correct the checking for frame length in flexcan_start_xmit()</title>
<updated>2018-03-03T09:23:27Z</updated>
<author>
<name>Luu An Phu</name>
</author>
<published>2018-01-02T03:44:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9137deb6cf4829194c9a01b272a17ff3fd1ddfe8'/>
<id>urn:sha1:9137deb6cf4829194c9a01b272a17ff3fd1ddfe8</id>
<content type='text'>
[ Upstream commit 13454c14550065fcc1705d6bd4ee6d40e057099f ]

The flexcan_start_xmit() function compares the frame length with data
register length to write frame content into data[0] and data[1]
register. Data register length is 4 bytes and frame maximum length is 8
bytes.

Fix the check that compares frame length with 3. Because the register
length is 4.

Signed-off-by: Luu An Phu &lt;phu.luuan@nxp.com&gt;
Reviewed-by: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
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: flexcan: fix resume function</title>
<updated>2016-09-19T14:09:05Z</updated>
<author>
<name>Fabio Estevam</name>
</author>
<published>2016-08-17T15:41:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4de349e786a3a2d51bd02d56f3de151bbc3c3df9'/>
<id>urn:sha1:4de349e786a3a2d51bd02d56f3de151bbc3c3df9</id>
<content type='text'>
On a imx6ul-pico board the following error is seen during system suspend:

dpm_run_callback(): platform_pm_resume+0x0/0x54 returns -110
PM: Device 2090000.flexcan failed to resume: error -110

The reason for this suspend error is because when the CAN interface is not
active the clocks are disabled and then flexcan_chip_enable() will
always fail due to a timeout error.

In order to fix this issue, only call flexcan_chip_enable/disable()
when the CAN interface is active.

Based on a patch from Dong Aisheng in the NXP kernel.

Signed-off-by: Fabio Estevam &lt;fabio.estevam@nxp.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: fix assignment of error location in CAN error messages</title>
<updated>2015-11-23T08:37:34Z</updated>
<author>
<name>Oliver Hartkopp</name>
</author>
<published>2015-11-21T17:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffd461f80d536336811d573f197f3e6d9872d054'/>
<id>urn:sha1:ffd461f80d536336811d573f197f3e6d9872d054</id>
<content type='text'>
As Dan Carpenter reported in http://marc.info/?l=linux-can&amp;m=144793696016187
the assignment of the error location in CAN error messages had some bit wise
overlaps. Indeed the value to be assigned in data[3] is no bitfield but defines
a single value which points to a location inside the CAN frame on the wire.

This patch fixes the assignments for the error locations in error messages.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: flexcan: enable interrupts atomically at the end of flexcan_chip_start()</title>
<updated>2015-09-21T06:38:23Z</updated>
<author>
<name>Marc Kleine-Budde</name>
</author>
<published>2015-08-27T12:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fa7da249269a6146ce456c43098901c81c8afdf'/>
<id>urn:sha1:6fa7da249269a6146ce456c43098901c81c8afdf</id>
<content type='text'>
This patch defers the writing of the interrupts bits of the CTRL register order
to enables all interrupts atomically at the the of the flexcan_chip_start()
function.

Suggested-by: Torsten Lang &lt;torsten.lang@uweschneider.de&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: flexcan: give member of flexcan_priv holding mailboxes a sensible name</title>
<updated>2015-09-21T06:38:23Z</updated>
<author>
<name>Marc Kleine-Budde</name>
</author>
<published>2015-08-25T08:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1ba763d1d4bda61bfb9b8e5154e6cf39a3e2d0e6'/>
<id>urn:sha1:1ba763d1d4bda61bfb9b8e5154e6cf39a3e2d0e6</id>
<content type='text'>
This patch gives the member of flexcan_priv holding mailboxes a sensible name,
by renaming from "cantxfg" to "mb":

    struct flexcan_priv::cantxfg -&gt; struct flexcan_priv::mb

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
</feed>
