30 Sep, 2013
1 commit
-
In the flexcan_chip_start() function first the flexcan core is going through
the soft reset sequence, then the RX FIFO is enabled.With the hardware is put into FIFO mode, message buffers 1...7 are reserved by
the FIFO engine. The remaining message buffers are in reset default values.
This patch removes the bogus initialization of the message buffers, as it
causes an imprecise external abort on imx6.Cc: linux-stable
Reported-by: Lothar Waßmann
Tested-by: Lothar Waßmann
Signed-off-by: Marc Kleine-Budde
27 Sep, 2013
1 commit
21 Sep, 2013
3 commits
-
The old implementation was heavy on str* functions and sprintf calls.
This version is more manual, but faster.Profiling just the printing of a 3 char CAN-id resulted in 60 instructions
for the manual method and over 2000 for the sprintf method. Bear in
mind the profiling was done against libc and not the kernel sprintf.Together with this rewrite an issue with sending and receiving of RTR frames
has been fixed by Oliver for the cases that the DLC is not zero.Signed-off-by: Andre Naujoks
Tested-by: Oliver Hartkopp
Acked-by: Oliver Hartkopp
Acked-by: Marc Kleine-Budde
Signed-off-by: David S. Miller -
The locking is needed, since the the internal buffer for the CAN frames is
changed during the wakeup call. This could cause buffer inconsistencies
under high loads, especially for the outgoing short CAN packet skbuffs.The needed locks led to deadlocks before commit
"5ede52538ee2b2202d9dff5b06c33bfde421e6e4 tty: Remove extra wakeup from pty
write() path", which removed the direct callback to the wakeup function from the
tty layer.As slcan.c is based on slip.c the issue in the original code is fixed, too.
Signed-off-by: Andre Naujoks
Acked-by: Oliver Hartkopp
Acked-by: Marc Kleine-Budde
Signed-off-by: David S. Miller -
Tx and rx urbs are not deallocated if something goes wrong in peak_usb_start().
The patch fixes error handling to deallocate all the resources.Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov
Acked-by: Stephane Grosjean
Signed-off-by: Marc Kleine-Budde
30 Aug, 2013
2 commits
-
the .get_clock() callback is run from probe() and might allocate
resources, introduce a .put_clock() callback that is run from remove()
to undo any allocation activitiesprepare and enable the clocks in open(), disable and unprepare the
clocks in close() if clocks were acquired during probe(), to not assume
knowledge about which activities are done in probe() and remove()use devm_get_clk() to lookup the SYS and REF clocks, to have the clocks
put upon device shutdownstore pointers to data structures upon successful allocation already
instead of deferral until complete setup, such that subroutines in the
setup sequence may access those data structures as well to track their
resource acquisitionsince clock allocation remains optional, the release callback as well as
the enable/disable calls in open/close are optional as wellCc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Gerhard Sittig
Signed-off-by: Anatolij Gustschin
Signed-off-by: Marc Kleine-Budde -
add a comment about the magic of deriving an MSCAN component index
from the peripheral's physical address / register offsetCc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Gerhard Sittig
Signed-off-by: Anatolij Gustschin
Signed-off-by: Marc Kleine-Budde
22 Aug, 2013
3 commits
-
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_set_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.Signed-off-by: Libo Chen
Signed-off-by: Marc Kleine-Budde -
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_set_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.Signed-off-by: Libo Chen
Signed-off-by: Marc Kleine-Budde -
This patch adds a type cast from 'unsigned int' to 'int'.
'priv->instance' may less than zero, so need a type cast, the related
warnings (allmodconfig, "EXTRA_CFLAGS=-W"):drivers/net/can/c_can/c_can_platform.c:198:3: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Signed-off-by: Chen Gang
Signed-off-by: Marc Kleine-Budde
21 Aug, 2013
3 commits
-
Patch allow to use different mode settings for SPI (MODE3 for example)
and limit maximal speed according to IC datasheet.Signed-off-by: Alexander Shiyan
Signed-off-by: Marc Kleine-Budde -
Flags is not used by boards, so remove this field from the driver
platform_data.Signed-off-by: Alexander Shiyan
Signed-off-by: Marc Kleine-Budde -
This patch replaces power callbacks to the regulator API. To improve
the readability of the code, helper for the regulator enable/disable
was added.Acked-by: Haojian Zhuang
Signed-off-by: Alexander Shiyan
Signed-off-by: Marc Kleine-Budde
17 Aug, 2013
1 commit
12 Aug, 2013
1 commit
-
Fix possibly wrong memcpy() bytes length since some CAN records received from
PCAN-USB could define a DLC field in range [9..15].
In that case, the real DLC value MUST be used to move forward the record pointer
but, only 8 bytes max. MUST be copied into the data field of the struct
can_frame object of the skb given to the network core.Cc: linux-stable
Signed-off-by: Stephane Grosjean
Signed-off-by: Marc Kleine-Budde
Signed-off-by: David S. Miller
04 Aug, 2013
1 commit
-
Merge net into net-next to setup some infrastructure Eric
Dumazet needs for usbnet changes.Signed-off-by: David S. Miller
01 Aug, 2013
2 commits
-
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.Signed-off-by: Fabio Estevam
Signed-off-by: Marc Kleine-Budde -
Using devm_ioremap_resource() can make the code simpler and smaller.
Also, place alloc_candev() after of_match_device() to make error handling
easier.Signed-off-by: Fabio Estevam
Signed-off-by: Marc Kleine-Budde
19 Jul, 2013
2 commits
-
If usb_8dev_start() fails to submit urb,
it unanchors the urb but forgets to free it.Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov
Signed-off-by: Marc Kleine-Budde -
The esd_usb2_read_bulk_callback() function is parsing the data that comes from
the USB CAN adapter. One datum is used as an index to access the dev->nets[]
array. This patch adds the missing bounds checking.Acked-by: Matthias Fuchs
Signed-off-by: Maximilian Schneider
Signed-off-by: Marc Kleine-Budde
12 Jul, 2013
1 commit
-
Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for setting the default pins. Compile tested only.Acked-by: Linus Walleij (personally at LCE13)
Signed-off-by: Wolfram Sang
Acked-by: Marc Kleine-Budde
Signed-off-by: David S. Miller
27 Jun, 2013
2 commits
-
of_match_ptr() eliminates having an #ifdef returning NULL for the case
when OF is disabled.Signed-off-by: Sachin Kamat
Signed-off-by: Marc Kleine-Budde -
Instead of using a GPIO to turn on/off the CAN transceiver, it is better to
use a regulator as some systems may use a PMIC to power the CAN transceiver.Acked-by: Shawn Guo
Signed-off-by: Fabio Estevam
Signed-off-by: Marc Kleine-Budde
20 Jun, 2013
1 commit
-
Conflicts:
drivers/net/wireless/ath/ath9k/Kconfig
drivers/net/xen-netback/netback.c
net/batman-adv/bat_iv_ogm.c
net/wireless/nl80211.cThe ath9k Kconfig conflict was a change of a Kconfig option name right
next to the deletion of another option.The xen-netback conflict was overlapping changes involving the
handling of the notify list in xen_netbk_rx_action().Batman conflict resolution provided by Antonio Quartulli, basically
keep everything in both conflict hunks.The nl80211 conflict is a little more involved. In 'net' we added a
dynamic memory allocation to nl80211_dump_wiphy() to fix a race that
Linus reported. Meanwhile in 'net-next' the handlers were converted
to use pre and post doit handlers which use a flag to determine
whether to hold the RTNL mutex around the operation.However, the dump handlers to not use this logic. Instead they have
to explicitly do the locking. There were apparent bugs in the
conversion of nl80211_dump_wiphy() in that we were not dropping the
RTNL mutex in all the return paths, and it seems we very much should
be doing so. So I fixed that whilst handling the overlapping changes.To simplify the initial returns, I take the RTNL mutex after we try
to allocate 'tb'.Signed-off-by: David S. Miller
19 Jun, 2013
1 commit
-
The usb_8dev hardware has problems on some xhci USB hosts. The driver fails to
read the firmware revision in the probe function. This leads to the following
Oops:[ 3356.635912] kernel BUG at net/core/dev.c:5701!
The driver tries to free the netdev, which has already been registered, without
unregistering it.This patch fixes the problem by unregistering the netdev in the error path.
Reported-by: Michael Olbrich
Reviewed-by: Bernd Krumboeck
Signed-off-by: Marc Kleine-Budde
12 Jun, 2013
1 commit
-
Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().Signed-off-by: Tushar Behera
CC: netdev@vger.kernel.org
CC: linux-can@vger.kernel.org
CC: Marc Kleine-Budde
CC: Wolfgang Grandegger
Acked-by: Marc Kleine-Budde
Signed-off-by: David S. Miller
06 Jun, 2013
1 commit
-
Merge 'net' bug fixes into 'net-next' as we have patches
that will build on top of them.This merge commit includes a change from Emil Goode
(emilgoode@gmail.com) that fixes a warning that would
have been introduced by this merge. Specifically it
fixes the pingv6_ops method ipv6_chk_addr() to add a
"const" to the "struct net_device *dev" argument and
likewise update the dummy_ipv6_chk_addr() declaration.Signed-off-by: David S. Miller
03 Jun, 2013
8 commits
-
smatch reports the following warnings:
drivers/net/can/usb/peak_usb/pcan_usb_pro.c:514 pcan_usb_pro_drv_loaded() error: doing dma on the stack (buffer)
drivers/net/can/usb/peak_usb/pcan_usb_pro.c:878 pcan_usb_pro_init() error: doing dma on the stack (&fi)
drivers/net/can/usb/peak_usb/pcan_usb_pro.c:889 pcan_usb_pro_init() error: doing dma on the stack (&bi)See "Documentation/DMA-API-HOWTO.txt" section "What memory is DMA'able?"
Cc: Stephane Grosjean
Signed-off-by: Marc Kleine-Budde -
smatch reports the following warnings:
drivers/net/can/usb/esd_usb2.c:640 esd_usb2_start() error: doing dma on the stack (&msg)
drivers/net/can/usb/esd_usb2.c:846 esd_usb2_close() error: doing dma on the stack (&msg)
drivers/net/can/usb/esd_usb2.c:855 esd_usb2_close() error: doing dma on the stack (&msg)
drivers/net/can/usb/esd_usb2.c:923 esd_usb2_set_bittiming() error: doing dma on the stack (&msg)
drivers/net/can/usb/esd_usb2.c:1047 esd_usb2_probe() error: doing dma on the stack (&msg)
drivers/net/can/usb/esd_usb2.c:1053 esd_usb2_probe() error: doing dma on the stack (&msg)See "Documentation/DMA-API-HOWTO.txt" section "What memory is DMA'able?"
Signed-off-by: Olivier Sobrie
Cc: Matthias Fuchs
Signed-off-by: Marc Kleine-Budde -
Unlike Kvaser Leaf light devices, some other Kvaser devices (like USBcan
Pro, USBcan R) receive CAN messages in CMD_LOG_MESSAGE frames. This
patch adds support for it.Cc: linux-stable # >= v3.8
Signed-off-by: Jonas Peterson
Signed-off-by: Olivier Sobrie
Signed-off-by: Marc Kleine-Budde -
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.Signed-off-by: Jingoo Han
Signed-off-by: Marc Kleine-Budde -
This patch removes the Kconfig symbol HAVE_CAN_FLEXCAN from arch/{arm,powerpc}
and allowing compilation unconditionally on all arm and powerpc platforms.This brings a bigger compile time coverage and removes the following dependency
warning found by Arnd Bergmann:warning: (SOC_IMX28 && SOC_IMX25 && SOC_IMX35 && IMX_HAVE_PLATFORM_FLEXCAN &&
SOC_IMX53 && SOC_IMX6Q) selects HAVE_CAN_FLEXCAN
which has unmet direct dependencies (NET && CAN && CAN_DEV)Acked-by: Arnd Bergmann
Acked-by: Benjamin Herrenschmidt
Acked-by: Shawn Guo
Signed-off-by: Marc Kleine-Budde -
Using SIMPLE_DEV_PM_OPS can make the code smaller and simpler.
Also change CONFIG_PM to CONFIG_PM_SLEEP.
Signed-off-by: Fabio Estevam
Signed-off-by: Marc Kleine-Budde -
Since commit ab78029 (drivers/pinctrl: grab default handles from device core)
we can rely on device core for handling pinctrl, so remove
devm_pinctrl_get_select_default() from the driver.Cc: Marc Kleine-Budde
Cc:
Signed-off-by: Fabio Estevam
Signed-off-by: Marc Kleine-Budde -
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller
29 May, 2013
1 commit
-
So far, only net_device * could be passed along with netdevice notifier
event. This patch provides a possibility to pass custom structure
able to provide info that event listener needs to know.Signed-off-by: Jiri Pirko
v2->v3: fix typo on simeth
shortened dev_getter
shortened notifier_info struct name
v1->v2: fix notifier_call parameter in call_netdevice_notifier()
Signed-off-by: David S. Miller
16 May, 2013
4 commits
-
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Marc Kleine-Budde -
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Marc Kleine-Budde -
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Marc Kleine-Budde -
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Marc Kleine-Budde