Linux-arch Archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Philipp Stanner" <pstanner@redhat.com>,
	"Bjorn Helgaas" <helgaas@kernel.org>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Neil Brown" <neilb@suse.de>, "John Sanpe" <sanpeqf@gmail.com>,
	"Kent Overstreet" <kent.overstreet@gmail.com>,
	"Niklas Schnelle" <schnelle@linux.ibm.com>,
	"Dave Jiang" <dave.jiang@intel.com>,
	"Uladzislau Koshchanka" <koshchanka@gmail.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"David Gow" <davidgow@google.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Rae Moar" <rmoar@google.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"wuqiang.matt" <wuqiang.matt@bytedance.com>,
	"Yury Norov" <yury.norov@gmail.com>,
	"Jason Baron" <jbaron@akamai.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Marco Elver" <elver@google.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Ben Dooks" <ben.dooks@codethink.co.uk>,
	"Danilo Krummrich" <dakr@redhat.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	Linux-Arch <linux-arch@vger.kernel.org>,
	stable@vger.kernel.org, "Arnd Bergmann" <arnd@kernel.org>
Subject: Re: [PATCH v5 RESEND 5/5] lib, pci: unify generic pci_iounmap()
Date: Fri, 26 Jan 2024 15:23:47 +0100	[thread overview]
Message-ID: <c11243e0-fcaf-4eda-92d3-c06a8f8cdb2d@app.fastmail.com> (raw)
In-Reply-To: <70b8db3ec0f8730fdd23dae21edc1a93d274b048.camel@redhat.com>

On Fri, Jan 26, 2024, at 14:59, Philipp Stanner wrote:
> On Tue, 2024-01-23 at 15:05 -0600, Bjorn Helgaas wrote:
>> On Thu, Jan 11, 2024 at 09:55:40AM +0100, Philipp Stanner wrote:
>> 
>> The kernel-doc addition could possibly also move there since it isn't
>> related to the unification.
>
> You mean the one from my devres-patch-series? Or documentation
> specifically about pci_iounmap()?
>
>> 
>> >  {
>> > -#ifdef ARCH_HAS_GENERIC_IOPORT_MAP
>> > -       uintptr_t start = (uintptr_t) PCI_IOBASE;
>> > -       uintptr_t addr = (uintptr_t) p;
>> > -
>> > -       if (addr >= start && addr < start + IO_SPACE_LIMIT) {
>> > -               ioport_unmap(p);
>> > +#ifdef CONFIG_HAS_IOPORT_MAP
>> > +       if (iomem_is_ioport(addr)) {
>> > +               ioport_unmap(addr);
>> >                 return;
>> >         }
>> >  #endif
>> > -       iounmap(p);
>> > +
>> > +       iounmap(addr);
>> >  }
>> 
>> > + * If CONFIG_GENERIC_IOMAP is selected and the architecture does
>> > NOT provide its
>> > + * own version, ARCH_WANTS_GENERIC_IOMEM_IS_IOPORT makes sure that
>> > the generic
>> > + * version from asm-generic/io.h is NOT used and instead the
>> > second "generic"
>> > + * version from this file here is used.
>> > + *
>> > + * There are currently two generic versions because of a difficult
>> > cleanup
>> > + * process. Namely, the version in lib/iomap.c once was really
>> > generic when IA64
>> > + * still existed. Today, it's only really used by x86.
>> > + *
>> > + * TODO: Move this function to x86-specific code.
>> 
>> Some of these TODOs look fairly simple.  Are they actually hard, or
>> could they just be done now?
>
> If they were simple from my humble POV I would have implemented them.
> The information about the x86-specficity is from Arnd Bergmann, the
> header-maintainer.
>
> I myself am not that sure how much work it would be to move the entire
> lib/iomap.c file to x86. At least some (possibley "dead") hooks to it
> still exist, for example here:
> arch/powerpc/platforms/Kconfig  # L.189

This one definitely takes some work to untangle, it's selected
by two powerpc platforms, but one doesn't actually need it any
more, and the other one uses it only for non-PCI devices.

I think the other architectures are easier to change and do
fix real bugs, but it's probably best done one at a time.

     Arnd

  reply	other threads:[~2024-01-26 14:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11  8:55 [PATCH v5 RESEND 0/5] Regather scattered PCI-Code Philipp Stanner
2024-01-11  8:55 ` [PATCH v5 RESEND 1/5] lib/pci_iomap.c: fix cleanup bugs in pci_iounmap() Philipp Stanner
2024-01-23 18:46   ` Bjorn Helgaas
2024-01-25 16:06     ` Philipp Stanner
2024-01-11  8:55 ` [PATCH v5 RESEND 2/5] lib: move pci_iomap.c to drivers/pci/ Philipp Stanner
2024-01-23 20:20   ` Bjorn Helgaas
2024-01-25 14:54     ` Philipp Stanner
2024-01-25 18:31       ` Bjorn Helgaas
2024-01-11  8:55 ` [PATCH v5 RESEND 3/5] lib: move pci-specific devres code " Philipp Stanner
2024-01-11  8:55 ` [PATCH v5 RESEND 4/5] pci: move devres code from pci.c to devres.c Philipp Stanner
2024-01-11  8:55 ` [PATCH v5 RESEND 5/5] lib, pci: unify generic pci_iounmap() Philipp Stanner
2024-01-23 21:05   ` Bjorn Helgaas
2024-01-26 13:59     ` Philipp Stanner
2024-01-26 14:23       ` Arnd Bergmann [this message]
2024-01-27 22:39       ` Bjorn Helgaas
2024-01-29 10:43         ` Philipp Stanner
2024-01-29 18:14           ` Bjorn Helgaas
2024-01-11  9:03 ` [PATCH v5 RESEND 0/5] Regather scattered PCI-Code Johannes Berg
2024-01-11  9:14   ` Philipp Stanner
2024-01-11  9:22     ` Johannes Berg
2024-01-11 14:53 ` Bjorn Helgaas
2024-01-11 15:32   ` Philipp Stanner

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=c11243e0-fcaf-4eda-92d3-c06a8f8cdb2d@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@kernel.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=bhelgaas@google.com \
    --cc=dakr@redhat.com \
    --cc=dave.jiang@intel.com \
    --cc=davidgow@google.com \
    --cc=elver@google.com \
    --cc=geert@linux-m68k.org \
    --cc=helgaas@kernel.org \
    --cc=jbaron@akamai.com \
    --cc=johannes@sipsolutions.net \
    --cc=keescook@chromium.org \
    --cc=kent.overstreet@gmail.com \
    --cc=koshchanka@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=neilb@suse.de \
    --cc=pstanner@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rmoar@google.com \
    --cc=sanpeqf@gmail.com \
    --cc=schnelle@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wuqiang.matt@bytedance.com \
    --cc=yury.norov@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).