Received: by 10.213.65.68 with SMTP id h4csp931508imn; Tue, 27 Mar 2018 11:26:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QDNJsIXpsI6E7Bb24nWkPIBhoU9w7aOUreFU4eVnOZGim7Ik502f1p4HLgWtzGBVamiKa X-Received: by 2002:a17:902:8ecb:: with SMTP id x11-v6mr392226plo.402.1522175213813; Tue, 27 Mar 2018 11:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522175213; cv=none; d=google.com; s=arc-20160816; b=hqRyW2PkQptOcIPrfNdYUpoo67OxOg/H6BhMx2UNfu6Yxa45P7OIbXOqoaRIWFj57n fC0vajwak1D7fjoSWdccBETsr+SF1lUGiDyZ7aaoZsJ5n17OP1jRvLsGDLShsmSzbkup mHOUhMYynXxo7PUAWpbDqSxet6Vht/j8CuwCGM4Tg4NpvIpZw/UHQ/zP1LnLoBX1GXHT TdkWsHFbiuaQxUZV9clkr4kiajmKRIFcsKDsxAH0Ex3KxRjXimHyORpvlPSiIv4kCvq9 FhQKsV5dqIcamN1gMSSz4eK8CO7p0mbjYEctQAFtcQ2Xa8r2ICNRgyicjK7howsmUMHK C+WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Oy28UGMdLpzEqoNoZohjXvq34CbASOk9Pwa9sp0QcvE=; b=EOaajGgwvZGGIS6cQ82Td5Fv4DXAcFSk+FLHpH5cxSbdH/dZu1lxSXpOjVqOP9bc+P xiLp1TI5QvW2UVvnsJtctLRDTBNU2fZjR10ZlfqhiVch8znBVmGL7x83zD+z8LuvXGtN 9Z7op7eilA6LT/91EGo5w8wlrcOEXfFslp5SMUgf5GR1Ife1hczDMTc59li8wajBU4mY LolAt1W30IlmgVYLP36+hbJOlEZ8sF9BotCjKeMXKgMHznjIkk74VN2BJ3wfq8wN1kKX YHc3bUl/su0Xdymwt0iqsgR+yU7LfClcWCrZ0CWatQWLTulVMVsrQcNOk4qliEIhfZ9X K64A== 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=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si1201582pgv.255.2018.03.27.11.26.39; Tue, 27 Mar 2018 11:26:53 -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=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbeC0SZD (ORCPT + 99 others); Tue, 27 Mar 2018 14:25:03 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:40389 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202AbeC0SZB (ORCPT ); Tue, 27 Mar 2018 14:25:01 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 15F2E10C04B2; Tue, 27 Mar 2018 11:24:59 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id CF4E83D19; Tue, 27 Mar 2018 11:24:59 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 1824E3D0F; Tue, 27 Mar 2018 11:24:58 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 27 Mar 2018 11:24:58 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 27 Mar 2018 23:54:55 +0530 Received: from [10.10.161.84] (10.10.161.84) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 27 Mar 2018 23:54:55 +0530 Subject: Re: dma-mapping: clearing GFP_ZERO flag caused crashes of Ethernet on arc/hsdk board. To: Andy Shevchenko , CC: Evgeniy Didin , "jesper.nilsson@axis.com" , Alexey Brodkin , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "geert@linux-m68k.org" , "dmaengine@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , Eugeniy Paltsev , "linux-arch@vger.kernel.org" , "linux-mm@kvack.org" References: <1522170774.2593.9.camel@synopsys.com> From: Vineet Gupta Message-ID: Date: Tue, 27 Mar 2018 11:24:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.10.161.84] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, Andy On 03/27/2018 11:11 AM, Andy Shevchenko wrote: > On Tue, Mar 27, 2018 at 8:12 PM, Evgeniy Didin > wrote: >> Hello, >> >> After commit 57bf5a8963f8 ("dma-mapping: clear harmful GFP_* flags in common code") we noticed problems with Ethernet controller on one of our platforms (namely ARC HSDK). >> I >> n particular we see that removal of __GFP_ZERO flag in function dma_alloc_attrs() was the culprit because in our implementation of arc_dma_alloc() we only allocate zeroed pages if >> that flag is explicitly set by the caller. Now with unconditional removal of that flag in dma_alloc_attrs() we allocate non-zeroed pages and that seem to cause problems. >> >> From >> mentioned commit message I may conclude that architectural code is supposed to always allocate zeroed pages but I cannot find any requirement of that in kernel's documentation. >> Coul >> d you please point me to that requirement if that exists at all, then we'll implement a fix in our arch code like that: [snip] > Another question why caller can't ask for zero pages explicitly? Question to whom ? The caller can ask for it - but the problem here is generic dma API code is clearing out GFP_ZERO and expecting arch code to memst unconditionally - is that expected of arch code - and is documented ? That is broken to begin with - arch dma_alloc* simply passes thru gfp flags to page allocator and doesn't muck around with them. We could in theory but doesn't seem like the right thing to do IMO. -Vineet