From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Tadeusz Struk <tadeusz.struk@intel.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-pci@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2] Dynamically add and remove device specific reset functions
Date: Fri, 2 Mar 2012 09:25:45 -0800 [thread overview]
Message-ID: <20120302092545.1719e6f2@jbarnes-desktop> (raw)
In-Reply-To: <CAErSpo6QzCy7cgN8boXu4zhGhTbjEG7RyJ6avaVKL_u=vGMOUw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2251 bytes --]
On Fri, 2 Mar 2012 10:17:53 -0700
Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Mar 2, 2012 at 10:06 AM, Tadeusz Struk <tadeusz.struk@intel.com> wrote:
> > On 02/03/12 16:29, Bjorn Helgaas wrote:
> >> Where do you plan to add calls to pci_dev_specific_reset_add()? In
> >> drivers?
> >
> > Yes, I'm working on a driver for a device with SRIOV capability.
> > I'll call it from there.
> >
> >> Did you consider adding a "reset" function pointer to struct
> >> pci_driver? That might be more natural -- the reset function is right
> >> with all the other code that knows about the device, and there's no
> >> issue with looking up the correct reset function.
> >> With this patch, we sort of have two different ways to map
> >> vendor/device IDs to code: the usual pci_register_driver() approach,
> >> and this one using reset_list. If pci_driver had a "reset" pointer,
> >> that would be used most of the time. You might still need the
> >> reset_list for generic things, e.g., the reset_intel_generic_dev()
> >> function, but it would be a fallback. It might look something like:
> >>
> >> struct pci_driver *drv = dev->driver;
> >>
> >> if (drv && drv->reset) {
> >> drv->reset(dev);
> >> return;
> >> }
> >>
> >> list_for_each_entry(i, &reset_list, list) {
> >> ...
> >
> > No, I didn't think about it.
> > This is good idea, but for me the pci_dev_specific_reset() works fine.
>
> I know your patch works fine, but I think we should have the
> discussion about whether adding a struct pci_driver pointer is a
> better long-term solution.
>
> Greg, Jesse, others, chime in if you have any thoughts.
I thought we had one already... /me digs around. Ah just for AER and
platform error handling.
I do like the idea of a driver hook here; I think there are quite a few
devices that can be reset w/o FLR and that may need additional
handling, so there's an opportunity to consolidate code.
I think it would probably make Tadeusz's patch smaller too; he could
just add the hook and a function for his driver, then conversions for
existing code could come later.
--
Jesse Barnes, Intel Open Source Technology Center
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-03-02 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 11:55 [PATCH v2] Dynamically add and remove device specific reset functions tadeusz.struk
2012-03-02 16:29 ` Bjorn Helgaas
2012-03-02 17:06 ` Tadeusz Struk
2012-03-02 17:17 ` Bjorn Helgaas
2012-03-02 17:25 ` Jesse Barnes [this message]
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=20120302092545.1719e6f2@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=tadeusz.struk@intel.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 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.