Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965876Ab3HIJfW (ORCPT ); Fri, 9 Aug 2013 05:35:22 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:40842 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964961Ab3HIJfS (ORCPT ); Fri, 9 Aug 2013 05:35:18 -0400 Date: Fri, 9 Aug 2013 10:35:06 +0100 From: Russell King - ARM Linux To: Krzysztof =?utf-8?Q?Ha=C5=82asa?= Cc: linux-kernel@vger.kernel.org, James Bottomley , "David S. Miller" , Bjorn Helgaas , Greg Kroah-Hartman Subject: Re: DMA masks Message-ID: <20130809093506.GN23006@n2100.arm.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 28 On Fri, Aug 09, 2013 at 11:12:36AM +0200, Krzysztof HaƂasa wrote: > Hi, > > I'm trying to understand why the struct device contains a pointer to > dma_mask and not the actual dma_mask: > > struct device { > ... > > u64 *dma_mask; /* dma mask (if dma'able device) */ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "If dma-able device" gives a clue. It is now the case that the DMA API refuses DMA (via dma_supported) if the DMA mask pointer is NULL. So, we're now in the situation where this conveys information, and merely getting rid of the indirection loses information which may be (and probably is) relied upon by drivers. However, placing the storage for the dma_mask pointer into struct device is something which I've recently discussed with Greg, and is something he'd like to see happen, so I'll be adding that to my DMA masks patch series in the very near future. -- 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/