Hi Heiner, sorry for the slow response. I am on the road for two weeks now which doesn't leave a lot of review time. The good (or bad?) news is that I finally found why I had the feeling of "something still missing" from this very interesting approach. > - /* Tell drivers about this removal */ > - mutex_lock(&core_lock); > - bus_for_each_drv(&i2c_bus_type, NULL, adap, > - __process_removed_adapter); > - mutex_unlock(&core_lock); You remove using the lock here... > - i2c_for_each_dev(driver, __process_removed_driver); > + /* Satisfy __must_check, function can't fail */ > + if (driver_for_each_device(&driver->driver, NULL, NULL, ... and here, because i2c_for_each_dev() utilizes the lock as well. This is, you open a race window for deleting clients via removing the driver and removing the adapter at the "same" time. The obvious solution is to use the lock also when removing clients in i2c_del_adapter(). But this needs careful thinking about potential side effects. Makes sense so far? All the best, Wolfram
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: [PATCH v2 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- From: Heiner Kallweit
- Re: [PATCH v2 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- From: Heiner Kallweit
- Re: [PATCH v2 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- References:
- [PATCH v2 0/4] i2c: Replace lists of special clients with flagging of such clients
- From: Heiner Kallweit
- [PATCH v2 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- From: Heiner Kallweit
- [PATCH v2 0/4] i2c: Replace lists of special clients with flagging of such clients
- Prev by Date: [PATCH v1 07/10] ASoC: codecs: add wsa881x-i2c amplifier codec driver
- Next by Date: Re: [PATCH 1/2] dt-bindings: sound: sprd,pcm-platform: convert to YAML
- Previous by thread: Re: [PATCH v2 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- Next by thread: Re: [PATCH v2 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- Index(es):