aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/can
AgeCommit message (Collapse)AuthorFilesLines
2014-11-18can: m_can: update to support CAN FD featuresDong Aisheng1-43/+134
Bosch M_CAN is CAN FD capable device. This patch implements the CAN FD features include up to 64 bytes payload and bitrate switch function. 1) Change the Rx FIFO and Tx Buffer to 64 bytes for support CAN FD up to 64 bytes payload. It's backward compatible with old 8 bytes normal CAN frame. 2) Allocate can frame or canfd frame based on EDL bit 3) Bitrate Switch function is disabled by default and will be enabled according to CANFD_BRS bit in cf->flags. Acked-by: Oliver Hartkopp <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: fix incorrect error messagesDong Aisheng1-3/+3
Fix a few error messages. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: add missing delay after setting CCCR_INIT bitDong Aisheng1-0/+1
The spec mentions there may be a delay until the value written to INIT can be read back due to the synchronization mechanism between the two clock domains. But it does not indicate the exact clock cycles needed. The 5us delay is a test value and seems ok. Without the delay, CCCR.CCE bit may fail to be set and then the initialization fail sometimes when do repeatly up and down. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: fix not set can_dlc for remote frameDong Aisheng1-3/+4
The original code missed to set the cf->can_dlc in the RTR case, so add it. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: fix possible sleep in napi pollDong Aisheng1-5/+15
The m_can_get_berr_counter function can sleep and it may be called in napi poll function. Rework it to fix the following warning. root@imx6qdlsolo:~# cangen can0 -f -L 12 -D 112233445566778899001122 [ 1846.017565] m_can 20e8000.can can0: entered error warning state [ 1846.023551] ------------[ cut here ]------------ [ 1846.028216] WARNING: CPU: 0 PID: 560 at kernel/locking/mutex.c:867 mutex_trylock+0x218/0x23c() [ 1846.036889] DEBUG_LOCKS_WARN_ON(in_interrupt()) [ 1846.041263] Modules linked in: [ 1846.044594] CPU: 0 PID: 560 Comm: cangen Not tainted 3.17.0-rc4-next-20140915-00010-g032d018-dirty #477 [ 1846.054033] Backtrace: [ 1846.056557] [<80012448>] (dump_backtrace) from [<80012728>] (show_stack+0x18/0x1c) [ 1846.064180] r6:809a07ec r5:809a07ec r4:00000000 r3:00000000 [ 1846.069966] [<80012710>] (show_stack) from [<806c9ee0>] (dump_stack+0x8c/0xa4) [ 1846.077264] [<806c9e54>] (dump_stack) from [<8002aa78>] (warn_slowpath_common+0x70/0x94) [ 1846.085403] r6:806cd1b0 r5:00000009 r4:be1d5c20 r3:be07b0c0 [ 1846.091204] [<8002aa08>] (warn_slowpath_common) from [<8002aad4>] (warn_slowpath_fmt+0x38/0x40) [ 1846.099951] r8:8119106c r7:80515aa4 r6:be027000 r5:00000001 r4:809d1df4 [ 1846.106830] [<8002aaa0>] (warn_slowpath_fmt) from [<806cd1b0>] (mutex_trylock+0x218/0x23c) [ 1846.115141] r3:80851c88 r2:8084fb74 [ 1846.118804] [<806ccf98>] (mutex_trylock) from [<80515aa4>] (clk_prepare_lock+0x14/0xf4) [ 1846.126859] r8:00000040 r7:be1d5cec r6:be027000 r5:be255800 r4:be027000 [ 1846.133737] [<80515a90>] (clk_prepare_lock) from [<80517660>] (clk_prepare+0x14/0x2c) [ 1846.141583] r5:be255800 r4:be027000 [ 1846.145272] [<8051764c>] (clk_prepare) from [<8041ff14>] (m_can_get_berr_counter+0x20/0xd4) [ 1846.153672] r4:be255800 r3:be07b0c0 [ 1846.157325] [<8041fef4>] (m_can_get_berr_counter) from [<80420428>] (m_can_poll+0x310/0x8fc) [ 1846.165809] r7:bd4dc540 r6:00000744 r5:11300000 r4:be255800 [ 1846.171590] [<80420118>] (m_can_poll) from [<8056a468>] (net_rx_action+0xcc/0x1b4) [ 1846.179204] r10:00000101 r9:be255ebc r8:00000040 r7:be7c3208 r6:8097c100 r5:be7c3200 [ 1846.187192] r4:0000012c [ 1846.189779] [<8056a39c>] (net_rx_action) from [<8002deec>] (__do_softirq+0xfc/0x2c4) [ 1846.197568] r10:00000101 r9:8097c088 r8:00000003 r7:8097c080 r6:40000001 r5:8097c08c [ 1846.205559] r4:00000020 [ 1846.208144] [<8002ddf0>] (__do_softirq) from [<8002e194>] (do_softirq+0x7c/0x88) [ 1846.215588] r10:00000000 r9:bd516a60 r8:be18ce00 r7:00000000 r6:be255800 r5:8056c0ec [ 1846.223578] r4:60000093 [ 1846.226163] [<8002e118>] (do_softirq) from [<8002e288>] (__local_bh_enable_ip+0xe8/0x10c) [ 1846.234386] r4:00000200 r3:be1d4000 [ 1846.238036] [<8002e1a0>] (__local_bh_enable_ip) from [<8056c108>] (__dev_queue_xmit+0x314/0x6b0) [ 1846.246868] r6:be255800 r5:bd516a00 r4:00000000 r3:be07b0c0 [ 1846.252645] [<8056bdf4>] (__dev_queue_xmit) from [<8056c4b8>] (dev_queue_xmit+0x14/0x18) Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: add missing message RAM initializationDong Aisheng1-1/+10
The M_CAN message RAM is usually equipped with a parity or ECC functionality. But RAM cells suffer a hardware reset and can therefore hold arbitrary content at startup - including parity and/or ECC bits. To prevent the M_CAN controller detecting checksum errors when reading potentially uninitialized TX message RAM content to transmit CAN frames the TX message RAM has to be written with (any kind of) initial data. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: add CONFIG_HAS_IOMEM dependenceDavid Cohen1-0/+1
m_can uses io memory which makes it not compilable on architectures without HAS_IOMEM such as UML: drivers/built-in.o: In function `m_can_plat_probe': m_can.c:(.text+0x218cc5): undefined reference to `devm_ioremap_resource' m_can.c:(.text+0x218df9): undefined reference to `devm_ioremap' Signed-off-by: David Cohen <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: m_can: add .ndo_change_mtu functionDong Aisheng1-0/+1
Use common can_change_mtu function. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: gs_usb: add .ndo_change_mtu functionMarc Kleine-Budde1-0/+1
Use common can_change_mtu function. Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: rcar_can: add .ndo_change_mtu functionMarc Kleine-Budde1-0/+1
Use common can_change_mtu function. Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: xilinx_can: add .ndo_change_mtu functionMarc Kleine-Budde1-0/+1
Use common can_change_mtu function. Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: xilinx_can: fix comparison of unsigned variableSudip Mukherjee1-1/+2
The variable err was of the type u32. It was being compared with < 0, and being an unsigned variable the comparison would have been always false. Moreover, err was getting the return value from set_reset_mode() and xcan_set_bittiming(), and both are returning int. Signed-off-by: Sudip Mukherjee <[email protected]> Reviewed-by: Michal Simek <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: remove unused variableSudip Mukherjee3-8/+2
these variable were only assigned some values, but then never reused again. so they are safe to be removed. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: esd_usb2: fix memory leak on disconnectAlexey Khoroshilov1-0/+1
It seems struct esd_usb2 dev is not deallocated on disconnect. The patch adds the missing deallocation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <[email protected]> Acked-by: Matthias Fuchs <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: dev: fix typo CIA -> CiA, CAN in AutomationRoman Fietze1-1/+1
This patch fixes a typo in CAN's dev.c: CIA -> CiA which stands for CAN in Automation. Signed-off-by: Roman Fietze <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-11-18can: dev: avoid calling kfree_skb() from interrupt contextThomas Körper1-1/+1
ikfree_skb() is Called in can_free_echo_skb(), which might be called from (TX Error) interrupt, which triggers the folloing warning: [ 1153.360705] ------------[ cut here ]------------ [ 1153.360715] WARNING: CPU: 0 PID: 31 at net/core/skbuff.c:563 skb_release_head_state+0xb9/0xd0() [ 1153.360772] Call Trace: [ 1153.360778] [<c167906f>] dump_stack+0x41/0x52 [ 1153.360782] [<c105bb7e>] warn_slowpath_common+0x7e/0xa0 [ 1153.360784] [<c158b909>] ? skb_release_head_state+0xb9/0xd0 [ 1153.360786] [<c158b909>] ? skb_release_head_state+0xb9/0xd0 [ 1153.360788] [<c105bc42>] warn_slowpath_null+0x22/0x30 [ 1153.360791] [<c158b909>] skb_release_head_state+0xb9/0xd0 [ 1153.360793] [<c158be90>] skb_release_all+0x10/0x30 [ 1153.360795] [<c158bf06>] kfree_skb+0x36/0x80 [ 1153.360799] [<f8486938>] ? can_free_echo_skb+0x28/0x40 [can_dev] [ 1153.360802] [<f8486938>] can_free_echo_skb+0x28/0x40 [can_dev] [ 1153.360805] [<f849a12c>] esd_pci402_interrupt+0x34c/0x57a [esd402] [ 1153.360809] [<c10a75b5>] handle_irq_event_percpu+0x35/0x180 [ 1153.360811] [<c10a7623>] ? handle_irq_event_percpu+0xa3/0x180 [ 1153.360813] [<c10a7731>] handle_irq_event+0x31/0x50 [ 1153.360816] [<c10a9c7f>] handle_fasteoi_irq+0x6f/0x120 [ 1153.360818] [<c10a9c10>] ? handle_edge_irq+0x110/0x110 [ 1153.360822] [<c1011b61>] handle_irq+0x71/0x90 [ 1153.360823] <IRQ> [<c168152c>] do_IRQ+0x3c/0xd0 [ 1153.360829] [<c1680b6c>] common_interrupt+0x2c/0x34 [ 1153.360834] [<c107d277>] ? finish_task_switch+0x47/0xf0 [ 1153.360836] [<c167c27b>] __schedule+0x35b/0x7e0 [ 1153.360839] [<c10a5334>] ? console_unlock+0x2c4/0x4d0 [ 1153.360842] [<c13df500>] ? n_tty_receive_buf_common+0x890/0x890 [ 1153.360845] [<c10707b6>] ? process_one_work+0x196/0x370 [ 1153.360847] [<c167c723>] schedule+0x23/0x60 [ 1153.360849] [<c1070de1>] worker_thread+0x161/0x460 [ 1153.360852] [<c1090fcf>] ? __wake_up_locked+0x1f/0x30 [ 1153.360854] [<c1070c80>] ? rescuer_thread+0x2f0/0x2f0 [ 1153.360856] [<c1074f01>] kthread+0xa1/0xc0 [ 1153.360859] [<c1680401>] ret_from_kernel_thread+0x21/0x30 [ 1153.360861] [<c1074e60>] ? kthread_create_on_node+0x110/0x110 [ 1153.360863] ---[ end trace 5ff83639cbb74b35 ]--- This patch replaces the kfree_skb() by dev_kfree_skb_any(). Signed-off-by: Thomas Körper <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-10-03drivers/net/can/Kconfig: Let CAN_AT91 depend on HAS_IOMEMChen Gang1-1/+1
CAN_AT91 needs HAS_IOMEM, so depends on it. The related error (with allmodconfig under um): CC [M] drivers/net/can/at91_can.o drivers/net/can/at91_can.c: In function ‘at91_can_probe’: drivers/net/can/at91_can.c:1329:2: error: implicit declaration of function ‘ioremap_nocache’ [-Werror=implicit-function-declaration] addr = ioremap_nocache(res->start, resource_size(res)); ^ drivers/net/can/at91_can.c:1329:7: warning: assignment makes pointer from integer without a cast [enabled by default] addr = ioremap_nocache(res->start, resource_size(res)); ^ drivers/net/can/at91_can.c:1384:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration] iounmap(addr); ^ Signed-off-by: Chen Gang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-09-23Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller4-16/+56
Conflicts: arch/mips/net/bpf_jit.c drivers/net/can/flexcan.c Both the flexcan and MIPS bpf_jit conflicts were cases of simple overlapping changes. Signed-off-by: David S. Miller <[email protected]>
2014-09-18can: at91_can: add missing prepare and unprepare of the clockDavid Dueck1-3/+5
In order to make the driver work with the common clock framework, this patch converts the clk_enable()/clk_disable() to clk_prepare_enable()/clk_disable_unprepare(). While there, add the missing error handling. Signed-off-by: David Dueck <[email protected]> Signed-off-by: Anthony Harivel <[email protected]> Acked-by: Boris Brezillon <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: flexcan: increase FLEXCAN_MCR_MAXMB() macro to 7 bitsMarc Kleine-Budde1-1/+1
This patch increases the mask in the FLEXCAN_MCR_MAXMB() to 7 bits as in the newer flexcan cores the MAXMB field is 7 bits wide. Reported-by: David Jander <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-completeMarc Kleine-Budde1-0/+3
After sending a RTR frame the TX mailbox becomes a RX_EMPTY mailbox. To avoid side effects when the RX-FIFO is full, this patch puts the TX mailbox into TX_INACTIVE mode in the transmission complete interrupt handler. This, of course, leaves a race window between the actual completion of the transmission and the handling of tx-complete interrupt. However this is the best we can do without busy polling the tx complete interrupt. Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: flexcan: implement workaround for errata ERR005829David Jander1-1/+15
This patch implements the workaround mentioned in ERR005829: ERR005829: FlexCAN: FlexCAN does not transmit a message that is enabled to be transmitted in a specific moment during the arbitration process. Workaround: The workaround consists of two extra steps after setting up a message for transmission: Step 8: Reserve the first valid mailbox as an inactive mailbox (CODE=0b1000). If RX FIFO is disabled, this mailbox must be message buffer 0. Otherwise, the first valid mailbox can be found using the "RX FIFO filters" table in the FlexCAN chapter of the chip reference manual. Step 9: Write twice INACTIVE code (0b1000) into the first valid mailbox. Signed-off-by: David Jander <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: flexcan: correctly initialize mailboxesDavid Jander1-0/+7
Apparently mailboxes may contain random data at startup, causing some of them being prepared for message reception. This causes overruns being missed or even confusing the IRQ check for trasmitted messages, increasing the transmit counter instead of the error counter. This patch initializes all mailboxes after the FIFO as RX_INACTIVE. Signed-off-by: David Jander <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: flexcan: mark TX mailbox as TX_INACTIVEMarc Kleine-Budde1-2/+13
This patch fixes the initialization of the TX mailbox. It is now correctly initialized as TX_INACTIVE not RX_EMPTY. Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: peak_pci: add PCI ID definition pcie card variantOliver Hartkopp1-1/+5
Add PCI ID definition for the single channel PCAN ExpressCard 34 adapter. Due to the subsystem id evaluation the correct number of channels (here 1) is created at initialization time. Tested including the LED functionality. Signed-off-by: Oliver Hartkopp <[email protected]> Acked-by: Stephane Grosjean <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-18can: c_can_platform: fix parameters of c_can_hw_raminit_ti()Roger Quadros1-2/+2
Pass the correct 'mask' and 'value' bits to c_can_hw_raminit_wait_ti(). They seem to have been swapped in the usage instances. Reported-by: Jay Schroeder <[email protected]> Signed-off-by: Roger Quadros <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-09-11can: flexcan: avoid calling usleep_range from interrupt contextDavid Jander1-5/+5
Apparently can_restart() runs from a (timer-) interrupt and can call flexcan_chip_[en|dis]able(), so avoid using usleep_range() Signed-off-by: David Jander <[email protected]> Cc: linux-stable <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-23Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller3-30/+43
Pulling to get some TIPC fixes that a net-next series depends upon. Signed-off-by: David S. Miller <[email protected]>
2014-08-21can: flexcan: handle state passive -> warning transitionSebastian Andrzej Siewior1-0/+7
Once the CAN-bus is open and a packet is sent, the controller switches into the PASSIVE state. Once the BUS is closed again it goes the back err-warning. The TX error counter goes 0 -> 0x80 -> 0x7f. This patch makes sure that the user learns about this state chang (CAN_STATE_ERROR_WARNING => CAN_STATE_ERROR_PASSIVE) Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Matthias Klein <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-21can: flexcan: Disable error interrupt when bus error reporting is disabledAlexander Stein1-0/+2
In case we don't have FLEXCAN_HAS_BROKEN_ERR_STATE and the user set CAN_CTRLMODE_BERR_REPORTING once it can not be unset again until reboot. So in case neither hardware nor user wants the error interrupt disable the bit. Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-21can: c_can: checking IS_ERR() instead of NULLDan Carpenter1-1/+1
devm_ioremap() returns NULL on error, not an ERR_PTR(). Fixes: 33cf75656923 ('can: c_can_platform: Fix raminit, use devm_ioremap() instead of devm_ioremap_resource()') Signed-off-by: Dan Carpenter <[email protected]> Cc: linux-stable <[email protected]> # >= v3.11 Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-21can: sja1000: Validate initialization state in start methodMirza Krak1-29/+33
When sja1000 is not compiled as module the SJA1000 chip is only initialized during device registration on kernel boot. Should the chip get a hardware reset there is no way to reinitialize it without re- booting the Linux kernel. This patch adds a check in sja1000_start if the chip is initialized, if not we initialize it. Signed-off-by: Mirza Krak <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: mcp251x: Use dmam_alloc_coherentHimangi Saraogi1-12/+4
This patch moves the data allocated using dma_alloc_coherent to the corresponding managed interface and does away with the calls to free the allocated memory in the probe and remove functions. Signed-off-by: Himangi Saraogi <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: dev: remove unused variable from can_calc_bittiming() functionLad, Prabhakar1-2/+1
this patch removes best_rate variable from can_calc_bittiming() function which was set but was never used. Signed-off-by: Lad, Prabhakar <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: rcar_can: add device tree supportSergei Shtylyov1-6/+22
Add support of the device tree probing for the Renesas R-Car CAN controllers. Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: rcar_can: support all input clocksSergei Shtylyov1-6/+36
When writing the driver, I didn't give enough attention to the possible sources of the CAN clock: although the value of the CLKR register was specified by the platform data, the driver only handled one case, that is CAN clock being sourced from the clkp1 clock, the same that clocks the whole CAN module. In order to fix that overlook, we'll have to handle the CAN clock separately from the peripheral clock (however, clkp1 will be specified for a CAN device only once)... Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: m_can: add Bosch M_CAN controller supportDong Aisheng5-0/+1214
The patch adds the basic CAN TX/RX function support for Bosch M_CAN controller. For TX, only one dedicated tx buffer is used for sending data. For RX, RXFIFO 0 is used for receiving data to avoid overflow. Rx FIFO 1 and Rx Buffers are not used currently, as well as Tx Event FIFO. Due to the message ram can be shared by multi m_can instances and the fifo element is configurable which is SoC dependant, the design is to parse the message ram related configuration data from device tree rather than hardcode define it in driver which can make the message ram sharing fully transparent to M_CAN controller driver, then we can gain better driver maintainability and future features upgrade. M_CAN also supports CANFD protocol features like data payload up to 64 bytes and bitrate switch at runtime, however, this patch still does not add the support for these features. Cc: Wolfgang Grandegger <[email protected]> Cc: Marc Kleine-Budde <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Oliver Hartkopp <[email protected]> Cc: Varka Bhadram <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Reviewed-by: Varka Bhadram <[email protected]> Signed-off-by: Fengguang Wu <[email protected]> [mkl: Squahed semicolon cleanup by Fengguang Wu] Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: flexcan: add vf610 support for FlexCANStefan Agner1-10/+71
Extend FlexCAN driver to support Vybrid. Vybrids variant of the IP has ECC support which is controlled through the memory error control register (MECR). There is also an errata which leads to false positive error detections (ID e5295). This patch disables the memory error detection completely. Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18can: flexcan: flexcan_get_berr_counter(): switch on clocks before accessing ↵Stefan Agner1-3/+27
ecr register The funcion flexcan_get_berr_counter() may be called from userspace even if the interface is down, this the clocks are disabled. This patch switches on the clocks before accessing the ecr register. Reported-by: Ashutosh Singh <[email protected]> Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-18net: can: use kbuild magic to inherit debug settingsWolfram Sang8-15/+1
No need to manually copy debug settings into subdir Makefiles. kbuild has a mechanism for inheriting, so let's use it. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-08-12PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine6-6/+7
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ - DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id i[] = z; // </smpl> [bhelgaas: add semantic patch] Signed-off-by: Benoit Taine <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-07-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-1/+2
Signed-off-by: David S. Miller <[email protected]>
2014-07-25can: c_can_platform: Fix raminit, use devm_ioremap() instead of ↵George Cherian1-1/+2
devm_ioremap_resource() The raminit register is shared register for both can0 and can1. Since commit: 32766ff net: can: Convert to use devm_ioremap_resource devm_ioremap_resource() is used to map raminit register. When using both interfaces the mapping for the can1 interface fails, leading to a non functional can interface. Signed-off-by: George Cherian <[email protected]> Signed-off-by: Mugunthan V N <[email protected]> Cc: linux-stable <[email protected]> # >= v3.11 Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-07-15Merge tag 'linux-can-next-for-3.17-20140715' of ↵David S. Miller2-41/+29
git://gitorious.org/linux-can/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2014-07-15 this is a pull request of 4 patches for net-next/master. Prabhakar Lad contributes a patch that converts the c_can driver to use the devm api. The remaining four patches by Nikita Edward Baruzdin improve the SJA1000 driver with loopback testing support and introduce a new testing mode presume ack, for successful transmission even if no ACK is received. ==================== Signed-off-by: David S. Miller <[email protected]>
2014-07-15net: set name_assign_type in alloc_netdev()Tom Gundersen2-2/+2
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert all users to pass NET_NAME_UNKNOWN. Coccinelle patch: @@ expression sizeof_priv, name, setup, txqs, rxqs, count; @@ ( -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs) | -alloc_netdev_mq(sizeof_priv, name, setup, count) +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count) | -alloc_netdev(sizeof_priv, name, setup) +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup) ) v9: move comments here from the wrong commit Signed-off-by: Tom Gundersen <[email protected]> Reviewed-by: David Herrmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-07-15can: sja1000: Add support for CAN_CTRLMODE_PRESUME_ACKNikita Edward Baruzdin1-4/+7
SJA1000 has a self test mode (STM) which does not require acknowledgement for the successful message transmission. In this mode a node test is possible without any other active node on the bus. This patch adds a possibility to set STM for SJA1000 controller through specifying the corresponding CAN_CTRLMODE_PRESUME_ACK netlink flag. Signed-off-by: Nikita Edward Baruzdin <[email protected]> Acked-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-07-15can: sja1000: Add support for CAN_CTRLMODE_LOOPBACKNikita Edward Baruzdin1-5/+13
This adds support for hardware loopback in SJA1000 by utilising its self reception request (SRR) feature. Upon SRR the message is transmitted and received simultaneously, meaning you can't have hardware loopback without actually sending a message to the CAN bus in case of SJA1000. Signed-off-by: Nikita Edward Baruzdin <[email protected]> Acked-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-07-15can: c_can: convert to use devm * apiLad, Prabhakar1-33/+10
This patch uses devm_* APIs as they are device managed and make code simpler. Signed-off-by: Lad, Prabhakar <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2014-06-16slcan: Port write_wakeup deadlock fix from slipTyler Hall1-10/+27
The commit "slip: Fix deadlock in write_wakeup" fixes a deadlock caused by a change made in both slcan and slip. This is a direct port of that fix. Signed-off-by: Tyler Hall <[email protected]> Cc: Oliver Hartkopp <[email protected]> Cc: Andre Naujoks <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2014-06-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-0/+3
Conflicts: include/net/inetpeer.h net/ipv6/output_core.c Changes in net were fixing bugs in code removed in net-next. Signed-off-by: David S. Miller <[email protected]>