From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A143C4321D for ; Mon, 20 Aug 2018 02:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 177EF20C0C for ; Mon, 20 Aug 2018 02:55:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 177EF20C0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=davemloft.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbeHTGIz (ORCPT ); Mon, 20 Aug 2018 02:08:55 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:39758 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbeHTGIz (ORCPT ); Mon, 20 Aug 2018 02:08:55 -0400 Received: from localhost (unknown [172.58.41.21]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id AF994147494BE; Sun, 19 Aug 2018 19:55:08 -0700 (PDT) Date: Sun, 19 Aug 2018 19:55:05 -0700 (PDT) Message-Id: <20180819.195505.1988137313680465320.davem@davemloft.net> To: brian.brooks@linaro.org Cc: 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 Subject: Re: [PATCH] net: mvpp2: avoid bouncing buffers From: David Miller In-Reply-To: <20180820024730.9147-1-brian.brooks@linaro.org> References: <20180820024730.9147-1-brian.brooks@linaro.org> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 19 Aug 2018 19:55:09 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks.