From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
JBeulich@novell.com, jeremy@goop.org, ian.campbell@citrix.com,
joe@perches.com
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, stable@kernel.org
Subject: [PATCH 3/6] xen-swiotlb: Fix wrong panic.
Date: Fri, 26 Aug 2011 14:44:27 -0400 [thread overview]
Message-ID: <1314384270-19850-4-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1314384270-19850-1-git-send-email-konrad.wilk@oracle.com>
Propagate the baremetal git commit "swiotlb: fix wrong panic"
(fba99fa38b023224680308a482e12a0eca87e4e1) in the Xen-SWIOTLB version.
wherein swiotlb's map_page wrongly calls panic() when it can't find
a buffer fit for device's dma mask. It should return an error instead.
Devices with an odd dma mask (i.e. under 4G) like b44 network card hit
this bug (the system crashes):
http://marc.info/?l=linux-kernel&m=129648943830106&w=2
If xen-swiotlb returns an error, b44 driver can use the own bouncing
mechanism.
CC: stable@kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/swiotlb-xen.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index d45cbac..ea8c289 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -293,9 +293,10 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
/*
* Ensure that the address returned is DMA'ble
*/
- if (!dma_capable(dev, dev_addr, size))
- panic("map_single: bounce buffer is not DMA'ble");
-
+ if (!dma_capable(dev, dev_addr, size)) {
+ swiotlb_tbl_unmap_single(dev, map, size, dir);
+ dev_addr = 0;
+ }
return dev_addr;
}
EXPORT_SYMBOL_GPL(xen_swiotlb_map_page);
--
1.7.4.1
next prev parent reply other threads:[~2011-08-26 18:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-26 18:44 [PATCH v2] Xen PCI and Xen SWIOTLB patches for 3.2 Konrad Rzeszutek Wilk
2011-08-26 18:44 ` [PATCH 1/6] xen-pcifront: Update warning comment to use 'e820_host' option Konrad Rzeszutek Wilk
2011-08-26 18:44 ` [PATCH 2/6] xen-swiotlb: Retry up three times to allocate Xen-SWIOTLB Konrad Rzeszutek Wilk
2011-08-26 18:44 ` Konrad Rzeszutek Wilk [this message]
2011-08-26 18:44 ` [PATCH 4/6] xen-swiotlb: fix printk and panic args Konrad Rzeszutek Wilk
2011-08-26 18:44 ` [PATCH 5/6] xen/pci: make bus notifier handler return sane values Konrad Rzeszutek Wilk
2011-08-26 18:44 ` [PATCH 6/6] xen-swiotlb: When doing coherent alloc/dealloc check before swizzling the MFNs Konrad Rzeszutek Wilk
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=1314384270-19850-4-git-send-email-konrad.wilk@oracle.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@novell.com \
--cc=ian.campbell@citrix.com \
--cc=jeremy@goop.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=xen-devel@lists.xensource.com \
/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).