Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp906508rwl; Wed, 5 Apr 2023 09:11:22 -0700 (PDT) X-Google-Smtp-Source: AKy350aeEExzROOvsQ5KdD68aqe45KLn+SBSdzEjyeRz/9xOWnE9cM4fGCpQCvWb+z2Yk9AEuj3z X-Received: by 2002:aa7:981a:0:b0:628:9b4:a6a2 with SMTP id e26-20020aa7981a000000b0062809b4a6a2mr6086923pfl.15.1680711082530; Wed, 05 Apr 2023 09:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680711082; cv=none; d=google.com; s=arc-20160816; b=EwTCC0vB0zGNQz2ayMn5tW+wqARwBY5Y2sFTUb+X5zQIGG1e+MKRIw739ZgwpVToK/ KrCABI6bw8UBOAuVJuNiLUiAqxLaW7VlEH7P3hX34kb04gm7agCMuMLrVN4ni2SLKmfj ogXnqk/GGSJQ7E3MLVxnAoO2TyjaRn+kwEqYutXp0y1kzqNevXJRkWImAs7c5cdrIO7y 0MKPMZsVoxruTNNRcMfoluTfZ45eG8a27HMeTi2gce1DydVVXBkyOaXwiqK5T1ey6WCu kB0s5DJG+4Ewlek8So0n8ZRwiQSu3bRmMGJXuC+MX1p7XRcXEBmXcms0/Ak9Lx0/WKnu Tvjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ir3s/Lf5lvCAlrm1TfcesrDtB2jAmtZCISN/6dp3hBc=; b=KjPb5NOvRydt1/96JwCt+FaK+7+U+lU8YPKT6b152zy+Y3tHeSenbFEoRSHYtDrF6h YlRjirtBiwP3VdiptsJQA1Zj4JqhlB+WYzV3ky8GcBwGSO4/jbdeew52PEygbod80+BL ZnU9b7TEvkXaG2fDYMoIhPDSIFtVfuL0tOz8OpZA0OUEPN8IyDEKKKhr8AN73vFcRsaW KY5cbCGeE7WEvw6+AzKus+2yWQIJMw0gylk7lXf0BY4iN9BK5NOs8pyY7vNENDS9+UT/ PlRjdsPLET6GavNdka2vi8Mxru5a9lpashiWYC/zq2zje/QEhIzmEouhoVPy8lwRCPkv nTbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=VNUObGKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x185-20020a6386c2000000b004fb1c44a4d1si12589495pgd.212.2023.04.05.09.11.09; Wed, 05 Apr 2023 09:11:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=VNUObGKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbjDEQHi (ORCPT + 99 others); Wed, 5 Apr 2023 12:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231859AbjDEQHf (ORCPT ); Wed, 5 Apr 2023 12:07:35 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8144ECD for ; Wed, 5 Apr 2023 09:07:32 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5005c57f95cso76619a12.1 for ; Wed, 05 Apr 2023 09:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1680710851; x=1683302851; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=ir3s/Lf5lvCAlrm1TfcesrDtB2jAmtZCISN/6dp3hBc=; b=VNUObGKko6sqyyipxJHZOjjD7Vgl2nINPanPLg9CF5dNFM42M+zPkinw5lJovFp5IT KgryiwfHZwGoUCHvFhE9cgxsLTI65w6qpIN9bd0/wPOfFcL5qWWLKMUORCChrg/EDytj /mEZ5jrCc5FzC1si2MslaSmste3VoXKbRjv7g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680710851; x=1683302851; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ir3s/Lf5lvCAlrm1TfcesrDtB2jAmtZCISN/6dp3hBc=; b=hrkKUQXJJvkloEllmpaxZ2Epk7SbLDTa/VYnP8O7McESMKKQaHknCU659AC93tnjJE fgGXcQQk21zR29Q6PZ6HqXWA9LSq3tkg0eY3wCKxHEPG7mPfvJV7B0qWpymLaCQZMvRK CjtKpu4qUmQFqzojl7Ud3BbtTRF9NYc+8pVcwcTNOJ4/mbMHXVAJO3Iw/9LaX7GMTZ6N c8wXeKbknzL9ybyKkvvV3xEHRwp8YXfIL5lLHWqBItQZqrl+6gc0OIX5EN7p5VdmaCE1 /kw7SCxn9DlKvxtWlFaQvZa3qXkXo7YmjmyXJiOIwKWU1DgWIk102FaOetJ0RDPzGwna uoYw== X-Gm-Message-State: AAQBX9e9O484LjjoSISwNaU9WhT7I5qka/7lLCS3wcdCpPtDhRx3wEOE bRrDBFig92otRVBZozS/hdD1sQ== X-Received: by 2002:a17:906:10c9:b0:931:4285:ea16 with SMTP id v9-20020a17090610c900b009314285ea16mr2360239ejv.7.1680710851411; Wed, 05 Apr 2023 09:07:31 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-33.fiber7.init7.net. [212.51.149.33]) by smtp.gmail.com with ESMTPSA id a23-20020a170906369700b0092a59ee224csm7492153ejc.185.2023.04.05.09.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 09:07:31 -0700 (PDT) Date: Wed, 5 Apr 2023 18:07:28 +0200 From: Daniel Vetter To: Arnd Bergmann Cc: Thomas Zimmermann , Daniel Vetter , Helge Deller , Javier Martinez Canillas , Greg Kroah-Hartman , Linux-Arch , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 01/18] fbdev: Prepare generic architecture helpers Message-ID: Mail-Followup-To: Arnd Bergmann , Thomas Zimmermann , Helge Deller , Javier Martinez Canillas , Greg Kroah-Hartman , Linux-Arch , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org References: <20230405150554.30540-1-tzimmermann@suse.de> <20230405150554.30540-2-tzimmermann@suse.de> <92fe3838-41f0-4e27-8467-161553ff724f@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92fe3838-41f0-4e27-8467-161553ff724f@app.fastmail.com> X-Operating-System: Linux phenom 6.1.0-7-amd64 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 05:53:03PM +0200, Arnd Bergmann wrote: > On Wed, Apr 5, 2023, at 17:05, Thomas Zimmermann wrote: > > Generic implementations of fb_pgprotect() and fb_is_primary_device() > > have been in the source code for a long time. Prepare the header file > > to make use of them. > > > > Improve the code by using an inline function for fb_pgprotect() and > > by removing include statements. > > > > Symbols are protected by preprocessor guards. Architectures that > > provide a symbol need to define a preprocessor token of the same > > name and value. Otherwise the header file will provide a generic > > implementation. This pattern has been taken from . > > > > Signed-off-by: Thomas Zimmermann > > Moving this into generic code is good, but I'm not sure > about the default for fb_pgprotect(): > > > + > > +#ifndef fb_pgprotect > > +#define fb_pgprotect fb_pgprotect > > +static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, > > + unsigned long off) > > +{ } > > +#endif > > I think most architectures will want the version we have on > arc, arm, arm64, loongarch, and sh already: > > static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, > unsigned long off) > { > vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); > } > > so I'd suggest making that version the default, and treating the > empty ones (m68knommu, sparc32) as architecture specific > workarounds. Yeah I was about to type the same suggestion :-) -Daniel > I see that sparc64 and parisc use pgprot_uncached here, but as > they don't define a custom pgprot_writecombine, this ends up being > the same, and they can use the above definition as well. > > mips defines pgprot_writecombine but uses pgprot_noncached > in fb_pgprotect(), which is probably a mistake and should have > been updated as part of commit 4b050ba7a66c ("MIPS: pgtable.h: > Implement the pgprot_writecombine function for MIPS"). > > Arnd -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch