x86:pci: Change sta2x11_dma_ops stucture to use switolb_dma_supported as it's dma_supported function in sta2x11-fixup.c
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Nicholas Krause
This changes the structure
sta2x11_dma_opsstucture to useswitolb_dma_supportedas it's function fordma_supportedhardware verus setting this value to NULL as this should be set correctly for whendma_supportedfunction needs to be called for this hardware. Otherwise this will cause a bug that will crash a operation needing to access this function if an intended hardware operation needs to call it but the kernel has the function pointer for this structure set to NULL incorrectly.
This is a pretty vague description - what specific hardware is affected and how is the bug triggered?
Thanks,
Ingo
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 23 lines · nick
Quoted 13 lines · Ingo Molnar
Quoted 9 lines · Nicholas Krause
This changes the structure
sta2x11_dma_opsstucture to useswitolb_dma_supportedas it's function fordma_supportedhardware verus setting this value to NULL as this should be set correctly for whendma_supportedfunction needs to be called for this hardware. Otherwise this will cause a bug that will crash a operation needing to access this function if an intended hardware operation needs to call it but the kernel has the function pointer for this structure set to NULL incorrectly.Quoted 7 lines
This is a pretty vague description - what specific hardware is affected and how is the bug triggered?
Thanks,
Ingo
Quoted 8 lines
Ingo,
I am unaware of any hardware exactly that this effects. However this should be fixed as a preventive feature in order to avoid future bugs related to hardware that need this function to be supported by the kernel. If you wish I can rewrite the commit message stating this instead of my earlier commit message.
Fair enough, and yes, adding that info would be nice - just appending your explanation would do the trick for me!
Thanks,
Ingo
Bjorn Helgaas
maintainerQuoted 18 lines · Nicholas Krause
This changes the structure
sta2x11_dma_opsstucture to useswitolb_dma_supportedas it's function fordma_supportedhardware verus setting this value to NULL as this should be set correctly for whendma_supportedfunction needs to be called for this hardware. Otherwise this will cause a bug that will crash a operation needing to access this function if an intended hardware operation needs to call it but the kernel has the function pointer for this structure set to NULL incorrectly.Signed-off-by Nicholas Krause <[email protected]>--- arch/x86/pci/sta2x11-fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/pci/sta2x11-fixup.c +0
-0
arch/x86/pci/sta2x11-fixup.c static struct dma_map_ops sta2x11_dma_ops = { · line 194
Quoted 5 lines
arch/x86/pci/sta2x11-fixup.c +1
-1@@ -191,7 +191,7 @@ static struct dma_map_ops sta2x11_dma_ops = { .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, .sync_sg_for_device = swiotlb_sync_sg_for_device, .mapping_error = swiotlb_dma_mapping_error, - .dma_supported = NULL, /* FIXME: we should use this instead! */ + .dma_supported = switolb_dma_supported,
I don't think this compiles.
Quoted 6 lines
arch/x86/pci/sta2x11-fixup.c +0
-1};/* At setup time, we use our own ops if the device is a ConneXt one */ --2.1.0