From: Bjorn Helgaas <helgaas@kernel.org>
To: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Cc: austin_bolen@dell.com, alex_gagniuc@dellteam.com,
keith.busch@intel.com, Shyam_Iyer@Dell.com, lukas@wunner.de,
okaya@kernel.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/3] PCI / ACPI: Remove the need for 'struct hotplug_params'
Date: Fri, 19 Apr 2019 17:02:20 -0500 [thread overview]
Message-ID: <20190419220220.GI173520@google.com> (raw)
In-Reply-To: <20190419200745.GH173520@google.com>
On Fri, Apr 19, 2019 at 03:07:45PM -0500, Bjorn Helgaas wrote:
> On Fri, Feb 08, 2019 at 10:24:12AM -0600, Alexandru Gagniuc wrote:
> > We used to first parse all the _HPP and _HPX tables before using the
> > information to program registers of PCIe devices. Up until HPX type 2,
> > there was only one structure of each type, so we could cheat and store
> > it on the stack.
> >
> > With HPX type 3 we get an arbitrary number of entries, so the above
> > model doesn't scale that well. Instead of parsing all tables at once,
> > parse and program each entry separately. For _HPP and _HPX 0 thru 2,
> > this is functionally equivalent. The change enables the upcoming _HPX3
> > to integrate more easily.
>
> I think this is tremendous! It's going to simplify this code
> dramatically. Two comments below.
> > static void pci_configure_device(struct pci_dev *dev)
> > {
> > - struct hotplug_params hpp;
> > - int ret;
> > + static const struct hotplug_program_ops hp_ops = {
> > + .program_type0 = program_hpp_type0,
> > + .program_type1 = program_hpp_type1,
> > + .program_type2 = program_hpp_type2,
> > + };
>
> What if we just moved program_hpp_type0(), etc from probe.c to
> pci-acpi.c? The only reason I see to have it in probe.c is for
> pci_default_type0, and I think that is a pretty obtuse way of doing
> default configuration. I would have no problem at all just hardcoding
> those defaults in probe.c and then potentially having them overwritten
> by _HPP/_HPX.
Actually, never mind about this. This would be a perfect project for
mentoring a Linux newbie.
I'll merge this series as-is and any restructuring/cleanup can happen
later, since it's not related to this series anyway.
Bjorn
next prev parent reply other threads:[~2019-04-19 22:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190208162414.3996-1-mr.nuke.me@gmail.com>
2019-02-08 16:24 ` [PATCH v1 1/3] PCI / ACPI: Do not export pci_get_hp_params() Alexandru Gagniuc
2019-04-22 20:58 ` Bjorn Helgaas
2019-04-22 23:45 ` Alex G
2019-02-08 16:24 ` [PATCH v1 2/3] PCI / ACPI: Remove the need for 'struct hotplug_params' Alexandru Gagniuc
2019-04-19 20:07 ` Bjorn Helgaas
2019-04-19 22:02 ` Bjorn Helgaas [this message]
2019-02-08 16:24 ` [PATCH v1 3/3] PCI / ACPI: Implement Type 3 _HPX record Alexandru Gagniuc
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=20190419220220.GI173520@google.com \
--to=helgaas@kernel.org \
--cc=Shyam_Iyer@Dell.com \
--cc=alex_gagniuc@dellteam.com \
--cc=austin_bolen@dell.com \
--cc=keith.busch@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mr.nuke.me@gmail.com \
--cc=okaya@kernel.org \
--cc=rjw@rjwysocki.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.