Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Krzysztof Wilczy??ski <kw@linux.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Kees Cook <keescook@chromium.org>, Pali Roh??r <pali@kernel.org>,
	Oliver O'Halloran <oohall@gmail.com>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback
Date: Mon, 28 Jun 2021 12:41:30 +0200	[thread overview]
Message-ID: <20210628104130.GB139153@rocinante> (raw)
In-Reply-To: <YNmf9sAB2NEnivsk@infradead.org>

Hi Christoph,

> >  	if (battr->mapping)
> > -		of->file->f_mapping = battr->mapping;
> > +		of->file->f_mapping = battr->mapping();
> 
> I think get_mapping() is a better name now.  That being said this
> whole programming model looks a little weird.

I would have to lean on Daniel and Dan here as they might have more
context than I do, especially since in the PCI world we are only
consumers of this new API.  The related patches are:

  commit 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the region")
  commit 636b21b50152 ("PCI: Revoke mappings like devmem") 

> Also, does this patch imply the mapping field of the sysfs bin
> attributes wasn't used before at all?

No, everything worked as intended, thankfully.  Changes here are meant
to help us transition to use static sysfs objects when we add various
PCI-related attributes a particular device.  This in turn will allow us
to remove the need for late_initcall() in the drivers/pci/pci-sysfs.c,
and thus fix the race condition people noticed on some platforms when
sysfs objects are being added while PCI sub-system and devices are
initialised.

More details are captured in the following conversations:
  https://lore.kernel.org/linux-pci/20200716110423.xtfyb3n6tn5ixedh@pali/
  https://lore.kernel.org/linux-pci/20210527205845.GA1421476@bjorn-Precision-5520/
  https://lore.kernel.org/linux-pci/20210313215747.GA2394467@bjorn-Precision-5520/

Dan's original patch:
  https://lore.kernel.org/linux-pci/CAPcyv4i0y_4cMGEpNVShLUyUk3nyWH203Ry3S87BqnDJE0Rmxg@mail.gmail.com/

	Krzysztof

  reply	other threads:[~2021-06-28 10:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 23:31 [PATCH 0/2] Allow deferred execution of iomem_get_mapping() Krzysztof Wilczyński
2021-06-25 23:31 ` [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback Krzysztof Wilczyński
2021-06-25 23:53   ` Dan Williams
2021-06-28 10:09   ` Christoph Hellwig
2021-06-28 10:41     ` Krzysztof Wilczy??ski [this message]
2021-06-28 17:36     ` Dan Williams
2021-06-28 18:06       ` Krzysztof Wilczyński
2021-06-28 18:29         ` Dan Williams
2021-06-25 23:31 ` [PATCH 2/2] PCI/sysfs: Pass iomem_get_mapping() as a function pointer Krzysztof Wilczyński
2021-06-25 23:56   ` Dan Williams
2021-06-26 13:07     ` Krzysztof Wilczyński
2021-06-28 10:15   ` Christoph Hellwig
2021-06-28 10:24     ` Krzysztof Wilczy??ski
2021-06-28 11:09       ` Greg Kroah-Hartman

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=20210628104130.GB139153@rocinante \
    --to=kw@linux.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=keescook@chromium.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=oohall@gmail.com \
    --cc=pali@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