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=-5.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 4EC87C3A5A3 for ; Tue, 27 Aug 2019 07:50:49 +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 213A1206BA for ; Tue, 27 Aug 2019 07:50:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gmc9mgOr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 213A1206BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mXaQ2PkT37IY32zxHMGTNdJ+sJSsDb0Z88J//mtCJfw=; b=gmc9mgOremh+E1 xKRZtPNG55hawgGG9pdGdw+JwDAGIDXCRlsBC9WUjBSfYBhRG+31ZeQJ37ozdCPDPv945LMsFKQQo ttuTgANRYPT0iXnyp2QEK8gszNc9JjVILURpsfB1IHAOpEx8/8LJIiCLnsjXEzcuZMCqbm0JnSoKq PmJxsyE0h7hp2WSNDyQMJQy3ABd9HbLYtNksFgxq0xYdDQHnwplfzm8ZIezcs2gBKPace3ZaQnIbR XKLVxQWd5pz3DSbCjfEZn5joFGlZkto9YspQmwJTzhx7gcUUVju6L8CmKQkjzN1XIHzei1ayyB7Vp AmXx4c2aMjQ068j/61Xw==; 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 1i2WFc-0001V6-IC; Tue, 27 Aug 2019 07:50:48 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2WFI-0001Eg-Lp for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2019 07:50:31 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 4577B68B05; Tue, 27 Aug 2019 09:50:21 +0200 (CEST) Date: Tue, 27 Aug 2019 09:50:21 +0200 From: Christoph Hellwig To: Masahiro Yamada Subject: Re: [PATCH v2 2/2] dma-contiguous: Use fallback alloc_pages for single pages Message-ID: <20190827075021.GA953@lst.de> References: <20190506223334.1834-1-nicoleotsuka@gmail.com> <20190506223334.1834-3-nicoleotsuka@gmail.com> <20190825011025.GA23410@lst.de> <20190826073320.GA11712@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190827_005028_874062_061C7F06 X-CRM114-Status: GOOD ( 20.45 ) 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: Ulf Hansson , Tony Lindgren , Catalin Marinas , Will Deacon , Linux Kernel Mailing List , Max Filippov , Christoph Hellwig , Marek Szyprowski , Stephen Rothwell , Joerg Roedel , Russell King , Thierry Reding , linux-xtensa@linux-xtensa.org, Kees Cook , Nicolin Chen , Andrew Morton , linux-arm-kernel , Chris Zankel , Wolfram Sang , Robin Murphy , linux-mmc , Adrian Hunter , iommu@lists.linux-foundation.org, iamjoonsoo.kim@lge.com, David Woodhouse 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 On Tue, Aug 27, 2019 at 04:45:20PM +0900, Masahiro Yamada wrote: > On Mon, Aug 26, 2019 at 4:33 PM Christoph Hellwig wrote: > > > > On Mon, Aug 26, 2019 at 11:05:00AM +0900, Masahiro Yamada wrote: > > > This is included in v5.3-rc6 > > > so I tested it. > > > > So there is no allocation failure, but you get I/O errors later? > > Right. > > > > > Does the device use a device-private CMA area? > > Not sure. > My driver is drivers/mmc/host/sdhci-cadence.c > It reuses routines in drivers/mmc/host/sdhci.c > > > > > Does it work with Linux > > 5.2 if CONFIG_DMA_CMA is disabled? > > No. > 5.2 + disable CONFIG_DMA_CMA > failed in the same way. So it seems like the device wants CMA memory. I guess the patch below will fix it, but that isn't the solution. Can you try it to confirm? In the end it probably assumes a dma mask it doesn't set that the CMA memory satisfies or something similar. diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 69cfb4345388..bd2f24aa7f19 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -236,7 +236,7 @@ struct page *dma_alloc_contiguous(struct device *dev, size_t size, gfp_t gfp) if (dev && dev->cma_area) cma = dev->cma_area; - else if (count > 1) + else cma = dma_contiguous_default_area; /* CMA can be used only in the context which permits sleeping */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel