Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-24 Thread Oliver Hartkopp
On 23.03.21 21:54, Rasmus Villemoes wrote: On 23/03/2021 19.59, Oliver Hartkopp wrote: On 23.03.21 15:00, Rasmus Villemoes wrote: Now what CONFIG_* knobs are responsible for putting -mabi=apcs-gnu in CFLAGS is left as an exercise for the reader. Regardless, it is not a bug in the

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Oliver Hartkopp
On 23.03.21 15:00, Rasmus Villemoes wrote: On 23/03/2021 13.49, Oliver Hartkopp wrote: On 23.03.21 12:36, Rasmus Villemoes wrote: and more directly from the horse's mouth: https://developer.arm.com/documentation/dui0067/d/arm-compiler-reference/c-and-c---implementation-de

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Oliver Hartkopp
On 23.03.21 12:36, Rasmus Villemoes wrote: On 23/03/2021 08.45, Oliver Hartkopp wrote: IMO we facing a compiler problem here - and we should be very happy that the BUILD_BUG_ON() triggered an issue after years of silence. I do not have a good feeling about what kind of strange effects this

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Oliver Hartkopp
Answering myself ... On 23.03.21 08:45, Oliver Hartkopp wrote: On 23.03.21 08:34, Marc Kleine-Budde wrote: On 23.03.2021 10:54:40, Rong Chen wrote: I tried arm-linux-gnueabi (gcc version 10.2.0) and the problem still exists, btw we prefer to not use the latest gcc compiler to avoid false

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Oliver Hartkopp
On 23.03.21 08:34, Marc Kleine-Budde wrote: On 23.03.2021 10:54:40, Rong Chen wrote: I tried arm-linux-gnueabi (gcc version 10.2.0) and the problem still exists, btw we prefer to not use the latest gcc compiler to avoid false positives. FWIW: I'm using latest debian arm compiler and the BUILD

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-22 Thread Oliver Hartkopp
Hi Rong, On 22.03.21 09:52, Rong Chen wrote: On 3/21/21 10:19 PM, Oliver Hartkopp wrote: Two reminders in two days? ;-) Did you check my answer here? https://lore.kernel.org/lkml/afffeb73-ba4c-ca2c-75d0-9e7899e5c...@hartkopp.net/ And did you try the partly revert? Hi Oliver, Sorry for

Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(struct canfd_frame,

2021-03-21 Thread Oliver Hartkopp
Two reminders in two days? ;-) Did you check my answer here? https://lore.kernel.org/lkml/afffeb73-ba4c-ca2c-75d0-9e7899e5c...@hartkopp.net/ And did you try the partly revert? Maybe there's a mismatch in include files - or BUILD_BUG_ON() generally does not work with unions on ARM as assumed he

Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_511' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(struct canfd_frame,

2021-03-19 Thread Oliver Hartkopp
On 19.03.21 09:06, kernel test robot wrote: Hi Oliver, FYI, the error/warning still remains. Hm - I have no clue either. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 8b12a62a4e3ed4ae99c715034f557eb391d6b196 commit: c7b74967799b1af52b3045d69d4

Re: [PATCH net v4 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-02-26 Thread Oliver Hartkopp
t) from [<809c6584>] (sch_direct_xmit+0xcc/0x264) r10:834e5600 r9: r8: r7:82b44000 r6:82ab1f00 r5:834e5600 r4:83f27400 | [<809c64b8>] (sch_direct_xmit) from [<809c6c0c>] (__qdisc_run+0x4f0/0x534) To fix this problem, only set skb ownership to sockets which have sti

Re: [PATCH net v3 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-02-24 Thread Oliver Hartkopp
0 r4:834e5600 | [<80972408>] (dev_hard_start_xmit) from [<809c6584>] (sch_direct_xmit+0xcc/0x264) r10:834e5600 r9: r8: r7:82b44000 r6:82ab1f00 r5:834e5600 r4:83f27400 | [<809c64b8>] (sch_direct_xmit) from [<809c6c0c>] (__qdisc_run+0x4f0/0x534) To fix th

Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_515' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(struct canfd_frame,

2021-02-13 Thread Oliver Hartkopp
On 13.02.21 20:57, kernel test robot wrote: Hi Oliver, FYI, the error/warning still remains. Yes, because of the this union, see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/can.h?id=c7b74967799b1af52b3045d69d4c26836b2d41de#n109 Maybe I was n

Re: [RFC PATCH net v2] net: introduce CAN specific pointer in the struct net_device

2021-02-12 Thread Oliver Hartkopp
Hello Oleksij, nice cleanup - and I like the removal of the notifier in af_can.c :-) Two questions/hints from my side: On 12.02.21 13:52, Oleksij Rempel wrote: diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c index d9281ae853f8..912401788d93 100644 --- a/drivers/net/can/dev/

Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_498' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(struct canfd_frame,

2021-02-11 Thread Oliver Hartkopp
Hello, On 11.02.21 17:51, kernel test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 291009f656e8eaebbdfd3a8d99f6b190a9ce9deb commit: c7b74967799b1af52b3045d69d4c26836b2d41de can: replace can_dlc as variable/element for payload length dat

Re: [PATCH] sh: fix sparse annotation in SH's __get_user_check()

2021-01-25 Thread Oliver Hartkopp
robot Reported-by: Oliver Hartkopp Signed-off-by: Luc Van Oostenryck --- arch/sh/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h index 73f3b48d4a34..e2623fe2ac09 100644 --- a/arch/sh/includ

Re: net/can/isotp.c:1240:13: sparse: sparse: incorrect type in initializer (different address spaces)

2021-01-14 Thread Oliver Hartkopp
On 14.01.21 10:47, kernel test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d commit: e057dd3fc20ffb3d7f150af46542a51b59b90127 can: add ISO 15765-2:2016 transport protocol date: 3 months ago co

Re: KMSAN: kernel-infoleak in move_addr_to_user (4)

2021-01-12 Thread Oliver Hartkopp
On 12.01.21 01:17, Cong Wang wrote: On Mon, Jan 11, 2021 at 11:33 AM Jakub Kicinski wrote: Looks like a AF_CAN socket: r0 = socket(0x1d, 0x2, 0x6) getsockname$packet(r0, &(0x7f000100)={0x11, 0x0, 0x0, 0x1, 0x0, 0x6, @broadcast}, &(0x7f00)=0x14) Right, it seems we need a mem

Re: WARNING in isotp_tx_timer_handler

2020-12-21 Thread Oliver Hartkopp
Hello Hillf, On 21.12.20 06:40, Hillf Danton wrote: Sun, 20 Dec 2020 11:24:13 -0800 syzbot found the following issue on: HEAD commit:5e60366d Merge tag 'fallthrough-fixes-clang-5.11-rc1' of g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=179a22875

Re: general protection fault in j1939_netdev_notify (2)

2020-12-21 Thread Oliver Hartkopp
On 20.12.20 15:37, Oleksij Rempel wrote: Hello Oliver, On Sun, Dec 20, 2020 at 02:18:27PM +0100, Oliver Hartkopp wrote: Hello Oleksij, I assume there is some ndev->ml_priv value set - but not from a CAN netdevice. it is kind of CAN device :) No, it is not. Team and bonding devi

Re: general protection fault in j1939_netdev_notify (2)

2020-12-20 Thread Oliver Hartkopp
Hello Oleksij, I assume there is some ndev->ml_priv value set - but not from a CAN netdevice. What was the reason to fiddle with the 'priv' stuff in j1939_netdev_notify() before checking if it was a CAN device? Would this patch fix the issue then? diff --git a/net/can/j1939/main.c b/net/ca

Re: [PATCH] can: m_can: add support for bosch mcan version 3.3.0

2020-11-26 Thread Oliver Hartkopp
On 26.11.20 11:48, Marc Kleine-Budde wrote: On 11/26/20 5:51 AM, Pankaj Sharma wrote: Add support for mcan bit timing and control mode according to bosch mcan IP version 3.3.0 The mcan version read from the Core Release field of CREL register would be 33. Accordingly the properties are to be

Re: BUG: receive list entry not found for dev vxcan1, id 002, mask C00007FF

2020-11-25 Thread Oliver Hartkopp
Hi Dmitry, On 25.11.20 19:48, Dmitry Vyukov wrote: On Wed, Nov 25, 2020 at 5:04 PM Oliver Hartkopp wrote: This seems to be very seldom but it does not break anything. Would removing the WARN(1) or replacing it with pr_warn() be ok to close this issue? Yes, this is the intended way to

Re: BUG: receive list entry not found for dev vxcan1, id 002, mask C00007FF

2020-11-25 Thread Oliver Hartkopp
Hello all, AFAICS the problems are caused by the WARN() statement here: https://elixir.bootlin.com/linux/v5.10-rc4/source/net/can/af_can.c#L546 The idea was to check whether CAN protocol implementations work correctly on their filter lists. With the fault injection it seem like we're getting

Re: net/can/isotp.c:1240:13: sparse: sparse: incorrect type in initializer (different address spaces)

2020-10-30 Thread Oliver Hartkopp
Hi all, On 29.10.20 08:33, Marc Kleine-Budde wrote: Hello, looks like sh is missing the some __user annotations so that sparse spwes these warnings. Adding sh maintainers to Cc. regards, Marc On 10/29/20 12:01 AM, kernel test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/g

Re: [PATCH] can: vxcan: Fix memleak in vxcan_newlink

2020-10-22 Thread Oliver Hartkopp
On 22.10.20 18:14, Jakub Kicinski wrote: On Wed, 21 Oct 2020 13:20:16 +0200 Oliver Hartkopp wrote: On 21.10.20 07:21, Dinghao Liu wrote: When rtnl_configure_link() fails, peer needs to be freed just like when register_netdevice() fails. Signed-off-by: Dinghao Liu Acked-by: Oliver

Re: [PATCH] can: vxcan: Fix memleak in vxcan_newlink

2020-10-21 Thread Oliver Hartkopp
On 21.10.20 07:21, Dinghao Liu wrote: When rtnl_configure_link() fails, peer needs to be freed just like when register_netdevice() fails. Signed-off-by: Dinghao Liu Acked-by: Oliver Hartkopp Btw. as the vxcan.c driver bases on veth.c the same issue can be found there! At this point

Re: [PATCH] can: Explain PDU in CAN_ISOTP help text

2020-10-13 Thread Oliver Hartkopp
enable the CAN_ISOTP option or not. Signed-off-by: Geert Uytterhoeven Acked-by: Oliver Hartkopp Yes, when you are so deep into it that PDU becomes a word like dog or cat ;-) Thanks, Oliver --- net/can/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/can/Kco

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

2020-10-01 Thread Oliver Hartkopp
h. Signed-off-by: Vincent Mailhol Acked-by: Oliver Hartkopp Thanks Vincent! --- include/uapi/linux/can/raw.h | 3 +++ net/can/raw.c| 4 2 files changed, 7 insertions(+) diff --git a/include/uapi/linux/can/raw.h b/include/uapi/linux/can/raw.h index 6a11d308eb5c..33

Re: [PATCH net-next] can: silence remove_proc_entry warning

2020-07-14 Thread Oliver Hartkopp
from can_remove_proc() if can proc_dir does not exists. Signed-off-by: Zhang Changzhong Acked-by: Oliver Hartkopp Thanks! --- net/can/proc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/can/proc.c b/net/can/proc.c index e6881bf..077af42 100644 --- a/net/can

Re: [PATCH 2/2] can: flexcan: add support for ISO CAN-FD

2020-06-30 Thread Oliver Hartkopp
On 30.06.20 07:53, Michael Walle wrote: [+ Oliver] Hi Joakim, Am 2020-06-30 04:42, schrieb Joakim Zhang: -Original Message- From: Michael Walle Sent: 2020年6月30日 2:18 To: linux-...@vger.kernel.org; net...@vger.kernel.org; linux-kernel@vger.kernel.org Cc: Wolfgang Grandegger ; Marc K

Re: [PATCH] can: Replace zero-length array with flexible-array

2020-06-03 Thread Oliver Hartkopp
Hi Gustavo, On 04.06.20 02:58, Gustavo A. R. Silva wrote: Sorry for the late reply. I totally lost track of this thread. :/ NP. At least your workflow seems to work :o) pahole shows exactly the same output either if cf is a zero-length array or a flexible-array member: $ pahole -C 'can_skb

Re: [PATCH] can: Replace zero-length array with flexible-array

2020-05-12 Thread Oliver Hartkopp
b/include/linux/can/skb.h @@ -34,7 +34,7 @@ struct can_skb_priv { int ifindex; int skbcnt; - struct can_frame cf[0]; + struct can_frame cf[]; }; static inline struct can_skb_priv *can_skb_prv(struct sk_buff *skb) Acked-by: Oliver Hartkopp @Gustavo: J

Re: [PATCH net-next] net: can: Fix compiling warning

2019-08-12 Thread Oliver Hartkopp
On 12/08/2019 07.48, maowenan wrote: On 2019/8/7 0:41, Oliver Hartkopp wrote: I compiled the code (the original version), but I do not get that "Should it be static?" warning: here are my steps for net/can/bcm.c, make allmodconfig ARCH=mips CROSS_COMPILE=mips-linux-gnu- make C

Re: [PATCH net-next] net: can: Fix compiling warning

2019-08-06 Thread Oliver Hartkopp
Hello Dan, On 06/08/2019 15.52, Dan Carpenter wrote: On Fri, Aug 02, 2019 at 10:10:20AM +0200, Oliver Hartkopp wrote: Btw. what kind of compiler/make switches are you using so that I can see these warnings myself the next time? These are Sparse warnings, not from GCC. I compiled the code

Re: [PATCH net-next] net: can: Fix compiling warning

2019-08-02 Thread Oliver Hartkopp
ng: symbol 'raw_sock_no_ioctlcmd' was not declared. Should it be static? Fixes: 473d924d7d46 ("can: fix ioctl function removal") Signed-off-by: Mao Wenan Acked-by: Oliver Hartkopp Thanks Mao! Btw. what kind of compiler/make switches are you using so that I can see these warning

Re: [can] 60649d4e0a: ltp.can_rcv_own_msgs.fail

2019-07-29 Thread Oliver Hartkopp
Hello Marc, On 29/07/2019 11.41, kernel test robot wrote: FYI, we noticed the following commit (built with gcc-7): commit: 60649d4e0af6c26b6c423dea9c57f39e823fc0c5 ("can: remove obsolete empty ioctl() handler") https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git maste

Re: INFO: task hung in unregister_netdevice_notifier (3)

2019-07-15 Thread Oliver Hartkopp
Hello all, On 14.07.19 06:07, syzbot wrote: syzbot has found a reproducer for the following crash on: the internal users of the CAN networking subsystem like CAN_BCM and CAN_RAW hold a number of CAN identifier subscriptions ('filters') for CAN netdevices (only type ARPHRD_CAN) in their socke

Re: [PATCH] net: can: Increase tx queue length

2019-03-10 Thread Oliver Hartkopp
Hi all, On 3/10/19 6:07 AM, Dave Taht wrote: Toke Høiland-Jørgensen writes: Appana Durga Kedareswara Rao writes: Hi Andre, On 3/9/19 3:07 PM, Appana Durga Kedareswara rao wrote: While stress testing the CAN interface on xilinx axi can in loopback mode getting message "write: no buffer

Re: [PATCH RFC] mac80211: Use IFF_ECHO to force delivery of tx_status frames

2019-02-26 Thread Oliver Hartkopp
Hi Julius, On 26.02.19 10:40, Julius Niedworok wrote: In order to force delivery of TX status frames for research and debugging purposes, implement the IFF_ECHO flag for ieee80211 devices. When this flag is set for a specific interface, IEEE80211_TX_CTL_REQ_TX_STATUS is enabled in all packets s

Re: [PATCH net-next v5 12/12] sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW

2019-02-02 Thread Oliver Hartkopp
Hi all, On 02.02.19 16:34, Deepa Dinamani wrote: Add new socket timeout options that are y2038 safe. (..) diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h index 9826d1db71d0..0d0fddb7e738 100644 --- a/arch/alpha/include/uapi/asm/socket.h +++ b/arch/alp

Re: UBSAN: Undefined behaviour in net/can/bcm.c

2019-01-12 Thread Oliver Hartkopp
On 1/12/19 10:03 PM, Kyungtae Kim wrote: On Sat, Jan 12, 2019 at 3:02 PM Oliver Hartkopp wrote: So there could potentially be some other users of timeval_to_ktime() that might have the same issue. The following would be the one related. Yes - it is also in bcm_rx_setup(). Same issue

Re: UBSAN: Undefined behaviour in net/can/bcm.c

2019-01-12 Thread Oliver Hartkopp
Hi, thanks for the report! On 1/12/19 8:25 PM, Kyungtae Kim wrote: We report a bug in linux-4.19.13: "UBSAN: Undefined behaviour in net/can/bcm.c" kernel config: https://kt0755.github.io/etc/config_4.19.13 repro: https://kt0755.github.io/etc/repro.296b5.c An integer overflow arose in bcm_time

Re: [PATCH] can: af_can: Fix Spectre v1 vulnerability

2018-12-23 Thread Oliver Hartkopp
After *trying* to follow the discussion on ... https://marc.info/?l=linux-kernel&m=154554485324143&w=2 [PATCH] net: core: Fix Spectre v1 vulnerability ... I'm still not sure whether af_can.c needs this enhancement or not. Just waiting for the end of the discussion :-) Thanks to the experts! O

Re: [PATCH 01/18] docs: can.rst: fix a footnote reference

2018-05-07 Thread Oliver Hartkopp
gt; > So, replace it by a valid syntax. > > Signed-off-by: Mauro Carvalho Chehab Acked-by: Oliver Hartkopp Thanks Mauro! Best regards, Oliver > --- > Documentation/networking/can.rst | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Documentation/n

Re: WARNING in can_rcv

2018-01-17 Thread Oliver Hartkopp
On 01/17/2018 10:43 AM, Marc Kleine-Budde wrote: On 01/17/2018 09:07 AM, Oliver Hartkopp wrote: On 01/17/2018 08:12 AM, Eric Biggers wrote: On Wed, Jan 17, 2018 at 07:39:24AM +0100, Oliver Hartkopp wrote: On 01/16/2018 07:11 PM, Dmitry Vyukov wrote: On Tue, Jan 16, 2018 at 7:07 PM

Re: WARNING in can_rcv

2018-01-17 Thread Oliver Hartkopp
On 01/17/2018 08:39 AM, Dmitry Vyukov wrote: On Wed, Jan 17, 2018 at 8:12 AM, Eric Biggers wrote: On Wed, Jan 17, 2018 at 07:39:24AM +0100, Oliver Hartkopp wrote: On 01/16/2018 07:11 PM, Dmitry Vyukov wrote: On Tue, Jan 16, 2018 at 7:07 PM, Marc Kleine-Budde wrote: On 01/16/2018 06:58

Re: WARNING in can_rcv

2018-01-17 Thread Oliver Hartkopp
On 01/17/2018 08:12 AM, Eric Biggers wrote: On Wed, Jan 17, 2018 at 07:39:24AM +0100, Oliver Hartkopp wrote: On 01/16/2018 07:11 PM, Dmitry Vyukov wrote: On Tue, Jan 16, 2018 at 7:07 PM, Marc Kleine-Budde wrote: On 01/16/2018 06:58 PM, syzbot wrote: Hello, syzkaller hit the following

Re: WARNING in can_rcv

2018-01-16 Thread Oliver Hartkopp
On 01/16/2018 07:11 PM, Dmitry Vyukov wrote: On Tue, Jan 16, 2018 at 7:07 PM, Marc Kleine-Budde wrote: On 01/16/2018 06:58 PM, syzbot wrote: Hello, syzkaller hit the following crash on a8750ddca918032d6349adbf9a4b6555e7db20da git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/

Re: syzkaller support for AF_CAN

2018-01-11 Thread Oliver Hartkopp
Hi Dmitry, On 01/11/2018 09:15 AM, Dmitry Vyukov wrote: On Wed, Jan 10, 2018 at 8:35 PM, Oliver Hartkopp wrote: I would be happy if you could also enable CONFIG_CAN and the network layer stuff below (RAW/BCM/GW) to see, if it explodes ;-) Sure, we can enable CAN configs if there is

Re: [v2] can: Use common error handling code in vxcan_newlink()

2017-11-02 Thread Oliver Hartkopp
On 11/01/2017 08:37 PM, SF Markus Elfring wrote: These addresses were suggested (or recommended?) by the script “get_maintainer.pl”. I know. (..) How does this view fit to the information in the section “5) Select the recipients for your patch” from the document “submitting-patches.rst”?

Re: [PATCH v2] can: Use common error handling code in vxcan_newlink()

2017-11-01 Thread Oliver Hartkopp
Elfring Acked-by: Oliver Hartkopp Again: Posting such a patch on linux-...@vger.kernel.org is ENOUGH! No need to cross post such a patch additionally on net...@vger.kernel.org linux-kernel@vger.kernel.org kernel-janit...@vger.kernel.org and to each of the maintainers m...@pengutronix.de w

Re: can: Use common error handling code in vxcan_newlink()

2017-10-29 Thread Oliver Hartkopp
Hi Markus, this discussion went far beyond the original posted patch for vxcan.c I would suggest you post your idea of the simplified error handling flow in vxcan.c just on linux-can ML (which is the right mailing list for CAN related stuff). Thanks, Oliver On 10/28/2017 10:13 PM, SF Markus

Re: can: Use common error handling code in vxcan_newlink()

2017-10-28 Thread Oliver Hartkopp
On 10/28/2017 09:18 PM, SF Markus Elfring wrote: If you want to change the semantic of the result check I am curious if another source code reduction (by the deletion of “ < 0”) will become acceptable at similar places. Source code reduction is not the main target. If you can simplify code w

Re: can: Use common error handling code in vxcan_newlink()

2017-10-28 Thread Oliver Hartkopp
On 10/28/2017 08:33 PM, SF Markus Elfring wrote: So if you would like to change the if-statement: It will need a small adjustment for the shown transformation. I was also unsure if the proposal will work in a single update step. 1. Send a patch for vxcan.c to improve the error handling flow

Re: [PATCH] can: Use common error handling code in vxcan_newlink()

2017-10-28 Thread Oliver Hartkopp
On 10/28/2017 10:23 AM, SF Markus Elfring wrote: @@ -227,10 +227,8 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,   netif_carrier_off(peer);     err = rtnl_configure_link(peer, ifmp); -    if (err < 0) { -    unregister_netdevice(peer); -    return err; -

Re: [PATCH] can: Use common error handling code in vxcan_newlink()

2017-10-27 Thread Oliver Hartkopp
Hi Markus, On 10/27/2017 10:30 PM, SF Markus Elfring wrote: From: Markus Elfring Date: Fri, 27 Oct 2017 22:22:24 +0200 * Add a jump target so that a bit of exception handling can be better reused at the end of this function. * Adjust two condition checks. This issue was detected by using

Re: [PATCH v2 30/37] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer

2017-10-27 Thread Oliver Hartkopp
On 10/22/2017 11:40 PM, Anna-Maria Gleixner wrote: From: Thomas Gleixner Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Cc: Oliver Hartkopp Acked

Re: [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates

2017-10-19 Thread Oliver Hartkopp
On 10/19/2017 09:54 PM, Mario Hüttel wrote: On 10/19/2017 08:35 PM, Oliver Hartkopp wrote: We already have this 'dsample-point' implemented in the ip tool: $ ip link set vcan0 type can help Usage: ip link set DEVICE type can [ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |

Re: [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates

2017-10-19 Thread Oliver Hartkopp
Hi Marc, On 10/19/2017 01:26 PM, Marc Kleine-Budde wrote: On 10/19/2017 01:14 PM, Oliver Hartkopp wrote: Since we have a netlink socket interface to configure sample point, I wonder if that should be extended to configure SSP too (or at least the offset part of SSP)? +1 too The struct

Re: [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates

2017-10-19 Thread Oliver Hartkopp
On 10/19/2017 11:13 AM, Marc Kleine-Budde wrote: On 10/19/2017 07:07 AM, Sekhar Nori wrote: Since we have a netlink socket interface to configure sample point, I wonder if that should be extended to configure SSP too (or at least the offset part of SSP)? +1 too Sekhar is right that ideal

Re: [PATCH] can: check for null sk before deferencing it via the call to sock_net

2017-10-16 Thread Oliver Hartkopp
On 10/16/2017 06:37 PM, Josh Boyer wrote: On Fri, Sep 8, 2017 at 1:46 PM, Oliver Hartkopp wrote: On 09/08/2017 05:02 PM, Colin King wrote: From: Colin Ian King The assignment of net via call sock_net will dereference sk. This is performed before a sanity null check on sk, so there could

Re: [PATCH] can: check for null sk before deferencing it via the call to sock_net

2017-09-08 Thread Oliver Hartkopp
the sk null check. Also replace the sk == NULL with the more usual !sk idiom. Detected by CoverityScan CID#1431862 ("Dereference before null check") Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM protocol") Signed-off-by: Colin Ian King Acked-by: Olive

Re: [PATCH 19/25] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer

2017-09-02 Thread Oliver Hartkopp
On 08/31/2017 02:23 PM, Anna-Maria Gleixner wrote: From: Thomas Gleixner Switch the timer to CLOCK_MONOTONIC_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Cc: Oliver Hartkopp

Re: [PATCH 19/25] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer

2017-09-01 Thread Oliver Hartkopp
On 09/01/2017 05:56 PM, Thomas Gleixner wrote: On Fri, 1 Sep 2017, Oliver Hartkopp wrote: On 08/31/2017 02:23 PM, Anna-Maria Gleixner wrote: (nothing here!) Please send patches inline and not as attachments. Tnx! PS: Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline

Re: [PATCH 19/25] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer

2017-09-01 Thread Oliver Hartkopp
Hi Anna-Maria & Thomas, thanks for the effort! I'm really happy that the hrtimer becomes softirq capable as it basically reverts this ugly commit from January 2009: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=6e5c172cf7ca1ab878cc6a6a4c1d52fef60f3ee0 From the

Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings

2017-07-31 Thread Oliver Hartkopp
Hi Kurt, On 07/28/2017 09:41 PM, Kurt Van Dijck wrote: The transceiver is an analog device that needs to support faster switching frequency (FETs) including minimizing delay to support CAN-FD ie higher bitrate. From the transceiver perspective the bits for "arbitration" and "data" look exactly

Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings

2017-07-28 Thread Oliver Hartkopp
Hi Kurt, On 07/28/2017 03:02 PM, Kurt Van Dijck wrote: The word 'max-arbitration-bitrate' makes the difference very clear. I think you are mixing up ISO layer 1 and ISO layer 2. In order to provide higher data throughput without putting extra limits on transceiver & wire, the requirement fo

Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings

2017-07-28 Thread Oliver Hartkopp
On 07/28/2017 06:57 AM, Kurt Van Dijck wrote: So while _a_ transceiver may be spec'd to 1MBit during arbitration, CAN FD packets may IMHO exceed that speed during data phase. When the bitrate is limited to 1Mbit/s you are ONLY allowed to use 1Mbit/s in the data section too (either with CAN or

Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings

2017-07-27 Thread Oliver Hartkopp
On 07/26/2017 08:29 PM, Franklin S Cooper Jr wrote: I'm fine with switching to using bitrate instead of speed. Kurk was originally the one that suggested to use the term arbitration and data since thats how the spec refers to it. Which I do agree with. But your right that in the drivers (stru

Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings

2017-07-26 Thread Oliver Hartkopp
On 07/26/2017 06:41 PM, Andrew Lunn wrote: On Mon, Jul 24, 2017 at 06:05:19PM -0500, Franklin S Cooper Jr wrote: + +Optional: + max-arbitration-speed: a positive non 0 value that determines the max + speed that CAN can run in non CAN-FD mode or during the +

Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings

2017-07-25 Thread Oliver Hartkopp
+ max-data-speed: a positive non 0 value that determines the max data rate + that can be used in CAN-FD mode. A value of -1 implies + CAN-FD is not supported by the transceiver. + +Examples: (..) + fixed-transceiver { + ma

Re: [PATCH 1/4] can: dev: Add support for limiting configured bitrate

2017-07-20 Thread Oliver Hartkopp
Hi Franklin, On 07/20/2017 01:36 AM, Franklin S Cooper Jr wrote: +#ifdef CONFIG_OF +void of_transceiver_is_fixed(struct net_device *dev) +{ (..) +} +EXPORT_SYMBOL(of_transceiver_is_fixed); +#endif I'm not sure about the naming here. As this is a CAN transceiver related option it should b

Re: [PATCH v4 1/4] can: m_can: move Message RAM initialization to function

2017-05-16 Thread Oliver Hartkopp
Hi Alexandre, On 05/16/2017 01:00 AM, Alexandre Belloni wrote: Hi, On 15/05/2017 at 20:51:30 -0700, Oliver Hartkopp wrote: On 05/15/2017 06:50 AM, Marc Kleine-Budde wrote: Looks good, added to linux-can-next. Isn't this a fix for linux-can instead? At least it would make no sense to

Re: [PATCH v4 1/4] can: m_can: move Message RAM initialization to function

2017-05-15 Thread Oliver Hartkopp
On 05/15/2017 06:50 AM, Marc Kleine-Budde wrote: On 05/12/2017 08:37 AM, Quentin Schulz wrote: Hi all, On 05/05/2017 15:50, Quentin Schulz wrote: To avoid possible ECC/parity checksum errors when reading an uninitialized buffer, the entire Message RAM is initialized when probing the driver.

Re: [PATCH net-next] can: fix build error without CONFIG_PROC_FS

2017-04-27 Thread Oliver Hartkopp
Hello Arnd, many thanks for your patch. Btw > static void canbcm_pernet_exit(struct net *net) > { > +#ifdef CONFIG_PROC_FS >/* remove /proc/net/can-bcm directory */ >if (IS_ENABLED(CONFIG_PROC_FS)) { >if (net->can.bcmproc_dir) >remove_proc_entry("can-bc

Re: linux-next: Tree for Apr 26 (net/can/bcm.c)

2017-04-26 Thread Oliver Hartkopp
Hi Randy, thanks for the report! Some fallout of my namespace support integration %-) I posted a patch for it: http://marc.info/?l=linux-can&m=149323049630039&w=2 Many thanks & best regards, Oliver On 04/26/2017 04:53 PM, Randy Dunlap wrote: On 04/26/17 01:03, Stephen Rothwell wrote: Hi al

Re: [PATCH v2] can: m_can: enable transmission of FD frame on latest version

2017-03-06 Thread Oliver Hartkopp
@Wenyou Yang: Can you please test the two patches posted here: [PATCH 1/2] can: m_can: handle bitrate setup on IP core >= 3.1.x http://marc.info/?l=linux-can&m=148883529927720&w=2 [PATCH 2/2] can: m_can: handle frame transmission on IP core >= 3.1.x http://marc.info/?l=linux-can&m=14888352992771

Re: [PATCH v2] can: m_can: enable transmission of FD frame on latest version

2017-03-06 Thread Oliver Hartkopp
om in the wild. Although I don't have a v3.0.x to test it should work from the documentation side of view. Reviewed-by: Oliver Hartkopp If we would like to make it really better, the code in m_can_start_xmit() should only fiddle with the M_CAN_CCCR register when working with the v3.0.x sili

Re: [PATCH] can: m_can: support transmit frame in CAN FD format

2017-03-05 Thread Oliver Hartkopp
The patch has some issues: On 03/03/2017 06:33 AM, Wenyou Yang wrote: Add support to transmit the frame in the CAN FD format and with the bit rate switching. This is a misleading comment. "can: m_can: support transmit frame in CAN FD format" is misleading too. You were able to send CAN FD fra

Re: [RESEND PATCH 1/1] can: m_can: fix bitrate setup on latest silicon

2017-02-19 Thread Oliver Hartkopp
Hi all, On 02/15/2017 03:08 PM, Quentin Schulz wrote: From: Florian Vallee According to the m_can user manual changelog the BTP register layout was updated with core revision 3.1.0 This change is not backward-compatible and using the current driver along with a recent IP results in an incorre

Re: [PATCH] can: Fix kernel panic at security_sock_rcv_skb

2017-01-14 Thread Oliver Hartkopp
Hello Eric, On 01/14/2017 04:43 AM, Liu Shuo wrote: On Thu 12.Jan'17 at 17:33:38 +0100, Oliver Hartkopp wrote: On 01/12/2017 02:01 PM, Eric Dumazet wrote: The main problem seems that the sockets themselves are not RCU protected. If CAN uses RCU for delivery, then sockets should be

Re: [PATCH] can: Fix kernel panic at security_sock_rcv_skb

2017-01-12 Thread Oliver Hartkopp
On 01/12/2017 02:01 PM, Eric Dumazet wrote: On Thu, 2017-01-12 at 09:22 +0100, Oliver Hartkopp wrote: But my main concern is: The reason why can_rx_delete_receiver() was introduced was the need to remove a huge number of receivers with can_rx_unregister(). When you call synchronize_rcu

Re: [PATCH] can: Fix kernel panic at security_sock_rcv_skb

2017-01-12 Thread Oliver Hartkopp
On 01/12/2017 07:33 AM, Liu ShuoX wrote: From: Zhang Yanmin The patch is for fix the below kernel panic: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] selinux_socket_sock_rcv_skb+0x65/0x2a0 Call Trace: [] security_sock_rcv_skb+0x4c/0x60 [] sk_filter+0x41/0x210 [

Re: net/can: warning in raw_setsockopt/__alloc_pages_slowpath

2016-12-02 Thread Oliver Hartkopp
On 12/02/2016 04:42 PM, Marc Kleine-Budde wrote: On 12/02/2016 04:11 PM, Oliver Hartkopp wrote: On 12/02/2016 02:24 PM, Marc Kleine-Budde wrote: On 12/02/2016 01:43 PM, Andrey Konovalov wrote: [] raw_setsockopt+0x1be/0x9f0 net/can/raw.c:506 We should add a check for a sensible

Re: net/can: warning in raw_setsockopt/__alloc_pages_slowpath

2016-12-02 Thread Oliver Hartkopp
On 12/02/2016 02:24 PM, Marc Kleine-Budde wrote: On 12/02/2016 01:43 PM, Andrey Konovalov wrote: [] raw_setsockopt+0x1be/0x9f0 net/can/raw.c:506 We should add a check for a sensible optlen static int raw_setsockopt(struct socket *sock, int level, int optname,

Re: net/can: use-after-free in bcm_rx_thr_flush

2016-11-22 Thread Oliver Hartkopp
On 11/22/2016 06:37 PM, Andrey Konovalov wrote: On Tue, Nov 22, 2016 at 6:29 PM, Oliver Hartkopp wrote: Hi Andrey, thanks for the report. Although I can't see the issue in the code ... Oh, I can see it now m( Will send a patch today. Many thanks, Oliver

Re: net/can: use-after-free in bcm_rx_thr_flush

2016-11-22 Thread Oliver Hartkopp
Hi Andrey, thanks for the report. Although I can't see the issue in the code ... On 11/22/2016 10:22 AM, Andrey Konovalov wrote: == BUG: KASAN: use-after-free in bcm_rx_thr_flush+0x284/0x2b0 Read of size 1 at addr 88006c1faae

Re: [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm

2016-11-21 Thread Oliver Hartkopp
them to be versioned. Add these declarations for x86, and an architecture-independent file that can be used for common symbols. User impact: kernels may fail to load modules at all when CONFIG_MODVERSIONS=y. late but great :-) Thanks for fixing this! Tested-by: Oliver Hartkopp (if you like) Regar

[PATCH] can: fix warning in bcm_connect/proc_register

2016-10-24 Thread Oliver Hartkopp
alov Suggested-by: Cong Wang Signed-off-by: Oliver Hartkopp --- net/can/bcm.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/net/can/bcm.c b/net/can/bcm.c index 8e999ff..8af9d25 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c @@ -1549,24 +154

Re: net/can: warning in bcm_connect/proc_register

2016-10-24 Thread Oliver Hartkopp
Hello Andrey, hello Cong, thanks for catching this issue. I added lock_sock() and a check for a failing proc_create_data() below. Can you please check if it solved the issue? I tested the patched version with the stress tool as advised by Andrey and did not see any problems in dmesg anymore.

Re: 'kbuild' merge before 4.9-rc1 breaks build and boot

2016-10-23 Thread Oliver Hartkopp
Hello Michal, your latest patch doesn't help on my system: http://git.kernel.org/cgit/linux/kernel/git/mmarek/kbuild.git/commit/?h=rc-fixes&id=989cea5c14be024e879c0055dc6d033680a52610 Regards, Oliver On 10/21/2016 06:23 PM, Oliver Hartkopp wrote: Hello Michal, I waited some days

Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver

2016-08-11 Thread Oliver Hartkopp
On 08/11/2016 10:58 AM, Andreas Werner wrote: On Thu, Aug 11, 2016 at 10:45:00AM +0200, Oliver Hartkopp wrote: When you still have the possibility to change the IP core I would suggest to create some kind of 16/32 bit value which you can pass to the CAN controller along with the CAN frame

Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver

2016-08-11 Thread Oliver Hartkopp
On 08/11/2016 09:14 AM, Andreas Werner wrote: On Wed, Aug 10, 2016 at 10:28:45PM +0200, Oliver Hartkopp wrote: Just check 'git grep IFF_ECHO'. Even grcan.c and janz-ican3.c have IFF_ECHO set - but implement it in a different way without using the provided machanism from dev.c .

Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver

2016-08-10 Thread Oliver Hartkopp
Hi Andreas, On 08/09/2016 08:10 AM, Andreas Werner wrote: On Mon, Aug 08, 2016 at 04:35:34PM +0200, Wolfgang Grandegger wrote: You specify here one echo_skb but it's not used anywhere. Local loopback seems not to be implemented. Agree with you, will set it to "0". No, the local loopback

Re: [PATCH] can: m_can: fix bitrate setup on latest silicon

2016-04-26 Thread Oliver Hartkopp
On 04/26/2016 03:46 PM, Florian Vallee wrote: According to the m_can user manual changelog the BTP register layout was updated with core revision 3.1.0 Hello Florian, nice to see a real v3.1.0 user emerging on the mailing list :-) I wonder whether this small change covers the updates made bet

Re: Linux 4.6 pci/host-hv merge error: PCI_HOTPLUG broken

2016-03-21 Thread Oliver Hartkopp
Oh. I've just seen that the issue was already fixed by Tero ... https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?h=for-linus&id=30b5b8808c12bcd947dd474980482561b69c1bcb Sorry for the noise! Regards, Oliver On 03/21/2016 09:19 PM, Oliver Hartkopp wrote: Hi Bjorn

Linux 4.6 pci/host-hv merge error: PCI_HOTPLUG broken

2016-03-21 Thread Oliver Hartkopp
Hi Bjorn, due to the merge of the branch 'pci/host-hv' the sourcing of the new PCI hotplug location was removed, see: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/pci/Kconfig?id=cfeb8139a1fbbbae3f1e986133f4e9e7833eeac4 Reported-by: Oliver Hartkopp

Re: [PATCH 12/12] [RFC] can: avoid using timeval for uapi

2015-10-05 Thread Oliver Hartkopp
gt; We could address problem a) by using '__u32' or 'int' members > rather than 'long', but that would have a more significant > downside in also breaking support for all existing 64-bit user > binaries that might be using this interface, which is likely > n

Re: [PATCH v8 0/4] can: Allwinner A10/A20 CAN Controller support - Summary

2015-09-17 Thread Oliver Hartkopp
Hi Maxime, On 17.09.2015 20:27, Maxime Ripard wrote: On Thu, Sep 17, 2015 at 08:12:31PM +0200, Oliver Hartkopp wrote: New CAN drivers go via can-next and net-next into mainline. Hmmm, actually, I meant 2 and 3, the two defconfig patches. The driver and bindings should of course go

Re: [PATCH v8 0/4] can: Allwinner A10/A20 CAN Controller support - Summary

2015-09-17 Thread Oliver Hartkopp
On 17.09.2015 19:54, Maxime Ripard wrote: On Wed, Sep 16, 2015 at 01:21:18PM +0200, Gerhard Bertelsmann wrote: Hi, please find attached the next version of my patch set. I have taken all remarks from Maxime Ripard into the new version Please review, test and report bugs if exists. The patch

Re: [PATCH - regression 4.1-rc8] can: fix loss of CAN frames in raw_rcv

2015-06-22 Thread Oliver Hartkopp
On 22.06.2015 13:49, Manfred Schlaegl wrote: On 2015-06-22 12:34, Oliver Hartkopp wrote: On 22.06.2015 12:10, Manfred Schlaegl wrote: Hypothetical example: If timestamping is enabled by the user and there is a significant delay between allocation and delivery of a skb (early allocation in

  1   2   >