From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id 4F0F38E0002 for ; Fri, 18 Jan 2019 07:18:12 -0500 (EST) Received: by mail-wr1-f71.google.com with SMTP id x3so6547227wru.22 for ; Fri, 18 Jan 2019 04:18:12 -0800 (PST) Received: from newverein.lst.de (verein.lst.de. [213.95.11.211]) by mx.google.com with ESMTPS id y8si39647771wrh.231.2019.01.18.04.18.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 04:18:10 -0800 (PST) Date: Fri, 18 Jan 2019 13:18:10 +0100 From: Christoph Hellwig Subject: Re: use generic DMA mapping code in powerpc V4 Message-ID: <20190118121810.GA13327@lst.de> References: <21f72a6a-9095-7034-f169-95e876228b2a@xenosoft.de> <27148ac2-2a92-5536-d886-2c0971ab43d9@xenosoft.de> <20190115133558.GA29225@lst.de> <685f0c06-af1b-0bec-ac03-f9bf1f7a2b35@xenosoft.de> <20190115151732.GA2325@lst.de> <20190118083539.GA30479@lst.de> <871403f2-fa7d-de15-89eb-070432e15c69@xenosoft.de> <20190118112842.GA9115@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Christian Zigotzky Cc: Christoph Hellwig , linux-arch@vger.kernel.org, Darren Stevens , linux-kernel@vger.kernel.org, Julian Margetson , linux-mm@kvack.org, iommu@lists.linux-foundation.org, Paul Mackerras , Olof Johansson , linuxppc-dev@lists.ozlabs.org On Fri, Jan 18, 2019 at 01:07:54PM +0100, Christian Zigotzky wrote: > git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a > > git checkout 257002094bc5935dd63207a380d9698ab81f0775 > > > I get the following error message with your patch: Hmm. Did I attached the wrong patch? Here is the one I want and just applied to that revision: diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index 355d16acee6d..e46c9b64ec0d 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -118,8 +118,11 @@ struct page *__dma_direct_alloc_pages(struct device *dev, size_t size, page = NULL; } } - if (!page) + if (!page) { page = alloc_pages_node(dev_to_node(dev), gfp, page_order); + if (!page) + pr_warn("failed to allocate memory with gfp 0x%x\n", gfp); + } if (page && !dma_coherent_ok(dev, page_to_phys(page), size)) { __free_pages(page, page_order); @@ -139,6 +142,10 @@ struct page *__dma_direct_alloc_pages(struct device *dev, size_t size, } } + if (!page) { + pr_warn("failed to allocate DMA memory!\n"); + dump_stack(); + } return page; }