Skip to contentSkip to conversation

x86:pci: Change sta2x11_dma_ops stucture to use switolb_dma_supported as it's dma_supported function in sta2x11-fixup.c

PATCH RESEND Ingo Molnar 2 participants 3 messages Feb 16, 2015 – Feb 18, 2015 2 messages not in the archive PCI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines · Nicholas Krause

This changes the structure sta2x11_dma_ops stucture to use switolb_dma_supported as it's function for dma_supported hardware verus setting this value to NULL as this should be set correctly for when dma_supported function 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]

#3 lore raw
Quoted 23 lines · nick
Quoted 13 lines · Ingo Molnar
Quoted 9 lines · Nicholas Krause

This changes the structure sta2x11_dma_ops stucture to use switolb_dma_supported as it's function for dma_supported hardware verus setting this value to NULL as this should be set correctly for when dma_supported function 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

maintainer
#4 lore raw
In reply to a message not in the archive
Quoted 18 lines · Nicholas Krause

This changes the structure sta2x11_dma_ops stucture to use switolb_dma_supported as it's function for dma_supported hardware verus setting this value to NULL as this should be set correctly for when dma_supported function 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.

---
 arch/x86/pci/sta2x11-fixup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/sta2x11-fixup.c +0 -0
index 5ceda85..d773a73 100644

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