* Re: Regarding bug in drivers/edac/x38_edac.c
[not found] <CAD=jOEZ9t4ztYtPKL9B1KA9=f4mniu6-bF_1-JWoPKJTE0kiaw@mail.gmail.com>
@ 2020-08-16 7:06 ` Borislav Petkov
2020-08-16 8:42 ` Madhuparna Bhowmik
0 siblings, 1 reply; 2+ messages in thread
From: Borislav Petkov @ 2020-08-16 7:06 UTC (permalink / raw)
To: Madhuparna Bhowmik
Cc: andrianov, mchehab, tony.luck, james.morse, rrichter, linux-edac
On Sun, Aug 16, 2020 at 12:05:57PM +0530, Madhuparna Bhowmik wrote:
> 2. Even if we ignore the 1st point above and probe is called after init
> finishes,
AFAIR and if you don't have any async probing (which I don't believe for
this driver or for any other EDAC driver), the ->probe() function gets
called during pci_register_driver(). From the docs:
Documentation/PCI/pci.rst:
"pci_register_driver() call
==========================
...
Once added, the driver probe routine will be invoked for any unclaimed
PCI devices listed in its (newly updated) pci_ids list."
You could verify that by adding some debugging printks to a driver's
probe function.
I believe it ends up somewhere in the driver core, looks like in
really_probe():
if (dev->bus->probe) {
ret = dev->bus->probe(dev);
in drivers/base/dd.c but I could be mistaken.
> In general, calling the probe function from init itself is a bit strange.
Yes, that is ugly - the init function tries what the probe function has
already tried, again.
But I don't think either 1. or 2. of yours happens - it is actually
clumsy but the mci_pdev is simply a check to verify whether the
->probe() succeeded and try it again.
Now, if you have that hardware, you could verify all that but I think
the reality is, I don't think anyone uses that hardware anymore and we
will remove them at some point in the future so you might wanna look at
some other drivers which *actually* are still in use.
:-)
HTH.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Regarding bug in drivers/edac/x38_edac.c
2020-08-16 7:06 ` Regarding bug in drivers/edac/x38_edac.c Borislav Petkov
@ 2020-08-16 8:42 ` Madhuparna Bhowmik
0 siblings, 0 replies; 2+ messages in thread
From: Madhuparna Bhowmik @ 2020-08-16 8:42 UTC (permalink / raw)
To: Borislav Petkov
Cc: Madhuparna Bhowmik, andrianov, mchehab, tony.luck, james.morse,
rrichter, linux-edac
On Sun, Aug 16, 2020 at 09:06:21AM +0200, Borislav Petkov wrote:
> On Sun, Aug 16, 2020 at 12:05:57PM +0530, Madhuparna Bhowmik wrote:
> > 2. Even if we ignore the 1st point above and probe is called after init
> > finishes,
>
> AFAIR and if you don't have any async probing (which I don't believe for
> this driver or for any other EDAC driver), the ->probe() function gets
> called during pci_register_driver(). From the docs:
>
> Documentation/PCI/pci.rst:
>
> "pci_register_driver() call
> ==========================
>
> ...
>
> Once added, the driver probe routine will be invoked for any unclaimed
> PCI devices listed in its (newly updated) pci_ids list."
>
> You could verify that by adding some debugging printks to a driver's
> probe function.
>
> I believe it ends up somewhere in the driver core, looks like in
>
> really_probe():
>
> if (dev->bus->probe) {
> ret = dev->bus->probe(dev);
>
> in drivers/base/dd.c but I could be mistaken.
>
> > In general, calling the probe function from init itself is a bit strange.
>
> Yes, that is ugly - the init function tries what the probe function has
> already tried, again.
>
> But I don't think either 1. or 2. of yours happens - it is actually
> clumsy but the mci_pdev is simply a check to verify whether the
> ->probe() succeeded and try it again.
>
Thanks a lot for clarifying this.
> Now, if you have that hardware, you could verify all that but I think
> the reality is, I don't think anyone uses that hardware anymore and we
> will remove them at some point in the future so you might wanna look at
> some other drivers which *actually* are still in use.
>
Alright, makes sense.
Regards,
Madhuparna
> :-)
>
> HTH.
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, back to index
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAD=jOEZ9t4ztYtPKL9B1KA9=f4mniu6-bF_1-JWoPKJTE0kiaw@mail.gmail.com>
2020-08-16 7:06 ` Regarding bug in drivers/edac/x38_edac.c Borislav Petkov
2020-08-16 8:42 ` Madhuparna Bhowmik
Linux-EDAC Archive on lore.kernel.org
Archives are clonable:
git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
linux-edac@vger.kernel.org
public-inbox-index linux-edac
Example config snippet for mirrors
Newsgroup available over NNTP:
nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git