All of lore.kernel.org
 help / color / mirror / Atom feed
* flexcan introduced a DIV/0 in kernel
@ 2021-04-09 10:18 Koen Vandeputte
  2021-04-09 11:21 ` Marc Kleine-Budde
  2021-04-12  1:56 ` Joakim Zhang
  0 siblings, 2 replies; 7+ messages in thread
From: Koen Vandeputte @ 2021-04-09 10:18 UTC (permalink / raw)
  To: linux-can; +Cc: wg, mkl, netdev, qiangqing.zhang, gregkh

Hi All,

I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229
Booting it shows the splat below on each run. [1]


It seems there are 2 patches regarding flexcan which were introduced in 
4.14.226

--> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
--> bb7c9039a396 ("can: flexcan: assert FRZ bit in flexcan_chip_freeze()")

Reverting these fixes the splat.

Hope this helps,

Koen



[1]

[   10.062140] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver 
not found, using dummy regulator
[   10.071631] Division by zero in kernel.
[   10.075511] CPU: 0 PID: 1061 Comm: kmodloader Not tainted 4.14.229 #0
[   10.081981] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   10.088529] Backtrace:
[   10.091040] [<8010ba30>] (dump_backtrace) from [<8010bdd4>] 
(show_stack+0x18/0x1c)
[   10.098631]  r7:9f5edc10 r6:60000013 r5:00000000 r4:80932c88
[   10.104336] [<8010bdbc>] (show_stack) from [<8063f8e0>] 
(dump_stack+0x9c/0xb0)
[   10.111591] [<8063f844>] (dump_stack) from [<8010bb90>] 
(__div0+0x1c/0x20)
[   10.118491]  r7:9f5edc10 r6:a0f0c000 r5:9ea3fd40 r4:9ea3f800
[   10.124199] [<8010bb74>] (__div0) from [<8063de94>] (Ldiv0+0x8/0x10)
[   10.130611] [<7f32b334>] (flexcan_mailbox_read [flexcan]) from 
[<7f32c480>] (flexcan_probe+0x360/0x468 [flexcan])
[   10.140902]  r7:9f5edc10 r6:a0f0c000 r5:9ea3fd40 r4:9ea3f800
[   10.146608] [<7f32c120>] (flexcan_probe [flexcan]) from [<8040f384>] 
(platform_drv_probe+0x60/0xb4)
[   10.155698]  r10:80903c08 r9:00000000 r8:0000000d r7:fffffdfb 
r6:7f32e014 r5:fffffffe
[   10.163562]  r4:9f5edc10
[   10.166117] [<8040f324>] (platform_drv_probe) from [<8040db78>] 
(driver_probe_device+0x154/0x2ec)
[   10.175012]  r7:7f32e014 r6:00000000 r5:9f5edc10 r4:80964928
[   10.180720] [<8040da24>] (driver_probe_device) from [<8040dd98>] 
(__driver_attach+0x88/0xac)
[   10.189195]  r9:7f32e080 r8:014000c0 r7:00000000 r6:9f5edc44 
r5:7f32e014 r4:9f5edc10
[   10.196985] [<8040dd10>] (__driver_attach) from [<8040bfc0>] 
(bus_for_each_dev+0x54/0xa8)
[   10.205199]  r7:00000000 r6:8040dd10 r5:7f32e014 r4:00000000
[   10.210891] [<8040bf6c>] (bus_for_each_dev) from [<8040d4ac>] 
(driver_attach+0x24/0x28)
[   10.218912]  r6:9e41e880 r5:8091b340 r4:7f32e014
[   10.223559] [<8040d488>] (driver_attach) from [<8040d0a0>] 
(bus_add_driver+0xf4/0x204)
[   10.231529] [<8040cfac>] (bus_add_driver) from [<8040e4e8>] 
(driver_register+0xb0/0xec)
[   10.239574]  r7:7f331000 r6:00000000 r5:ffffe000 r4:7f32e014
[   10.245266] [<8040e438>] (driver_register) from [<8040f2d4>] 
(__platform_driver_register+0x48/0x50)
[   10.254332]  r5:ffffe000 r4:80903c08
[   10.257953] [<8040f28c>] (__platform_driver_register) from 
[<7f331020>] (init_module+0x20/0x1000 [flexcan])
[   10.267729] [<7f331000>] (init_module [flexcan]) from [<80101a1c>] 
(do_one_initcall+0xc4/0x188)
[   10.276490] [<80101958>] (do_one_initcall) from [<80192458>] 
(do_init_module+0x68/0x204)
[   10.284615]  r9:7f32e080 r8:014000c0 r7:00000000 r6:9e48b640 
r5:9e4af000 r4:7f32e080
[   10.292389] [<801923f0>] (do_init_module) from [<801944b4>] 
(load_module+0x1e1c/0x220c)
[   10.300441]  r7:00000000 r6:9e4af1a8 r5:9e4af000 r4:9e8f3f30
[   10.306158] [<80192698>] (load_module) from [<80194a00>] 
(SyS_init_module+0x15c/0x17c)
[   10.314110]  r10:00000051 r9:000128ce r8:ffffe000 r7:001e545c 
r6:00000000 r5:a0f0945c
[   10.321957]  r4:0000345c
[   10.324541] [<801948a4>] (SyS_init_module) from [<801079e0>] 
(ret_fast_syscall+0x0/0x54)
[   10.332663]  r10:00000080 r9:9e8f2000 r8:80107be4 r7:00000080 
r6:00000003 r5:00000000
[   10.340511]  r4:00000000
[   10.344089] flexcan 2090000.flexcan: device registered 
(reg_base=a0f0c000, irq=33)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: flexcan introduced a DIV/0 in kernel
  2021-04-09 10:18 flexcan introduced a DIV/0 in kernel Koen Vandeputte
@ 2021-04-09 11:21 ` Marc Kleine-Budde
  2021-04-09 11:32   ` Greg KH
  2021-04-09 12:55   ` Koen Vandeputte
  2021-04-12  1:56 ` Joakim Zhang
  1 sibling, 2 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2021-04-09 11:21 UTC (permalink / raw)
  To: Koen Vandeputte, linux-can; +Cc: wg, netdev, qiangqing.zhang, gregkh


[-- Attachment #1.1: Type: text/plain, Size: 935 bytes --]

On 4/9/21 12:18 PM, Koen Vandeputte wrote:
> Hi All,
> 
> I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229
> Booting it shows the splat below on each run. [1]
> 
> 
> It seems there are 2 patches regarding flexcan which were introduced in 
> 4.14.226
> 
> --> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
> --> bb7c9039a396 ("can: flexcan: assert FRZ bit in flexcan_chip_freeze()")
> 
> Reverting these fixes the splat.

This patch should fix the problem:

47c5e474bc1e can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing
bitrate

Greg, can you pick this up for v4.14?

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: flexcan introduced a DIV/0 in kernel
  2021-04-09 11:21 ` Marc Kleine-Budde
@ 2021-04-09 11:32   ` Greg KH
  2021-04-09 12:55   ` Koen Vandeputte
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2021-04-09 11:32 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Koen Vandeputte, linux-can, wg, netdev, qiangqing.zhang

On Fri, Apr 09, 2021 at 01:21:05PM +0200, Marc Kleine-Budde wrote:
> On 4/9/21 12:18 PM, Koen Vandeputte wrote:
> > Hi All,
> > 
> > I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229
> > Booting it shows the splat below on each run. [1]
> > 
> > 
> > It seems there are 2 patches regarding flexcan which were introduced in 
> > 4.14.226
> > 
> > --> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
> > --> bb7c9039a396 ("can: flexcan: assert FRZ bit in flexcan_chip_freeze()")
> > 
> > Reverting these fixes the splat.
> 
> This patch should fix the problem:
> 
> 47c5e474bc1e can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing
> bitrate
> 
> Greg, can you pick this up for v4.14?

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: flexcan introduced a DIV/0 in kernel
  2021-04-09 11:21 ` Marc Kleine-Budde
  2021-04-09 11:32   ` Greg KH
@ 2021-04-09 12:55   ` Koen Vandeputte
  2021-04-09 13:10     ` Marc Kleine-Budde
  1 sibling, 1 reply; 7+ messages in thread
From: Koen Vandeputte @ 2021-04-09 12:55 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can; +Cc: wg, netdev, qiangqing.zhang, gregkh


On 09.04.21 13:21, Marc Kleine-Budde wrote:
> On 4/9/21 12:18 PM, Koen Vandeputte wrote:
>> Hi All,
>>
>> I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229
>> Booting it shows the splat below on each run. [1]
>>
>>
>> It seems there are 2 patches regarding flexcan which were introduced in
>> 4.14.226
>>
>> --> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
>> --> bb7c9039a396 ("can: flexcan: assert FRZ bit in flexcan_chip_freeze()")
>>
>> Reverting these fixes the splat.
> This patch should fix the problem:
>
> 47c5e474bc1e can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing
> bitrate
>
> Greg, can you pick this up for v4.14?
>
> regards,
> Marc
>
Checking kernels 4.4 & 4.9 shows that this fix is also missing over there.


Marc,

Can you confirm that it's also required for these?


Thanks,

Koen


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: flexcan introduced a DIV/0 in kernel
  2021-04-09 12:55   ` Koen Vandeputte
@ 2021-04-09 13:10     ` Marc Kleine-Budde
  2021-04-09 13:27       ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Marc Kleine-Budde @ 2021-04-09 13:10 UTC (permalink / raw)
  To: Koen Vandeputte; +Cc: linux-can, wg, netdev, qiangqing.zhang, gregkh

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

On 09.04.2021 14:55:59, Koen Vandeputte wrote:
> 
> On 09.04.21 13:21, Marc Kleine-Budde wrote:
> > On 4/9/21 12:18 PM, Koen Vandeputte wrote:
> > > Hi All,
> > > 
> > > I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229
> > > Booting it shows the splat below on each run. [1]
> > > 
> > > 
> > > It seems there are 2 patches regarding flexcan which were introduced in
> > > 4.14.226
> > > 
> > > --> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
> > > --> bb7c9039a396 ("can: flexcan: assert FRZ bit in flexcan_chip_freeze()")
> > > 
> > > Reverting these fixes the splat.
> > This patch should fix the problem:
> > 
> > 47c5e474bc1e can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing
> > bitrate
> > 
> > Greg, can you pick this up for v4.14?
> > 
> > regards,
> > Marc
> > 
> Checking kernels 4.4 & 4.9 shows that this fix is also missing over there.
> 
> Marc,
> Can you confirm that it's also required for these?

ACK, the fix is needed for v4.4.265 and v4.9.265.

Thanks for checking this,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: flexcan introduced a DIV/0 in kernel
  2021-04-09 13:10     ` Marc Kleine-Budde
@ 2021-04-09 13:27       ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2021-04-09 13:27 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Koen Vandeputte, linux-can, wg, netdev, qiangqing.zhang

On Fri, Apr 09, 2021 at 03:10:01PM +0200, Marc Kleine-Budde wrote:
> On 09.04.2021 14:55:59, Koen Vandeputte wrote:
> > 
> > On 09.04.21 13:21, Marc Kleine-Budde wrote:
> > > On 4/9/21 12:18 PM, Koen Vandeputte wrote:
> > > > Hi All,
> > > > 
> > > > I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229
> > > > Booting it shows the splat below on each run. [1]
> > > > 
> > > > 
> > > > It seems there are 2 patches regarding flexcan which were introduced in
> > > > 4.14.226
> > > > 
> > > > --> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
> > > > --> bb7c9039a396 ("can: flexcan: assert FRZ bit in flexcan_chip_freeze()")
> > > > 
> > > > Reverting these fixes the splat.
> > > This patch should fix the problem:
> > > 
> > > 47c5e474bc1e can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing
> > > bitrate
> > > 
> > > Greg, can you pick this up for v4.14?
> > > 
> > > regards,
> > > Marc
> > > 
> > Checking kernels 4.4 & 4.9 shows that this fix is also missing over there.
> > 
> > Marc,
> > Can you confirm that it's also required for these?
> 
> ACK, the fix is needed for v4.4.265 and v4.9.265.

Now queued up there too, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: flexcan introduced a DIV/0 in kernel
  2021-04-09 10:18 flexcan introduced a DIV/0 in kernel Koen Vandeputte
  2021-04-09 11:21 ` Marc Kleine-Budde
@ 2021-04-12  1:56 ` Joakim Zhang
  1 sibling, 0 replies; 7+ messages in thread
From: Joakim Zhang @ 2021-04-12  1:56 UTC (permalink / raw)
  To: Koen Vandeputte, linux-can; +Cc: wg, mkl, netdev, gregkh


Hi Koen, Mac,

Sorry about this regression, it has caused inconvenience to many people.

I tested the first version, but only double check the logic after improving the patch per Mac's advice.

I will keep in mind, test each version before upstream to avoid unexpected issues, sorry.

Best Regards,
Joakim Zhang

> -----Original Message-----
> From: Koen Vandeputte <koen.vandeputte@citymesh.com>
> Sent: 2021年4月9日 18:18
> To: linux-can@vger.kernel.org
> Cc: wg@grandegger.com; mkl@pengutronix.de; netdev@vger.kernel.org;
> Joakim Zhang <qiangqing.zhang@nxp.com>; gregkh@linuxfoundation.org
> Subject: flexcan introduced a DIV/0 in kernel
> 
> Hi All,
> 
> I just updated kernel 4.14 within OpenWRT from 4.14.224 to 4.14.229 Booting
> it shows the splat below on each run. [1]
> 
> 
> It seems there are 2 patches regarding flexcan which were introduced in
> 4.14.226
> 
> --> ce59ffca5c49 ("can: flexcan: enable RX FIFO after FRZ/HALT valid")
> --> bb7c9039a396 ("can: flexcan: assert FRZ bit in
> --> flexcan_chip_freeze()")
> 
> Reverting these fixes the splat.
> 
> Hope this helps,
> 
> Koen
> 
> 
> 
> [1]
> 
> [   10.062140] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not
> found, using dummy regulator [   10.071631] Division by zero in kernel.
> [   10.075511] CPU: 0 PID: 1061 Comm: kmodloader Not tainted 4.14.229 #0
> [   10.081981] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [   10.088529] Backtrace:
> [   10.091040] [<8010ba30>] (dump_backtrace) from [<8010bdd4>]
> (show_stack+0x18/0x1c)
> [   10.098631]  r7:9f5edc10 r6:60000013 r5:00000000 r4:80932c88
> [   10.104336] [<8010bdbc>] (show_stack) from [<8063f8e0>]
> (dump_stack+0x9c/0xb0)
> [   10.111591] [<8063f844>] (dump_stack) from [<8010bb90>]
> (__div0+0x1c/0x20)
> [   10.118491]  r7:9f5edc10 r6:a0f0c000 r5:9ea3fd40 r4:9ea3f800
> [   10.124199] [<8010bb74>] (__div0) from [<8063de94>] (Ldiv0+0x8/0x10)
> [   10.130611] [<7f32b334>] (flexcan_mailbox_read [flexcan]) from
> [<7f32c480>] (flexcan_probe+0x360/0x468 [flexcan])
> [   10.140902]  r7:9f5edc10 r6:a0f0c000 r5:9ea3fd40 r4:9ea3f800
> [   10.146608] [<7f32c120>] (flexcan_probe [flexcan]) from [<8040f384>]
> (platform_drv_probe+0x60/0xb4)
> [   10.155698]  r10:80903c08 r9:00000000 r8:0000000d r7:fffffdfb
> r6:7f32e014 r5:fffffffe
> [   10.163562]  r4:9f5edc10
> [   10.166117] [<8040f324>] (platform_drv_probe) from [<8040db78>]
> (driver_probe_device+0x154/0x2ec)
> [   10.175012]  r7:7f32e014 r6:00000000 r5:9f5edc10 r4:80964928
> [   10.180720] [<8040da24>] (driver_probe_device) from [<8040dd98>]
> (__driver_attach+0x88/0xac)
> [   10.189195]  r9:7f32e080 r8:014000c0 r7:00000000 r6:9f5edc44
> r5:7f32e014 r4:9f5edc10
> [   10.196985] [<8040dd10>] (__driver_attach) from [<8040bfc0>]
> (bus_for_each_dev+0x54/0xa8)
> [   10.205199]  r7:00000000 r6:8040dd10 r5:7f32e014 r4:00000000
> [   10.210891] [<8040bf6c>] (bus_for_each_dev) from [<8040d4ac>]
> (driver_attach+0x24/0x28)
> [   10.218912]  r6:9e41e880 r5:8091b340 r4:7f32e014 [   10.223559]
> [<8040d488>] (driver_attach) from [<8040d0a0>]
> (bus_add_driver+0xf4/0x204)
> [   10.231529] [<8040cfac>] (bus_add_driver) from [<8040e4e8>]
> (driver_register+0xb0/0xec)
> [   10.239574]  r7:7f331000 r6:00000000 r5:ffffe000 r4:7f32e014
> [   10.245266] [<8040e438>] (driver_register) from [<8040f2d4>]
> (__platform_driver_register+0x48/0x50)
> [   10.254332]  r5:ffffe000 r4:80903c08
> [   10.257953] [<8040f28c>] (__platform_driver_register) from [<7f331020>]
> (init_module+0x20/0x1000 [flexcan]) [   10.267729] [<7f331000>]
> (init_module [flexcan]) from [<80101a1c>]
> (do_one_initcall+0xc4/0x188)
> [   10.276490] [<80101958>] (do_one_initcall) from [<80192458>]
> (do_init_module+0x68/0x204)
> [   10.284615]  r9:7f32e080 r8:014000c0 r7:00000000 r6:9e48b640
> r5:9e4af000 r4:7f32e080
> [   10.292389] [<801923f0>] (do_init_module) from [<801944b4>]
> (load_module+0x1e1c/0x220c)
> [   10.300441]  r7:00000000 r6:9e4af1a8 r5:9e4af000 r4:9e8f3f30
> [   10.306158] [<80192698>] (load_module) from [<80194a00>]
> (SyS_init_module+0x15c/0x17c)
> [   10.314110]  r10:00000051 r9:000128ce r8:ffffe000 r7:001e545c
> r6:00000000 r5:a0f0945c
> [   10.321957]  r4:0000345c
> [   10.324541] [<801948a4>] (SyS_init_module) from [<801079e0>]
> (ret_fast_syscall+0x0/0x54)
> [   10.332663]  r10:00000080 r9:9e8f2000 r8:80107be4 r7:00000080
> r6:00000003 r5:00000000
> [   10.340511]  r4:00000000
> [   10.344089] flexcan 2090000.flexcan: device registered
> (reg_base=a0f0c000, irq=33)
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-12  1:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 10:18 flexcan introduced a DIV/0 in kernel Koen Vandeputte
2021-04-09 11:21 ` Marc Kleine-Budde
2021-04-09 11:32   ` Greg KH
2021-04-09 12:55   ` Koen Vandeputte
2021-04-09 13:10     ` Marc Kleine-Budde
2021-04-09 13:27       ` Greg KH
2021-04-12  1:56 ` Joakim Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.