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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 6858CC433EF for ; Thu, 23 Sep 2021 08:06:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 466C861216 for ; Thu, 23 Sep 2021 08:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239775AbhIWIH7 (ORCPT ); Thu, 23 Sep 2021 04:07:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:47940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235983AbhIWIH6 (ORCPT ); Thu, 23 Sep 2021 04:07:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1385611C6; Thu, 23 Sep 2021 08:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632384387; bh=WmBmb6i0i7239EXCGN+BOz5nInIBrgdqOjVqXfYBJyQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GLiDPZs1LHeivfhM9LAWCRMtpap2mbhfhTwfBJ2cEU3ReN0qGytmZ+X9Gl/a+pUFt 7QMv2N3Ge8xC0oQfTHoQi8YChR4h+gT5gkyixHFmAds9cSRv0GgquieQIGA1c2LmbY onWEyQ2JCRPdsrTUwdczIqvAVQIr8ihFieHXOEJk= Date: Thu, 23 Sep 2021 10:06:25 +0200 From: Greg Kroah-Hartman To: Florian Fainelli Cc: linux-kernel@vger.kernel.org, Sasha Levin , stable@vger.kernel.org, Konrad Rzeszutek Wilk , Russell King , Mike Rapoport , Andrew Morton , Ard Biesheuvel , Max Filippov , "moderated list:ARM PORT" Subject: Re: [PATCH stable 5.10] ARM: Qualify enabling of swiotlb_init() Message-ID: References: <20210923001425.414046-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210923001425.414046-1-f.fainelli@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 05:14:24PM -0700, Florian Fainelli wrote: > commit fcf044891c84e38fc90eb736b818781bccf94e38 upstream > > We do not need a SWIOTLB unless we have DRAM that is addressable beyond > the arm_dma_limit. Compare max_pfn with arm_dma_pfn_limit to determine > whether we do need a SWIOTLB to be initialized. > > Fixes: ad3c7b18c5b3 ("arm: use swiotlb for bounce buffering on LPAE configs") > Signed-off-by: Florian Fainelli > Signed-off-by: Konrad Rzeszutek Wilk > --- > arch/arm/mm/init.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index d54d69cf1732..75f3ab531bdf 100644 > --- a/arch/arm/mm/init.c > +++ b/arch/arm/mm/init.c > @@ -378,7 +378,11 @@ static void __init free_highpages(void) > void __init mem_init(void) > { > #ifdef CONFIG_ARM_LPAE > - swiotlb_init(1); > + if (swiotlb_force == SWIOTLB_FORCE || > + max_pfn > arm_dma_pfn_limit) > + swiotlb_init(1); > + else > + swiotlb_force = SWIOTLB_NO_FORCE; > #endif > > set_max_mapnr(pfn_to_page(max_pfn) - mem_map); > -- > 2.25.1 > Both now queued up, thanks. greg k-h