linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Vadim Pasternak <vadimp@mellanox.com>,
	andy.shevchenko@gmail.com, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, jiri@resnulli.us,
	michaelsh@mellanox.com, Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v1 2/4] platform/x86: mlx-platform: Add differed bus functionality
Date: Thu, 22 Mar 2018 15:18:40 -0700	[thread overview]
Message-ID: <20180322221840.GC24138@fury> (raw)
In-Reply-To: <20180322090451.GA22313@kroah.com>

On Thu, Mar 22, 2018 at 10:04:51AM +0100, Greg Kroah-Hartman wrote:
> On Wed, Mar 21, 2018 at 03:58:18PM -0700, Darren Hart wrote:
> > On Tue, Feb 13, 2018 at 10:09:34PM +0000, Vadim Pasternak wrote:
> > > Add deferred bus functionality in order to enforce probing flow execution
> > > order. Driver mlx-platform activates platform driver i2c-mux-reg, which
> > > creates busses infrastructure, after that it activates mlxreg-hotplug
> > > driver, which uses these busses, for connecting devices. The possible
> > > miss-ordering can happened, for example in case the probing routine of
> > > mlxreg-hotplug is already started execution, while i2c-mux-reg probing
> > > routine is not completed yet. In such situation the first one could
> > > attempt to connect device to adapter number, which is not created yet.
> > > And as a result this connection will fail. In order to ensure the order of
> > > probing execution on mlxreg-hotplug probe routine will be deferred until
> > > all the busses is not created by  probe routine of i2c-mux-reg.
> > > In order to ensure the flow order, mlx-platform driver passes the highest
> > > bus number to the mlxreg-hotplug platform data, which in their turn could
> > > wait in the deferred state, until all the necessary buses topology is not
> > > exist.
> > 
> > Vadim,
> > 
> > I've got part way through a review of this series several times, and keep
> > running out of time trying to determine if the solution is appropriate
> > for the problem.
> > 
> > The deferred probing waiting for the i2c bus to be available seems like
> > something we might be able to handle more elegantly with:
> > 
> > 1) request_module() in the platform driver
> > 2) careful use of init levels (subsys, device, late)
> > 
> > This isn't something I'm well versed in - so I'll reach out here for
> > some advice from Greg and the i2c maintainer, Wolfram, and list (added
> > to Cc).
> 
> deferred device probe?
> 

This patch series adds the following, which I believe is what you're referring
to Greg? :

+       /* Defer probing if the necessary adapter is not configured yet. */
+       deferred_adap = i2c_get_adapter(pdata->deferred_nr);
+       if (!deferred_adap)
+               return -EPROBE_DEFER;

This is the preferred approach? Have the platform driver define the expected
adapter number, and then defer until that becomes available?

-- 
Darren Hart
VMware Open Source Technology Center

  reply	other threads:[~2018-03-22 22:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 22:09 [PATCH v1 0/4] platform/x86: mlx-platform: Add bus differed and auto detection functionalities Vadim Pasternak
2018-02-13 22:09 ` [PATCH v1 1/4] platform/x86: mlx-platform: Use define for the channel numbers Vadim Pasternak
2018-02-13 22:09 ` [PATCH v1 2/4] platform/x86: mlx-platform: Add differed bus functionality Vadim Pasternak
2018-03-21 22:58   ` Darren Hart
2018-03-22  9:04     ` Greg KH
2018-03-22 22:18       ` Darren Hart [this message]
2018-03-22 22:39         ` Greg KH
2018-02-13 22:09 ` [PATCH v1 3/4] platform/mellanox: mlxreg-hotplug: Change input for device create routine Vadim Pasternak
2018-02-13 22:09 ` [PATCH v1 4/4] platform/x86: mlx-platform: Add physical bus number auto detection Vadim Pasternak
2018-02-16  1:32 ` [PATCH v1 0/4] platform/x86: mlx-platform: Add bus differed and auto detection functionalities Darren Hart
2018-02-17  5:08   ` Vadim Pasternak
2018-03-22 23:55 ` Darren Hart
2018-03-23 15:59   ` Vadim Pasternak
2018-03-23 23:09     ` Darren Hart

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=20180322221840.GC24138@fury \
    --to=dvhart@infradead.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiri@resnulli.us \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michaelsh@mellanox.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=vadimp@mellanox.com \
    --cc=wsa@the-dreams.de \
    /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).