All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Schwarz <max.schwarz-BGeptl67XyCzQB+pC5nmwQ@public.gmane.org>
To: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c-rk3x: move setup to the earlier subsys initcall
Date: Mon, 22 Sep 2014 18:05:43 +0200	[thread overview]
Message-ID: <7192455.FveG5nGWsJ@xq-nb> (raw)
In-Reply-To: <1411370675-27866-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

Hi Chris,

Am Montag, 22. September 2014, 15:24:35 schrieb Chris Zhong:
> Some device using this bus, such as regulators, they should register
> as early as possible, so the I2C bus master needs to be loaded early.
> Therefore initialize via subsys_initcall() is better.

You could also use probe deferral in the regulator driver to wait until the 
bus is ready. I don't know if you're already doing it, just wanted to point 
that out.

That said, this change will make the boot faster in any case by avoiding 
unnecessary deferrals, so I'm for it if you fix the minor issue below.

> Signed-off-by: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> 
> ---
> 
>  drivers/i2c/busses/i2c-rk3x.c |   13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index e637c32..5b91901 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -760,7 +760,18 @@ static struct platform_driver rk3x_i2c_driver = {
>  	},
>  };
> 
> -module_platform_driver(rk3x_i2c_driver);
> +static int __init rk3x_i2c_init_driver(void)
> +{
> +	return platform_driver_register(&rk3x_i2c_driver);
> +}
> +
> +static void __exit rk3x_i2c_exit_driver(void)
> +{
> +	platform_driver_unregister(&rk3x_i2c_driver);
> +}
> +
> +subsys_initcall(rk3x_i2c_init_driver);
> +module_exit(rk3x_i2c_exit_driver);

This means that the driver cannot be used as a loadable module any more, 
right?

In that case, you should probably turn the tristate option in Kconfig into a 
bool.

Cheers,
  Max

WARNING: multiple messages have this Message-ID (diff)
From: max.schwarz@online.de (Max Schwarz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] i2c-rk3x: move setup to the earlier subsys initcall
Date: Mon, 22 Sep 2014 18:05:43 +0200	[thread overview]
Message-ID: <7192455.FveG5nGWsJ@xq-nb> (raw)
In-Reply-To: <1411370675-27866-1-git-send-email-zyw@rock-chips.com>

Hi Chris,

Am Montag, 22. September 2014, 15:24:35 schrieb Chris Zhong:
> Some device using this bus, such as regulators, they should register
> as early as possible, so the I2C bus master needs to be loaded early.
> Therefore initialize via subsys_initcall() is better.

You could also use probe deferral in the regulator driver to wait until the 
bus is ready. I don't know if you're already doing it, just wanted to point 
that out.

That said, this change will make the boot faster in any case by avoiding 
unnecessary deferrals, so I'm for it if you fix the minor issue below.

> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
> 
> ---
> 
>  drivers/i2c/busses/i2c-rk3x.c |   13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index e637c32..5b91901 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -760,7 +760,18 @@ static struct platform_driver rk3x_i2c_driver = {
>  	},
>  };
> 
> -module_platform_driver(rk3x_i2c_driver);
> +static int __init rk3x_i2c_init_driver(void)
> +{
> +	return platform_driver_register(&rk3x_i2c_driver);
> +}
> +
> +static void __exit rk3x_i2c_exit_driver(void)
> +{
> +	platform_driver_unregister(&rk3x_i2c_driver);
> +}
> +
> +subsys_initcall(rk3x_i2c_init_driver);
> +module_exit(rk3x_i2c_exit_driver);

This means that the driver cannot be used as a loadable module any more, 
right?

In that case, you should probably turn the tristate option in Kconfig into a 
bool.

Cheers,
  Max

WARNING: multiple messages have this Message-ID (diff)
From: Max Schwarz <max.schwarz@online.de>
To: Chris Zhong <zyw@rock-chips.com>
Cc: dianders@chromium.org, linux-rockchip@lists.infradead.org,
	Heiko Stuebner <heiko@sntech.de>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c-rk3x: move setup to the earlier subsys initcall
Date: Mon, 22 Sep 2014 18:05:43 +0200	[thread overview]
Message-ID: <7192455.FveG5nGWsJ@xq-nb> (raw)
In-Reply-To: <1411370675-27866-1-git-send-email-zyw@rock-chips.com>

Hi Chris,

Am Montag, 22. September 2014, 15:24:35 schrieb Chris Zhong:
> Some device using this bus, such as regulators, they should register
> as early as possible, so the I2C bus master needs to be loaded early.
> Therefore initialize via subsys_initcall() is better.

You could also use probe deferral in the regulator driver to wait until the 
bus is ready. I don't know if you're already doing it, just wanted to point 
that out.

That said, this change will make the boot faster in any case by avoiding 
unnecessary deferrals, so I'm for it if you fix the minor issue below.

> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
> 
> ---
> 
>  drivers/i2c/busses/i2c-rk3x.c |   13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index e637c32..5b91901 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -760,7 +760,18 @@ static struct platform_driver rk3x_i2c_driver = {
>  	},
>  };
> 
> -module_platform_driver(rk3x_i2c_driver);
> +static int __init rk3x_i2c_init_driver(void)
> +{
> +	return platform_driver_register(&rk3x_i2c_driver);
> +}
> +
> +static void __exit rk3x_i2c_exit_driver(void)
> +{
> +	platform_driver_unregister(&rk3x_i2c_driver);
> +}
> +
> +subsys_initcall(rk3x_i2c_init_driver);
> +module_exit(rk3x_i2c_exit_driver);

This means that the driver cannot be used as a loadable module any more, 
right?

In that case, you should probably turn the tristate option in Kconfig into a 
bool.

Cheers,
  Max


  parent reply	other threads:[~2014-09-22 16:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22  7:24 [PATCH] i2c-rk3x: move setup to the earlier subsys initcall Chris Zhong
2014-09-22  7:24 ` Chris Zhong
2014-09-22  7:24 ` Chris Zhong
     [not found] ` <1411370675-27866-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-09-22 16:05   ` Max Schwarz [this message]
2014-09-22 16:05     ` Max Schwarz
2014-09-22 16:05     ` Max Schwarz
2014-09-22 16:20     ` Max Schwarz
2014-09-22 16:20       ` Max Schwarz
2014-09-22 16:22     ` Doug Anderson
2014-09-22 16:22       ` Doug Anderson
2014-09-22 16:22       ` Doug Anderson
     [not found]       ` <CAD=FV=VUoK8SDng6O4-VVq8UZf88b3bSe-hQMht3R2nmYXqMFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-22 17:13         ` Wolfram Sang
2014-09-22 17:13           ` Wolfram Sang
2014-09-22 17:13           ` Wolfram Sang

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=7192455.FveG5nGWsJ@xq-nb \
    --to=max.schwarz-bgeptl67xyczqb+pc5nmwq@public.gmane.org \
    --cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
    --cc=zyw-TNX95d0MmH7DzftRWevZcw@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.