From: Thomas Zimmermann <tzimmermann@suse.de>
To: David Laight <David.Laight@ACULAB.COM>,
"deller@gmx.de" <deller@gmx.de>,
"geert@linux-m68k.org" <geert@linux-m68k.org>,
"javierm@redhat.com" <javierm@redhat.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>,
"vgupta@kernel.org" <vgupta@kernel.org>,
"chenhuacai@kernel.org" <chenhuacai@kernel.org>,
"kernel@xen0n.name" <kernel@xen0n.name>,
"davem@davemloft.net" <davem@davemloft.net>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"sam@ravnborg.org" <sam@ravnborg.org>,
"suijingfeng@loongson.cn" <suijingfeng@loongson.cn>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
kernel test robot <lkp@intel.com>,
"linux-parisc@vger.kernel.org" <linux-parisc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-m68k@lists.linux-m68k.org"
<linux-m68k@lists.linux-m68k.org>,
"loongarch@lists.linux.dev" <loongarch@lists.linux.dev>,
"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Artur Rojek <contact@artur-rojek.eu>
Subject: Re: [PATCH v7 1/7] fbdev/hitfb: Cast I/O offset to address
Date: Fri, 12 May 2023 13:45:22 +0200 [thread overview]
Message-ID: <ab63aa0b-0db8-dfa0-cb63-2f16a66fe2f2@suse.de> (raw)
In-Reply-To: <c25758dd7b4a4563b0d33c751da8cf6d@AcuMS.aculab.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 2188 bytes --]
Hi
Am 12.05.23 um 13:16 schrieb David Laight:
> From: Thomas Zimmermann
>> Sent: 12 May 2023 11:25
>>
>> Cast I/O offsets to pointers to use them with I/O functions. The I/O
>> functions expect pointers of type 'volatile void __iomem *', but the
>> offsets are plain integers. Build warnings are
>>
>> ../drivers/video/fbdev/hitfb.c: In function 'hitfb_accel_wait':
>> ../arch/x86/include/asm/hd64461.h:18:33: warning: passing argument 1 of 'fb_readw' makes pointer
>> from integer without a cast [-Wint-conversion]
>> 18 | #define HD64461_IO_OFFSET(x) (HD64461_IOBASE + (x))
>> | ^~~~~~~~~~~~~~~~~~~~~~
> ...
>> 52 | static inline u16 fb_readw(const volatile void __iomem *addr)
>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>>
>> This patch only fixes the build warnings. It's not clear if the I/O
>> offsets can legally be passed to the I/O helpers. It was apparently
>> broken in 2007 when custom inw()/outw() helpers got removed by
>> commit 34a780a0afeb ("sh: hp6xx pata_platform support."). Fixing the
>> driver would require setting the I/O base address.
>
> Did you try changing the definition of HD64461_IOBASE to include
> a (volatile void __iomem *) cast?
I thought about it, but didn't try it. I didn't want bend the meaning of
OFFSET and IOBASE too much. They sound like integer constants to me.
> A lot less churn...
>
> I'm guessing that 'sh' deosn't have in/out instructions so this
> is something that is always mapped at a fixed kernel virtual address?
No idea. I cannot try the driver and was only able to build it by
hacking up something that makes COMPILE_TEST work.
The current patch seemed like the safest bet, even with the churn.
Best regards
Thomas
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
--
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)
[-- 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
next prev parent reply other threads:[~2023-05-12 11:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 10:24 [PATCH v7 0/7] fbdev: Move framebuffer I/O helpers to <asm/fb.h> Thomas Zimmermann
2023-05-12 10:24 ` [PATCH v7 1/7] fbdev/hitfb: Cast I/O offset to address Thomas Zimmermann
2023-05-12 11:16 ` David Laight
2023-05-12 11:45 ` Thomas Zimmermann [this message]
2023-05-16 17:44 ` Helge Deller
2023-05-12 10:24 ` [PATCH v7 2/7] fbdev/matrox: Remove trailing whitespaces Thomas Zimmermann
2023-05-12 10:24 ` [PATCH v7 3/7] ipu-v3: Include <linux/io.h> Thomas Zimmermann
2023-05-12 10:24 ` [PATCH v7 4/7] fbdev: Include <linux/io.h> in various drivers Thomas Zimmermann
2023-05-12 10:24 ` [PATCH v7 5/7] fbdev: Include <linux/fb.h> instead of <asm/fb.h> Thomas Zimmermann
2023-05-12 10:24 ` [PATCH v7 6/7] fbdev: Move framebuffer I/O helpers into <asm/fb.h> Thomas Zimmermann
2023-05-12 10:24 ` [PATCH v7 7/7] fbdev: Rename fb_mem*() helpers 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=ab63aa0b-0db8-dfa0-cb63-2f16a66fe2f2@suse.de \
--to=tzimmermann@suse.de \
--cc=David.Laight@ACULAB.COM \
--cc=James.Bottomley@HansenPartnership.com \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=contact@artur-rojek.eu \
--cc=daniel@ffwll.ch \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=kernel@xen0n.name \
--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-parisc@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=lkp@intel.com \
--cc=loongarch@lists.linux.dev \
--cc=sam@ravnborg.org \
--cc=sparclinux@vger.kernel.org \
--cc=suijingfeng@loongson.cn \
--cc=vgupta@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).