ide: fix crash at boot with siimage driver
PATCH 1/1 ide: fix crash at boot with siimage driver
Some change to the IDE layer are causing the siimage driver to crash at boot with a NULL dereference. This is due to the sil_dma_ops not containing all the necessary pointers. I suppose it used to just "override" the defaults while now, it needs to contain everything.
---
drivers/ide/pci/siimage.c +7 -0
@@ -780,7 +780,14 @@ static const struct ide_port_ops sil_sat };static struct ide_dma_ops sil_dma_ops = { + .dma_host_set = ide_dma_host_set, + .dma_setup = ide_dma_setup, + .dma_exec_cmd = ide_dma_exec_cmd, + .dma_start = ide_dma_start, + .dma_end = __ide_dma_end, .dma_test_irq = siimage_dma_test_irq, + .dma_timeout = ide_dma_timeout, + .dma_lost_irq = ide_dma_lost_irq, };#define DECLARE_SII_DEV (name_str, p_ops) \
Hello.
Quoted 4 lines · Benjamin Herrenschmidt
Some change to the IDE layer are causing the siimage driver to crash at boot with a NULL dereference. This is due to the
sil_dma_opsnot containing all the necessary pointers. I suppose it used to just "override" the defaults while now, it needs to contain everything.
Both the patch introducing 'struct ide_dma_ops' into drivers and making
them 'const' were in the same batch. However, the latter patch (now commit f37afdaca711838b50ecd89b9c15fc745270d77c) erroneously missed siimage.c -- which I didn't notice when reviewing, sigh...
drivers/ide/pci/siimage.c static const struct ide_port_ops sil_sat · line 782
Quoted 11 lines
Signed-off-by Benjamin Herrenschmidt <[email protected]>---
Index:
linux-work/drivers/ide/pci/siimage.c
===================================================================drivers/ide/pci/siimage.c +0
-0@@ -780,7 +780,14 @@ static const struct ide_port_ops sil_sat };static struct ide_dma_ops sil_dma_ops = {
Could you please make this 'const' -- the same way as the mentioned commit
does in other drivers?
drivers/ide/pci/siimage.c static const struct ide_port_ops sil_sat · line 793
Quoted 11 lines
drivers/ide/pci/siimage.c +7
-0+ .dma_host_set = ide_dma_host_set, + .dma_setup = ide_dma_setup, + .dma_exec_cmd = ide_dma_exec_cmd, + .dma_start = ide_dma_start, + .dma_end = __ide_dma_end, .dma_test_irq = siimage_dma_test_irq, + .dma_timeout = ide_dma_timeout, + .dma_lost_irq = ide_dma_lost_irq, };#define DECLARE_SII_DEV (name_str, p_ops) \
MBR, Sergei
Bartlomiej Zolnierkiewicz
AppliedQuoted 9 lines · Sergei Shtylyov
Hello.
Quoted 4 lines · Benjamin Herrenschmidt
Some change to the IDE layer are causing the siimage driver to crash at boot with a NULL dereference. This is due to the
sil_dma_opsnot containing all the necessary pointers. I suppose it used to just "override" the defaults while now, it needs to contain everything.
Quoted 6 lines
Both the patch introducing 'struct
ide_dma_ops' into drivers and making
them 'const' were in the same batch. However, the latter patch (now commitf37afdaca711838b50ecd89b9c15fc745270d77c) erroneously missedsiimage.c-- which I didn't notice when reviewing, sigh...Quoted 1 line
Signed-off-by Benjamin Herrenschmidt <[email protected]>
Applied, thanks for fixing it.
Quoted 9 lines
Quoted 9 lines
---
Index:
linux-work/drivers/ide/pci/siimage.c
===================================================================drivers/ide/pci/siimage.c +0
-0@@ -780,7 +780,14 @@ static const struct ide_port_ops sil_sat };
Quoted 4 lines
drivers/ide/pci/siimage.c static const struct ide_port_ops sil_sat · line 782
Quoted 1 line
drivers/ide/pci/siimage.c +0
-0static struct ide_dma_ops sil_dma_ops = {Could you please make this 'const' -- the same way as the mentioned commit
does in other drivers?
Thanks for noticing, I took care of it while merging the patch.
Quoted 11 lines
Quoted 11 lines
drivers/ide/pci/siimage.c +7
-0+ .dma_host_set = ide_dma_host_set, + .dma_setup = ide_dma_setup, + .dma_exec_cmd = ide_dma_exec_cmd, + .dma_start = ide_dma_start, + .dma_end = __ide_dma_end, .dma_test_irq = siimage_dma_test_irq, + .dma_timeout = ide_dma_timeout, + .dma_lost_irq = ide_dma_lost_irq, };#define DECLARE_SII_DEV (name_str, p_ops) \