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 3276BC4332F for ; Thu, 24 Feb 2022 10:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233412AbiBXK1e (ORCPT ); Thu, 24 Feb 2022 05:27:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233297AbiBXK1b (ORCPT ); Thu, 24 Feb 2022 05:27:31 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE8E2F1AC4; Thu, 24 Feb 2022 02:27:00 -0800 (PST) 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 98A7B14BF; Thu, 24 Feb 2022 02:27:00 -0800 (PST) Received: from [10.163.48.178] (unknown [10.163.48.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B93F3F70D; Thu, 24 Feb 2022 02:26:54 -0800 (PST) From: Anshuman Khandual Subject: Re: [PATCH 01/11] dma-direct: use is_swiotlb_active in dma_direct_map_page To: Christoph Hellwig , iommu@lists.linux-foundation.org Cc: x86@kernel.org, Stefano Stabellini , Boris Ostrovsky , Juergen Gross , Joerg Roedel , David Woodhouse , Lu Baolu , Robin Murphy , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, tboot-devel@lists.sourceforge.net, linux-pci@vger.kernel.org References: <20220222153514.593231-1-hch@lst.de> <20220222153514.593231-2-hch@lst.de> Message-ID: <29452ad3-9db9-49d5-f91c-cb8507633ec0@arm.com> Date: Thu, 24 Feb 2022 15:56:56 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20220222153514.593231-2-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On 2/22/22 9:05 PM, Christoph Hellwig wrote: > Use the more specific is_swiotlb_active check instead of checking the > global swiotlb_force variable. > > Signed-off-by: Christoph Hellwig > --- > kernel/dma/direct.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h > index 4632b0f4f72eb..4dc16e08c7e1a 100644 > --- a/kernel/dma/direct.h > +++ b/kernel/dma/direct.h > @@ -91,7 +91,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev, > return swiotlb_map(dev, phys, size, dir, attrs); > > if (unlikely(!dma_capable(dev, dma_addr, size, true))) { > - if (swiotlb_force != SWIOTLB_NO_FORCE) > + if (is_swiotlb_active(dev)) > return swiotlb_map(dev, phys, size, dir, attrs); > > dev_WARN_ONCE(dev, 1, > Reviewed-by: Anshuman Khandual