Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3549963imm; Mon, 20 Aug 2018 00:04:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxw+uuQU3HrV7AbH5p0M9PcNrVeHeYLVJ6H7+3N/Wmp3G875PLT1RaLO+82SplqlDl3YLUh X-Received: by 2002:a63:ec43:: with SMTP id r3-v6mr41296849pgj.295.1534748646294; Mon, 20 Aug 2018 00:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534748646; cv=none; d=google.com; s=arc-20160816; b=lYAiKrsEZzsxv56MPvXiBuQhgSfLFWn5wBHNbtgLskHCWOnGD3AZRi5A6S65Cq14Ms G+lp0DDdn+b1c3jLX9SKcXuy/2AXvsngaWmrOF/9Ir/0xzCrHSFk0YkJUhEgudpv7xV2 oejuIoQh5oeY12z7WGnxDQCT9tO7NEEDQTS3rHcyKSmM2HWb//aMzDg7Qs1U9AU3crN5 baZwFRpopkduqRkz/3V455CXvbVYOKjDEuq80+ix3Eg+NlmHZtShsTqhC4pFixnOR/pS BJkOCqsiObGEUY9Lr679d4hEFuSNo70IZFBMKDzchwpOqxon+olCv8jBJ13FwRJ+xoin 0R3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=KOvWWnjNuRg5n45nsgAjLXDXaL7UloHoQQkKHmCPzYA=; b=fkD1mwZY+PODSsM6uKyGyNiUvxOHPOgBbpv9QAlhGu6Zb+o9lRoYJzN8CMRMhvTqvw 73SrLON841KSf/lkz5sZKaUNzgviKAoBGKnS7C5ImRDyyidUZEjW+LMQ+HBxyritrVFp 8h2EpvUqQtdqOlOc4oUj3wHb85qT6EE9fCgWbXmdplieacGjNPVgFPOcdL12Y5MhPJbq 6x5r8ldX/u6zoiAEkuQts4GpbBrI1h+l1dvT9GG6bemeM32xhFDPuilcIWQvyXJNOLJ6 Jj1gW8/EtwUA3AqtrE07GbfzlF9+U7sDWW/XHDI0DbD8L8aw1CKEUK+y/2K5pJOmBimK lTXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22-v6si9381674pfl.220.2018.08.20.00.03.50; Mon, 20 Aug 2018 00:04:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726174AbeHTKRO (ORCPT + 99 others); Mon, 20 Aug 2018 06:17:14 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:32788 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbeHTKRO (ORCPT ); Mon, 20 Aug 2018 06:17:14 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7K6xww1032286; Mon, 20 Aug 2018 00:02:16 -0700 Received: from il-exch02.marvell.com ([199.203.130.102]) by mx0b-0016f401.pphosted.com with ESMTP id 2kxjyhd3pm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 20 Aug 2018 00:02:15 -0700 Received: from IL-EXCH01.marvell.com (10.4.102.220) by IL-EXCH02.marvell.com (10.4.102.221) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 20 Aug 2018 10:02:13 +0300 Received: from IL-EXCH01.marvell.com ([fe80::5d63:81cd:31e2:fc36]) by IL-EXCH01.marvell.com ([fe80::5d63:81cd:31e2:fc36%20]) with mapi id 15.00.1210.000; Mon, 20 Aug 2018 10:02:12 +0300 From: Yan Markman To: Christoph Hellwig , David Miller CC: "brian.brooks@linaro.org" , "antoine.tenart@bootlin.com" , "maxime.chevallier@bootlin.com" , "Stefan Chulski" , "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 Thread-Topic: [PATCH] net: mvpp2: avoid bouncing buffers Thread-Index: AQHUODE62236Kn8eQ0iIUx1wbhA8MqTH+e4AgAA79OA= Date: Mon, 20 Aug 2018 07:02:12 +0000 Message-ID: <88db0c1b20fc466f815d0e8382a156dc@IL-EXCH01.marvell.com> References: <20180820024730.9147-1-brian.brooks@linaro.org> <20180819.195505.1988137313680465320.davem@davemloft.net> <20180820062326.GA22222@infradead.org> In-Reply-To: <20180820062326.GA22222@infradead.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [199.203.130.14] Content-Type: multipart/mixed; boundary="_002_88db0c1b20fc466f815d0e8382a156dcILEXCH01marvellcom_" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-20_02:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=1 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=1 clxscore=1011 lowpriorityscore=0 mlxscore=1 impostorscore=0 mlxlogscore=209 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808200076 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --_002_88db0c1b20fc466f815d0e8382a156dcILEXCH01marvellcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi everybody The MVPP2 code already has DMA's patch taken from OLD Backport and placed b= y Antoine Tenart. Please refer the attached=20 Best regards Yan Markman -----Original Message----- From: Christoph Hellwig [mailto:hch@infradead.org]=20 Sent: Monday, August 20, 2018 9:23 AM To: David Miller Cc: brian.brooks@linaro.org; antoine.tenart@bootlin.com; maxime.chevallier@= bootlin.com; Yan Markman ; Stefan Chulski ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; bjorn.top= el@intel.com; brian.brooks@arm.com Subject: Re: [PATCH] net: mvpp2: avoid bouncing buffers 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 >=20 > > @@ -5126,6 +5126,12 @@ static int mvpp2_probe(struct platform_device *p= dev) > > } > > =20 > > if (priv->hw_version =3D=3D 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 =3D &priv->dma_mask; >=20 > The platform code might be doing this exactly because it cannot=20 > support different coherent and streaming DMA masks. >=20 > Well, in any case, the platform code is doing it for a reason and=20 > overriding this in a "driver" of all places seems totally=20 > inappropriate and at best a layering violation. >=20 > I would rather you fix this in a way that involves well defined APIs=20 > that set the DMA masks or whatever to the values that you need, rather=20 > than going behind the platform code's back and changing the DMA mask=20 > pointer like this. Agreed. What platform do you see this issue on? --_002_88db0c1b20fc466f815d0e8382a156dcILEXCH01marvellcom_ Content-Type: application/octet-stream; name="0009-net-mvpp2-fix-the-dma_mask-and-coherent_dma_mask-set.patch" Content-Description: 0009-net-mvpp2-fix-the-dma_mask-and-coherent_dma_mask-set.patch Content-Disposition: attachment; filename="0009-net-mvpp2-fix-the-dma_mask-and-coherent_dma_mask-set.patch"; size=3572; creation-date="Mon, 20 Aug 2018 06:56:56 GMT"; modification-date="Thu, 09 Aug 2018 22:08:13 GMT" Content-Transfer-Encoding: base64 RnJvbSA4MTBmYWY0NTMzZDM0M2ZlMWRmODQ4NTNiN2UyMmZjMjczM2E4ZWE5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbnRvaW5lIFRlbmFydCA8YW50b2luZS50ZW5hcnRAYm9vdGxp bi5jb20+CkRhdGU6IFdlZCwgOCBBdWcgMjAxOCAxNDozMDo1OCArMDMwMApTdWJqZWN0OiBbUEFU Q0ggMDkvNDBdIG5ldDogbXZwcDI6IGZpeCB0aGUgZG1hX21hc2sgYW5kIGNvaGVyZW50X2RtYV9t YXNrCiBzZXR0aW5ncwoKVGhlIGRldi0+ZG1hX21hc2sgdXN1YWxseSBwb2ludHMgdG8gZGV2LT5j b2hlcmVudF9kbWFfbWFzay4gVGhpcyBpcyBhbgppc3N1ZSBhcyBzZXR0aW5nIGJvdGggb2YgdGhl bSB3aWxsIG92ZXJyaWRlIHRoZSBvdGhlci4gVGhpcyBpcwpwcm9ibGVtYXRpYyBoZXJlIGFzIHRo ZSBQUHYyIGRyaXZlciB1c2VzIGEgMzItYml0LW1hc2sgZm9yIGNvaGVyZW50CmFjY2Vzc2VzICh0 eHEsIHJ4cSwgYm0pIGFuZCBhIDQwLWJpdCBtYXNrIGZvciBhbGwgb3RoZXIgYWNjZXNzZXMgZHVl IHRvCmFuIGhhcmR3YXJlIGxpbWl0YXRpb24uCgpUaGlzIGNhbiBsZWFkIHRvIGEgbWVtb3J5IHJl bWFwIGZvciBhbGwgZG1hX21hcF9zaW5nbGUoKSBjYWxscyB3aGVuCmRlYWxpbmcgd2l0aCBtZW1v cnkgYWJvdmUgNEdCLgoKQ2hhbmdlLUlkOiBJYjhhMDRhMDZhMWYzMGJmYTQzYjYyMjUwZjIxY2Zl MDk0NjRkOTFlZAp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