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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AB640C46CD2 for ; Tue, 9 Jan 2024 10:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=mq+uqQ1GvkV+OiQy4bzYZszGgjMN/foOSc/5Y9lvhGw=; b=3Sl4X6djsAGQLb U8VvKiLkN5U1a3iw1YdPU+/lMLU1F8nqwKX1fOa2YInEViMXaw5Rsq0joHW7F7m0tnRg049IaqvNe 1AL16O+/x+x5OiBWKVikTJT3cXUWMWKTKtvJ7vHop8WS3JqZPmckEahH7U+Xc1Uqc1x/fG8H7kawL F3v1OZCa3M8TMSuSG6fyKhfyZ4iv5XYISueR/3D7H2r33Qz9+sCaOmdCdY2pZw9A/69KzaaOqVNlb pXw54nWCmL7Ofqt+IC0kFfkyG7NK+qmemBfA6xZJdpah//RK+EXldDf5ramBBr9Tnx4KYAQy/2dm+ QjWXuSTqWsn/mLg+UTkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rN9lE-007gbw-3B; Tue, 09 Jan 2024 10:55:08 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rN9lB-007gb3-3D for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2024 10:55:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7383E60C21; Tue, 9 Jan 2024 10:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A2E5C43394; Tue, 9 Jan 2024 10:55:02 +0000 (UTC) Date: Tue, 9 Jan 2024 10:54:59 +0000 From: Catalin Marinas To: Baruch Siach Cc: Christoph Hellwig , Marek Szyprowski , Rob Herring , Frank Rowand , Will Deacon , Robin Murphy , iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Petr =?utf-8?B?VGVzYcWZw61r?= , Ramon Fried , Elad Nachman Subject: Re: [PATCH RFC 3/4] dma-direct: add offset to zone_dma_bits Message-ID: References: <87msterf7b.fsf@tarshish> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87msterf7b.fsf@tarshish> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240109_025506_074285_5360CAB0 X-CRM114-Status: GOOD ( 21.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 09, 2024 at 12:03:43PM +0200, Baruch Siach wrote: > On Mon, Jan 08 2024, Catalin Marinas wrote: > > On Wed, Dec 27, 2023 at 05:04:27PM +0200, Baruch Siach wrote: > >> Current code using zone_dma_bits assume that all addresses range in the > >> bits mask are suitable for DMA. For some existing platforms this > >> assumption is not correct. DMA range might have non zero lower limit. > >> > >> Add 'zone_dma_off' for platform code to set base address for DMA zone. > >> > >> Rename the dma_direct_supported() local 'min_mask' variable to better > >> describe its use as limit. > >> > >> Suggested-by: Catalin Marinas > > > > When I suggested taking the DMA offsets into account, that's not exactly > > what I meant. Based on patch 4, it looks like zone_dma_off is equivalent > > to the lower CPU address. Let's say a system has DRAM starting at 2GB > > and all 32-bit DMA-capable devices has a DMA offset of 0. We want > > ZONE_DMA32 to end at 4GB rather than 6GB. > > Patch 4 sets zone_dma_off to the lower limit from 'dma-ranges' property > that determines zone_dma_bits. This is not necessarily equivalent to > start of DRAM, though it happens to be that way on my platform. A bit better but it still assumes that all devices have the same DMA offset which may not be the case. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel