linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers
@ 2014-02-10 10:03 Wolfram Sang
       [not found] ` <1392026654-5343-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
  2014-03-28  7:55 ` [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	adi-buildroot-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

With I2C, class based instantiation means if a master driver has e.g.
I2C_CLASS_HWMON set, all slave drivers with this class will try to probe a
device using an array of possible addresses and some heuristics. That creates
traffic and needs time, even when nothing is connected. This mechanism is
needed when you do not have another method to describe the slaves. Embedded I2C
drivers do not need class based instantiation, since there is i2c_board_info or
devicetree description. Some drivers have the class flags set, though, and it
has spread further over the years. We can't remove the flags directly, because
there might be users out there relying on this feature. So, we add a
deprecation warning if a device is instantiated via class attributes. After
giving some time to switch over, we can then finally remove the class flags and
gain boot time.

Patch 1 adds some missing documentation. Patch 2 adds the deprecation feature.
Patches 3+4 are tested on hardware I need. Patches 5-17 are suggestions for
drivers I think could benefit from that. For those, acks are needed before I
will apply them to my tree. If you use a different driver which can also
benefit from this, just send a patch adding the new DEPRECATED flag.

The series can also be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/deprecated_class

Thanks,

   Wolfram


Wolfram Sang (17):
  Documentation: i2c: describe devicetree method for instantiating
    devices
  i2c: add deprecation warning for class based instantiation
  i2c: i2c-omap: deprecate class based instantiation
  i2c: i2c-at91: deprecate class based instantiation
  i2c: i2c-bcm2835: deprecate class based instantiation
  i2c: i2c-bfin-twi: deprecate class based instantiation
  i2c: i2c-davinci: deprecate class based instantiation
  i2c: i2c-designware-platdrv: deprecate class based instantiation
  i2c: i2c-mv64xxx: deprecate class based instantiation
  i2c: i2c-nomadik: deprecate class based instantiation
  i2c: i2c-ocores: deprecate class based instantiation
  i2c: i2c-rcar: deprecate class based instantiation
  i2c: i2c-s3c2410: deprecate class based instantiation
  i2c: i2c-sirf: deprecate class based instantiation
  i2c: i2c-stu300: deprecate class based instantiation
  i2c: i2c-tegra: deprecate class based instantiation
  i2c: i2c-xiic: deprecate class based instantiation

 Documentation/i2c/instantiating-devices     | 34 +++++++++++++++++++++++++++--
 drivers/i2c/busses/i2c-at91.c               |  2 +-
 drivers/i2c/busses/i2c-bcm2835.c            |  2 +-
 drivers/i2c/busses/i2c-bfin-twi.c           |  2 +-
 drivers/i2c/busses/i2c-davinci.c            |  2 +-
 drivers/i2c/busses/i2c-designware-platdrv.c |  2 +-
 drivers/i2c/busses/i2c-mv64xxx.c            |  2 +-
 drivers/i2c/busses/i2c-nomadik.c            |  2 +-
 drivers/i2c/busses/i2c-ocores.c             |  2 +-
 drivers/i2c/busses/i2c-omap.c               |  2 +-
 drivers/i2c/busses/i2c-rcar.c               |  2 +-
 drivers/i2c/busses/i2c-s3c2410.c            |  2 +-
 drivers/i2c/busses/i2c-sirf.c               |  2 +-
 drivers/i2c/busses/i2c-stu300.c             |  2 +-
 drivers/i2c/busses/i2c-tegra.c              |  2 +-
 drivers/i2c/busses/i2c-xiic.c               |  2 +-
 drivers/i2c/i2c-core.c                      |  7 ++++++
 include/linux/i2c.h                         |  1 +
 18 files changed, 55 insertions(+), 17 deletions(-)

-- 
1.8.5.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 16/17] i2c: i2c-tegra: deprecate class based instantiation
       [not found] ` <1392026654-5343-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
@ 2014-02-10 10:04   ` Wolfram Sang
       [not found]     ` <1392026654-5343-17-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Wolfram Sang, Laxman Dewangan, Stephen Warren, Thierry Reding,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

 drivers/i2c/busses/i2c-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index e661ede..a9adbbe 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -787,7 +787,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
 
 	i2c_set_adapdata(&i2c_dev->adapter, i2c_dev);
 	i2c_dev->adapter.owner = THIS_MODULE;
-	i2c_dev->adapter.class = I2C_CLASS_HWMON;
+	i2c_dev->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
 		sizeof(i2c_dev->adapter.name));
 	i2c_dev->adapter.algo = &tegra_i2c_algo;
-- 
1.8.5.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 16/17] i2c: i2c-tegra: deprecate class based instantiation
       [not found]     ` <1392026654-5343-17-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
@ 2014-02-10 16:46       ` Stephen Warren
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2014-02-10 16:46 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Laxman Dewangan, Thierry Reding,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 02/10/2014 03:04 AM, Wolfram Sang wrote:
> Warn users that class based instantiation is going away soon in favour
> of more robust probing and faster bootup times.

Acked-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
       [not found] ` <1392026654-5343-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
@ 2014-03-28  7:55 ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2014-03-28  7:55 UTC (permalink / raw)
  To: linux-i2c
  Cc: adi-buildroot-devel, davinci-linux-open-source, linux-arm-kernel,
	linux-doc, linux-kernel, linux-omap, linux-samsung-soc,
	linux-tegra

[-- Attachment #1: Type: text/plain, Size: 2857 bytes --]

On Mon, Feb 10, 2014 at 11:03:54AM +0100, Wolfram Sang wrote:
> With I2C, class based instantiation means if a master driver has e.g.
> I2C_CLASS_HWMON set, all slave drivers with this class will try to probe a
> device using an array of possible addresses and some heuristics. That creates
> traffic and needs time, even when nothing is connected. This mechanism is
> needed when you do not have another method to describe the slaves. Embedded I2C
> drivers do not need class based instantiation, since there is i2c_board_info or
> devicetree description. Some drivers have the class flags set, though, and it
> has spread further over the years. We can't remove the flags directly, because
> there might be users out there relying on this feature. So, we add a
> deprecation warning if a device is instantiated via class attributes. After
> giving some time to switch over, we can then finally remove the class flags and
> gain boot time.
> 
> Patch 1 adds some missing documentation. Patch 2 adds the deprecation feature.
> Patches 3+4 are tested on hardware I need. Patches 5-17 are suggestions for
> drivers I think could benefit from that. For those, acks are needed before I
> will apply them to my tree. If you use a different driver which can also
> benefit from this, just send a patch adding the new DEPRECATED flag.
> 
> The series can also be found here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/deprecated_class
> 
> Thanks,
> 
>    Wolfram
> 
> 
> Wolfram Sang (17):
>   Documentation: i2c: describe devicetree method for instantiating
>     devices
>   i2c: add deprecation warning for class based instantiation
>   i2c: i2c-omap: deprecate class based instantiation
>   i2c: i2c-at91: deprecate class based instantiation
>   i2c: i2c-bcm2835: deprecate class based instantiation
>   i2c: i2c-bfin-twi: deprecate class based instantiation
>   i2c: i2c-davinci: deprecate class based instantiation
>   i2c: i2c-designware-platdrv: deprecate class based instantiation
>   i2c: i2c-mv64xxx: deprecate class based instantiation
>   i2c: i2c-nomadik: deprecate class based instantiation
>   i2c: i2c-ocores: deprecate class based instantiation
>   i2c: i2c-rcar: deprecate class based instantiation
>   i2c: i2c-s3c2410: deprecate class based instantiation
>   i2c: i2c-sirf: deprecate class based instantiation
>   i2c: i2c-stu300: deprecate class based instantiation
>   i2c: i2c-tegra: deprecate class based instantiation
>   i2c: i2c-xiic: deprecate class based instantiation

I reconsidered and have now applied all patches. That way, all these
drivers can be converted to no class based instantiation in one go after
some grace period. If it turns out, one driver actually needs it, there
is still the grace period left to remove the DEPRECATED flag again.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-28  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
     [not found] ` <1392026654-5343-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-02-10 10:04   ` [PATCH 16/17] i2c: i2c-tegra: deprecate class based instantiation Wolfram Sang
     [not found]     ` <1392026654-5343-17-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-02-10 16:46       ` Stephen Warren
2014-03-28  7:55 ` [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang

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).