All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
@ 2015-01-15 18:33 Pantelis Antoniou
       [not found] ` <1421346798-17148-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-15 18:33 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou,
	Pantelis Antoniou

Mark (and unmark) device nodes with the POPULATE flag as appropriate.
This is required to avoid multi probing when using I2C and device
overlays containing a mux.
This patch is also more careful with the release of the adapter device
which caused a deadlock with muxes, and does not break the build
on !OF since the node flag accessors are not defined then.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
---
 drivers/i2c/i2c-core.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 39d25a8..1d44e3a 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1122,6 +1122,10 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
  */
 void i2c_unregister_device(struct i2c_client *client)
 {
+#if IS_ENABLED(CONFIG_OF_DYNAMIC)
+	if (client->dev.of_node)
+		of_node_clear_flag(client->dev.of_node, OF_POPULATED);
+#endif
 	device_unregister(&client->dev);
 }
 EXPORT_SYMBOL_GPL(i2c_unregister_device);
@@ -1441,8 +1445,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
 
 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
 
-	for_each_available_child_of_node(adap->dev.of_node, node)
+	for_each_available_child_of_node(adap->dev.of_node, node) {
+		if (of_node_test_and_set_flag(node, OF_POPULATED))
+			continue;
 		of_i2c_register_device(adap, node);
+	}
 }
 
 static int of_dev_node_match(struct device *dev, void *data)
@@ -1976,6 +1983,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		if (adap == NULL)
 			return NOTIFY_OK;	/* not for us */
 
+		if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
+			put_device(&adap->dev);
+			return NOTIFY_OK;
+		}
+
 		client = of_i2c_register_device(adap, rd->dn);
 		put_device(&adap->dev);
 
@@ -1986,6 +1998,10 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		}
 		break;
 	case OF_RECONFIG_CHANGE_REMOVE:
+		/* already depopulated? */
+		if (!of_node_check_flag(rd->dn, OF_POPULATED))
+			return NOTIFY_OK;
+
 		/* find our device by node */
 		client = of_find_i2c_device_by_node(rd->dn);
 		if (client == NULL)
-- 
1.7.12

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1421346798-17148-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-01-15 18:55   ` Guenter Roeck
       [not found]     ` <20150115185545.GA20251-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
  2015-01-15 21:24   ` Rob Herring
  2015-01-22 14:48   ` Wolfram Sang
  2 siblings, 1 reply; 36+ messages in thread
From: Guenter Roeck @ 2015-01-15 18:55 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Wolfram Sang, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> This patch is also more careful with the release of the adapter device
> which caused a deadlock with muxes, and does not break the build
> on !OF since the node flag accessors are not defined then.
> 
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/i2c/i2c-core.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 39d25a8..1d44e3a 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1122,6 +1122,10 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
>   */
>  void i2c_unregister_device(struct i2c_client *client)
>  {
> +#if IS_ENABLED(CONFIG_OF_DYNAMIC)

Hi Pantelis,

I thought I read a note somewhere a couple of days ago suggesting that
CONFIG_OF_DYNAMIC would go away soon. Also, of_node_clear_flag is defined
in #ifdef CONFIG_OF, and AFAICS none of the other callers set OF_POPULATED
in the context of CONFIG_OF_DYNAMIC. Given that, wouldn't it be better
to use CONFIG_OF ?

Thanks,
Guenter

> +	if (client->dev.of_node)
> +		of_node_clear_flag(client->dev.of_node, OF_POPULATED);
> +#endif
>  	device_unregister(&client->dev);
>  }
>  EXPORT_SYMBOL_GPL(i2c_unregister_device);
> @@ -1441,8 +1445,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
>  
>  	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
>  
> -	for_each_available_child_of_node(adap->dev.of_node, node)
> +	for_each_available_child_of_node(adap->dev.of_node, node) {
> +		if (of_node_test_and_set_flag(node, OF_POPULATED))
> +			continue;
>  		of_i2c_register_device(adap, node);
> +	}
>  }
>  
>  static int of_dev_node_match(struct device *dev, void *data)
> @@ -1976,6 +1983,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
>  		if (adap == NULL)
>  			return NOTIFY_OK;	/* not for us */
>  
> +		if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
> +			put_device(&adap->dev);
> +			return NOTIFY_OK;
> +		}
> +
>  		client = of_i2c_register_device(adap, rd->dn);
>  		put_device(&adap->dev);
>  
> @@ -1986,6 +1998,10 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
>  		}
>  		break;
>  	case OF_RECONFIG_CHANGE_REMOVE:
> +		/* already depopulated? */
> +		if (!of_node_check_flag(rd->dn, OF_POPULATED))
> +			return NOTIFY_OK;
> +
>  		/* find our device by node */
>  		client = of_find_i2c_device_by_node(rd->dn);
>  		if (client == NULL)
> -- 
> 1.7.12
> 

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]     ` <20150115185545.GA20251-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2015-01-15 19:12       ` Pantelis Antoniou
       [not found]         ` <18134341-FA1D-4ED6-8ED3-E4BF8F90B47E-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-15 19:12 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Wolfram Sang, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Guenter,

> On Jan 15, 2015, at 20:55 , Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
> 
> On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> This is required to avoid multi probing when using I2C and device
>> overlays containing a mux.
>> This patch is also more careful with the release of the adapter device
>> which caused a deadlock with muxes, and does not break the build
>> on !OF since the node flag accessors are not defined then.
>> 
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> ---
>> drivers/i2c/i2c-core.c | 18 +++++++++++++++++-
>> 1 file changed, 17 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
>> index 39d25a8..1d44e3a 100644
>> --- a/drivers/i2c/i2c-core.c
>> +++ b/drivers/i2c/i2c-core.c
>> @@ -1122,6 +1122,10 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
>>  */
>> void i2c_unregister_device(struct i2c_client *client)
>> {
>> +#if IS_ENABLED(CONFIG_OF_DYNAMIC)
> 
> Hi Pantelis,
> 
> I thought I read a note somewhere a couple of days ago suggesting that
> CONFIG_OF_DYNAMIC would go away soon. Also, of_node_clear_flag is defined
> in #ifdef CONFIG_OF, and AFAICS none of the other callers set OF_POPULATED
> in the context of CONFIG_OF_DYNAMIC. Given that, wouldn't it be better
> to use CONFIG_OF ?
> 
> Thanks,
> Guenter
> 

Well, I thought about it. Thing is that the notifier is under CONFIG_DYNAMIC,
and it seems it’s natural to be that way.

When we move to always enabling CONFIG_DYNAMIC the change to CONFIG_OF will be
part of the conversion.

Regards

— Pantelis

>> +	if (client->dev.of_node)
>> +		of_node_clear_flag(client->dev.of_node, OF_POPULATED);
>> +#endif
>> 	device_unregister(&client->dev);
>> }
>> EXPORT_SYMBOL_GPL(i2c_unregister_device);
>> @@ -1441,8 +1445,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
>> 
>> 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
>> 
>> -	for_each_available_child_of_node(adap->dev.of_node, node)
>> +	for_each_available_child_of_node(adap->dev.of_node, node) {
>> +		if (of_node_test_and_set_flag(node, OF_POPULATED))
>> +			continue;
>> 		of_i2c_register_device(adap, node);
>> +	}
>> }
>> 
>> static int of_dev_node_match(struct device *dev, void *data)
>> @@ -1976,6 +1983,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
>> 		if (adap == NULL)
>> 			return NOTIFY_OK;	/* not for us */
>> 
>> +		if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
>> +			put_device(&adap->dev);
>> +			return NOTIFY_OK;
>> +		}
>> +
>> 		client = of_i2c_register_device(adap, rd->dn);
>> 		put_device(&adap->dev);
>> 
>> @@ -1986,6 +1998,10 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
>> 		}
>> 		break;
>> 	case OF_RECONFIG_CHANGE_REMOVE:
>> +		/* already depopulated? */
>> +		if (!of_node_check_flag(rd->dn, OF_POPULATED))
>> +			return NOTIFY_OK;
>> +
>> 		/* find our device by node */
>> 		client = of_find_i2c_device_by_node(rd->dn);
>> 		if (client == NULL)
>> -- 
>> 1.7.12

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]         ` <18134341-FA1D-4ED6-8ED3-E4BF8F90B47E-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-01-15 19:23           ` Guenter Roeck
  0 siblings, 0 replies; 36+ messages in thread
From: Guenter Roeck @ 2015-01-15 19:23 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Wolfram Sang, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Thu, Jan 15, 2015 at 09:12:36PM +0200, Pantelis Antoniou wrote:
> Hi Guenter,
> 
> > On Jan 15, 2015, at 20:55 , Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
> > 
> > On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
> >> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> >> This is required to avoid multi probing when using I2C and device
> >> overlays containing a mux.
> >> This patch is also more careful with the release of the adapter device
> >> which caused a deadlock with muxes, and does not break the build
> >> on !OF since the node flag accessors are not defined then.
> >> 
> >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> ---
> >> drivers/i2c/i2c-core.c | 18 +++++++++++++++++-
> >> 1 file changed, 17 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> >> index 39d25a8..1d44e3a 100644
> >> --- a/drivers/i2c/i2c-core.c
> >> +++ b/drivers/i2c/i2c-core.c
> >> @@ -1122,6 +1122,10 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
> >>  */
> >> void i2c_unregister_device(struct i2c_client *client)
> >> {
> >> +#if IS_ENABLED(CONFIG_OF_DYNAMIC)
> > 
> > Hi Pantelis,
> > 
> > I thought I read a note somewhere a couple of days ago suggesting that
> > CONFIG_OF_DYNAMIC would go away soon. Also, of_node_clear_flag is defined
> > in #ifdef CONFIG_OF, and AFAICS none of the other callers set OF_POPULATED
> > in the context of CONFIG_OF_DYNAMIC. Given that, wouldn't it be better
> > to use CONFIG_OF ?
> > 
> > Thanks,
> > Guenter
> > 
> 
> Well, I thought about it. Thing is that the notifier is under CONFIG_DYNAMIC,
> and it seems it’s natural to be that way.
> 
> When we move to always enabling CONFIG_DYNAMIC the change to CONFIG_OF will be
> part of the conversion.
> 
Ok.

Thanks,
Guenter

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1421346798-17148-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-01-15 18:55   ` Guenter Roeck
@ 2015-01-15 21:24   ` Rob Herring
  2015-01-22 14:48   ` Wolfram Sang
  2 siblings, 0 replies; 36+ messages in thread
From: Rob Herring @ 2015-01-15 21:24 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Wolfram Sang, Guenter Roeck, Matt Porter, Greg Kroah-Hartman,
	Grant Likely, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

On Thu, Jan 15, 2015 at 12:33 PM, Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> This patch is also more careful with the release of the adapter device
> which caused a deadlock with muxes, and does not break the build
> on !OF since the node flag accessors are not defined then.

Why don't we define them then and get rid of the ifdef below.

It may be good to split this out of of.h because we don't want drivers
fiddling with these bits.

Rob

>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/i2c/i2c-core.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 39d25a8..1d44e3a 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1122,6 +1122,10 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
>   */
>  void i2c_unregister_device(struct i2c_client *client)
>  {
> +#if IS_ENABLED(CONFIG_OF_DYNAMIC)
> +       if (client->dev.of_node)
> +               of_node_clear_flag(client->dev.of_node, OF_POPULATED);
> +#endif
>         device_unregister(&client->dev);
>  }
>  EXPORT_SYMBOL_GPL(i2c_unregister_device);
> @@ -1441,8 +1445,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
>
>         dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
>
> -       for_each_available_child_of_node(adap->dev.of_node, node)
> +       for_each_available_child_of_node(adap->dev.of_node, node) {
> +               if (of_node_test_and_set_flag(node, OF_POPULATED))
> +                       continue;
>                 of_i2c_register_device(adap, node);
> +       }
>  }
>
>  static int of_dev_node_match(struct device *dev, void *data)
> @@ -1976,6 +1983,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
>                 if (adap == NULL)
>                         return NOTIFY_OK;       /* not for us */
>
> +               if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
> +                       put_device(&adap->dev);
> +                       return NOTIFY_OK;
> +               }
> +
>                 client = of_i2c_register_device(adap, rd->dn);
>                 put_device(&adap->dev);
>
> @@ -1986,6 +1998,10 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
>                 }
>                 break;
>         case OF_RECONFIG_CHANGE_REMOVE:
> +               /* already depopulated? */
> +               if (!of_node_check_flag(rd->dn, OF_POPULATED))
> +                       return NOTIFY_OK;
> +
>                 /* find our device by node */
>                 client = of_find_i2c_device_by_node(rd->dn);
>                 if (client == NULL)
> --
> 1.7.12
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1421346798-17148-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-01-15 18:55   ` Guenter Roeck
  2015-01-15 21:24   ` Rob Herring
@ 2015-01-22 14:48   ` Wolfram Sang
  2015-01-22 14:58     ` Rob Herring
  2 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-22 14:48 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> This patch is also more careful with the release of the adapter device
> which caused a deadlock with muxes, and does not break the build
> on !OF since the node flag accessors are not defined then.
> 
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

Applied to for-current, thanks!


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-22 14:48   ` Wolfram Sang
@ 2015-01-22 14:58     ` Rob Herring
       [not found]       ` <CAL_JsqKEBYwX=5zgWbdVRxm-H-sFiDa9rAp26BvuKNECoNW=uQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Rob Herring @ 2015-01-22 14:58 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

On Thu, Jan 22, 2015 at 8:48 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> This is required to avoid multi probing when using I2C and device
>> overlays containing a mux.
>> This patch is also more careful with the release of the adapter device
>> which caused a deadlock with muxes, and does not break the build
>> on !OF since the node flag accessors are not defined then.
>>
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>
> Applied to for-current, thanks!

Ignoring my comments? It's not a big deal, but Pantelis did send out
the DT patch necessary for my suggestion[1]. It's needed in another
place now, too.

Rob

[1] https://lkml.org/lkml/2015/1/21/602
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]       ` <CAL_JsqKEBYwX=5zgWbdVRxm-H-sFiDa9rAp26BvuKNECoNW=uQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-22 15:02         ` Wolfram Sang
  2015-01-22 23:09           ` Rob Herring
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-22 15:02 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Thu, Jan 22, 2015 at 08:58:36AM -0600, Rob Herring wrote:
> On Thu, Jan 22, 2015 at 8:48 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> > On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
> >> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> >> This is required to avoid multi probing when using I2C and device
> >> overlays containing a mux.
> >> This patch is also more careful with the release of the adapter device
> >> which caused a deadlock with muxes, and does not break the build
> >> on !OF since the node flag accessors are not defined then.
> >>
> >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >
> > Applied to for-current, thanks!
> 
> Ignoring my comments? It's not a big deal, but Pantelis did send out
> the DT patch necessary for my suggestion[1]. It's needed in another
> place now, too.

Not sure if I saw this patch before...

Is this DT patch targetted to for-next or for-current. Because this
patch is a bugfix and needs to go into this cycle. I'll happily apply a
cleanup patch to for-next then.

> 
> Rob
> 
> [1] https://lkml.org/lkml/2015/1/21/602

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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-22 15:02         ` Wolfram Sang
@ 2015-01-22 23:09           ` Rob Herring
       [not found]             ` <CAL_JsqKYvcec=xWQM7_Dgrr5zmkefXqGCQvHwJ+uxNgfiv7fcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Rob Herring @ 2015-01-22 23:09 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

On Thu, Jan 22, 2015 at 9:02 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> On Thu, Jan 22, 2015 at 08:58:36AM -0600, Rob Herring wrote:
>> On Thu, Jan 22, 2015 at 8:48 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>> > On Thu, Jan 15, 2015 at 08:33:18PM +0200, Pantelis Antoniou wrote:
>> >> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> >> This is required to avoid multi probing when using I2C and device
>> >> overlays containing a mux.
>> >> This patch is also more careful with the release of the adapter device
>> >> which caused a deadlock with muxes, and does not break the build
>> >> on !OF since the node flag accessors are not defined then.
>> >>
>> >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> >
>> > Applied to for-current, thanks!
>>
>> Ignoring my comments? It's not a big deal, but Pantelis did send out
>> the DT patch necessary for my suggestion[1]. It's needed in another
>> place now, too.
>
> Not sure if I saw this patch before...
>
> Is this DT patch targetted to for-next or for-current. Because this
> patch is a bugfix and needs to go into this cycle. I'll happily apply a
> cleanup patch to for-next then.

Feel free to apply it for 3.19 with my ack. You then want to pick up
v1 of this patch.

Rob

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]             ` <CAL_JsqKYvcec=xWQM7_Dgrr5zmkefXqGCQvHwJ+uxNgfiv7fcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-24  4:26               ` Wolfram Sang
  2015-01-24  7:16                 ` Pantelis Antoniou
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-24  4:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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


> Feel free to apply it for 3.19 with my ack. You then want to pick up
> v1 of this patch.

Sigh, I give up, this is too confusing. I don't know which one is V1,
they are not numbered in any way. And I have been holding back my pull
request for too long already.

I'll drop this patch. Whatever should be applied should be resent,
mentioning the release it is aimed for and how the planning/dependency
on the DT patch is.


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-24  4:26               ` Wolfram Sang
@ 2015-01-24  7:16                 ` Pantelis Antoniou
       [not found]                   ` <DEFFB75F-347B-43F9-98E5-BBD019276A37-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-24  7:16 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Rob Herring, Guenter Roeck, Matt Porter, Greg Kroah-Hartman,
	Grant Likely, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

> On Jan 24, 2015, at 06:26 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> 
> 
>> Feel free to apply it for 3.19 with my ack. You then want to pick up
>> v1 of this patch.
> 
> Sigh, I give up, this is too confusing. I don't know which one is V1,
> they are not numbered in any way. And I have been holding back my pull
> request for too long already.
> 
> I'll drop this patch. Whatever should be applied should be resent,
> mentioning the release it is aimed for and how the planning/dependency
> on the DT patch is.
> 

Nooooo! This is a bugfix for 3.19 :)

I’m resending the original patch; the dependency is on 

	"of: Empty node & property flag accessors when !OF”

https://lkml.org/lkml/2015/1/21/602

Regards

— Pantelis

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]                   ` <DEFFB75F-347B-43F9-98E5-BBD019276A37-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-01-26 15:55                     ` Wolfram Sang
  2015-01-26 19:27                       ` Rob Herring
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-26 15:55 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Rob Herring, Guenter Roeck, Matt Porter, Greg Kroah-Hartman,
	Grant Likely, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Sat, Jan 24, 2015 at 09:16:16AM +0200, Pantelis Antoniou wrote:
> Hi Wolfram,
> 
> > On Jan 24, 2015, at 06:26 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> > 
> > 
> >> Feel free to apply it for 3.19 with my ack. You then want to pick up
> >> v1 of this patch.
> > 
> > Sigh, I give up, this is too confusing. I don't know which one is V1,
> > they are not numbered in any way. And I have been holding back my pull
> > request for too long already.
> > 
> > I'll drop this patch. Whatever should be applied should be resent,
> > mentioning the release it is aimed for and how the planning/dependency
> > on the DT patch is.
> > 
> 
> Nooooo! This is a bugfix for 3.19 :)
> 
> I’m resending the original patch; the dependency is on 
> 
> 	"of: Empty node & property flag accessors when !OF”
> 
> https://lkml.org/lkml/2015/1/21/602

Which is going in when?


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-26 15:55                     ` Wolfram Sang
@ 2015-01-26 19:27                       ` Rob Herring
       [not found]                         ` <CAL_JsqL9m-r3aJhiwSY61xXG9CbkHfD7RqrbNG=mBJnGD_-YPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Rob Herring @ 2015-01-26 19:27 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Mon, Jan 26, 2015 at 9:55 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> On Sat, Jan 24, 2015 at 09:16:16AM +0200, Pantelis Antoniou wrote:
>> Hi Wolfram,
>>
>> > On Jan 24, 2015, at 06:26 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>> >
>> >
>> >> Feel free to apply it for 3.19 with my ack. You then want to pick up
>> >> v1 of this patch.
>> >
>> > Sigh, I give up, this is too confusing. I don't know which one is V1,
>> > they are not numbered in any way. And I have been holding back my pull
>> > request for too long already.
>> >
>> > I'll drop this patch. Whatever should be applied should be resent,
>> > mentioning the release it is aimed for and how the planning/dependency
>> > on the DT patch is.
>> >
>>
>> Nooooo! This is a bugfix for 3.19 :)
>>
>> I’m resending the original patch; the dependency is on
>>
>>       "of: Empty node & property flag accessors when !OF”
>>
>> https://lkml.org/lkml/2015/1/21/602
>
> Which is going in when?

Can you apply it since it is a dependency on this bug fix patch.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]                         ` <CAL_JsqL9m-r3aJhiwSY61xXG9CbkHfD7RqrbNG=mBJnGD_-YPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-26 19:45                           ` Wolfram Sang
  2015-01-29 22:45                             ` Wolfram Sang
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-26 19:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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

> > Which is going in when?
> 
> Can you apply it since it is a dependency on this bug fix patch.

I can but I don't have it in my inbox. So, I need a resent version with
a DT maintainer's ack.


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-26 19:45                           ` Wolfram Sang
@ 2015-01-29 22:45                             ` Wolfram Sang
  0 siblings, 0 replies; 36+ messages in thread
From: Wolfram Sang @ 2015-01-29 22:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Mon, Jan 26, 2015 at 08:45:41PM +0100, Wolfram Sang wrote:
> > > Which is going in when?
> > 
> > Can you apply it since it is a dependency on this bug fix patch.
> 
> I can but I don't have it in my inbox. So, I need a resent version with
> a DT maintainer's ack.

Ping?


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-05-06 18:37         ` Wolfram Sang
  2015-05-06 18:39           ` Pantelis Antoniou
@ 2015-07-09 20:29           ` Wolfram Sang
  1 sibling, 0 replies; 36+ messages in thread
From: Wolfram Sang @ 2015-07-09 20:29 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely, Rob Herring,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Wed, May 06, 2015 at 08:37:33PM +0200, Wolfram Sang wrote:
> On Wed, May 06, 2015 at 10:51:07AM -0700, Kevin Hilman wrote:
> > On Wed, Apr 22, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> > > On Sat, Jan 24, 2015 at 09:16:29AM +0200, Pantelis Antoniou wrote:
> > >> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> > >> This is required to avoid multi probing when using I2C and device
> > >> overlays containing a mux.
> > >> This patch is also more careful with the release of the adapter device
> > >> which caused a deadlock with muxes, and does not break the build
> > >> on !OF since the node flag accessors are not defined then.
> > >>
> > >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> > >
> > > Now, that the dependency is upstream: applied to for-current, thanks!
> > 
> > I'm not seeing this in linux-next, or in your for-current branch.
> > 
> > Was this dropped or superseded by something else?
> 
> I dropped it because it caused a build bug. So, we need another
> dependency in... I am not sure if this is already in.

Applied to for-current AGAIN, let's hope it will work this time...


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]                               ` <041469A7-65F2-4C33-AD67-0B0CE4DEDD75-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-06-10 14:31                                 ` Rob Herring
  0 siblings, 0 replies; 36+ messages in thread
From: Rob Herring @ 2015-06-10 14:31 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Wolfram Sang, Kevin Hilman, Guenter Roeck, Greg Kroah-Hartman,
	Grant Likely, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Wed, Jun 10, 2015 at 9:10 AM, Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> Hi Wolfram,
>
>> On Jun 10, 2015, at 17:08 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>>
>>>> IIRC it is the one which adds OF_POPULATED. If so, why is this not
>>>> scheduled for 4.1 as this bugfix depends on it?
>>>
>>> No idea. This is an obvious bugfix.
>>
>> Dunno if you did but mentioning after the commit message where you think
>> it should be applied is very helpful for maintainers.
>>
>>> I would like to, yes. It’s just the nature of the process when dealing with
>>> multiple kernel trees. I would be happy for someone to pick up and queue it
>>> for 4.1.
>>
>> That might be too late now... You could also have sent the patch to me
>> so that I could apply it via i2c with rob's ack. Next time...
>>
>
> No worries. I’ve waited a couple of years until these things got in, I can wait
> one more release cycle.

You should know this already, but in the future for cross subsystem
dependencies:
- send the whole series together
- Be clear if they are targeted for current rc and/or stable
- suggest who you think should merge them:
  - for fixes, whomever took the offending commit if it is the same
kernel cycle.
  - for dependencies, get ack's on the dependencies.

Rob

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-06-10 14:08                           ` Wolfram Sang
  2015-06-10 14:10                             ` Pantelis Antoniou
@ 2015-06-10 14:18                             ` Rob Herring
  1 sibling, 0 replies; 36+ messages in thread
From: Rob Herring @ 2015-06-10 14:18 UTC (permalink / raw)
  To: Wolfram Sang, Pantelis Antoniou
  Cc: Kevin Hilman, Guenter Roeck, Matt Porter, Greg Kroah-Hartman,
	Grant Likely, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Wed, Jun 10, 2015 at 9:08 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>> > IIRC it is the one which adds OF_POPULATED. If so, why is this not
>> > scheduled for 4.1 as this bugfix depends on it?
>>
>> No idea. This is an obvious bugfix.
>
> Dunno if you did but mentioning after the commit message where you think
> it should be applied is very helpful for maintainers.

+1

>> I would like to, yes. It’s just the nature of the process when dealing with
>> multiple kernel trees. I would be happy for someone to pick up and queue it
>> for 4.1.
>
> That might be too late now... You could also have sent the patch to me
> so that I could apply it via i2c with rob's ack. Next time...

That is exactly what I suggested on Jan 26 and Wolfram asked to resend
with my ack. Pantelis sent it on Apr 24 (w/o my ack) and I applied it
on May 29. Wolfram acked it, so I assumed you were not picking it up.
It sat there for over a month, so it must not have been critical to
apply for 4.1.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-06-10 14:08                           ` Wolfram Sang
@ 2015-06-10 14:10                             ` Pantelis Antoniou
       [not found]                               ` <041469A7-65F2-4C33-AD67-0B0CE4DEDD75-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-06-10 14:18                             ` Rob Herring
  1 sibling, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-06-10 14:10 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Rob Herring, Kevin Hilman, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

> On Jun 10, 2015, at 17:08 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> 
>>> IIRC it is the one which adds OF_POPULATED. If so, why is this not
>>> scheduled for 4.1 as this bugfix depends on it?
>> 
>> No idea. This is an obvious bugfix.
> 
> Dunno if you did but mentioning after the commit message where you think
> it should be applied is very helpful for maintainers.
> 
>> I would like to, yes. It’s just the nature of the process when dealing with
>> multiple kernel trees. I would be happy for someone to pick up and queue it
>> for 4.1.
> 
> That might be too late now... You could also have sent the patch to me
> so that I could apply it via i2c with rob's ack. Next time...
> 

No worries. I’ve waited a couple of years until these things got in, I can wait
one more release cycle.

Regards

— Pantelis

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]                         ` <B9EA0BC3-56D8-4676-BEFC-734EC1FE6649-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-06-10 14:08                           ` Wolfram Sang
  2015-06-10 14:10                             ` Pantelis Antoniou
  2015-06-10 14:18                             ` Rob Herring
  0 siblings, 2 replies; 36+ messages in thread
From: Wolfram Sang @ 2015-06-10 14:08 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Rob Herring, Kevin Hilman, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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

> > IIRC it is the one which adds OF_POPULATED. If so, why is this not
> > scheduled for 4.1 as this bugfix depends on it?
> 
> No idea. This is an obvious bugfix.

Dunno if you did but mentioning after the commit message where you think
it should be applied is very helpful for maintainers.

> I would like to, yes. It’s just the nature of the process when dealing with
> multiple kernel trees. I would be happy for someone to pick up and queue it
> for 4.1.

That might be too late now... You could also have sent the patch to me
so that I could apply it via i2c with rob's ack. Next time...


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-06-10 12:49                     ` Wolfram Sang
@ 2015-06-10 13:51                       ` Pantelis Antoniou
       [not found]                         ` <B9EA0BC3-56D8-4676-BEFC-734EC1FE6649-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-06-10 13:51 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Rob Herring, Kevin Hilman, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

> On Jun 10, 2015, at 15:49 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> 
> On Wed, Jun 10, 2015 at 07:42:59AM -0500, Rob Herring wrote:
>> On Wed, Jun 10, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>>> 
>>>>>>>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>>>>>>>> This is required to avoid multi probing when using I2C and device
>>>>>>>> overlays containing a mux.
>>>>>>>> This patch is also more careful with the release of the adapter device
>>>>>>>> which caused a deadlock with muxes, and does not break the build
>>>>>>>> on !OF since the node flag accessors are not defined then.
>>>>>>>> 
>>>>>>>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>>>>>>> 
>>>>>>> Now, that the dependency is upstream: applied to for-current, thanks!
>>>>>> 
>>>>>> I'm not seeing this in linux-next, or in your for-current branch.
>>>>>> 
>>>>>> Was this dropped or superseded by something else?
>>>>> 
>>>>> I dropped it because it caused a build bug. So, we need another
>>>>> dependency in... I am not sure if this is already in.
>>>>> 
>>>> 
>>>> FWIW, I’ve posted the dependency patch already; it’s trivial as you recall.
>>>> 
>>>> Lets hope it gets picked so that this one can go in.
>>> 
>>> Is that in now?
>> 
>> You mean "of: Move OF flags to be visible even when !CONFIG_OF"? If
>> so, it is queued up for 4.2 in my tree.
> 
> Sorry, I lost track of all the fixes needed for this one. I also can't
> recall being CCed to them. Pity.
> 
> IIRC it is the one which adds OF_POPULATED. If so, why is this not
> scheduled for 4.1 as this bugfix depends on it?
> 

No idea. This is an obvious bugfix.

> Pantelis, thanks for all the work yet I must say I am seriously confused
> with the handling of this patch. I thought you wanted the original I2C
> fix applied asap?

I would like to, yes. It’s just the nature of the process when dealing with
multiple kernel trees. I would be happy for someone to pick up and queue it
for 4.1.

Regards

— Pantelis

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]                   ` <CAL_Jsq+xTZy3QsdaXieR8LSVEJfSeehtcytZLOyt7ghTZ=Bcxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-06-10 12:49                     ` Wolfram Sang
  2015-06-10 13:51                       ` Pantelis Antoniou
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-06-10 12:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Kevin Hilman, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Wed, Jun 10, 2015 at 07:42:59AM -0500, Rob Herring wrote:
> On Wed, Jun 10, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> >
> >> >>>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> >> >>>> This is required to avoid multi probing when using I2C and device
> >> >>>> overlays containing a mux.
> >> >>>> This patch is also more careful with the release of the adapter device
> >> >>>> which caused a deadlock with muxes, and does not break the build
> >> >>>> on !OF since the node flag accessors are not defined then.
> >> >>>>
> >> >>>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> >>>
> >> >>> Now, that the dependency is upstream: applied to for-current, thanks!
> >> >>
> >> >> I'm not seeing this in linux-next, or in your for-current branch.
> >> >>
> >> >> Was this dropped or superseded by something else?
> >> >
> >> > I dropped it because it caused a build bug. So, we need another
> >> > dependency in... I am not sure if this is already in.
> >> >
> >>
> >> FWIW, I’ve posted the dependency patch already; it’s trivial as you recall.
> >>
> >> Lets hope it gets picked so that this one can go in.
> >
> > Is that in now?
> 
> You mean "of: Move OF flags to be visible even when !CONFIG_OF"? If
> so, it is queued up for 4.2 in my tree.

Sorry, I lost track of all the fixes needed for this one. I also can't
recall being CCed to them. Pity.

IIRC it is the one which adds OF_POPULATED. If so, why is this not
scheduled for 4.1 as this bugfix depends on it?

Pantelis, thanks for all the work yet I must say I am seriously confused
with the handling of this patch. I thought you wanted the original I2C
fix applied asap?


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-06-10  5:40               ` Wolfram Sang
@ 2015-06-10 12:42                 ` Rob Herring
       [not found]                   ` <CAL_Jsq+xTZy3QsdaXieR8LSVEJfSeehtcytZLOyt7ghTZ=Bcxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Rob Herring @ 2015-06-10 12:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Pantelis Antoniou, Kevin Hilman, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Wed, Jun 10, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>
>> >>>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> >>>> This is required to avoid multi probing when using I2C and device
>> >>>> overlays containing a mux.
>> >>>> This patch is also more careful with the release of the adapter device
>> >>>> which caused a deadlock with muxes, and does not break the build
>> >>>> on !OF since the node flag accessors are not defined then.
>> >>>>
>> >>>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/HQFizaE/u3fw@public.gmane.orgm>
>> >>>
>> >>> Now, that the dependency is upstream: applied to for-current, thanks!
>> >>
>> >> I'm not seeing this in linux-next, or in your for-current branch.
>> >>
>> >> Was this dropped or superseded by something else?
>> >
>> > I dropped it because it caused a build bug. So, we need another
>> > dependency in... I am not sure if this is already in.
>> >
>>
>> FWIW, I’ve posted the dependency patch already; it’s trivial as you recall.
>>
>> Lets hope it gets picked so that this one can go in.
>
> Is that in now?

You mean "of: Move OF flags to be visible even when !CONFIG_OF"? If
so, it is queued up for 4.2 in my tree.

Rob

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]             ` <A4E060DB-2799-4BF5-9CA6-DE53B7DF9A30-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-06-10  5:40               ` Wolfram Sang
  2015-06-10 12:42                 ` Rob Herring
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-06-10  5:40 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Kevin Hilman, Guenter Roeck, Matt Porter, Greg Kroah-Hartman,
	Grant Likely, Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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


> >>>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> >>>> This is required to avoid multi probing when using I2C and device
> >>>> overlays containing a mux.
> >>>> This patch is also more careful with the release of the adapter device
> >>>> which caused a deadlock with muxes, and does not break the build
> >>>> on !OF since the node flag accessors are not defined then.
> >>>> 
> >>>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >>> 
> >>> Now, that the dependency is upstream: applied to for-current, thanks!
> >> 
> >> I'm not seeing this in linux-next, or in your for-current branch.
> >> 
> >> Was this dropped or superseded by something else?
> > 
> > I dropped it because it caused a build bug. So, we need another
> > dependency in... I am not sure if this is already in.
> > 
> 
> FWIW, I’ve posted the dependency patch already; it’s trivial as you recall.
> 
> Lets hope it gets picked so that this one can go in.

Is that in now?


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-05-06 18:37         ` Wolfram Sang
@ 2015-05-06 18:39           ` Pantelis Antoniou
       [not found]             ` <A4E060DB-2799-4BF5-9CA6-DE53B7DF9A30-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-07-09 20:29           ` Wolfram Sang
  1 sibling, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-05-06 18:39 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Kevin Hilman, Guenter Roeck, Matt Porter, Greg Kroah-Hartman,
	Grant Likely, Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

> On May 6, 2015, at 21:37 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> 
> On Wed, May 06, 2015 at 10:51:07AM -0700, Kevin Hilman wrote:
>> On Wed, Apr 22, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>>> On Sat, Jan 24, 2015 at 09:16:29AM +0200, Pantelis Antoniou wrote:
>>>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>>>> This is required to avoid multi probing when using I2C and device
>>>> overlays containing a mux.
>>>> This patch is also more careful with the release of the adapter device
>>>> which caused a deadlock with muxes, and does not break the build
>>>> on !OF since the node flag accessors are not defined then.
>>>> 
>>>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>>> 
>>> Now, that the dependency is upstream: applied to for-current, thanks!
>> 
>> I'm not seeing this in linux-next, or in your for-current branch.
>> 
>> Was this dropped or superseded by something else?
> 
> I dropped it because it caused a build bug. So, we need another
> dependency in... I am not sure if this is already in.
> 

FWIW, I’ve posted the dependency patch already; it’s trivial as you recall.

Lets hope it gets picked so that this one can go in.

Regards

— Pantelis

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found]       ` <CAMAWPa-HMhJK9UzwfaMPe-MO=4mzjvC=nRwPX-pbab_fb3YZ9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-06 18:37         ` Wolfram Sang
  2015-05-06 18:39           ` Pantelis Antoniou
  2015-07-09 20:29           ` Wolfram Sang
  0 siblings, 2 replies; 36+ messages in thread
From: Wolfram Sang @ 2015-05-06 18:37 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely, Rob Herring,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Wed, May 06, 2015 at 10:51:07AM -0700, Kevin Hilman wrote:
> On Wed, Apr 22, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> > On Sat, Jan 24, 2015 at 09:16:29AM +0200, Pantelis Antoniou wrote:
> >> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> >> This is required to avoid multi probing when using I2C and device
> >> overlays containing a mux.
> >> This patch is also more careful with the release of the adapter device
> >> which caused a deadlock with muxes, and does not break the build
> >> on !OF since the node flag accessors are not defined then.
> >>
> >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >
> > Now, that the dependency is upstream: applied to for-current, thanks!
> 
> I'm not seeing this in linux-next, or in your for-current branch.
> 
> Was this dropped or superseded by something else?

I dropped it because it caused a build bug. So, we need another
dependency in... I am not sure if this is already in.


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-04-22  7:40   ` Wolfram Sang
@ 2015-05-06 17:51     ` Kevin Hilman
       [not found]       ` <CAMAWPa-HMhJK9UzwfaMPe-MO=4mzjvC=nRwPX-pbab_fb3YZ9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Hilman @ 2015-05-06 17:51 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Pantelis Antoniou, Guenter Roeck, Matt Porter,
	Greg Kroah-Hartman, Grant Likely, Rob Herring,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

On Wed, Apr 22, 2015 at 12:40 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> On Sat, Jan 24, 2015 at 09:16:29AM +0200, Pantelis Antoniou wrote:
>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> This is required to avoid multi probing when using I2C and device
>> overlays containing a mux.
>> This patch is also more careful with the release of the adapter device
>> which caused a deadlock with muxes, and does not break the build
>> on !OF since the node flag accessors are not defined then.
>>
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>
> Now, that the dependency is upstream: applied to for-current, thanks!

I'm not seeing this in linux-next, or in your for-current branch.

Was this dropped or superseded by something else?

Kevin

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1422083789-18905-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-04-22  7:40   ` Wolfram Sang
  2015-05-06 17:51     ` Kevin Hilman
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-04-22  7:40 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Sat, Jan 24, 2015 at 09:16:29AM +0200, Pantelis Antoniou wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> This patch is also more careful with the release of the adapter device
> which caused a deadlock with muxes, and does not break the build
> on !OF since the node flag accessors are not defined then.
> 
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

Now, that the dependency is upstream: applied to for-current, thanks!


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

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

* [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
@ 2015-01-24  7:16 Pantelis Antoniou
       [not found] ` <1422083789-18905-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-24  7:16 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou,
	Pantelis Antoniou

Mark (and unmark) device nodes with the POPULATE flag as appropriate.
This is required to avoid multi probing when using I2C and device
overlays containing a mux.
This patch is also more careful with the release of the adapter device
which caused a deadlock with muxes, and does not break the build
on !OF since the node flag accessors are not defined then.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
---
 drivers/i2c/i2c-core.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 39d25a8..8c32ee3 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1122,6 +1122,8 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
  */
 void i2c_unregister_device(struct i2c_client *client)
 {
+	if (client->dev.of_node)
+		of_node_clear_flag(client->dev.of_node, OF_POPULATED);
 	device_unregister(&client->dev);
 }
 EXPORT_SYMBOL_GPL(i2c_unregister_device);
@@ -1441,8 +1443,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
 
 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
 
-	for_each_available_child_of_node(adap->dev.of_node, node)
+	for_each_available_child_of_node(adap->dev.of_node, node) {
+		if (of_node_test_and_set_flag(node, OF_POPULATED))
+			continue;
 		of_i2c_register_device(adap, node);
+	}
 }
 
 static int of_dev_node_match(struct device *dev, void *data)
@@ -1976,6 +1981,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		if (adap == NULL)
 			return NOTIFY_OK;	/* not for us */
 
+		if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
+			put_device(&adap->dev);
+			return NOTIFY_OK;
+		}
+
 		client = of_i2c_register_device(adap, rd->dn);
 		put_device(&adap->dev);
 
@@ -1986,6 +1996,10 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		}
 		break;
 	case OF_RECONFIG_CHANGE_REMOVE:
+		/* already depopulated? */
+		if (!of_node_check_flag(rd->dn, OF_POPULATED))
+			return NOTIFY_OK;
+
 		/* find our device by node */
 		client = of_find_i2c_device_by_node(rd->dn);
 		if (client == NULL)
-- 
1.7.12

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-15 17:35   ` Wolfram Sang
@ 2015-01-15 18:32     ` Pantelis Antoniou
  0 siblings, 0 replies; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-15 18:32 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

> On Jan 15, 2015, at 19:35 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> 
> On Thu, Jan 15, 2015 at 06:33:55PM +0200, Pantelis Antoniou wrote:
>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> This is required to avoid multi probing when using I2C and device
>> overlays containing a mux.
>> This patch is also more careful with the release of the adapter device
>> which caused a deadlock with muxes.
>> 
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> 
> Applied to for-current, thanks!
> 

Just sent an updated patch that doesn’t break the build on !OF; some
OF accessors are not defined then.

Regards

— Pantelis


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1421339635-16039-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-01-15 17:35   ` Wolfram Sang
  2015-01-15 18:32     ` Pantelis Antoniou
  0 siblings, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-15 17:35 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Thu, Jan 15, 2015 at 06:33:55PM +0200, Pantelis Antoniou wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> This patch is also more careful with the release of the adapter device
> which caused a deadlock with muxes.
> 
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

Applied to for-current, thanks!


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

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

* [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
@ 2015-01-15 16:33 Pantelis Antoniou
       [not found] ` <1421339635-16039-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-15 16:33 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou,
	Pantelis Antoniou

Mark (and unmark) device nodes with the POPULATE flag as appropriate.
This is required to avoid multi probing when using I2C and device
overlays containing a mux.
This patch is also more careful with the release of the adapter device
which caused a deadlock with muxes.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
---
 drivers/i2c/i2c-core.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 39d25a8..8c32ee3 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1122,6 +1122,8 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
  */
 void i2c_unregister_device(struct i2c_client *client)
 {
+	if (client->dev.of_node)
+		of_node_clear_flag(client->dev.of_node, OF_POPULATED);
 	device_unregister(&client->dev);
 }
 EXPORT_SYMBOL_GPL(i2c_unregister_device);
@@ -1441,8 +1443,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
 
 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
 
-	for_each_available_child_of_node(adap->dev.of_node, node)
+	for_each_available_child_of_node(adap->dev.of_node, node) {
+		if (of_node_test_and_set_flag(node, OF_POPULATED))
+			continue;
 		of_i2c_register_device(adap, node);
+	}
 }
 
 static int of_dev_node_match(struct device *dev, void *data)
@@ -1976,6 +1981,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		if (adap == NULL)
 			return NOTIFY_OK;	/* not for us */
 
+		if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
+			put_device(&adap->dev);
+			return NOTIFY_OK;
+		}
+
 		client = of_i2c_register_device(adap, rd->dn);
 		put_device(&adap->dev);
 
@@ -1986,6 +1996,10 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		}
 		break;
 	case OF_RECONFIG_CHANGE_REMOVE:
+		/* already depopulated? */
+		if (!of_node_check_flag(rd->dn, OF_POPULATED))
+			return NOTIFY_OK;
+
 		/* find our device by node */
 		client = of_find_i2c_device_by_node(rd->dn);
 		if (client == NULL)
-- 
1.7.12

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1421082094-10267-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-01-13 12:05   ` Wolfram Sang
@ 2015-01-13 15:12   ` Wolfram Sang
  1 sibling, 0 replies; 36+ messages in thread
From: Wolfram Sang @ 2015-01-13 15:12 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Mon, Jan 12, 2015 at 07:01:34PM +0200, Pantelis Antoniou wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> 
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

Applied to for-current, thanks!


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

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
  2015-01-13 12:05   ` Wolfram Sang
@ 2015-01-13 12:08     ` Pantelis Antoniou
  0 siblings, 0 replies; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-13 12:08 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

> On Jan 13, 2015, at 14:05 , Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> 
> On Mon, Jan 12, 2015 at 07:01:34PM +0200, Pantelis Antoniou wrote:
>> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
>> This is required to avoid multi probing when using I2C and device
>> overlays containing a mux.
>> 
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> 
> Looks good. I'd think this is 3.19 material?
> 

It’s a obvious bug fix.

If you can queue this for 3.19 that’d be great.

Regards

— Pantelis

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

* Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
       [not found] ` <1421082094-10267-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-01-13 12:05   ` Wolfram Sang
  2015-01-13 12:08     ` Pantelis Antoniou
  2015-01-13 15:12   ` Wolfram Sang
  1 sibling, 1 reply; 36+ messages in thread
From: Wolfram Sang @ 2015-01-13 12:05 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou

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

On Mon, Jan 12, 2015 at 07:01:34PM +0200, Pantelis Antoniou wrote:
> Mark (and unmark) device nodes with the POPULATE flag as appropriate.
> This is required to avoid multi probing when using I2C and device
> overlays containing a mux.
> 
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

Looks good. I'd think this is 3.19 material?


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

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

* [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE
@ 2015-01-12 17:01 Pantelis Antoniou
       [not found] ` <1421082094-10267-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Pantelis Antoniou @ 2015-01-12 17:01 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Matt Porter, Greg Kroah-Hartman, Grant Likely,
	Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou,
	Pantelis Antoniou

Mark (and unmark) device nodes with the POPULATE flag as appropriate.
This is required to avoid multi probing when using I2C and device
overlays containing a mux.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
---
 drivers/i2c/i2c-core.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e020a16..afc189c 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1122,6 +1122,8 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
  */
 void i2c_unregister_device(struct i2c_client *client)
 {
+	if (client->dev.of_node)
+		of_node_clear_flag(client->dev.of_node, OF_POPULATED);
 	device_unregister(&client->dev);
 }
 EXPORT_SYMBOL_GPL(i2c_unregister_device);
@@ -1441,8 +1443,11 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
 
 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
 
-	for_each_available_child_of_node(adap->dev.of_node, node)
+	for_each_available_child_of_node(adap->dev.of_node, node) {
+		if (of_node_test_and_set_flag(node, OF_POPULATED))
+			continue;
 		of_i2c_register_device(adap, node);
+	}
 }
 
 static int of_dev_node_match(struct device *dev, void *data)
@@ -1976,6 +1981,9 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		if (adap == NULL)
 			return NOTIFY_OK;	/* not for us */
 
+		if (of_node_test_and_set_flag(rd->dn, OF_POPULATED))
+			return NOTIFY_OK;
+
 		client = of_i2c_register_device(adap, rd->dn);
 		put_device(&adap->dev);
 
@@ -1986,6 +1994,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 		}
 		break;
 	case OF_RECONFIG_CHANGE_REMOVE:
+
+		/* already depopulated? */
+		if (!of_node_check_flag(rd->dn, OF_POPULATED))
+			return NOTIFY_OK;
+
 		/* find our device by node */
 		client = of_find_i2c_device_by_node(rd->dn);
 		if (client == NULL)
-- 
1.7.12

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

end of thread, other threads:[~2015-07-09 20:29 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-15 18:33 [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE Pantelis Antoniou
     [not found] ` <1421346798-17148-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-01-15 18:55   ` Guenter Roeck
     [not found]     ` <20150115185545.GA20251-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-01-15 19:12       ` Pantelis Antoniou
     [not found]         ` <18134341-FA1D-4ED6-8ED3-E4BF8F90B47E-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-01-15 19:23           ` Guenter Roeck
2015-01-15 21:24   ` Rob Herring
2015-01-22 14:48   ` Wolfram Sang
2015-01-22 14:58     ` Rob Herring
     [not found]       ` <CAL_JsqKEBYwX=5zgWbdVRxm-H-sFiDa9rAp26BvuKNECoNW=uQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-22 15:02         ` Wolfram Sang
2015-01-22 23:09           ` Rob Herring
     [not found]             ` <CAL_JsqKYvcec=xWQM7_Dgrr5zmkefXqGCQvHwJ+uxNgfiv7fcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-24  4:26               ` Wolfram Sang
2015-01-24  7:16                 ` Pantelis Antoniou
     [not found]                   ` <DEFFB75F-347B-43F9-98E5-BBD019276A37-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-01-26 15:55                     ` Wolfram Sang
2015-01-26 19:27                       ` Rob Herring
     [not found]                         ` <CAL_JsqL9m-r3aJhiwSY61xXG9CbkHfD7RqrbNG=mBJnGD_-YPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-26 19:45                           ` Wolfram Sang
2015-01-29 22:45                             ` Wolfram Sang
  -- strict thread matches above, loose matches on Subject: below --
2015-01-24  7:16 Pantelis Antoniou
     [not found] ` <1422083789-18905-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-04-22  7:40   ` Wolfram Sang
2015-05-06 17:51     ` Kevin Hilman
     [not found]       ` <CAMAWPa-HMhJK9UzwfaMPe-MO=4mzjvC=nRwPX-pbab_fb3YZ9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-06 18:37         ` Wolfram Sang
2015-05-06 18:39           ` Pantelis Antoniou
     [not found]             ` <A4E060DB-2799-4BF5-9CA6-DE53B7DF9A30-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-06-10  5:40               ` Wolfram Sang
2015-06-10 12:42                 ` Rob Herring
     [not found]                   ` <CAL_Jsq+xTZy3QsdaXieR8LSVEJfSeehtcytZLOyt7ghTZ=Bcxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-10 12:49                     ` Wolfram Sang
2015-06-10 13:51                       ` Pantelis Antoniou
     [not found]                         ` <B9EA0BC3-56D8-4676-BEFC-734EC1FE6649-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-06-10 14:08                           ` Wolfram Sang
2015-06-10 14:10                             ` Pantelis Antoniou
     [not found]                               ` <041469A7-65F2-4C33-AD67-0B0CE4DEDD75-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-06-10 14:31                                 ` Rob Herring
2015-06-10 14:18                             ` Rob Herring
2015-07-09 20:29           ` Wolfram Sang
2015-01-15 16:33 Pantelis Antoniou
     [not found] ` <1421339635-16039-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-01-15 17:35   ` Wolfram Sang
2015-01-15 18:32     ` Pantelis Antoniou
2015-01-12 17:01 Pantelis Antoniou
     [not found] ` <1421082094-10267-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-01-13 12:05   ` Wolfram Sang
2015-01-13 12:08     ` Pantelis Antoniou
2015-01-13 15:12   ` Wolfram Sang

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.