Re: [PATCH] ssb: Fix coherent DMA mask for PCI devices

Previous thread: [GIT PULL] one kbuild fix for powerpc by Sam Ravnborg on Thursday, June 12, 2008 - 9:16 am. (3 messages)

Next thread: [PATCH 0/3][BUGFIX] configfs: Fix deadlock rmdir() vs rename() by Louis Rilling on Thursday, June 12, 2008 - 9:31 am. (1 message)
To: John Linville <linville@...>
Cc: <linux-wireless@...>, <netdev@...>, linux-kernel <linux-kernel@...>, Kirill A. Shutemov <kirill@...>, Glauber Costa <gcosta@...>
Date: Thursday, June 12, 2008 - 9:33 am

This fixes setting the coherent DMA mask for PCI devices.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

John, please queue this bugfix for 2.6.26

The whole SSB DMA API should be rewritten, as it makes too many bad
assumptions about the other subsytems. I will do that soon.
But let's apply this patch for now, as it fixes this particular bug.

Index: wireless-testing/drivers/ssb/main.c
===================================================================
--- wireless-testing.orig/drivers/ssb/main.c 2008-05-17 18:44:32.000000000 +0200
+++ wireless-testing/drivers/ssb/main.c 2008-06-12 15:24:04.000000000 +0200
@@ -1165,21 +1165,27 @@ u32 ssb_dma_translation(struct ssb_devic
}
EXPORT_SYMBOL(ssb_dma_translation);

int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask)
{
struct device *dma_dev = ssb_dev->dma_dev;
+ int err = 0;

#ifdef CONFIG_SSB_PCIHOST
- if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI)
- return dma_set_mask(dma_dev, mask);
+ if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) {
+ err = pci_set_dma_mask(ssb_dev->bus->host_pci, mask);
+ if (err)
+ return err;
+ err = pci_set_consistent_dma_mask(ssb_dev->bus->host_pci, mask);
+ return err;
+ }
#endif
dma_dev->coherent_dma_mask = mask;
dma_dev->dma_mask = &dma_dev->coherent_dma_mask;

- return 0;
+ return err;
}
EXPORT_SYMBOL(ssb_dma_set_mask);

int ssb_bus_may_powerdown(struct ssb_bus *bus)
{
struct ssb_chipcommon *cc;
--

To: Michael Buesch <mb@...>
Cc: John Linville <linville@...>, <linux-wireless@...>, <netdev@...>, linux-kernel <linux-kernel@...>, Kirill A. Shutemov <kirill@...>, Glauber Costa <gcosta@...>
Date: Thursday, June 12, 2008 - 5:44 pm

Hmm. Does the patch have anything to do with this bug report?

http://bugzilla.kernel.org/show_bug.cgi?id=10819
--

To: Pekka Enberg <penberg@...>
Cc: John Linville <linville@...>, <linux-wireless@...>, <netdev@...>, linux-kernel <linux-kernel@...>, Kirill A. Shutemov <kirill@...>, Glauber Costa <gcosta@...>
Date: Thursday, June 12, 2008 - 7:21 pm

Sorry. Magic crystal ball is broken. :)
Can you please try?

--
Greetings Michael.
--

Previous thread: [GIT PULL] one kbuild fix for powerpc by Sam Ravnborg on Thursday, June 12, 2008 - 9:16 am. (3 messages)

Next thread: [PATCH 0/3][BUGFIX] configfs: Fix deadlock rmdir() vs rename() by Louis Rilling on Thursday, June 12, 2008 - 9:31 am. (1 message)