linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Cc: andrianov <andrianov@ispras.ru>,
	mchehab@kernel.org, tony.luck@intel.com, james.morse@arm.com,
	rrichter@marvell.com, linux-edac@vger.kernel.org
Subject: Re: Regarding bug in drivers/edac/x38_edac.c
Date: Sun, 16 Aug 2020 09:06:21 +0200	[thread overview]
Message-ID: <20200816070621.GB21914@zn.tnic> (raw)
In-Reply-To: <CAD=jOEZ9t4ztYtPKL9B1KA9=f4mniu6-bF_1-JWoPKJTE0kiaw@mail.gmail.com>

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

       reply	other threads:[~2020-08-16  7:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAD=jOEZ9t4ztYtPKL9B1KA9=f4mniu6-bF_1-JWoPKJTE0kiaw@mail.gmail.com>
2020-08-16  7:06 ` Borislav Petkov [this message]
2020-08-16  8:42   ` Regarding bug in drivers/edac/x38_edac.c Madhuparna Bhowmik

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=20200816070621.GB21914@zn.tnic \
    --to=bp@alien8.de \
    --cc=andrianov@ispras.ru \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=madhuparnabhowmik10@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=rrichter@marvell.com \
    --cc=tony.luck@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 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 NNTP newsgroup(s).