* [BUG] mtd: rawnand: denali_pci: page fault when probing fails
@ 2022-04-10 14:17 ` Zheyu Ma
0 siblings, 0 replies; 6+ messages in thread
From: Zheyu Ma @ 2022-04-10 14:17 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr; +Cc: linux-mtd, Linux Kernel Mailing List
Hello,
I found a bug in the denali_pci module.
When the driver fails to probe, we will get the following splat:
[ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for
irq 0x1000
[ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
[ 4.473538] nand: No NAND device found
[ 4.474068] BUG: unable to handle page fault for address:
ffffc90005000410
[ 4.475169] #PF: supervisor write access in kernel mode
[ 4.475579] #PF: error_code(0x0002) - not-present page
[ 4.478362] RIP: 0010:iowrite32+0x9/0x50
[ 4.486068] Call Trace:
[ 4.486269] <IRQ>
[ 4.486443] denali_isr+0x15b/0x300 [denali]
[ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
[ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
[ 4.487571] handle_irq_event+0x7d/0x1b0
[ 4.487884] handle_fasteoi_irq+0x2b0/0x770
[ 4.488219] __common_interrupt+0xc8/0x1b0
[ 4.488549] common_interrupt+0x9a/0xc0
It seems that the driver unmap the memory region before disabling the irq.
Regards,
Zheyu Ma
^ permalink raw reply [flat|nested] 6+ messages in thread
* [BUG] mtd: rawnand: denali_pci: page fault when probing fails
@ 2022-04-10 14:17 ` Zheyu Ma
0 siblings, 0 replies; 6+ messages in thread
From: Zheyu Ma @ 2022-04-10 14:17 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr; +Cc: linux-mtd, Linux Kernel Mailing List
Hello,
I found a bug in the denali_pci module.
When the driver fails to probe, we will get the following splat:
[ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for
irq 0x1000
[ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
[ 4.473538] nand: No NAND device found
[ 4.474068] BUG: unable to handle page fault for address:
ffffc90005000410
[ 4.475169] #PF: supervisor write access in kernel mode
[ 4.475579] #PF: error_code(0x0002) - not-present page
[ 4.478362] RIP: 0010:iowrite32+0x9/0x50
[ 4.486068] Call Trace:
[ 4.486269] <IRQ>
[ 4.486443] denali_isr+0x15b/0x300 [denali]
[ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
[ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
[ 4.487571] handle_irq_event+0x7d/0x1b0
[ 4.487884] handle_fasteoi_irq+0x2b0/0x770
[ 4.488219] __common_interrupt+0xc8/0x1b0
[ 4.488549] common_interrupt+0x9a/0xc0
It seems that the driver unmap the memory region before disabling the irq.
Regards,
Zheyu Ma
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] mtd: rawnand: denali_pci: page fault when probing fails
2022-04-10 14:17 ` Zheyu Ma
@ 2022-04-11 7:37 ` Miquel Raynal
-1 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2022-04-11 7:37 UTC (permalink / raw)
To: Zheyu Ma; +Cc: richard, vigneshr, linux-mtd, Linux Kernel Mailing List
Hi Zheyu,
zheyuma97@gmail.com wrote on Sun, 10 Apr 2022 22:17:35 +0800:
> Hello,
>
> I found a bug in the denali_pci module.
> When the driver fails to probe, we will get the following splat:
>
> [ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for
> irq 0x1000
> [ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
> [ 4.473538] nand: No NAND device found
> [ 4.474068] BUG: unable to handle page fault for address:
> ffffc90005000410
> [ 4.475169] #PF: supervisor write access in kernel mode
> [ 4.475579] #PF: error_code(0x0002) - not-present page
> [ 4.478362] RIP: 0010:iowrite32+0x9/0x50
> [ 4.486068] Call Trace:
> [ 4.486269] <IRQ>
> [ 4.486443] denali_isr+0x15b/0x300 [denali]
> [ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
> [ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
> [ 4.487571] handle_irq_event+0x7d/0x1b0
> [ 4.487884] handle_fasteoi_irq+0x2b0/0x770
> [ 4.488219] __common_interrupt+0xc8/0x1b0
> [ 4.488549] common_interrupt+0x9a/0xc0
>
> It seems that the driver unmap the memory region before disabling the irq.
Thanks for the report! The mapping is done with devm_ helpers and so is
the IRQ registration, so it's slightly more complicated that just
moving a function call in the remove path, apparently. Would you mind
investigating and proposing a patch?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] mtd: rawnand: denali_pci: page fault when probing fails
@ 2022-04-11 7:37 ` Miquel Raynal
0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2022-04-11 7:37 UTC (permalink / raw)
To: Zheyu Ma; +Cc: richard, vigneshr, linux-mtd, Linux Kernel Mailing List
Hi Zheyu,
zheyuma97@gmail.com wrote on Sun, 10 Apr 2022 22:17:35 +0800:
> Hello,
>
> I found a bug in the denali_pci module.
> When the driver fails to probe, we will get the following splat:
>
> [ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for
> irq 0x1000
> [ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
> [ 4.473538] nand: No NAND device found
> [ 4.474068] BUG: unable to handle page fault for address:
> ffffc90005000410
> [ 4.475169] #PF: supervisor write access in kernel mode
> [ 4.475579] #PF: error_code(0x0002) - not-present page
> [ 4.478362] RIP: 0010:iowrite32+0x9/0x50
> [ 4.486068] Call Trace:
> [ 4.486269] <IRQ>
> [ 4.486443] denali_isr+0x15b/0x300 [denali]
> [ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
> [ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
> [ 4.487571] handle_irq_event+0x7d/0x1b0
> [ 4.487884] handle_fasteoi_irq+0x2b0/0x770
> [ 4.488219] __common_interrupt+0xc8/0x1b0
> [ 4.488549] common_interrupt+0x9a/0xc0
>
> It seems that the driver unmap the memory region before disabling the irq.
Thanks for the report! The mapping is done with devm_ helpers and so is
the IRQ registration, so it's slightly more complicated that just
moving a function call in the remove path, apparently. Would you mind
investigating and proposing a patch?
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] mtd: rawnand: denali_pci: page fault when probing fails
2022-04-11 7:37 ` Miquel Raynal
@ 2022-04-11 11:23 ` Zheyu Ma
-1 siblings, 0 replies; 6+ messages in thread
From: Zheyu Ma @ 2022-04-11 11:23 UTC (permalink / raw)
To: Miquel Raynal; +Cc: richard, vigneshr, linux-mtd, Linux Kernel Mailing List
On Mon, Apr 11, 2022 at 3:37 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Zheyu,
>
> zheyuma97@gmail.com wrote on Sun, 10 Apr 2022 22:17:35 +0800:
>
> > Hello,
> >
> > I found a bug in the denali_pci module.
> > When the driver fails to probe, we will get the following splat:
> >
> > [ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for
> > irq 0x1000
> > [ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
> > [ 4.473538] nand: No NAND device found
> > [ 4.474068] BUG: unable to handle page fault for address:
> > ffffc90005000410
> > [ 4.475169] #PF: supervisor write access in kernel mode
> > [ 4.475579] #PF: error_code(0x0002) - not-present page
> > [ 4.478362] RIP: 0010:iowrite32+0x9/0x50
> > [ 4.486068] Call Trace:
> > [ 4.486269] <IRQ>
> > [ 4.486443] denali_isr+0x15b/0x300 [denali]
> > [ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
> > [ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
> > [ 4.487571] handle_irq_event+0x7d/0x1b0
> > [ 4.487884] handle_fasteoi_irq+0x2b0/0x770
> > [ 4.488219] __common_interrupt+0xc8/0x1b0
> > [ 4.488549] common_interrupt+0x9a/0xc0
> >
> > It seems that the driver unmap the memory region before disabling the irq.
>
> Thanks for the report! The mapping is done with devm_ helpers and so is
> the IRQ registration, so it's slightly more complicated that just
> moving a function call in the remove path, apparently. Would you mind
> investigating and proposing a patch?
I have proposed a patch for this issue, please correct me if I am wrong.
Thanks,
Zheyu Ma
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] mtd: rawnand: denali_pci: page fault when probing fails
@ 2022-04-11 11:23 ` Zheyu Ma
0 siblings, 0 replies; 6+ messages in thread
From: Zheyu Ma @ 2022-04-11 11:23 UTC (permalink / raw)
To: Miquel Raynal; +Cc: richard, vigneshr, linux-mtd, Linux Kernel Mailing List
On Mon, Apr 11, 2022 at 3:37 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Zheyu,
>
> zheyuma97@gmail.com wrote on Sun, 10 Apr 2022 22:17:35 +0800:
>
> > Hello,
> >
> > I found a bug in the denali_pci module.
> > When the driver fails to probe, we will get the following splat:
> >
> > [ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for
> > irq 0x1000
> > [ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
> > [ 4.473538] nand: No NAND device found
> > [ 4.474068] BUG: unable to handle page fault for address:
> > ffffc90005000410
> > [ 4.475169] #PF: supervisor write access in kernel mode
> > [ 4.475579] #PF: error_code(0x0002) - not-present page
> > [ 4.478362] RIP: 0010:iowrite32+0x9/0x50
> > [ 4.486068] Call Trace:
> > [ 4.486269] <IRQ>
> > [ 4.486443] denali_isr+0x15b/0x300 [denali]
> > [ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
> > [ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
> > [ 4.487571] handle_irq_event+0x7d/0x1b0
> > [ 4.487884] handle_fasteoi_irq+0x2b0/0x770
> > [ 4.488219] __common_interrupt+0xc8/0x1b0
> > [ 4.488549] common_interrupt+0x9a/0xc0
> >
> > It seems that the driver unmap the memory region before disabling the irq.
>
> Thanks for the report! The mapping is done with devm_ helpers and so is
> the IRQ registration, so it's slightly more complicated that just
> moving a function call in the remove path, apparently. Would you mind
> investigating and proposing a patch?
I have proposed a patch for this issue, please correct me if I am wrong.
Thanks,
Zheyu Ma
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-11 11:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10 14:17 [BUG] mtd: rawnand: denali_pci: page fault when probing fails Zheyu Ma
2022-04-10 14:17 ` Zheyu Ma
2022-04-11 7:37 ` Miquel Raynal
2022-04-11 7:37 ` Miquel Raynal
2022-04-11 11:23 ` Zheyu Ma
2022-04-11 11:23 ` Zheyu Ma
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.