From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753738AbbBTHRD (ORCPT ); Fri, 20 Feb 2015 02:17:03 -0500 Received: from gate.crashing.org ([63.228.1.57]:49654 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbbBTHRB (ORCPT ); Fri, 20 Feb 2015 02:17:01 -0500 Message-ID: <1424416602.27448.36.camel@kernel.crashing.org> Subject: Re: Concerns about "mpt2sas: Added Reply Descriptor Post Queue (RDPQ) Array support" From: Benjamin Herrenschmidt To: Sreekanth Reddy Cc: "Martin K. Petersen" , James Bottomley , Linux Kernel Mailing List , scsi , Christoph Hellwig Date: Fri, 20 Feb 2015 18:16:42 +1100 In-Reply-To: <1424409761.27448.32.camel@kernel.crashing.org> References: <1424408500.27448.25.camel@kernel.crashing.org> <1424408769.27448.28.camel@kernel.crashing.org> <1424409761.27448.32.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-02-20 at 16:22 +1100, Benjamin Herrenschmidt wrote: > Looking a bit more closely, you basically do > > - set_dma_mask(64-bit) > - set_consistent_dma_mask(32-bit) > > Now, I don't know how x86 will react to the conflicting masks, but on > ppc64, I'm pretty sure the second one will barf. IE, the first one will > establish a set of direct mapping ops which give you a bypass of the > iommu to all of memory. The second one will then do a > dma_supported(mask) call which will hit the direct ops, and they will > fail since a 32-bit mask cannot address the bypass completely. > > Are architectures really required to support such mismatching dma_mask > and consistent_dma_mask ? what a bloody trainwreck ... :-( Oh well, looks like x86 supports it and it won't be too hard to support it on ppc64 as well. We even had some code along those lines for FSL platforms with an ifdef due to the amount of drivers that used to fail setting the consistent mask properly but that seems to be mostly fixed nowadays. Ben.