Re: Oops in ssi (through nokia-modem)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sebastian, Pavel,

On 08/12/2021 22:07, Pavel Machek wrote:
> Hi!
> 
>> As soon as nokia-modem on my Nokia N900 gets used, I get the following
>> warning, followed by an oops [1]. I believe the nokia-modem module is
>> probed with the "pm=1" argument, but that doesn't seem particularly
>> important given the trace, I think.
> 
> Actually, it seems two warnings and an oops.
> 
>>> [  165.467529] IPv6: ADDRCONF(NETDEV_CHANGE): phonet0: link becomes ready
>>> [  165.498687] ------------[ cut here ]------------
>>> [  165.503417] WARNING: CPU: 0 PID: 662 at kernel/dma/mapping.c:188 __dma_map_sg_attrs+0xd8/0x100
> 
> This one should be easy. __dma_map_sg_attrs
> 
>         if (WARN_ON_ONCE(!dev->dma_mask))
> 		return 0;
> 
> someone forgot to set the mask. ssi_start_dma() has some dev_dbgs,
> could you make sure they end up in the logs?
> 
> Maybe it is as simple as adding dma_set_mask() somehwere?
> dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ?
> 
> 
>>> [  165.787841] ---[ end trace a3f2b689bab17aa5 ]---
>>> [  166.436523] irq 26: nobody cared (try booting with the "irqpoll" option)
>>> [  166.443298] CPU: 0 PID: 662 Comm: irq/83-SSI PORT Tainted: G        W         5.15.2-218696-g31e48a7f0946-dirty #1
>>> [  166.453704] Hardware name: Nokia RX-51 board
> 
> Second warning here. We don't have handler for irq 26. 
> 
>>> [  166.593566] 8<--- cut here ---
>>> [  166.600799] Unable to handle kernel NULL pointer dereference at virtual address 00000000
>>> [  166.608978] pgd = 34df813c
>>> [  166.611724] [00000000] *pgd=00000000
> 
> And now the oops...

It looks like the warnings and oops go together. I realised that v5.9
was fine, linux-5.9.y (stable) was not, so I did a bisect on that, and
found this commit (upstream commit in the description).

> $ git bisect good
> 4e57482e8440fac7137832629109730ea4b267aa is the first bad commit
> commit 4e57482e8440fac7137832629109730ea4b267aa
> Author: Thomas Tai <thomas.tai@xxxxxxxxxx>
> Date:   Thu Sep 17 18:43:03 2020 +0200
> 
>     dma-direct: Fix potential NULL pointer dereference
> 
>     [ Upstream commit f959dcd6ddfd29235030e8026471ac1b022ad2b0 ]
> 
>     When booting the kernel v5.9-rc4 on a VM, the kernel would panic when
>     printing a warning message in swiotlb_map(). The dev->dma_mask must not
>     be a NULL pointer when calling the dma mapping layer. A NULL pointer
>     check can potentially avoid the panic.
> 
>     Signed-off-by: Thomas Tai <thomas.tai@xxxxxxxxxx>
>     Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
>     Signed-off-by: Christoph Hellwig <hch@xxxxxx>
>     Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> 
>  include/linux/dma-direct.h |  3 ---
>  kernel/dma/mapping.c       | 11 +++++++++++
>  2 files changed, 11 insertions(+), 3 deletions(-)

So it sounds like setting the dev->dma_mask in the driver is the right
fix, as Pavel suggested. The commit returns an error when the mask is
NULL and that is probably what causes the oops later on. I'll try look
at fixing this soon, unless someone beats me to it. I suppose we'll want
this potential fix in the stable trees as well.

Regards,
Merlijn



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux