An error occurred fetching the project authors.
- 07 Jun, 2019 2 commits
-
-
Fabio Estevam authored
Currently the following message is observed when the flexcan driver is probed: flexcan 2090000.flexcan: device registered (reg_base=(ptrval), irq=23) The reason for printing 'ptrval' is explained at Documentation/core-api/printk-formats.rst: "Pointers printed without a specifier extension (i.e unadorned %p) are hashed to prevent leaking information about the kernel memory layout. This has the added benefit of providing a unique identifier. On 64-bit machines the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it gathers enough entropy." Instead of passing %pK, which can print the correct address, simply remove the entire message as it is not really that useful. Signed-off-by:
Fabio Estevam <festevam@gmail.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Joakim Zhang authored
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 (8badd65e 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 <qiangqing.zhang@nxp.com> Reviewed-by:
Dong Aisheng <aisheng.dong@nxp.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 22 Jan, 2019 2 commits
-
-
Uwe Kleine-König authored
Commit cbffaf7a ("can: flexcan: Always use last mailbox for TX") introduced a loop letting i run up to (including) ARRAY_SIZE(regs->mb) and in the body accessed regs->mb[i] which is an out-of-bounds array access that then resulted in an access to an reserved register area. Later this was changed by commit 0517961c ("can: flexcan: Add provision for variable payload size") to iterate a bit differently but still runs one iteration too much resulting to call flexcan_get_mb(priv, priv->mb_count) which results in a WARN_ON and then a NULL pointer exception. This only affects devices compatible with "fsl,p1010-flexcan", "fsl,imx53-flexcan", "fsl,imx35-flexcan", "fsl,imx25-flexcan", "fsl,imx28-flexcan", so newer i.MX SoCs are not affected. Fixes: cbffaf7a ("can: flexcan: Always use last mailbox for TX") Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: linux-stable <stable@vger.kernel.org> # >= 4.20 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
YueHaibing authored
Fix a static code checker warning: drivers/net/can/flexcan.c:1435 flexcan_setup_stop_mode() warn: passing zero to 'PTR_ERR' Fixes: de3578c1 ("can: flexcan: add self wakeup support") Signed-off-by:
YueHaibing <yuehaibing@huawei.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 28 Nov, 2018 9 commits
-
-
Pankaj Bansal authored
The message buffer RAM area is not a contiguous 1KB area but 2 partitions of 512 bytes each. Till now, we used Message buffers with payload size 8 bytes, which translates to 32 MBs per partition and no spare space is left in any partition. However, in upcoming SOC LX2160A the message buffers can have payload size 64 bytes. This results in less than 32 MBs per partition and some empty area is left at the end of each partition.This empty area should not be accessed. Therefore, split the Message Buffer RAM area into two partitions. Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Pankaj Bansal authored
Till now the flexcan module supported 8 byte payload size as per CAN 2.0 specifications. But now upcoming flexcan module in NXP LX2160A SOC supports CAN FD protocol too. The Message buffers need to be configured to have payload size 64 bytes. Therefore, added provision in the driver for payload size to be 64 bytes. Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Pankaj Bansal authored
rx offload depends on number of message buffers, which in turn depends on messgae buffer size. with the upcoming LX2160A SOC the message buffer size can be configured to 72 bytes if it were to be used in CAN FD mode. The current mode in which the flexcan is being operated is known at the time of flexcan_open() but not at the time of flexcan_probe(). Therefore, move the rx_offload_add() from flexcan_probe() to flexcan_open(). correspondingly, move rx_offload_delete() from flexcan_remove() to flexcan_close(). Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Pankaj Bansal authored
Self reception disable bit needs to be cleared for loopback mode to work in flexcan. Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Aisheng Dong authored
If wakeup is enabled, enter stop mode, else enter disabled mode. Self wake can only work on stop mode. Starting from IMX6, the flexcan stop mode control bits is SoC specific, move it out of IP driver and parse it from devicetree. Signed-off-by:
Aisheng Dong <aisheng.dong@nxp.com> Signed-off-by:
Joakim Zhang <qiangqing.zhang@nxp.com> Reviewed-by:
Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
With the conversion of the flexcan driver to support both timestamp and FIFO mode the setup of the MCR register ("enable fifo") has been moved. This patch moves the comment too, in order to match the code again. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch fixes the following checkpatch warning: | Macro argument 'x' may be better as '(x)' to avoid precedence issues Fixes: cbffaf7a ("can: flexcan: Always use last mailbox for TX") Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The patch fixes the indention by replacing space by tabs, as noted by checkpatch: | ERROR: code indent should use tabs where possible | #980: FILE: drivers/net/can/flexcan.c:980: Fixes: da49a807 ("can: flexcan: implement error passive state quirk") Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch fixes the indentio nin flexcan_start_xmit() by alligning the code to the opening parenthesis. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 09 Nov, 2018 6 commits
-
-
Oleksij Rempel authored
Currently, in case of bus error, driver will generate error message and put in the tail of the message queue. To avoid confusions, this change should place the bus related messages in proper order. Signed-off-by:
Oleksij Rempel <o.rempel@pengutronix.de> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Oleksij Rempel authored
This function has nothing todo with error. Signed-off-by:
Oleksij Rempel <o.rempel@pengutronix.de> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Oleksij Rempel authored
Current flexcan driver will put TX-ECHO in regular unsorted way, in this case TX-ECHO can come after the response to the same TXed message. In some cases, for example for J1939 stack, things will break. This patch is using new rx-offload API to put the messages just in the right place. Signed-off-by:
Oleksij Rempel <o.rempel@pengutronix.de> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The previous patch changes the TX path to always use the last mailbox regardless of the used offload scheme (rx-fifo or timestamp based). This means members "tx_mb" and "tx_mb_idx" of the struct flexcan_priv don't depend on the offload scheme, so replace them by compile time constants. Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Alexander Stein authored
Essentially this patch moves the TX mailbox to position 63, regardless of timestamp based offloading or RX FIFO. So mainly the iflag register usage regarding TX has changed. The rest is consolidating RX FIFO and timestamp offloading as they now use both the same TX mailbox. The reason is a very annoying behavior regarding sending RTR frames when _not_ using RX FIFO: If a TX mailbox sent a RTR frame it becomes a RX mailbox. For that reason flexcan_irq disables the TX mailbox again. But if during the time the RTR was sent and the TX mailbox is disabled a new CAN frames is received, it is lost without notice. The reason is that so-called "Move-in" process starts from the lowest mailbox which happen to be a TX mailbox set to EMPTY. Steps to reproduce (I used an imx7d): 1. generate regular bursts of messages 2. send a RTR from flexcan with higher priority than burst messages every 1ms, e.g. cangen -I 0x100 -L 0 -g 1 -R can0 3. notice a lost message without notification after some seconds When running an iperf in parallel this problem is occurring even more frequently. Using filters is not possible as at least one single CAN-ID is allowed. Handling the TX MB during RX is also not possible as there is no race-free disable of RX MB. There is still a slight window when the described problem can occur. But for that all RX MB must be in use which is essentially next to an overrun. Still there will be no indication if it ever occurs. Signed-off-by:
Alexander Stein <alexander.stein@systec-electronic.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Pankaj Bansal authored
Unlock the MB irrespective of reception method being FIFO or timestamp based. It is optional but recommended to unlock Mailbox as soon as possible and make it available for reception. Reported-by:
Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 27 Jul, 2018 2 commits
-
-
Fabio Estevam authored
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by:
Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 08 May, 2018 1 commit
-
-
Uwe Kleine-König authored
In commit 88462d2a ("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 d50f4630 ("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: 88462d2a ("can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers.") Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by:
Gavin Schenk <g.schenk@eckelmann.de> Cc: linux-stable <stable@vger.kernel.org> # >= v4.16 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 04 Jan, 2018 1 commit
-
-
Luu An Phu authored
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 <phu.luuan@nxp.com> Reviewed-by:
Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 01 Dec, 2017 4 commits
-
-
Marc Kleine-Budde authored
Enable FLEXCAN_QUIRK_BROKEN_PERR_STATE for VF610 to report correct state transitions. Tested-by:
Mirza Krak <mirza.krak@gmail.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The flexcan IP cores used on MX25 and MX35 do not generate Error Passive IRQs. Update the IP core overview table in the driver accordingly. Suggested-by:
ZHU Yi (ST-FIR/ENG1-Zhu) <Yi.Zhu5@cn.bosch.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Pankaj Bansal authored
This patch adds platform specific details for NXP SOC LS1021A to the flexcan driver code. Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Signed-off-by:
Bhupesh Sharma <bhupesh.sharma@freescale.com> Reviewed-by:
Zhengxiong Jin <Jason.Jin@freescale.com> Reviewed-by:
Poonam Aggrwal <poonam.aggrwal@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Pankaj Bansal authored
The FlexCAN driver assumed that FlexCAN controller is big endian for powerpc architecture and little endian for other architectures. But this may not be the case. FlexCAN controller can be little or big endian on any architecture. For e.g. NXP LS1021A ARM based SOC has big endian FlexCAN controller. Therefore, the driver has been modified to add a provision for both types of controllers using an additional device tree property. On a "fsl,p1010-flexcan" device BE is default, on all other devices LE is. Big Endian controllers should have "big-endian" set in the device tree. check "Documentation/devicetree/bindings/net/can/fsl-flexcan.txt" for usage. This is the standard practice followed in linux. for more info check: Documentation/devicetree/bindings/common-properties.txt Signed-off-by:
Pankaj Bansal <pankaj.bansal@nxp.com> Signed-off-by:
Bhupesh Sharma <bhupesh.sharma@freescale.com> Signed-off-by:
Sakar Arora <Sakar.Arora@freescale.com> Reviewed-by:
Zhengxiong Jin <Jason.Jin@freescale.com> Reviewed-by:
Poonam Aggrwal <poonam.aggrwal@nxp.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 19 Oct, 2017 6 commits
-
-
ZHU Yi (ST-FIR/ENG1-Zhu) authored
Enable FLEXCAN_QUIRK_BROKEN_WERR_STATE and FLEXCAN_QUIRK_BROKEN_PERR_STATE for p1010 to report correct state transitions. Signed-off-by:
Zhu Yi <yi.zhu5@cn.bosch.com> Signed-off-by:
Mark Jonas <mark.jonas@de.bosch.com> Acked-by:
Wolfgang Grandegger <wg@grandegger.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
ZHU Yi (ST-FIR/ENG1-Zhu) authored
Enable FLEXCAN_QUIRK_BROKEN_PERR_STATE for i.MX28 to report correct state transitions, especially to error passive. Signed-off-by:
Wolfgang Grandegger <wg@grandegger.com> Signed-off-by:
Zhu Yi <yi.zhu5@cn.bosch.com> Signed-off-by:
Mark Jonas <mark.jonas@de.bosch.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
ZHU Yi (ST-FIR/ENG1-Zhu) authored
Enable FLEXCAN_QUIRK_BROKEN_PERR_STATE for i.MX6 to report correct state transitions. Signed-off-by:
Zhu Yi <yi.zhu5@cn.bosch.com> Signed-off-by:
Mark Jonas <mark.jonas@de.bosch.com> Acked-by:
Wolfgang Grandegger <wg@grandegger.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
ZHU Yi (ST-FIR/ENG1-Zhu) authored
Add FLEXCAN_QUIRK_BROKEN_PERR_STATE for better description of the missing error passive interrupt quirk. Error interrupt flooding may happen if the broken error state quirk fix is enabled. For example, in case there is singled out node on the bus and the node sends a frame, then error interrupt flooding happens and will not stop because the node cannot go to bus off. The flooding will stop after another node connected to the bus again. If high bitrate configured on the low end system, then the flooding may causes performance issue, hence, this patch mitigates this by: 1. disable error interrupt upon error passive state transition 2. re-enable error interrupt upon error warning state transition 3. disable/enable error interrupt upon error active state transition depends on FLEXCAN_QUIRK_BROKEN_WERR_STATE In this way, the driver is still able to report correct state transitions without additional latency. When there are bus problems, flooding of error interrupts is limited to the number of frames required to change state from error warning to error passive if the core has [TR]WRN_INT connected (FLEXCAN_QUIRK_BROKEN_WERR_STATE is not enabled), otherwise, the flooding is limited to the number of frames required to change state from error active to error passive. Signed-off-by:
Zhu Yi <yi.zhu5@cn.bosch.com> Signed-off-by:
Mark Jonas <mark.jonas@de.bosch.com> Acked-by:
Wolfgang Grandegger <wg@grandegger.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
ZHU Yi (ST-FIR/ENG1-Zhu) authored
Rename FLEXCAN_QUIRK_BROKEN_ERR_STATE to FLEXCAN_QUIRK_BROKEN_WERR_STATE for better description of the missing [TR]WRN_INT quirk. Signed-off-by:
Zhu Yi <yi.zhu5@cn.bosch.com> Signed-off-by:
Mark Jonas <mark.jonas@de.bosch.com> Acked-by:
Wolfgang Grandegger <wg@grandegger.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
ZHU Yi (ST-FIR/ENG1-Zhu) authored
Update state upon any interrupt to report correct state transitions in case the flexcan core enabled the broken error state quirk fix. Signed-off-by:
Zhu Yi <yi.zhu5@cn.bosch.com> Signed-off-by:
Mark Jonas <mark.jonas@de.bosch.com> Acked-by:
Wolfgang Grandegger <wg@grandegger.com> Cc: linux-stable <stable@vger.kernel.org> # >= v4.11 Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 03 Mar, 2017 1 commit
-
-
Marc Kleine-Budde authored
This patch fixes the typo "Disble" -> "Disable". Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
- 06 Feb, 2017 6 commits
-
-
Marc Kleine-Budde authored
This patch switches the imx6 and vf610 based SoCs from the hardware FIFO to the timestamp based rx offloading. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
The flexcan IP core has 64 mailboxes. For now they are configured for RX as a hardware FIFO. This FIFO has a fixed depth of 6 CAN frames. In some high load scenarios it turns out thas this buffer is too small. In order to have a buffer larger than the 6 frames FIFO, this patch adds support for timestamp based offloading via the generic rx-offload infrastructure. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
In order to receive RTR frames in the non HW FIFO mode the RSS and EACEN bits of the reg_ctrl2 have to be activated. As this has no side effect in the FIFO mode, we do this unconditionally on cores with the reg_ctrl2. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
Modern flexcan IP cores support two RX modes. One is using the 6 fames deep hardware FIFO, the other is using up to 64 mailboxes (in non FIFO mode). For now only the HW FIFO mode is activated. In order to make use of the RX mailboxes the individual RX masking feature has to be activated, otherwise matching mailboxes are overwritten during the reception process. This however switches on the individual RX masking, which uses reg_rximr registers for masking. This patch activates the individual RX masking feature unconditionally and initializes the mask registers (reg_rximr) with 0x0 == "don't care", which switches off any filtering. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch converts the flexcan driver to make use of the rx-offload can_rx_offload_irq_offload_fifo() helper function. The idea is to read the CAN frames already in the interrupt context, as the depth of the flexcan HW FIFO is too shallow, resulting in too many missed frames. During a normal NAPI poll the frames are the pushed into the upper layers. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Marc Kleine-Budde authored
This patch makes the TX mailbox selectable duing runtime. This is a preparation patch to use of the hardware FIFO selectable via runtime. As the TX mailbox number is different in HW FIFO and normal mode. Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-