From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] net: mvpp2: avoid bouncing buffers Date: Sun, 19 Aug 2018 23:23:26 -0700 Message-ID: <20180820062326.GA22222@infradead.org> References: <20180820024730.9147-1-brian.brooks@linaro.org> <20180819.195505.1988137313680465320.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: brian.brooks@linaro.org, antoine.tenart@bootlin.com, maxime.chevallier@bootlin.com, ymarkman@marvell.com, stefanc@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.topel@intel.com, brian.brooks@arm.com To: David Miller Return-path: Received: from bombadil.infradead.org ([198.137.202.133]:48082 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbeHTJhu (ORCPT ); Mon, 20 Aug 2018 05:37:50 -0400 Content-Disposition: inline In-Reply-To: <20180819.195505.1988137313680465320.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, Aug 19, 2018 at 07:55:05PM -0700, David Miller wrote: > From: Brian Brooks > Date: Sun, 19 Aug 2018 21:47:30 -0500 > > > @@ -5126,6 +5126,12 @@ static int mvpp2_probe(struct platform_device *pdev) > > } > > > > if (priv->hw_version == MVPP22) { > > + /* Platform code may have set dev->dma_mask to point > > + * to dev->coherent_dma_mask, but we want to ensure > > + * they take different values due to comment below. > > + */ > > + pdev->dev.dma_mask = &priv->dma_mask; > > The platform code might be doing this exactly because it cannot support > different coherent and streaming DMA masks. > > Well, in any case, the platform code is doing it for a reason and > overriding this in a "driver" of all places seems totally > inappropriate and at best a layering violation. > > I would rather you fix this in a way that involves well defined APIs > that set the DMA masks or whatever to the values that you need, rather > than going behind the platform code's back and changing the DMA mask > pointer like this. Agreed. What platform do you see this issue on?