linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: arnd@arndb.de, daniel.vetter@ffwll.ch, deller@gmx.de,
	javierm@redhat.com, gregkh@linuxfoundation.org,
	linux-arch@vger.kernel.org, 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 v2 01/19] fbdev: Prepare generic architecture helpers
Date: Mon, 17 Apr 2023 11:03:46 +0200	[thread overview]
Message-ID: <2b4f75b8-aa83-8e41-7c99-7c8d573c0f31@suse.de> (raw)
In-Reply-To: <CAMuHMdUfViWzPbB+GcGUwxmGNxAohfq71Jed3DzS=Cb+gBzotg@mail.gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2727 bytes --]

Hi Geert

Am 11.04.23 um 10:08 schrieb Geert Uytterhoeven:
> Hi Thomas,
> 
> On Thu, Apr 6, 2023 at 4:30 PM Thomas Zimmermann <tzimmermann@suse.de> 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. The default mode set by
>> fb_pgprotect() is now writecombine, which is what most platforms
>> want.
>>
>> 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 <asm/io.h>.
>>
>> v2:
>>          *  use writecombine mappings by default (Arnd)
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> 
> Thanks for your patch!
> 
>> --- a/include/asm-generic/fb.h
>> +++ b/include/asm-generic/fb.h
>> @@ -1,13 +1,32 @@
>>   /* SPDX-License-Identifier: GPL-2.0 */
>> +
>>   #ifndef __ASM_GENERIC_FB_H_
>>   #define __ASM_GENERIC_FB_H_
>> -#include <linux/fb.h>
>>
>> -#define fb_pgprotect(...) do {} while (0)
>> +/*
>> + * Only include this header file from your architecture's <asm/fb.h>.
>> + */
>> +
>> +#include <asm/page.h>
>> +
>> +struct fb_info;
>> +struct file;
>> +
>> +#ifndef fb_pgprotect
>> +#define fb_pgprotect fb_pgprotect
>> +static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
>> +                               unsigned long off)
> 
> Does this affect any noMMU platforms that relied on fb_pgprotect()
> doing nothing before?
> Perhaps the body below should be protected by "#ifdef CONFIG_MMU"?

I cannot conclusively answer this question, but I did some grep'ing 
('git grep ndef | grep CONFIG_MMU'):

Only the architectures in this patchset provide <asm/fb.h> but nothing 
anywhere uses <asm-generic/fb.h> yet. And of those architectures, only 
arm and m68k have !CONFIG_MMU cases. Those are handled in the rsp 
patches. I think we're good.

> 
>> +{
>> +       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
> 
> Shouldn't this use the pgprot_val() wrapper?

No, I think. Grep'ing for vm_page_prot, I'm not seeing it being used in 
such assignments.

Best regards
Thomas

> 
>> +}
>> +#endif
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  reply	other threads:[~2023-04-17  9:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 14:30 [PATCH v2 00/19] arch: Consolidate <asm/fb.h> Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 01/19] fbdev: Prepare generic architecture helpers Thomas Zimmermann
2023-04-06 14:37   ` Arnd Bergmann
2023-04-11  8:08   ` Geert Uytterhoeven
2023-04-17  9:03     ` Thomas Zimmermann [this message]
2023-04-17  9:22       ` Arnd Bergmann
2023-04-06 14:30 ` [PATCH v2 02/19] arch/arc: Implement <asm/fb.h> with generic helpers Thomas Zimmermann
2023-04-06 14:43   ` Arnd Bergmann
2023-04-17  9:04     ` Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 03/19] arch/arm: " Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 04/19] arch/arm64: " Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 05/19] arch/ia64: " Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 06/19] arch/loongarch: " Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 07/19] arch/m68k: Merge variants of fb_pgprotect() into single function Thomas Zimmermann
2023-04-11  8:10   ` Geert Uytterhoeven
2023-04-06 14:30 ` [PATCH v2 08/19] arch/m68k: Implement <asm/fb.h> with generic helpers Thomas Zimmermann
2023-04-11  8:20   ` Geert Uytterhoeven
2023-04-06 14:30 ` [PATCH v2 09/19] arch/mips: " Thomas Zimmermann
2023-04-06 14:51   ` Arnd Bergmann
2023-04-06 14:30 ` [PATCH v2 10/19] video: Remove trailing whitespaces Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 11/19] video: Move HP PARISC STI core code to shared location Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 12/19] arch/parisc: Remove trailing whitespaces Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 13/19] arch/parisc: Implement fb_is_primary_device() under arch/parisc Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 14/19] arch/parisc: Implement <asm/fb.h> with generic helpers Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 15/19] arch/powerpc: " Thomas Zimmermann
2023-04-12  6:17   ` Michael Ellerman
2023-04-06 14:30 ` [PATCH v2 16/19] arch/sh: " Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 17/19] arch/sparc: Implement fb_is_primary_device() in source file Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 18/19] arch/sparc: Implement <asm/fb.h> with generic helpers Thomas Zimmermann
2023-04-06 14:30 ` [PATCH v2 19/19] arch/x86: " Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b4f75b8-aa83-8e41-7c99-7c8d573c0f31@suse.de \
    --to=tzimmermann@suse.de \
    --cc=arnd@arndb.de \
    --cc=daniel.vetter@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=javierm@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=sparclinux@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).