39df17a1 | 22-Nov-2024 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: f81604: f81604_handle_can_bus_errors(): fix {rx,tx}_errors statistics
[ Upstream commit d7b916540c2ba3d2a88c27b2a6287b39d8eac052 ]
The f81604_handle_can_bus_errors() function only incremented
can: f81604: f81604_handle_can_bus_errors(): fix {rx,tx}_errors statistics
[ Upstream commit d7b916540c2ba3d2a88c27b2a6287b39d8eac052 ]
The f81604_handle_can_bus_errors() function only incremented the receive error counter and never the transmit error counter, even if the ECC_DIR flag reported that an error had occurred during transmission.
Increment the receive/transmit error counter based on the value of the ECC_DIR flag.
Fixes: 88da17436973 ("can: usb: f81604: add Fintek F81604 support") Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://patch.msgid.link/20241122221650.633981-13-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
c7f3a539 | 22-Nov-2024 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: ems_usb: ems_usb_rx_err(): fix {rx,tx}_errors statistics
[ Upstream commit 72a7e2e74b3075959f05e622bae09b115957dffe ]
The ems_usb_rx_err() function only incremented the receive error counter a
can: ems_usb: ems_usb_rx_err(): fix {rx,tx}_errors statistics
[ Upstream commit 72a7e2e74b3075959f05e622bae09b115957dffe ]
The ems_usb_rx_err() function only incremented the receive error counter and never the transmit error counter, even if the ECC_DIR flag reported that an error had occurred during transmission.
Increment the receive/transmit error counter based on the value of the ECC_DIR flag.
Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface") Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://patch.msgid.link/20241122221650.633981-12-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
1cdd3563 | 18-Oct-2024 |
Alexander Kozhinov <ak.alexander.kozhinov@gmail.com> |
can: gs_usb: add usb endpoint address detection at driver probe step
[ Upstream commit 889b2ae9139a87b3390f7003cb1bb3d65bf90a26 ]
There is an approach made to implement gs_usb firmware/driver based
can: gs_usb: add usb endpoint address detection at driver probe step
[ Upstream commit 889b2ae9139a87b3390f7003cb1bb3d65bf90a26 ]
There is an approach made to implement gs_usb firmware/driver based on Zephyr RTOS. It was found that USB stack of Zephyr RTOS overwrites USB EP addresses, if they have different last 4 bytes in absence of other endpoints.
For example in case of gs_usb candlelight firmware EP-IN is 0x81 and EP-OUT 0x02. If there are no additional USB endpoints, Zephyr RTOS will overwrite EP-OUT to 0x01. More information can be found in the discussion with Zephyr RTOS USB stack maintainer here:
https://github.com/zephyrproject-rtos/zephyr/issues/67812
There are already two different gs_usb FW driver implementations based on Zephyr RTOS:
1. https://github.com/CANnectivity/cannectivity (by: https://github.com/henrikbrixandersen) 2. https://github.com/zephyrproject-rtos/zephyr/compare/main...KozhinovAlexander:zephyr:gs_usb (by: https://github.com/KozhinovAlexander)
At the moment both Zephyr RTOS implementations use dummy USB endpoint, to overcome described USB stack behavior from Zephyr itself. Since Zephyr RTOS is intended to be used on microcontrollers with very constrained amount of resources (ROM, RAM) and additional endpoint requires memory, it is more convenient to update the gs_usb driver in the Linux kernel.
To fix this problem, update the gs_usb driver from using hard coded endpoint numbers to evaluate the endpoint descriptors and use the endpoints provided there.
Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com> Link: https://patch.msgid.link/20241018212450.31746-1-ak.alexander.kozhinov@gmail.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
259f549c | 24-Sep-2023 |
Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
can: etas_es58x: add missing a blank line after declaration
[ Upstream commit 4f8005092cafc194ba6a8e5f39626ba0b9f08271 ]
Fix below checkpatch warning:
WARNING: Missing a blank line after declara
can: etas_es58x: add missing a blank line after declaration
[ Upstream commit 4f8005092cafc194ba6a8e5f39626ba0b9f08271 ]
Fix below checkpatch warning:
WARNING: Missing a blank line after declarations #2233: FILE: drivers/net/can/usb/etas_es58x/es58x_core.c:2233: + int ret = es58x_init_netdev(es58x_dev, ch_idx); + if (ret) {
Fixes: d8f26fd689dd ("can: etas_es58x: remove es58x_get_product_info()") Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20230924110914.183898-3-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
24bc41b4 | 02-Jun-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: convert to NAPI/rx-offload to avoid OoO reception
The driver used to pass received CAN frames/skbs to the network stack with netif_rx(). In netif_rx() the skbs are queued to the local C
can: gs_usb: convert to NAPI/rx-offload to avoid OoO reception
The driver used to pass received CAN frames/skbs to the network stack with netif_rx(). In netif_rx() the skbs are queued to the local CPU. If IRQs are handled in round robin, OoO packets may occur.
To avoid out-of-order reception convert the driver from netif_rx() to NAPI.
For USB devices with timestamping support use the rx-offload helper can_rx_offload_queue_timestamp() for the RX, and can_rx_offload_get_echo_skb_queue_timestamp() for the TX path. Devices without timestamping support use can_rx_offload_queue_tail() for RX, and can_rx_offload_get_echo_skb_queue_tail() for the TX path.
Link: https://lore.kernel.org/all/559D628C.5020100@hartkopp.net Link: https://github.com/candle-usb/candleLight_fw/issues/166 Link: https://lore.kernel.org/all/20230718-gs_usb-rx-offload-v2-3-716e542d14d5@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
d4cfb83d | 06-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_usb_disconnect(): remove not needed usb_kill_anchored_urbs()
In gs_usb_disconnect(), all channels are destroyed first, then all anchored RX URBs (parent->rx_submitted) are disposed w
can: gs_usb: gs_usb_disconnect(): remove not needed usb_kill_anchored_urbs()
In gs_usb_disconnect(), all channels are destroyed first, then all anchored RX URBs (parent->rx_submitted) are disposed with usb_kill_anchored_urbs().
The call to usb_kill_anchored_urbs() is not needed, as gs_destroy_candev() of the last active channel already disposes the RX URBS.
Remove not needed call to usb_kill_anchored_urbs() from gs_usb_disconnect().
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-11-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
5391e0cb | 06-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_destroy_candev(): remove not needed usb_kill_anchored_urbs()
In gs_destroy_candev(), the netdev is unregistered first, then all anchored TX URBs (dev->tx_submitted) are disposed with
can: gs_usb: gs_destroy_candev(): remove not needed usb_kill_anchored_urbs()
In gs_destroy_candev(), the netdev is unregistered first, then all anchored TX URBs (dev->tx_submitted) are disposed with usb_kill_anchored_urbs().
The call to usb_kill_anchored_urbs() is not needed, as unregister_candev() calls gs_can_close(), which already disposes the TX URBS.
Remove not needed call to usb_kill_anchored_urbs() from gs_destroy_candev().
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-10-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
5c6c313a | 08-Feb-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_can_close(): don't complain about failed device reset during ndo_stop
When the USB device is unplugged, gs_can_close() (which implements the struct net_device_ops::ndo_stop callback)
can: gs_usb: gs_can_close(): don't complain about failed device reset during ndo_stop
When the USB device is unplugged, gs_can_close() (which implements the struct net_device_ops::ndo_stop callback) is called. In this function an attempt is made to shut down the USB device with a USB control message. For disconnected devices this will fail and a warning message is printed.
Silence the driver by removing the printout of the error message if the reset command fails.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-9-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
1494ffe4 | 12-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_can_start_xmit(), gs_can_open(): clean up printouts in error path
Remove unnecessary "out of memory" message from the error path of gs_can_start_xmit() and gs_can_open().
Convert th
can: gs_usb: gs_can_start_xmit(), gs_can_open(): clean up printouts in error path
Remove unnecessary "out of memory" message from the error path of gs_can_start_xmit() and gs_can_open().
Convert the printout in case of a failing usb_submit_urb() in gs_can_open() from numbers to human readable error codes.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-8-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
6c8bc15f | 04-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_usb_receive_bulk_callback(): count RX overflow errors also in case of OOM
In case of an RX overflow error from the CAN controller and an OOM where no skb can be allocated, the error
can: gs_usb: gs_usb_receive_bulk_callback(): count RX overflow errors also in case of OOM
In case of an RX overflow error from the CAN controller and an OOM where no skb can be allocated, the error counters are not incremented.
Fix this by first incrementing the error counters and then allocate the skb.
Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-7-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
55ad95d9 | 03-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_usb_receive_bulk_callback(): make use of stats
Make use the previously assigned variable stats instead of using netdev->stats.
Link: https://lore.kernel.org/all/20230718-gs_usb-clea
can: gs_usb: gs_usb_receive_bulk_callback(): make use of stats
Make use the previously assigned variable stats instead of using netdev->stats.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-6-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
fcb880ef | 03-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_usb_receive_bulk_callback(): make use of netdev
Make use the previously assigned variable netdev instead of using dev->netdev.
Link: https://lore.kernel.org/all/20230718-gs_usb-clea
can: gs_usb: gs_usb_receive_bulk_callback(): make use of netdev
Make use the previously assigned variable netdev instead of using dev->netdev.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-5-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
b6980ad3 | 06-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: uniformly use "parent" as variable name for struct gs_usb
To ease readability and maintainability uniformly use the variable name "parent" for the struct gs_usb in the gs_usb driver.
L
can: gs_usb: uniformly use "parent" as variable name for struct gs_usb
To ease readability and maintainability uniformly use the variable name "parent" for the struct gs_usb in the gs_usb driver.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-4-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
a2002f45 | 06-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_usb_set_timestamp(): remove return statements form void function
Remove the return statements from void gs_usb_set_timestamp() function, as it's not generally useful.
Link: https://
can: gs_usb: gs_usb_set_timestamp(): remove return statements form void function
Remove the return statements from void gs_usb_set_timestamp() function, as it's not generally useful.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-3-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
5780148b | 06-Jul-2023 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: gs_usb: gs_usb_probe(): align block comment
Indent block comment so that it aligns the * on each line.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-2-c3b9154ec605@pengutronix.
can: gs_usb: gs_usb_probe(): align block comment
Indent block comment so that it aligns the * on each line.
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-2-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|