Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp480993pxb; Tue, 14 Sep 2021 01:53:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS93wydI0Vqy7bI1gbaBXNolRJkjaSoNiAg3OXYuKkzzLglAhkUGtiC2z7DsjXcAopysVa X-Received: by 2002:a92:690b:: with SMTP id e11mr11039806ilc.321.1631609591202; Tue, 14 Sep 2021 01:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631609591; cv=none; d=google.com; s=arc-20160816; b=plWE8zswik/k1DKgObc6Xbo7OGctrHMMOWwnRHTjZ9Gx3QtSAA2dnZ0QOpvde1f8ML c+GWR+VDDCQYmhIVi25e1fyWo997weQB+3gFL6Vxi3KFR6YKuj5dvQj+/MtbIsIdbfba bt2Qz3T/WrOT0RnCiwptLqF6cXN3IAgvGY+lcORy4kdqjc3d3cU1PERIOn+nRpgc01VB QKsbzzDfpjjcpsjQ/6bN7u6dJMC5X8Q5KTHLkNdegt9zlz8w+bkSeuKxL7Y8Thjz6zuT 0qvY2ez7O+oXc2Q7zVd5FH9KcZR6jRvTq5NJ4Nke7bbwp2k5PDOUsQGoqmL8pZFXzFbN j3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:authorized-sender; bh=USxxlPIjwlygp0BCv2ZhIUWrXO0f0ZeOaEGuXUL6cTA=; b=KK9hCi6bBTumGkd/yyKM8MxiIG5k5syeyOQG8WSms0iqZVt9r72CvqvDn/ABUT536n DvSs+auAR1f6IXRmh0GY9FGyfGLJ98Pym5rg3PhN7/n1D1xBnkkHD9GvKUQK6mYSoCiR YV+gfYGN4ZQClGjJh0/j12Hd+sNeLhYwqXz98HZ9uzF4f645qSVf1oc5UGJw9UJlWpte 7upuiwDIk8ky+CPT10aTOt0uNwPkC0HGFPyu4Yn7t+6xeSwlN7zGi8fTB8GSr+HMB8sB X8xANWzHY3heabJqimWLubg9cYB0Bxd2saWCECfnYbXi7UMPRh8Mr0YdffO04gaUVpJ+ onUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si9138834ila.10.2021.09.14.01.52.59; Tue, 14 Sep 2021 01:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbhINIxO (ORCPT + 99 others); Tue, 14 Sep 2021 04:53:14 -0400 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:13548 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231238AbhINIxL (ORCPT ); Tue, 14 Sep 2021 04:53:11 -0400 X-Halon-ID: 00cded83-1539-11ec-ac84-005056917a89 Authorized-sender: andreas@gaisler.com Received: from [192.168.10.42] (h-98-128-223-123.na.cust.bahnhof.se [98.128.223.123]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 00cded83-1539-11ec-ac84-005056917a89; Tue, 14 Sep 2021 10:51:52 +0200 (CEST) Subject: Re: [PATCH] sparc32: Page align size in arch_dma_alloc To: Christoph Hellwig Cc: David Miller , sparclinux@vger.kernel.org, Sam Ravnborg , linux-kernel@vger.kernel.org, software@gaisler.com References: <20210908074822.16793-1-andreas@gaisler.com> <20210909060712.GA25485@lst.de> <3a653ab5-14d2-f61f-cb0a-cbeba93b4ac8@gaisler.com> <20210914061705.GB26679@lst.de> From: Andreas Larsson Message-ID: <87971ad4-9519-cf0d-76a8-6baa253d0122@gaisler.com> Date: Tue, 14 Sep 2021 10:51:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210914061705.GB26679@lst.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-09-14 08:17, Christoph Hellwig wrote: > Thanks. Can you take a look and test the two patches below on top of > your fix? A git tree is also available here: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/sparc32-generic-dma > In a quick test, this seems to work on LEON for code paths previously going to arch_dma_alloc and arch_dma_free. However, this makes setting up these DMA mappings to not go through sparc_dma_alloc_resource, and it seems important that they do that on Sun systems. Hopefully, someone with more knowledge about that could chime in here. The added pgprot_dmacoherent is problematic as it sets SRMMU_PRIV, which sets up kernel access only. This was fine for arch_dma_alloc that sets up kernel accesses only, but for user space DMA mmap this would make them kernel accessable only. Having no sparc-specific pgprot_dmacoherent, keeping it to default to pgprot_noncached, is probably better. -- Andreas Larsson