linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Bjorn Helgaas <helgaas@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	Peter Zijlstra <peterz@infradead.org>,
	openrisc@lists.librecores.org
Subject: Re: [PATCH v3 2/3] openrisc: Add pci bus support
Date: Fri, 29 Jul 2022 16:54:52 +0900	[thread overview]
Message-ID: <YuOSTOAVw6zekvL+@antec> (raw)
In-Reply-To: <ceb732ee-0ea1-b471-0b57-3cc3bcb80a2d@roeck-us.net>

On Thu, Jul 28, 2022 at 11:10:37PM -0700, Guenter Roeck wrote:
> On 7/28/22 22:50, Stafford Horne wrote:
> > On Thu, Jul 28, 2022 at 08:37:28PM -0700, Guenter Roeck wrote:
> > > On Mon, Jul 25, 2022 at 11:07:36AM +0900, Stafford Horne wrote:
> > > > This patch adds required definitions to allow for PCI buses on OpenRISC.
> > > > This is being tested on the OpenRISC QEMU virt platform which is in
> > > > development.
> > > > 
> > > > OpenRISC does not have IO ports so we keep the definition of
> > > > IO_SPACE_LIMIT and PIO_RESERVED to be 0.
> > > > 
> > > > Note, since commit 66bcd06099bb ("parport_pc: Also enable driver for PCI
> > > > systems") all platforms that support PCI also need to support parallel
> > > > port.  We add a generic header to support compiling parallel port
> > > > drivers, though they generally will not work as they require IO ports.
> > > > 
> > > > Signed-off-by: Stafford Horne <shorne@gmail.com>
> > > 
> > > This patch results in
> > > 
> > > Building openrisc:allmodconfig ... failed
> > > --------------
> > > Error log:
> > > drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe':
> > > drivers/video/fbdev/riva/fbdev.c:2062:42: error:
> > > 	passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type
> > > 
> > > drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidiafb_probe':
> > > drivers/video/fbdev/nvidia/nvidia.c:1414:20: error:
> > > 	passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type
> > > 
> > > drivers/scsi/aic7xxx/aic7xxx_osm.c: In function 'ahc_platform_free':
> > > drivers/scsi/aic7xxx/aic7xxx_osm.c:1231:41: error:
> > > 	passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type
> > > 
> > > ... and so on.
> > > 
> > > Prior to this patch, the code was not enabled because it depends on PCI.
> > 
> > Hi Guenter,
> > 
> > Thanks for reporting this.
> > 
> > It's interesting, I don't get this on the openrisc/for-next branch.
> > 
> 
> Hmm, weird. I see it all over the place. Complete log is at
> https://kerneltests.org/builders/next-openrisc-next/builds/1880/steps/buildcommand/logs/stdio
> if you are interested.
> 
> > BTW, do you turn off WERROR on the allmodconfig config?  I get many warnings
> > such as the below, but I haven't looked into it much yet:
> > 
> 
> No, I don't. Disabling it would defeat its purpose.
> 
> >      fs/exec.c: In function 'shift_arg_pages':
> >      fs/exec.c:687:27: error: 'tlb' is used uninitialized [-Werror=uninitialized]
> >        687 |         struct mmu_gather tlb;
> > 	  |                           ^~~
> > 
> 
> I don't see that in next-20220728. I tried with gcc-11.2 and 11.3.
> Which compiler do you use ?

I am using gcc 12.0.1 with next-20220728.  That might exaplain it, I am doing
compiler development at the same time so I always end up with the latest and
greatest warnings.

$ or1k-linux-gcc -v
  ..
  gcc version 12.0.1 20220210 (experimental) (GCC)

I can see the issue now:

    drivers/video/fbdev/riva/fbdev.c:2062:42: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
     2062 |                 iounmap(default_par->riva.PRAMIN);
	  |                         ~~~~~~~~~~~~~~~~~^~~~~~~

Just adding volatile does seem to fix this, I will do some more testing and
create a formal patch.

--

diff --git a/arch/openrisc/include/asm/io.h b/arch/openrisc/include/asm/io.h
index 625ac6ad1205..ee6043a03173 100644
--- a/arch/openrisc/include/asm/io.h
+++ b/arch/openrisc/include/asm/io.h
@@ -31,7 +31,7 @@
 void __iomem *ioremap(phys_addr_t offset, unsigned long size);
 
 #define iounmap iounmap
-extern void iounmap(void __iomem *addr);
+extern void iounmap(volatile void __iomem *addr);
 
 #include <asm-generic/io.h>
 
diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c
index daae13a76743..8ec0dafecf25 100644
--- a/arch/openrisc/mm/ioremap.c
+++ b/arch/openrisc/mm/ioremap.c
@@ -77,7 +77,7 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size)
 }
 EXPORT_SYMBOL(ioremap);
 
-void iounmap(void __iomem *addr)
+void iounmap(volatile void __iomem *addr)
 {
        /* If the page is from the fixmap pool then we just clear out
         * the fixmap mapping.


  reply	other threads:[~2022-07-29  7:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  2:07 [PATCH v3 0/3] OpenRISC support for virt platform with PCI Stafford Horne
2022-07-25  2:07 ` [PATCH v3 1/3] asm-generic: Support NO_IOPORT_MAP in pci_iomap.h Stafford Horne
2022-07-25 17:10   ` Bjorn Helgaas
2022-07-25 21:25     ` Stafford Horne
2022-07-25  2:07 ` [PATCH v3 2/3] openrisc: Add pci bus support Stafford Horne
2022-07-29  3:37   ` Guenter Roeck
2022-07-29  5:50     ` Stafford Horne
2022-07-29  6:10       ` Guenter Roeck
2022-07-29  7:54         ` Stafford Horne [this message]
2022-07-25  2:07 ` [PATCH v3 3/3] openrisc: Add virt defconfig Stafford Horne

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=YuOSTOAVw6zekvL+@antec \
    --to=shorne@gmail.com \
    --cc=arnd@arndb.de \
    --cc=helgaas@kernel.org \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=openrisc@lists.librecores.org \
    --cc=palmer@rivosinc.com \
    --cc=peterz@infradead.org \
    --cc=stefan.kristiansson@saunalahti.fi \
    /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).