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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 68B77C3A5A2 for ; Fri, 23 Aug 2019 12:58:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A1D22339D for ; Fri, 23 Aug 2019 12:58:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="K2lhocEt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="x3UMbC/b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A1D22339D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kf/qu1xZD7E3JiG1QtTkR72Ruwsa/dIT5yuWq/TM1Ks=; b=K2lhocEtYtTLBe mAOCqkBU8b1FYf0LQSTdv01+XFBQ14mS1eOm2Ac2x/wICcZLhHfwGvPcFZ5VqByxqiyMMjJqN73e0 tlCMv1Dzf4wHxn8OweboKU+7TANb9/19vBXuTFSOGAX7Bhz9+Wn38pD6CQ1vLOYAjSyYr+ud1Cwk/ 1gv1CEUaAxTzVCaQfAeCoITvMltVTme1TSgEVInGzEdFCfi0gmIjj8Tx4xZqGdFh9ey2dTovlosaq jwb+QkyeFqUU9kV96EQkvnY1aFtiVAu9G4nTwIDiWg6rt5C2JA+r+dmYOnL9JPl1crVJtItcX7vjP PpqyqTXkRwS5vxpTi/kA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i198h-0001Z5-Tk; Fri, 23 Aug 2019 12:57:59 +0000 Received: from conssluserg-05.nifty.com ([210.131.2.90]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i198f-0001Yh-An for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2019 12:57:59 +0000 Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) (authenticated) by conssluserg-05.nifty.com with ESMTP id x7NCvTVI031822 for ; Fri, 23 Aug 2019 21:57:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com x7NCvTVI031822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566565050; bh=Ub/aJVgL0Rn8PS4l6h9MNegKzCHvoAER+77sx19M0UY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=x3UMbC/bnXW7WwUIPfky1srdR+lkOf6ENu7W4g32BgP9neaRCruuC32JcjlhjxN50 JCL5rpdimcwEhwnUW6elfxYfS2nlO2SCXR6k01yAU1wN83eOMb5beFGx/3cx7HTwq6 n+rpv8LepgsA0BDfGZ0UHdpzQ5RSS7mI5TAxFCuzoboOT0g3d/M0HxQu4SVst8XDYo Ud5zaiI4DPM58r7+q3a6n5/a8MgSRX31R8Xn3IsduQFic7/qGwzMYkn6xELF578JDr aZxbRSKfBjDcn4O0xsYJjWy3uimPl8qTSQPR0ww3RhRIGaDq66wYW2dit4Q6M7c7ja N/LW4Lt0Fgyng== X-Nifty-SrcIP: [209.85.217.41] Received: by mail-vs1-f41.google.com with SMTP id y16so6164351vsc.3 for ; Fri, 23 Aug 2019 05:57:29 -0700 (PDT) X-Gm-Message-State: APjAAAVUVFOi3RWT1w6CvWb3XPTGA+Clrm6Vo4BQJOVeukPjfTZtJ8hd 4HD14aGJ3m6bNHTuNsQHQLuwaXC4O1ul4g+Gtf4= X-Google-Smtp-Source: APXvYqxkUJRBa4Gu9eJJ/5yY3HcOprjiA+d7CfrbMqgNuwpDTZWvyQ2suLPAbzt4RY2ouQTzsdu17SpfNRdBFLKueKM= X-Received: by 2002:a67:8a83:: with SMTP id m125mr2655031vsd.181.1566565048153; Fri, 23 Aug 2019 05:57:28 -0700 (PDT) MIME-Version: 1.0 References: <20190506223334.1834-1-nicoleotsuka@gmail.com> <20190506223334.1834-3-nicoleotsuka@gmail.com> In-Reply-To: From: Masahiro Yamada Date: Fri, 23 Aug 2019 21:56:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] dma-contiguous: Use fallback alloc_pages for single pages To: Nicolin Chen , Christoph Hellwig , linux-mmc , Ulf Hansson , Adrian Hunter X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190823_055757_596274_7B440F2F X-CRM114-Status: GOOD ( 22.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Zankel , linux-xtensa@linux-xtensa.org, Kees Cook , Stephen Rothwell , Tony Lindgren , Catalin Marinas , Joerg Roedel , Will Deacon , Russell King , iommu@lists.linux-foundation.org, Linux Kernel Mailing List , Max Filippov , Wolfram Sang , iamjoonsoo.kim@lge.com, Andrew Morton , Thierry Reding , Robin Murphy , David Woodhouse , linux-arm-kernel , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org + linux-mmc, Ulf Hansson, Adrian Hunter, ADMA of SDHCI is not working since bd2e75633c8012fc8a7431c82fda66237133bf7e Did anybody see the same problem? Masahiro On Fri, Aug 23, 2019 at 9:49 PM Masahiro Yamada wrote: > > On Tue, May 7, 2019 at 7:36 AM Nicolin Chen wrote: > > > > The addresses within a single page are always contiguous, so it's > > not so necessary to always allocate one single page from CMA area. > > Since the CMA area has a limited predefined size of space, it may > > run out of space in heavy use cases, where there might be quite a > > lot CMA pages being allocated for single pages. > > > > However, there is also a concern that a device might care where a > > page comes from -- it might expect the page from CMA area and act > > differently if the page doesn't. > > > > This patch tries to use the fallback alloc_pages path, instead of > > one-page size allocations from the global CMA area in case that a > > device does not have its own CMA area. This'd save resources from > > the CMA global area for more CMA allocations, and also reduce CMA > > fragmentations resulted from trivial allocations. > > > > Signed-off-by: Nicolin Chen > > > This commit (bd2e75633c8012fc8a7431c82fda66237133bf7e) > broke the DMA for my MMC driver in the following way: > > > > > [ 1.876755] mmc0: ADMA error > [ 1.883385] mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== > [ 1.889834] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00000002 > [ 1.896284] mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001 > [ 1.902733] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 > [ 1.909182] mmc0: sdhci: Present: 0x01ff02f6 | Host ctl: 0x00000019 > [ 1.915631] mmc0: sdhci: Power: 0x0000000b | Blk gap: 0x00000000 > [ 1.922081] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x0000fa07 > [ 1.928530] mmc0: sdhci: Timeout: 0x0000000b | Int stat: 0x00000001 > [ 1.934981] mmc0: sdhci: Int enab: 0x03ff008b | Sig enab: 0x03ff008b > [ 1.941429] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000001 > [ 1.947880] mmc0: sdhci: Caps: 0x546ec800 | Caps_1: 0x00000000 > [ 1.954329] mmc0: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000 > [ 1.960778] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xffffffff > [ 1.967229] mmc0: sdhci: Resp[2]: 0x320f5903 | Resp[3]: 0x3fd05e00 > [ 1.973678] mmc0: sdhci: Host ctl2: 0x00000000 > [ 1.978125] mmc0: sdhci: ADMA Err: 0x00000001 | ADMA Ptr: 0x000000013965b200 > [ 1.985271] mmc0: sdhci: ============================================ > [ 1.991758] mmc0: error -5 whilst initialising MMC card > [ 1.991913] 43fb0000.uart: ttyS1 at MMIO 0x43fb0000 (irq = 0, > base_baud = 768000) is a 16550A > [ 2.011011] hctosys: unable to open rtc device (rtc0) > [ 2.017694] Freeing unused kernel memory: 2368K > [ 2.027131] Run /init as init process > Starting syslogd: OK > Starting klogd: OK > Initializing random number generator... [ 2.074399] random: dd: > uninitialized urandom read (512 bytes read) > done. > Starting network: OK > [ 2.109593] mmc0: ADMA error > [ 2.112488] mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== > [ 2.118941] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00000002 > [ 2.125389] mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001 > [ 2.131840] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 > [ 2.138289] mmc0: sdhci: Present: 0x01ff02f6 | Host ctl: 0x00000019 > [ 2.144738] mmc0: sdhci: Power: 0x0000000b | Blk gap: 0x00000000 > [ 2.151188] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00004e47 > [ 2.157637] mmc0: sdhci: Timeout: 0x0000000b | Int stat: 0x00000001 > [ 2.164087] mmc0: sdhci: Int enab: 0x03ff008b | Sig enab: 0x03ff008b > [ 2.170536] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000001 > [ 2.176987] mmc0: sdhci: Caps: 0x546ec800 | Caps_1: 0x00000000 > [ 2.183435] mmc0: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000 > [ 2.189886] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xffffffff > [ 2.196335] mmc0: sdhci: Resp[2]: 0x320f5903 | Resp[3]: 0x3fd05e00 > [ 2.202784] mmc0: sdhci: Host ctl2: 0x00000000 > [ 2.207232] mmc0: sdhci: ADMA Err: 0x00000001 | ADMA Ptr: 0x000000013965b200 > [ 2.214379] mmc0: sdhci: ============================================ > > [ 2.220881] mmc0: error -5 whilst initialising MMC card > Welcome to Buildroot > buildroot login: [ 2.332786] mmc0: ADMA error > [ 2.335668] mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== > [ 2.342119] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00000002 > [ 2.348568] mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001 > [ 2.355018] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 > [ 2.361468] mmc0: sdhci: Present: 0x01ff02f6 | Host ctl: 0x00000019 > [ 2.367917] mmc0: sdhci: Power: 0x0000000b | Blk gap: 0x00000000 > [ 2.374367] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x0000f447 > [ 2.380816] mmc0: sdhci: Timeout: 0x0000000b | Int stat: 0x00000001 > [ 2.387267] mmc0: sdhci: Int enab: 0x03ff008b | Sig enab: 0x03ff008b > [ 2.393716] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000001 > [ 2.400166] mmc0: sdhci: Caps: 0x546ec800 | Caps_1: 0x00000000 > [ 2.406615] mmc0: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000 > [ 2.413065] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xffffffff > [ 2.419515] mmc0: sdhci: Resp[2]: 0x320f5903 | Resp[3]: 0x3fd05e00 > [ 2.425963] mmc0: sdhci: Host ctl2: 0x00000000 > [ 2.430412] mmc0: sdhci: ADMA Err: 0x00000001 | ADMA Ptr: 0x000000013965b200 > [ 2.437557] mmc0: sdhci: ============================================ > [ 2.444031] mmc0: error -5 whilst initialising MMC card > [ 2.572203] mmc0: ADMA error > [ 2.575089] mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== > [ 2.581540] mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00000002 > [ 2.587989] mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001 > [ 2.594439] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 > [ 2.600889] mmc0: sdhci: Present: 0x01ef02f6 | Host ctl: 0x00000019 > [ 2.607339] mmc0: sdhci: Power: 0x0000000b | Blk gap: 0x00000000 > [ 2.613788] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x0000e8c7 > [ 2.620237] mmc0: sdhci: Timeout: 0x0000000b | Int stat: 0x00000001 > [ 2.626686] mmc0: sdhci: Int enab: 0x03ff008b | Sig enab: 0x03ff008b > [ 2.633137] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000001 > [ 2.639586] mmc0: sdhci: Caps: 0x546ec800 | Caps_1: 0x00000000 > [ 2.646036] mmc0: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000 > [ 2.652485] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xffffffff > [ 2.658936] mmc0: sdhci: Resp[2]: 0x320f5903 | Resp[3]: 0x3fd05e00 > [ 2.665384] mmc0: sdhci: Host ctl2: 0x00000000 > [ 2.669832] mmc0: sdhci: ADMA Err: 0x00000001 | ADMA Ptr: 0x000000013965b200 > [ 2.676979] mmc0: sdhci: ============================================ > [ 2.683450] mmc0: error -5 whilst initialising MMC card > > CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline > | ttyUSB0 > > Reverting this commit fixed the problem. > > > > -- > Best Regards > Masahiro Yamada -- Best Regards Masahiro Yamada _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel