[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dd921bae-0145-09e2-24b1-f08d89a78eba@suse.de>
Date: Wed, 3 May 2023 16:55:05 +0200
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Arnd Bergmann <arnd@...db.de>, Helge Deller <deller@....de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Javier Martinez Canillas <javierm@...hat.com>,
Daniel Vetter <daniel@...ll.ch>,
Vineet Gupta <vgupta@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>,
"David S . Miller" <davem@...emloft.net>,
"James E . J . Bottomley" <James.Bottomley@...senPartnership.com>,
Sam Ravnborg <sam@...nborg.org>
Cc: linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Linux-Arch <linux-arch@...r.kernel.org>,
linux-snps-arc@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-ia64@...r.kernel.org, loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org, sparclinux@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-parisc@...r.kernel.org
Subject: Re: [PATCH v3 5/6] fbdev: Move framebuffer I/O helpers into
<asm/fb.h>
Hi
Am 02.05.23 um 22:06 schrieb Arnd Bergmann:
> On Tue, May 2, 2023, at 15:02, Thomas Zimmermann wrote:
>> Implement framebuffer I/O helpers, such as fb_read*() and fb_write*(),
>> in the architecture's <asm/fb.h> header file or the generic one.
>>
>> The common case has been the use of regular I/O functions, such as
>> __raw_readb() or memset_io(). A few architectures used plain system-
>> memory reads and writes. Sparc used helpers for its SBus.
>>
>> The architectures that used special cases provide the same code in
>> their __raw_*() I/O helpers. So the patch replaces this code with the
>> __raw_*() functions and moves it to <asm-generic/fb.h> for all
>> architectures.
>>
>> v3:
>> * implement all architectures with generic helpers
>> * support reordering and native byte order (Geert, Arnd)
>
> This looks good for the read/write helpers, but I'm a little
> worried about the memset and memcpy functions, since they do
> change behavior on some architectures:
>
> - on sparc64, fb_mem{set,cpy} uses ASI_PHYS_BYPASS_EC_E (like __raw_readb)
> while mem{set_,cpy_from,cpy_to} uses ASI_PHYS_BYPASS_EC_E_L (like readb)
> I don't know the effect of that, but it seems intentional
>
> - on loongarch and csky, the _io variants avoid unaligned access,
> while the normal memcpy/memset is probably broken, so your
> patch is a bugfix
>
> - on ia64, the _io variants use bytewise access and avoid any longer
> loads and stores, so your patch probably makes things slower.
>
> It's probably safe to deal with all the above by either adding
> architecture specific overrides to the current version, or
> by doing the semantic changes before the move to asm/fb.h, but
> one way or the other I'd prefer this to be separate from the
> consolidation patch that should not have any changes in behavior.
I think I'll add architecture overrides that contain the current code,
even if they contain some force-casting wrt __iomem. If anyone wants to
fix the issues, they can then address them easily.
Best regards
Thomas
>
> Arnd
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists