From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966039AbcHEBF0 (ORCPT ); Thu, 4 Aug 2016 21:05:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965351AbcHEBFX (ORCPT ); Thu, 4 Aug 2016 21:05:23 -0400 Date: Thu, 4 Aug 2016 18:05:01 -0700 From: Andrew Morton To: Mauricio Faria de Oliveira Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, corbet@lwn.net, rmk+kernel@arm.linux.org.uk, keith.busch@intel.com, axboe@fb.com, benh@kernel.crashing.org, mpe@ellerman.id.au, k.kozlowski@samsung.com Subject: Re: [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce the DMA_ATTR_NO_WARN attribute Message-Id: <20160804180501.f80c9b919341c486e2a95894@linux-foundation.org> In-Reply-To: <57A3DB17.3060603@linux.vnet.ibm.com> References: <1470092390-25451-1-git-send-email-mauricfo@linux.vnet.ibm.com> <20160804150145.fb5690e9a873121db1dfa0b1@linux-foundation.org> <57A3DB17.3060603@linux.vnet.ibm.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Aug 2016 21:17:27 -0300 Mauricio Faria de Oliveira wrote: > > [snip] An alternative (and more idiomatic) fix would be to > > change the blk_rq_map_sg() interface to permit passing down some > > foo_NOWARN flag and propagating that down the stack into > > ppc_iommu_map_sg(). Was this approach evaluated? I suspect it might > > be messy. > > I see; I haven't evaluated that, but agree with you it might be messy. > > As far as I can see, in order to pass something to blk_rq_map_sg() and > have it eventually make into ppc_iommu_map_sg(), that something should > be present in the scatterlist -- which seems to be what's common/passed > to both blk_rq_map_sg() (the interface point proposed) and dma_map_sg() > (which is the function which reaches ppc_iommu_map_sg() down the chain). > > It seems a bit hidden, and (if I got the suggestion right), it doesn't > seem to be in the scope of scatterlist to contain such a flag. > > One point of the patches is make the attribute visible/explicit; I see > it can be inconvenient sometimes, but it allows for a clear / evident > difference between dma_map_sg() calls which are (not) OK with failures. > > (for example, the 2 calls in nvme_map_data() - they can return either > BLK_MQ_RQ_QUEUE_BUSY or BLK_MQ_RQ_QUEUE_ERROR - so the former is OK.) Of course, the alternative is to just delete the damn warnings from ppc_iommu_map_sg(). Imagine that! Have they ever been of any use to anyone?