Re: [PATCH][next] can: etas_es58x: Fix missing null check on netdev pointer

2021-04-15 Thread Vincent MAILHOL
TAS ES58X CAN > > USB interfaces") > > Signed-off-by: Colin Ian King Acked-by: Vincent Mailhol Thanks Colin!

[PATCH] can: etas_es58x: fix null pointer dereference when handling error frames

2021-04-13 Thread Vincent Mailhol
ch is the length of any CAN error frames) solves this NULL pointer dereference. Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces") Reported-by: Arunachalam Santhanam Signed-off-by: Vincent Mailhol --- Hi Marc, I am really sorry, but I was just notifi

Re: [PATCH v15 0/3] Introducing ETAS ES58X CAN USB interfaces

2021-04-12 Thread Vincent MAILHOL
Hi Marc, On Mon. 12 Apr 2021 at 18:20, Marc Kleine-Budde wrote: > On 10.04.2021 18:59:45, Vincent Mailhol wrote: > > Here comes the 15th iteration of the patch. This new version addresses > > the comments received from Marc (thanks again for the review!) and > > simplify

[PATCH v15 3/3] can: etas_es58x: add support for the ETAS ES58X_FD CAN USB interfaces

2021-04-10 Thread Vincent Mailhol
This patch add support for the ES582.1 and ES584.1 interfaces from ETAS GmbH (https://www.etas.com/en/products/es58x.php). Co-developed-by: Arunachalam Santhanam Signed-off-by: Arunachalam Santhanam Signed-off-by: Vincent Mailhol --- drivers/net/can/usb/etas_es58x/Makefile | 2

[PATCH v15 2/3] can: etas_es58x: add support for ETAS ES581.4 CAN USB interface

2021-04-10 Thread Vincent Mailhol
This patch adds support for the ES581.4 interface from ETAS GmbH (https://www.etas.com/en/products/es58x.php). Co-developed-by: Arunachalam Santhanam Signed-off-by: Arunachalam Santhanam Signed-off-by: Vincent Mailhol --- drivers/net/can/usb/etas_es58x/Makefile | 2 +- drivers/net/can

[PATCH v15 1/3] can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces

2021-04-10 Thread Vincent Mailhol
: Vincent Mailhol --- drivers/net/can/usb/Kconfig | 10 + drivers/net/can/usb/Makefile|1 + drivers/net/can/usb/etas_es58x/Makefile |3 + drivers/net/can/usb/etas_es58x/es58x_core.c | 2281 +++ drivers/net/can/usb/etas_es58x/es58x_core.h

[PATCH v15 0/3] Introducing ETAS ES58X CAN USB interfaces

2021-04-10 Thread Vincent Mailhol
with -W1). v1 (2020-09-27): - First release Vincent Mailhol (3): can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces can: etas_es58x: add support for ETAS ES581.4 CAN USB interface can: etas_es58x: add support for the ETAS ES58X_FD CAN USB interfaces driv

[PATCH v3 1/1] netdev: add netdev_queue_set_dql_min_limit()

2021-03-21 Thread Vincent Mailhol
switching, virtualization...), that they constantly reach better performances with a specific predefined dql.min_limit value with no noticeable latency impact. Signed-off-by: Vincent Mailhol --- include/linux/netdevice.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a

[PATCH v3 0/1] Allow drivers to modify dql.min_limit value

2021-03-21 Thread Vincent Mailhol
https://lore.kernel.org/linux-can/20210309153547.q7zspf46k6ter...@pengutronix.de/ Link to RFC v1: https://lore.kernel.org/linux-can/20210309152354.95309-1-mailhol.vinc...@wanadoo.fr/T/#t Vincent Mailhol (1): netdev: add netdev_queue_set_dql_min_limit() include/linux/netdevice.h | 18 +++

[RFC PATCH v2 1/1] netdev: add netdev_queue_set_dql_min_limit()

2021-03-10 Thread Vincent Mailhol
performances with a specific predefined dql.min_limit value with no noticeable latency impact. Signed-off-by: Vincent Mailhol --- include/linux/netdevice.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ddf4cfc12615

[RFC PATCH v2 0/1] Allow drivers to modify dql.min_limit value

2021-03-10 Thread Vincent Mailhol
ink to RFC v1: https://lore.kernel.org/linux-can/20210309152354.95309-1-mailhol.vinc...@wanadoo.fr/T/#t Vincent Mailhol (1): dql: add dql_set_min_limit() include/linux/netdevice.h | 17 + 1 file changed, 17 insertions(+) -- 2.26.2

Re: [RFC PATCH 1/1] dql: add dql_set_min_limit()

2021-03-10 Thread Vincent MAILHOL
Hi Dave, Thanks for the comprehensive comments! On Wed. 10 Mar 2021 at 04:44, Dave Taht wrote: > > I note that "proof" is very much in the developer's opinion and > limited testing base. > > Actual operational experience, as in a real deployment, with other > applications, > heavy context switc

Re: [RFC PATCH 1/1] dql: add dql_set_min_limit()

2021-03-09 Thread Vincent MAILHOL
On Wed. 10 Mar 2021 at 00:23, Vincent Mailhol wrote: > > Add a function to set the dynamic queue limit minimum value. > > This function is to be used by network drivers which are able to > prove, at least through empirical tests, that they reach better > performances with a s

[RFC PATCH 1/1] dql: add dql_set_min_limit()

2021-03-09 Thread Vincent Mailhol
Add a function to set the dynamic queue limit minimum value. This function is to be used by network drivers which are able to prove, at least through empirical tests, that they reach better performances with a specific predefined dql.min_limit value. Signed-off-by: Vincent Mailhol --- include

[RFC PATCH 0/1] Modify dql.min_limit value inside the driver

2021-03-09 Thread Vincent Mailhol
iling list: https://lore.kernel.org/linux-can/20210309125708.ei75tr5vp2san...@pengutronix.de/ Thank you for your comments. Yours sincerely, Vincent Vincent Mailhol (1): dql: add dql_set_min_limit() include/linux/dynamic_queue_limits.h | 3 +++ lib/dynamic_queue_limits.c | 8 2

Re: [PATCH RESEND iproute2 5.11] iplink_can: add Classical CAN frame LEN8_DLC support

2021-02-01 Thread Vincent MAILHOL
E_PRESUME_ACK); > + } else if (matches(*argv, "cc-len8-dlc") == 0) { > + NEXT_ARG(); > + set_ctrlmode("cc-len8-dlc", *argv, &cm, > +CAN_CTRLMODE_CC_LEN8_DLC); > } else if (matches(*argv, "restart") == 0) { > __u32 val = 1; > > addattr32(n, 1024, IFLA_CAN_RESTART, val); > } else if (matches(*argv, "restart-ms") == 0) { > -- > 2.29.2 Reviewed-by: Vincent Mailhol Reviewed and tested the patch, everything is OK for me. Thanks Oliver!

[PATCH v11 0/1] add support for ETAS ES58X CAN USB interfaces

2021-01-24 Thread Vincent Mailhol
sted with GCC -WExtra but not with -W1). v1 (2020-09-27): - First release Yours sincerely, Vincent *** BLURB HERE *** Vincent Mailhol (1): can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces drivers/net/can/usb/Kconfig | 10 + drivers/net/can

Re: [PATCH v1] can: mcp251xfd: Add some sysfs debug interfaces for registers r/w

2021-01-22 Thread Vincent MAILHOL
Hi, In addition to Marc’s comment, I also have security concerns. On Fri. 22 Jan 2021 at 15:22, Su Yanjun wrote: > When i debug mcp2518fd, some method to track registers is > needed. This easy debug interface will be ok. > > For example, > read a register at 0xe00: > echo 0xe00 > can_get_reg > c

Re: [PATCH v4 1/3] can: dev: can_restart: fix use after free bug

2021-01-20 Thread Vincent MAILHOL
On Wed. 20 janv. 2021 at 21:53, Marc Kleine-Budde wrote: > On 1/20/21 12:41 PM, Vincent Mailhol wrote: > > After calling netif_rx_ni(skb), dereferencing skb is unsafe. > > Especially, the can_frame cf which aliases skb memory is accessed > > after the netif_rx_ni() in: >

[PATCH v4 2/3] can: vxcan: vxcan_xmit: fix use after free bug

2021-01-20 Thread Vincent Mailhol
After calling netif_rx_ni(skb), dereferencing skb is unsafe. Especially, the canfd_frame cfd which aliases skb memory is accessed after the netif_rx_ni(). Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)") Signed-off-by: Vincent Mailhol --- drivers/net/can/vxcan.c | 6

[PATCH v4 1/3] can: dev: can_restart: fix use after free bug

2021-01-20 Thread Vincent Mailhol
and Netlink interface") Signed-off-by: Vincent Mailhol --- *Remark for upstream* drivers/net/can/dev.c has been moved to drivers/net/can/dev/dev.c in below commit, please carry the patch forward. Reference: 3e77f70e7345 ("can: dev: move driver related infrastructure into separate subdir&q

[PATCH v4 3/3] can: peak_usb: fix use after free bugs

2021-01-20 Thread Vincent Mailhol
pters") Signed-off-by: Vincent Mailhol --- drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index 61631f4fd92a..f347ecc79aef 100644 --- a/d

[PATCH v4 0/3] Fix several use after free bugs

2021-01-20 Thread Vincent Mailhol
0120085356.m7nabbw5zhy7p...@hardanger.blackshift.org/ Changes since v1: - fix a silly typo in patch 2/3 (variable len was declared twice...) Vincent Mailhol (3): can: dev: can_restart: fix use after free bug can: vxcan: vxcan_xmit: fix use after free bug can: peak_usb: fix use after free bugs drive

[PATCH v3 1/3] can: dev: can_restart: fix use after free bug

2021-01-20 Thread Vincent Mailhol
ved to drivers/net/can/dev/dev.c in below commit, please carry the patch forward. Reference: 3e77f70e7345 ("can: dev: move driver related infrastructure into separate subdir") Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface") Signed-off-by: Vincent Mailhol

[PATCH v3 2/3] can: vxcan: vxcan_xmit: fix use after free bug

2021-01-20 Thread Vincent Mailhol
After calling netif_rx_ni(skb), dereferencing skb is unsafe. Especially, the canfd_frame cfd which aliases skb memory is accessed after the netif_rx_ni(). Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)") Signed-off-by: Vincent Mailhol --- drivers/net/can/vxcan.c | 6

[PATCH v3 3/3] can: peak_usb: fix use after free bugs

2021-01-20 Thread Vincent Mailhol
pters") Signed-off-by: Vincent Mailhol --- drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index 61631f4fd92a..f347ecc79aef 100644 --- a/d

[PATCH v3 0/3] Fix several use after free bugs

2021-01-20 Thread Vincent Mailhol
patch 2/3 (variable len was declared twice...) Vincent Mailhol (3): can: dev: can_restart: fix use after free bug can: vxcan: vxcan_xmit: fix use after free bug can: peak_usb: fix use after free bugs drivers/net/can/dev.c | 4 ++-- drivers/net/can/usb/peak_usb/pcan_us

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Vincent MAILHOL
On Fri. 15 Jan 2021 at 02:03, Oliver Hartkopp wrote: > On 14.01.21 10:16, Vincent MAILHOL wrote: > > On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp > > wrote: > >> On 14.01.21 02:59, Vincent MAILHOL wrote: > >>> On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde

Re: [PATCH v10 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2021-01-14 Thread Vincent MAILHOL
On Fri. 15 Jan 2021 at 02:23, Oliver Hartkopp wrote: > > Hi Vincent, > > On 12.01.21 14:05, Vincent Mailhol wrote: > > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from > > ETAS GmbH (https://www.etas.com/en/products/es58x.php). > > (..) > >

Re: [PATCH v10 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2021-01-14 Thread Vincent MAILHOL
On Tue. 14 janv. 2021 at 01:04, Marc Kleine-Budde wrote: > > On 1/13/21 1:15 PM, Vincent MAILHOL wrote: > >>> +/** > >>> + * es58x_calculate_crc() - Compute the crc16 of a given URB. > >>> + * @urb_cmd: The URB command for which we want to calculate the C

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Vincent MAILHOL
On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp wrote: > On 14.01.21 02:59, Vincent MAILHOL wrote: > > On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote: > >> > >> If the length paramter in len2dlc() exceeds the size of the len2dlc array, > >> we > >

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-13 Thread Vincent MAILHOL
> length check, and returns CANFD_MAX_DLC (which is 0xf). > > Reviewed-by: Vincent Mailhol > Link: https://lore.kernel.org/r/2021041930.693847-9-...@pengutronix.de > Signed-off-by: Marc Kleine-Budde > --- > drivers/net/can/dev/length.c | 6 ++ > 1 file changed, 2

Re: [PATCH v10 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2021-01-13 Thread Vincent MAILHOL
On Wed. 13 Jan 2021 at 21:15, Vincent MAILHOL wrote: > > Hi Marc, > > Thanks for the comments! > > On Wed. 13 Jan 2021 à 18:33, Marc Kleine-Budde wrote: > > > > On 1/12/21 2:05 PM, Vincent Mailhol wrote: > > > This driver supports the ES581.4, ES582.1 and

Re: [PATCH v10 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2021-01-13 Thread Vincent MAILHOL
Hi Marc, Thanks for the comments! On Wed. 13 Jan 2021 à 18:33, Marc Kleine-Budde wrote: > > On 1/12/21 2:05 PM, Vincent Mailhol wrote: > > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from > > ETAS GmbH (https://www.etas.com/en/products/es58x.php). >

Re: [PATCH v10 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2021-01-12 Thread Vincent MAILHOL
On Tue 13 Jan 2021 at 00:29, kernel test robot wrote: > > Hi Vincent, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v5.11-rc3 next-20210111] > [If your patch is applied to the wrong git tree, kindly drop us a note. >

Re: [PATCH v10 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2021-01-12 Thread Vincent MAILHOL
On Tue. 12 Jan 2021 at 22:05, Vincent Mailhol wrote: > > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from > ETAS GmbH (https://www.etas.com/en/products/es58x.php). > > Co-developed-by: Arunachalam Santhanam > Signed-off-by: Arunachalam Santhanam > S

[PATCH v10 0/1] add support for ETAS ES58X CAN USB interfaces

2021-01-12 Thread Vincent Mailhol
warnings (v1 was tested with GCC -WExtra but not with -W1). v1 (2020-09-27): - First release Vincent Mailhol (1): can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces drivers/net/can/usb/Kconfig | 10 + drivers/net/can/usb/Makefile|1 +

Re: [PATCH v3 1/1] can: dev: add software tx timestamps

2021-01-12 Thread Vincent MAILHOL
On Tue. 12 Jan 2021 at 16:58, Marc Kleine-Budde wrote: > > On 1/12/21 1:00 AM, Vincent MAILHOL wrote: > [...] > > > Mark: do you want me to send a v4 of that patch with above > > comment removed or can you directly do the change in your testing > > branch? > >

[PATCH v4 1/1] can: dev: add software tx timestamps

2021-01-12 Thread Vincent Mailhol
=eb88531bdbfaafb827192d1fc6c5a3fcc4fadd96 * Put the call to skb_tx_timestamp() just before adding it to the array: https://lkml.org/lkml/2021/1/10/54 * About Tx hardware timestamps https://lore.kernel.org/linux-can/2021071152.gb11...@hoboy.vegasvil.org/ Signed-off-by: Vincent Mailhol --- drivers/net/can/dev

[PATCH v4 0/1] Add software TX timestamps to the CAN devices

2021-01-12 Thread Vincent Mailhol
and suppress the comment related to SOF_TIMESTAMPING_TX_HARDWARE. Reference: https://lore.kernel.org/linux-can/2021071152.gb11...@hoboy.vegasvil.org/ Vincent Mailhol (1): can: dev: add software tx timestamps drivers/net/can/dev/skb.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.26.2

Re: [PATCH v3 1/1] can: dev: add software tx timestamps

2021-01-11 Thread Vincent MAILHOL
On Tue. 12 Jan 2021 at 11:14, Richard Cochran wrote: > > On Tue, Jan 12, 2021 at 09:00:33AM +0900, Vincent MAILHOL wrote: > > Out of curiosity, which programs do you use? I guess wireshark > > but please let me know if you use any other programs (I just use > > to write

Re: [PATCH v3 1/1] can: dev: add software tx timestamps

2021-01-11 Thread Vincent MAILHOL
On Tue. 12 Jan 2021 at 02:11, Richard Cochran wrote: > > On Sun, Jan 10, 2021 at 09:49:03PM +0900, Vincent Mailhol wrote: > > * The hardware rx timestamp of a local loopback message is the > > hardware tx timestamp. This means that there are no needs to

[PATCH v3 1/1] can: dev: add software tx timestamps

2021-01-10 Thread Vincent Mailhol
/lkml/2021/1/10/54 Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 3486704c8a95..850759c7677f 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -481,6 +481,7 @@ int

[PATCH v3 0/1] Add software TX timestamps to the CAN devices

2021-01-10 Thread Vincent Mailhol
between the kernel tx software timestamp and the userland tx software timestamp). v2 was a mistake, please ignore it (fogot to do git add, changes were not reflected...) v3 reflects the comments that Jeroen made in https://lkml.org/lkml/2021/1/10/54 Vincent Mailhol (1): can: dev: add software

[PATCH v2 1/1] can: dev: add software tx timestamps

2021-01-10 Thread Vincent Mailhol
/lkml/2021/1/10/54 Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 3486704c8a95..3904e0874543 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -484,6 +484,8 @@ int

[PATCH v2 0/1] Add software TX timestamps to the CAN devices

2021-01-10 Thread Vincent Mailhol
between the kernel tx software timestamp and the userland tx software timestamp). v2 reflects the comments that Jeroen made in https://lkml.org/lkml/2021/1/10/54 Vincent Mailhol (1): can: dev: add software tx timestamps drivers/net/can/dev.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.26.2

Re: [PATCH 1/1] can: dev: add software tx timestamps

2021-01-10 Thread Vincent MAILHOL
Hello Jeroen, On Sun. 10 Jan 2021 at 20:29, Jeroen Hofstee wrote: > > Hello Vincent, > > On 1/10/21 11:35 AM, Vincent Mailhol wrote: > > Call skb_tx_timestamp() within can_put_echo_skb() so that a software > > tx timestamp gets attached on the skb. > > > [..] >

[PATCH 1/1] can: dev: add software tx timestamps

2021-01-10 Thread Vincent Mailhol
the error queue in CAN RAW sockets (which is needed for tx timestamps) was introduced in: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb88531bdbfaafb827192d1fc6c5a3fcc4fadd96 Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 2 ++ 1 file changed, 2

[PATCH 0/1] Add software TX timestamps to the CAN devices

2021-01-10 Thread Vincent Mailhol
between the kernel tx software timestamp and the userland tx software timestamp). Vincent Mailhol (1): can: dev: add software tx timestamps drivers/net/can/dev.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.26.2

Re: [PATCH v6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2020-11-16 Thread Vincent MAILHOL
On Mon. 16 Nov 2020 at 03:55, Marc Kleine-Budde wrote: > On 11/14/20 4:22 PM, Vincent Mailhol wrote: > > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from > > ETAS GmbH (https://www.etas.com/en/products/es58x.php). > > > > Co-developed-by: Arunachala

Re: [PATCH v6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2020-11-15 Thread Vincent MAILHOL
patch-id tags seem to have been ignored. FYI, I used the below command to generate the patch. git format-patch --base=bff6f1db91e330d7fba56f815cdbc412c75fe163 -v6 -o patch/v6 HEAD~1 Yours sincerely, Vincent Mailhol > url: > https://github.com/0day-ci/linux/commits/Vincent-Mailhol/ca

Re: [PATCH v4 5/7] can: update documentation for DLC usage in Classical CAN

2020-11-09 Thread Vincent MAILHOL
On Mon. 9 Nov 2020 at 19:26, Oliver Hartkopp wrote: > > The extension of struct can_frame with the len8_dlc element and the > can_dlc naming issue required an update of the documentation. > > Additionally introduce the term 'Classical CAN' which has been established > by CAN in Automation to separa

Re: [PATCH v4 4/7] can: replace can_dlc as variable/element for payload length

2020-11-09 Thread Vincent MAILHOL
ne is for FD frames. > > /* map the sanitized data length to an appropriate data length code */ > u8 can_len2dlc(u8 len); can_len2dlc() might be renamed (e.g. can_get_fd_dlc()) if Example 1 solution is chosen. > struct net_device *alloc_candev_mqs(int sizeof_priv, unsigned int > echo_skb_max, Yours sincerely, Vincent Mailhol

Re: [net 05/27] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-11-04 Thread Vincent MAILHOL
be nice to extend the NAPI with skb loopback for drivers which already supports it but I am not sure how to include the other drivers. > @Marc: Can we also use NAPI for echo'ing the skbs? Yours sincerely, Vincent Mailhol

Re: [net 05/27] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-11-03 Thread Vincent MAILHOL
On Wed. 4 Nov 2020 10:21, Jakub Kicinski wrote: > On Tue, 3 Nov 2020 23:06:14 +0100 Marc Kleine-Budde wrote: >> From: Vincent Mailhol >> >> If a driver calls can_get_echo_skb() during a hardware IRQ (which is often, >> but >> not always, the case), the 'WA

[PATCH v4 3/4] can: dev: __can_get_echo_skb(): fix the return length

2020-10-16 Thread Vincent Mailhol
The length of Remote Transmission Request (RTR) frames is always 0 bytes. The DLC represents the requested length, not the actual length of the RTR. But __can_get_echo_skb() returns the DLC value regardless. Apply get_can_len() function to retrieve the correct length. Signed-off-by: Vincent

[PATCH v4 2/4] can: dev: add a helper function to get the correct length of Classical frames

2020-10-16 Thread Vincent Mailhol
classical CAN frames: this is incorrect! This patch introduces function get_can_len() which can be used in remediation. The function takes the SKB as an input in order to be able to determine if the frame is classical or FD. Signed-off-by: Vincent Mailhol --- Changes in v4: None Changes in v3:

[PATCH v4 1/4] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-10-16 Thread Vincent Mailhol
behind is that only CAN devices are affected by this issue). [1] https://patchwork.ozlabs.org/patch/835236/ Signed-off-by: Vincent Mailhol --- Changes in v3 and v4: None Changes in v2: - Minor changes of link format in the changelog. --- drivers/net/can/dev.c | 6 +- 1 file changed, 5 inser

[PATCH v4 0/4] can: add support for ETAS ES58X CAN USB

2020-10-16 Thread Vincent Mailhol
lsusb -v information in PATCH 7/7 and rephrased the comment. - Take care to put everyone in CC of each of the patch of the series (sorry for the mess in v1...) Vincent Mailhol (4): can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context can: dev: add a helper func

Re: [PATCH v3 6/7] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2020-10-10 Thread Vincent Mailhol
gt; > You can provide an outer macro that does the sizeof() and then calls the a > normal (static inline) function to do the actual work. Applied to the next 3 > macros. OK. Will be fixed in v4. > > +#define ES58X_SIZEOF_URB_CMD(es58x_urb_cmd_type, msg_field) > > \ > > + (offsetof(es58x_urb_cmd_type, raw_msg) \ > > + + sizeof_field(es58x_urb_cmd_type, msg_field) \ > > + + sizeof_field(es58x_urb_cmd_type, \ > > + reserved_for_crc16_do_not_use)) > > static inline? Sorry but this one can not be converted into a static inline: the first argument is a type (that will become the first argument of offsetof() and sizeof_field()). One more time, thank you for your time and your review! Yours sincerely, Vincent Mailhol

[PATCH v3 7/7] usb: cdc-acm: add quirk to blacklist ETAS ES58X devices

2020-10-02 Thread Vincent Mailhol
-by: Vincent Mailhol --- Changes in v3: None Changes in v2: - Added dmesg and lsusb -v information and rephrased the comment. --- drivers/usb/class/cdc-acm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index

[PATCH v3 5/7] can: dev: add a helper function to calculate the duration of one bit

2020-10-02 Thread Vincent Mailhol
the CAN ISO standard. Device drivers for CAN might need those. Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for additional information. Signed-off-by: Vincent Mailhol --- Changes in v3: None Changes in v2: None --- drivers/net/can/dev.c | 13 ++--- include

[PATCH v3 4/7] can: dev: __can_get_echo_skb(): fix the return length

2020-10-02 Thread Vincent Mailhol
The length of Remote Transmission Request (RTR) frames is always 0 bytes. The DLC represents the requested length, not the actual length of the RTR. But __can_get_echo_skb() returns the DLC value regardless. Apply get_can_len() function to retrieve the correct length. Signed-off-by: Vincent

[PATCH v3 3/7] can: dev: add a helper function to get the correct length of Classical frames

2020-10-02 Thread Vincent Mailhol
classical CAN frames: this is incorrect! This patch introduces function get_can_len() which can be used in remediation. The function takes the SKB as an input in order to be able to determine if the frame is classical or FD. Signed-off-by: Vincent Mailhol --- Changes in v3: - Make get_can_len()

[PATCH v3 2/7] can: dev: fix type of get_can_dlc() and get_canfd_dlc() macros

2020-10-02 Thread Vincent Mailhol
The macros get_can_dlc() and get_canfd_dlc() are not visible in userland. As such, type u8 should be preferred over type __u8. Reference: https://lkml.org/lkml/2020/10/1/708 Signed-off-by: Vincent Mailhol --- include/linux/can/dev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH v3 1/7] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-10-02 Thread Vincent Mailhol
behind is that only CAN devices are affected by this issue). [1] https://patchwork.ozlabs.org/patch/835236/ Signed-off-by: Vincent Mailhol --- Changes in v3: None Changes in v2: - Minor changes of link format in the changelog. --- drivers/net/can/dev.c | 6 +- 1 file changed, 5 inser

[PATCH v3 0/7] can: add support for ETAS ES58X CAN USB

2020-10-02 Thread Vincent Mailhol
put everyone in CC of each of the patch of the series (sorry for the mess in v1...) Vincent Mailhol (7): can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context can: dev: fix type of get_can_dlc() and get_canfd_dlc() macros can: dev: add a helper function to get t

Re: [PATCH v2 5/6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

2020-10-01 Thread Vincent Mailhol
> > + num_element = > > + es58x_msg_num_element(es58x_dev->dev, > > + bulk_rx_loopback_msg->rx_loopback_msg, > > + msg_len); > > + if (unlikely(num_element <= 0)) > > + return num_element; > > Meta-comment on your use of '

Re: [PATCH v2 2/6] can: dev: add a helper function

2020-10-01 Thread Vincent Mailhol
> > +static inline int get_can_len(struct sk_buff *skb) > > make this return an u8 > make the skb const > > > +{ > > + struct canfd_frame *cf =3D (struct canfd_frame *)skb->data; > > const > > > + > > + if (can_is_canfd_skb(skb)) > > + return min_t(__u8, cf->len, CANFD_MAX_DLEN);

[PATCH v2 6/6] usb: cdc-acm: add quirk to blacklist ETAS ES58X devices

2020-09-30 Thread Vincent Mailhol
-by: Vincent Mailhol --- drivers/usb/class/cdc-acm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 7f6f3ab5b8a6..ed9355094e8c 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1906,6

[PATCH v2 4/6] can: dev: add a helper function to calculate the duration of one bit

2020-09-30 Thread Vincent Mailhol
the CAN ISO standard. Device drivers for CAN might need those. Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for additional information. Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 13 ++--- include/linux/can/dev.h | 15 +++ 2 fil

[PATCH v2 3/6] can: dev: __can_get_echo_skb(): fix the return length

2020-09-30 Thread Vincent Mailhol
The length of Remote Transmission Request (RTR) frames is always 0 bytes. The DLC represents the requested length, not the actual length of the RTR. But __can_get_echo_skb() returns the DLC value regardless. Apply get_can_len() function to retrieve the correct length. Signed-off-by: Vincent

[PATCH v2 2/6] can: dev: add a helper function to get the correct length of Classical frames

2020-09-30 Thread Vincent Mailhol
classical CAN frames: this is incorrect! This patch introduces function get_can_len() which can be used in remediation. The function takes the SKB as an input in order to be able to determine if the frame is classical or FD. Signed-off-by: Vincent Mailhol --- include/linux/can/dev.h | 23 +++

[PATCH v2 1/6] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-09-30 Thread Vincent Mailhol
behind is that only CAN devices are affected by this issue). [1] https://patchwork.ozlabs.org/patch/835236/ Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 68834a

[PATCH v2 0/6] can: add support for ETAS ES58X CAN USB

2020-09-30 Thread Vincent Mailhol
sed the comment. - Take care to put everyone in CC of each of the patch of the series (sorry for the mess in v1...) Vincent Mailhol (6): can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context can: dev: add a helper function to get the correct length of C

Re: [PATCH 6/6] USB: cdc-acm: blacklist ETAS ES58X device

2020-09-28 Thread Vincent Mailhol
> > Did you mean to send this twice? Sorry for that, I screwed things up a first time when sending the patches: only included the CAN mailing list (linux-...@vger.kernel.org) but ommitted linux-ker...@vger.kernel.org in the cover letter. As a result, it broke the chain reply on lkml.org so I prefe

[PATCH 6/6] USB: cdc-acm: blacklist ETAS ES58X device

2020-09-26 Thread Vincent Mailhol
The ES58X devices are incorrectly recognized as USB Modem (CDC ACM), preventing the etas-es58x module to load. Thus, these have been added to the ignore list in drivers/usb/class/cdc-acm.c Signed-off-by: Vincent Mailhol --- drivers/usb/class/cdc-acm.c | 11 +++ 1 file changed, 11

[PATCH 4/6] can: dev: add a helper function to calculate the duration of one bit

2020-09-26 Thread Vincent Mailhol
the CAN ISO standard. Device drivers for CAN might need those. Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for additional information. Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 13 ++--- include/linux/can/dev.h | 15 +++ 2 fil

[PATCH 3/6] can: dev: __can_get_echo_skb(): fix the return length

2020-09-26 Thread Vincent Mailhol
The length of Remote Transmission Request (RTR) frames is always 0 bytes. The DLC represents the requested length, not the actual length of the RTR. But __can_get_echo_skb() returns the DLC value regardless. Apply get_can_len() function to retrieve the correct length. Signed-off-by: Vincent

[PATCH 2/6] can: dev: add a helper function to get the correct length of Classical frames

2020-09-26 Thread Vincent Mailhol
classical CAN frames: this is incorrect! This patch introduces function get_can_len() which can be used in remediation. The function takes the SKB as an input in order to be able to determine if the frame is classical or FD. Signed-off-by: Vincent Mailhol --- include/linux/can/dev.h | 23 +++

[PATCH 0/6] can: add support for ETAS ES58X CAN USB

2020-09-26 Thread Vincent Mailhol
. Thank you for your comments. Vincent Mailhol (6): can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context can: dev: add a helper function to get the correct length of Classical frames can: dev: __can_get_echo_skb(): fix the return length can: dev: add a he

[PATCH 1/6] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-09-26 Thread Vincent Mailhol
tack (the assumption behind is that only CAN devices are affected by this issue). Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 68834a2853c9..e291fda395a0 100644 -

[PATCH 1/6] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-09-26 Thread Vincent Mailhol
tack (the assumption behind is that only CAN devices are affected by this issue). Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 68834a2853c9..e291fda395a0 100644 -

[PATCH 3/6] can: dev: __can_get_echo_skb(): fix the return length

2020-09-26 Thread Vincent Mailhol
The length of Remote Transmission Request (RTR) frames is always 0 bytes. The DLC represents the requested length, not the actual length of the RTR. But __can_get_echo_skb() returns the DLC value regardless. Apply get_can_len() function to retrieve the correct length. Signed-off-by: Vincent

[PATCH 4/6] can: dev: add a helper function to calculate the duration of one bit

2020-09-26 Thread Vincent Mailhol
the CAN ISO standard. Device drivers for CAN might need those. Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for additional information. Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 13 ++--- include/linux/can/dev.h | 15 +++ 2 fil

[PATCH 1/6] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

2020-09-26 Thread Vincent Mailhol
tack (the assumption behind is that only CAN devices are affected by this issue). Signed-off-by: Vincent Mailhol --- drivers/net/can/dev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 68834a2853c9..e291fda395a0 100644 -

[PATCH] can: raw: add missing error queue support

2020-09-26 Thread Vincent Mailhol
relies on the error queue such as skb_tx_timestamp(). SCM_CAN_RAW_ERRQUEUE is defined as the type for the CAN raw error queue. SCM stands for "Socket control messages". The name is inspired from SCM_J1939_ERRQUEUE of include/uapi/linux/can/j1939.h. Signed-off-by: Vincent Mailhol --- in