Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763028AbYCUWri (ORCPT ); Fri, 21 Mar 2008 18:47:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762489AbYCUWpz (ORCPT ); Fri, 21 Mar 2008 18:45:55 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:34686 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762436AbYCUWpx (ORCPT ); Fri, 21 Mar 2008 18:45:53 -0400 Message-Id: <20080321224346.817519507@sous-sol.org> References: <20080321224250.144333319@sous-sol.org> User-Agent: quilt/0.46-1 Date: Fri, 21 Mar 2008 15:43:10 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org, jejb@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, James Bottomley , Greg Kroah-Hartman Subject: [patch 20/76] drivers: fix dma_get_required_mask Content-Disposition: inline; filename=drivers-fix-dma_get_required_mask.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1479 Lines: 40 -stable review patch. If anyone has any objections, please let us know. --------------------- From: James Bottomley 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. Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- drivers/base/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -647,7 +647,7 @@ u64 dma_get_required_mask(struct device 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 -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/