From: Michael Buesch <mb@bu3sch.de>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
"linux-kernel" <linux-kernel@vger.kernel.org>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Glauber Costa <gcosta@redhat.com>
Subject: [PATCH] ssb: Fix coherent DMA mask for PCI devices
Date: Thu, 12 Jun 2008 15:33:13 +0200 [thread overview]
Message-ID: <200806121533.14435.mb@bu3sch.de> (raw)
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;
next reply other threads:[~2008-06-12 13:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 13:33 Michael Buesch [this message]
[not found] ` <200806121533.14435.mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org>
2008-06-12 21:44 ` [PATCH] ssb: Fix coherent DMA mask for PCI devices Pekka Enberg
[not found] ` <84144f020806121444i43d381ehdee1774c135d8841-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-06-12 23:21 ` Michael Buesch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806121533.14435.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=gcosta@redhat.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).