All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 0/6] i2c: Get rid of the legacy binding model
Date: Sat, 2 May 2009 11:16:54 -0700	[thread overview]
Message-ID: <200905021116.54865.david-b@pacbell.net> (raw)
In-Reply-To: <20090502113856.39940f1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

On Saturday 02 May 2009, Jean Delvare wrote:
> 1* In i2c_device_uevent() there is the following piece of code:
> 
>         /* by definition, legacy drivers can't hotplug */
>         if (dev->driver)
>                 return 0;
> 
> David, I presume this can go away?

Legacy drivers are going away, so ... yes.  :)


> 2* Core locking should be checked. I am not completely sure what
> core_lock was supposed to protect, nor what it should protect now. I
> think it should protect at least i2c_adapter_idr, driver->detect()
> calls (which may add a device to the driver->clients list) and
> driver->attach_adapter() calls (for the same reason), although for the
> latter two, a per-driver lock may be more appropriate.

Protecting the IDR seems right to me.  I'd have to look at the
post-patches code to say more ... but for now I'll just say that
locking driver->*() calls seems less desirable than just making
sure the updates to clients_list are protected.  You should work
to minimize lock scope, so in general *drop* locks before calling
out from one module to another.  (Lots of nastiness comes from
the other module making calls that involve more locking...)


> At the moment, we also hold the lock for all of i2c_register_adapter(),
> i2c_del_adapter() and i2c_del_driver(), but not i2c_register_driver(),
> which seems a little inconsistent. David, do you know if we need to
> serialize the calls to device_register() and device_unregister(), or if
> the driver core takes care of this for us?

Driver core locking should eventually suffice for everything except
data structures directly managed by the I2C framework.

- Dave

  parent reply	other threads:[~2009-05-02 18:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-02  9:38 [PATCH 0/6] i2c: Get rid of the legacy binding model Jean Delvare
     [not found] ` <20090502113856.39940f1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-05-02  9:39   ` [PATCH 1/6] i2c: Kill client_register and client_unregister methods Jean Delvare
2009-05-02  9:40   ` [PATCH 2/6] i2c: Get rid of the legacy binding model Jean Delvare
     [not found]     ` <20090502114020.41c38247-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-05-02 19:03       ` David Brownell
     [not found]         ` <200905021203.43974.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-05-03  7:25           ` Jean Delvare
2009-05-02  9:41   ` [PATCH 3/6] i2c: Drop i2c_probe function Jean Delvare
2009-05-02  9:42   ` [PATCH 4/6] i2c: Merge i2c_attach_client into i2c_new_device Jean Delvare
2009-05-02  9:43   ` [PATCH 5/6] i2c: Kill is_newstyle_driver Jean Delvare
2009-05-02  9:45   ` [PATCH 6/6] i2c: Kill the redundant client list Jean Delvare
2009-05-02 18:16   ` David Brownell [this message]
2009-05-02 19:14   ` [PATCH 0/6] i2c: Get rid of the legacy binding model David Brownell
     [not found]     ` <200905021214.02937.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-05-03  7:05       ` Jean Delvare

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=200905021116.54865.david-b@pacbell.net \
    --to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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.