From: Tomas Henzl <thenzl@redhat.com> Date: Thu, 30 Apr 2009 18:17:04 +0300 Subject: [misc] drivers fix dma_get_required_mask Message-id: 49F9C0F0.6000301@redhat.com O-Subject: [RHEL5.4 PATCH4/3] drivers fix dma_get_required_mask Bugzilla: 475455 RH-Acked-by: David Milburn <dmilburn@redhat.com> Resolves bz475455 The mpt patches are OK, I think we miss in rhel5 upstream commit e88a0c2ca81207a75afe5bbb8020541dabf606ac I'd prefer adding this patch to rhel, but I could also change the mpt patch to not use dma_get_required_mask (as it was before). "There's a bug in the current implementation of dma_get_required_mask() where it ands the returned mask with the current device mask. This rather defeats the purpose if you're using the call to determine what your mask should be (since you will at that time have the default DMA_32BIT_MASK). This bug results in any driver that uses this function *always* getting a 32 bit mask, which is wrong. Fix by removing the and with dev->dma_mask." Tomas diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 2b8755d..e90c4e1 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -558,7 +558,7 @@ u64 dma_get_required_mask(struct device *dev) high_totalram += high_totalram - 1; mask = (((u64)high_totalram) << 32) + 0xffffffff; } - return mask & *dev->dma_mask; + return mask; } EXPORT_SYMBOL_GPL(dma_get_required_mask); #endif