aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/can
AgeCommit message (Collapse)AuthorFilesLines
2020-09-22can: flexcan: quirks: get rid of long linesMarc Kleine-Budde1-8/+17
This patch reformats the quirks to get rid of long lines. Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-22can: flexcan: struct flexcan_regs: document registers not affected by soft resetMarc Kleine-Budde1-11/+11
This patch documents which registers are not affected by a soft reset of the flexcan IP core. Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-22can: flexcan: more register namesMarc Kleine-Budde1-2/+12
This patch adds some new register names and tries to ensure with a static_assert that the documented offset is correct. Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-22can: flexcan: flexcan_exit_stop_mode(): remove stray empty lineMarc Kleine-Budde1-1/+0
This patch removes a stray empty line from the flexcan_exit_stop_mode() function. Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-22can: flexcan: sort include files alphabeticallyMarc Kleine-Budde1-2/+2
This patch sorts the include files alphabetically. Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-21can: mcp25xxfd: add listen-only modeKurt Van Dijck1-6/+10
This commit enables listen-only mode, which works internally like CANFD mode. Signed-off-by: Kurt Van Dijck <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-21can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CANMarc Kleine-Budde2-0/+2908
This patch adds support for the Microchip MCP25xxFD SPI CAN controller family. Tested-by: Kurt Van Dijck <[email protected]> Tested-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-21can: mcp25xxfd: add regmap infrastructureMarc Kleine-Budde7-0/+1507
This patch adds the regmap infrastructure for the Microchip MCP25xxFD SPI CAN controller family. The actual driver is added in the next commit. Tested-by: Kurt Van Dijck <[email protected]> Tested-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-09-21can: rx-offload: can_rx_offload_add_manual(): add new initialization functionMarc Kleine-Budde1-0/+11
This patch adds a new initialization function: can_rx_offload_add_manual() It should be used to add support rx-offload to a driver, if the callback mechanism should not be used. Use e.g. can_rx_offload_queue_sorted() to queue skbs into rx-offload. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mscan: simplify clock enable/disableZhang Changzhong1-18/+10
All the NULL checks are pointless, clk_*() routines already deal with NULL just fine. Signed-off-by: Zhang Changzhong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mscan: mpc5xxx_can: update contact emailWolfram Sang1-1/+1
The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mcp251x: add support for half duplex controllersTim Harvey1-7/+27
Some SPI host controllers do not support full-duplex SPI and are marked as such via the SPI_CONTROLLER_HALF_DUPLEX controller flag. For such controllers use half duplex transactions but retain full duplex transactions for the controllers that can handle those. Signed-off-by: Tim Harvey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mcp251x: Use readx_poll_timeout() helperAndy Shevchenko1-31/+33
We may use special helper macro to poll IO till condition or timeout occurs. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mcp251x: add GPIO supportTimo Schlüßler1-0/+243
The mcp251x variants feature 3 general purpose digital inputs and 2 outputs. With this patch they are accessible through the gpio framework. Signed-off-by: Timo Schlüßler <[email protected]> Tested-by: Timo Schlüßler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mcp251x: sort include files alphabeticallyMarc Kleine-Budde1-2/+2
This patch sorts the include files alphabetically. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: spi: Kconfig: remove unneeded dependencies form Kconfig symbolsMarc Kleine-Budde1-2/+0
Since commits 653ee35ce6d5 ("can: hi311x: remove custom DMA mapped buffer") Fixes: df58525df395 ("can: mcp251x: remove custom DMA mapped buffer") both the hi3111x and the mcp251x driver don't make use of the DMA API any more. So we can safely remove the HAS_DMA dependency. While we're here, remove the unneeded CAN_DEV and SPI dependencies from the CAN_HI311X symbol, as the parent menus already have these dependencies. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: pcan_usb: add support of rxerr/txerr countersStephane Grosjean1-16/+117
This patch adds the support of the rx/tx errors CAN counters to the driver of the PCAN-USB PC-CAN interface from PEAK-System GmbH. The PCAN-USB is capable of giving back the values of the rx/tx errors counters, to provide more details and statistics to the linux-can layer. Getting these values allows the driver to better tune CAN_ERR_CRTL_TX_xxx and CAN_ERR_CRTL_RX_xxx bits in case of the interface enters any CAN_STATE_ERROR_xxx state. Signed-off-by: Stephane Grosjean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: pcan_usb: Document the commands sent to the deviceStephane Grosjean1-7/+26
This patch documents the functions and numbers of the commands sent by the driver to the PCAN-USB CAN device from PEAK-System GmbH. Signed-off-by: Stephane Grosjean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: pch_can: use generic power managementVaibhav Gupta1-42/+21
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unnecessary load from the driver. This also avoids the need for the driver to directly call most of the PCI helper functions and device power state control functions, as through the generic framework PCI Core takes care of the necessary operations, and drivers are required to do only device-specific jobs. Signed-off-by: Vaibhav Gupta <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: peak_canfd: Remove unused macrosWang Hai1-2/+0
CANFD_CLK_SEL_DIV_MASK and CANFD_OPTIONS_SET are never used after they were introduced. Remove them. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wang Hai <[email protected]> Link: https://lore.kernel.org/r/[email protected] [mkl: keep CANFD_CLK_SEL_DIV_MASK for documentation purpose] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: peak_usb: convert to use le32_add_cpu()Liu Shixin1-1/+1
Convert cpu_to_le32(le32_to_cpu(E1) + E2) to use le32_add_cpu(). Signed-off-by: Liu Shixin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: ti_hecc: convert to devm_platform_ioremap_resource_byname()Dejin Zheng1-22/+5
Use the function devm_platform_ioremap_resource_byname() to simplify source code which calls the functions platform_get_resource_byname() and devm_ioremap_resource(). Remove also a few error messages which became unnecessary with this software refactoring. Signed-off-by: Dejin Zheng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mscan: mark expected switch fall-throughMarc Kleine-Budde1-0/+1
As -Wimplicit-fallthrough is now enabled the mscan driver shows this warning, which is fixed by this patch: drivers/net/can/mscan/mscan.c: In function ‘mscan_start_xmit’: drivers/net/can/mscan/mscan.c:211:3: warning: this statement may fall through [-Wimplicit-fallthrough=] 211 | netif_stop_queue(dev); | ^~~~~~~~~~~~~~~~~~~~~ drivers/net/can/mscan/mscan.c:212:2: note: here 212 | case 2: | ^~~~ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: mcba_usb: remove redundant initialization of variable errColin Ian King1-1/+1
The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: c_can: Remove unused inline functionYueHaibing1-9/+0
commit 524369e2391f ("can: c_can: remove obsolete STRICT_FRAME_ORDERING Kconfig option") left behind this, remove it. Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: dev: can_bus_off(): print scheduling of restart if activatedMarc Kleine-Budde1-1/+5
If a CAN device goes into bus-off and has automatic restart enabled, inform user that a automatic restart is scheduled after the configured delay. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: dev: can_change_state(): print human readable state change messagesMarc Kleine-Budde1-1/+25
In order to ease debugging let can_change_state() print the human readable state change messages. Also print the old and new state. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: dev: can_put_echo_skb(): propagate error in case of errorsMarc Kleine-Budde1-4/+7
The function can_put_echo_skb() can fail for several reasons. It may fail due to OOM, but when it fails it's usually due to locking problems in the driver. In order to help developing and debugging of new drivers propagate error value in case of errors. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: dev: can_put_echo_skb(): print number of echo_skb that is occupiedMarc Kleine-Budde1-1/+1
This patch prints the number of the occupied echo_skb, to ease implementing and debugging of new drivers. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: softing: update dead linkDiego Elio Pettenò1-1/+1
BerliOS has not been operating for more than five years. linux-can moved to GitHub. Signed-off-by: Diego Elio Pettenò <[email protected]> Link: https://lore.kernel.org/r/[email protected] [mkl: split into two patches - handle softing part here] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: slcan: update dead linkDiego Elio Pettenò1-2/+2
BerliOS has not been operating for more than five years. linux-can moved to GitHub. Signed-off-by: Diego Elio Pettenò <[email protected]> Link: https://lore.kernel.org/r/[email protected] [mkl: split into two patches - handle slcan part here] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: drivers: fix spelling mistakesMarc Kleine-Budde21-36/+36
This patch fixes spelling erros found by "codespell" in the drivers/net/can subtree. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: flexcan: fix spelling mistake "reserverd" -> "reserved"Alexandre Belloni1-1/+1
Fix a mistake in a register layout description. Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-09-21can: grcan: fix spelling mistake "buss" -> "bus"Colin Ian King1-1/+1
There is a spelling mistake in a netdev_err error message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-08-23treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva8-11/+11
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <[email protected]>
2020-07-16treewide: Remove uninitialized_var() usageKees Cook1-1/+1
Using uninitialized_var() is dangerous as it papers over real bugs[1] (or can in the future), and suppresses unrelated compiler warnings (e.g. "unused variable"). If the compiler thinks it is uninitialized, either simply initialize the variable or make compiler changes. In preparation for removing[2] the[3] macro[4], remove all remaining needless uses with the following script: git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \ xargs perl -pi -e \ 's/\buninitialized_var\(([^\)]+)\)/\1/g; s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;' drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid pathological white-space. No outstanding warnings were found building allmodconfig with GCC 9.3.0 for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64, alpha, and m68k. [1] https://lore.kernel.org/lkml/[email protected]/ [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/ [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/ [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ Reviewed-by: Leon Romanovsky <[email protected]> # drivers/infiniband and mlx4/mlx5 Acked-by: Jason Gunthorpe <[email protected]> # IB Acked-by: Kalle Valo <[email protected]> # wireless drivers Reviewed-by: Chao Yu <[email protected]> # erofs Signed-off-by: Kees Cook <[email protected]>
2020-06-15can: peak_canfd: Replace zero-length array with flexible-arrayGustavo A. R. Silva1-2/+2
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21 Signed-off-by: Gustavo A. R. Silva <[email protected]>
2020-06-14treewide: replace '---help---' in Kconfig files with 'help'Masahiro Yamada12-49/+49
Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over '---help---'"), the number of '---help---' has been gradually decreasing, but there are still more than 2400 instances. This commit finishes the conversion. While I touched the lines, I also fixed the indentation. There are a variety of indentation styles found. a) 4 spaces + '---help---' b) 7 spaces + '---help---' c) 8 spaces + '---help---' d) 1 space + 1 tab + '---help---' e) 1 tab + '---help---' (correct indentation) f) 1 tab + 1 space + '---help---' g) 1 tab + 2 spaces + '---help---' In order to convert all of them to 1 tab + 'help', I ran the following commend: $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/' Signed-off-by: Masahiro Yamada <[email protected]>
2020-05-23net: Fix return value about devm_platform_ioremap_resource()Tiezhu Yang2-2/+5
When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-04-01slcan: Don't transmit uninitialized stack data in paddingRichard Palethorpe1-3/+1
struct can_frame contains some padding which is not explicitly zeroed in slc_bump. This uninitialized data will then be transmitted if the stack initialization hardening feature is not enabled (CONFIG_INIT_STACK_ALL). This commit just zeroes the whole struct including the padding. Signed-off-by: Richard Palethorpe <[email protected]> Fixes: a1044e36e457 ("can: add slcan driver for serial/USB-serial CAN adapters") Reviewed-by: Kees Cook <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Marc Kleine-Budde <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-03-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller1-0/+3
Overlapping header include additions in macsec.c A bug fix in 'net' overlapping with the removal of 'version' string in ena_netdev.c Overlapping test additions in selftests Makefile Overlapping PCI ID table adjustments in iwlwifi driver. Signed-off-by: David S. Miller <[email protected]>
2020-03-21slcan: not call free_netdev before rtnl_unlock in slcan_openOliver Hartkopp1-0/+3
As the description before netdev_run_todo, we cannot call free_netdev before rtnl_unlock, fix it by reorder the code. This patch is a 1:1 copy of upstream slip.c commit f596c87005f7 ("slip: not call free_netdev before rtnl_unlock in slip_open"). Reported-by: yangerkun <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-03-12Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller1-0/+1
Minor overlapping changes, nothing serious. Signed-off-by: David S. Miller <[email protected]>
2020-03-11net: slcan, slip -- no need for goto when if () will doPavel Machek1-5/+2
No need to play with gotos to jump over single statement. Signed-off-by: Pavel Machek <[email protected]> Acked-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-03-03can: add missing attribute validation for terminationJakub Kicinski1-0/+1
Add missing attribute validation for IFLA_CAN_TERMINATION to the netlink policy. Fixes: 12a6075cabc0 ("can: dev: add CAN interface termination API") Signed-off-by: Jakub Kicinski <[email protected]> Acked-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-01-27Merge tag 'ioremap-5.6' of git://git.infradead.org/users/hch/ioremapLinus Torvalds5-5/+5
Pull ioremap updates from Christoph Hellwig: "Remove the ioremap_nocache API (plus wrappers) that are always identical to ioremap" * tag 'ioremap-5.6' of git://git.infradead.org/users/hch/ioremap: remove ioremap_nocache and devm_ioremap_nocache MIPS: define ioremap_nocache to ioremap
2020-01-22can, slip: Protect tty->disc_data in write_wakeup and close with RCURichard Palethorpe1-2/+10
write_wakeup can happen in parallel with close/hangup where tty->disc_data is set to NULL and the netdevice is freed thus also freeing disc_data. write_wakeup accesses disc_data so we must prevent close from freeing the netdev while write_wakeup has a non-NULL view of tty->disc_data. We also need to make sure that accesses to disc_data are atomic. Which can all be done with RCU. This problem was found by Syzkaller on SLCAN, but the same issue is reproducible with the SLIP line discipline using an LTP test based on the Syzkaller reproducer. A fix which didn't use RCU was posted by Hillf Danton. Fixes: 661f7fda21b1 ("slip: Fix deadlock in write_wakeup") Fixes: a8e83b17536a ("slcan: Port write_wakeup deadlock fix from slip") Reported-by: [email protected] Signed-off-by: Richard Palethorpe <[email protected]> Cc: Wolfgang Grandegger <[email protected]> Cc: Marc Kleine-Budde <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Tyler Hall <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2020-01-06remove ioremap_nocache and devm_ioremap_nocacheChristoph Hellwig5-5/+5
ioremap has provided non-cached semantics by default since the Linux 2.6 days, so remove the additional ioremap_nocache interface. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2020-01-02can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling ↵Florian Faber1-11/+10
to irq mode Under load, the RX side of the mscan driver can get stuck while TX still works. Restarting the interface locks up the system. This behaviour could be reproduced reliably on a MPC5121e based system. The patch fixes the return value of the NAPI polling function (should be the number of processed packets, not constant 1) and the condition under which IRQs are enabled again after polling is finished. With this patch, no more lockups were observed over a test period of ten days. Fixes: afa17a500a36 ("net/can: add driver for mscan family & mpc52xx_mscan") Signed-off-by: Florian Faber <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-01-02can: gs_usb: gs_usb_probe(): use descriptors of current altsettingJohan Hovold1-2/+2
Make sure to always use the descriptors of the current alternate setting to avoid future issues when accessing fields that may differ between settings. Signed-off-by: Johan Hovold <[email protected]> Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Signed-off-by: Marc Kleine-Budde <[email protected]>