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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72BFDC41513 for ; Mon, 16 Oct 2023 11:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbjJPL7z (ORCPT ); Mon, 16 Oct 2023 07:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjJPL7y (ORCPT ); Mon, 16 Oct 2023 07:59:54 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85671E3 for ; Mon, 16 Oct 2023 04:59:53 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B8461FB; Mon, 16 Oct 2023 05:00:33 -0700 (PDT) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DA1E43F5A1; Mon, 16 Oct 2023 04:59:49 -0700 (PDT) Message-ID: <4f709c6d-0635-4136-9cfa-717484f47fde@arm.com> Date: Mon, 16 Oct 2023 12:59:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 08/12] dma-direct: warn when coherent allocations aren't supported Content-Language: en-GB To: Christoph Hellwig , Greg Ungerer , iommu@lists.linux.dev Cc: Paul Walmsley , Palmer Dabbelt , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Marek Szyprowski , Geert Uytterhoeven , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , linux-m68k@lists.linux-m68k.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Jim Quinlan References: <20231016054755.915155-1-hch@lst.de> <20231016054755.915155-9-hch@lst.de> From: Robin Murphy In-Reply-To: <20231016054755.915155-9-hch@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-m68k@vger.kernel.org On 16/10/2023 6:47 am, Christoph Hellwig wrote: > Log a warning once when dma_alloc_coherent fails because the platform > does not support coherent allocations at all. Reviewed-by: Robin Murphy > Signed-off-by: Christoph Hellwig > --- > kernel/dma/direct.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > index 1327d04fa32a25..fddfea3b2fe173 100644 > --- a/kernel/dma/direct.c > +++ b/kernel/dma/direct.c > @@ -240,8 +240,10 @@ void *dma_direct_alloc(struct device *dev, size_t size, > */ > set_uncached = IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED); > remap = IS_ENABLED(CONFIG_DMA_DIRECT_REMAP); > - if (!set_uncached && !remap) > + if (!set_uncached && !remap) { > + pr_warn_once("coherent DMA allocations not supported on this platform.\n"); > return NULL; > + } > } > > /*