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 C80EAC76188 for ; Wed, 5 Apr 2023 16:08:41 +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=UNe8cR+/ADvik/1bca2aaIy7C6bzdJsP8oqFN5onfdA=; b=RXaenCm5fhSvLt AYkWvFprxrKtzRM7Fh+AGZmX6Ni6ewpPzQcD3QcZ8RP98CPJtRUbx+cmMMwQsisVu/hQHW//0M1hM kS8BaneJMhqzHp3IN0ss31rtpb4npCxVcNrtFfSBZhWKn65LBPs5+jLhABw8JjYx2GYcJ5fDws5fA ash/nAkKqEThxa6QlrHtP2kEGpXBsfzM/dMINsqo93AG2xeAN78eZyp2CQ3YCfjE9yirx94+HG8ns JpROY+J6mJ3K13UTvgcoQ3A5Im5tnSF6dmzLuaUT270iJOgsooHFOzwNaqLgFFAH6MNWxe+40PF2o BbgGIaAidKfRGi96Eg5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk5fe-0054L8-1j; Wed, 05 Apr 2023 16:07:38 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk5fa-0054J8-1I for linux-arm-kernel@lists.infradead.org; Wed, 05 Apr 2023 16:07:36 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5002f12ccfeso76123a12.0 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=cswDmeUV/+ko7sfTO0yoYr+56EkcjXBUKKjuO56ShK01c5k7TCI5U7VhylkhKVDAiR 02RRrzUP4xwkIZ2X85Bc7iEHY9keUvo5s4YiKkAM8osiCWsAJORkc1bmCd6LRBcegdwO ty2zpKs7FIixXruRlrxhNWYje8QK6bo1ByH8+crNd1JwuHkAhHaTd96HTorS/1+pZq0Y HaKNbMz+BMzMbORJ4xKI1IGPBbrbftZZUiQ8ZevCXGl0ro9qT6/QWMpgCZdHdRvHRrda 05bzz6Sn2EaQ3fcJeO/jbTbxBUSu2zWIK18Rwxh71JQ5ROFRSDNZx5CjKQ1PI+izAOWg NaYg== X-Gm-Message-State: AAQBX9e64XYRy0y2TpMAufOjGyJlWdgjbmIjypW4x3CKrhy9rKXEuyyM pdayALGogf5aZ0j7jVUfEOGWvw== X-Google-Smtp-Source: AKy350aQMCCIGd+ttlIn6lmvnbNQhhwBJ1Oi0jxEBwn9z6WIX2aUYNMX4MoVCA82q+F4FspzQF+uZA== 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-Disposition: inline In-Reply-To: <92fe3838-41f0-4e27-8467-161553ff724f@app.fastmail.com> X-Operating-System: Linux phenom 6.1.0-7-amd64 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_090734_438754_3535ED91 X-CRM114-Status: GOOD ( 30.06 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel