diff mbox

[2/2] i2c: designware: Allow build Baytrail semaphore support when IOSF_MBI=m

Message ID 1449748124-20744-2-git-send-email-jarkko.nikula@linux.intel.com
State Accepted
Headers show

Commit Message

Jarkko Nikula Dec. 10, 2015, 11:48 a.m. UTC
I believe i2c-designware-baytrail.c doesn't have strict dependency that
Intel SoC IOSF Sideband support must be always built-in in order to be
able to compile support for Intel Baytrail I2C bus sharing HW semaphore.

Redefine build dependencies so that CONFIG_IOSF_MBI=y is required only
when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
Hi David. Can you ack/nak this patch as I'm not fully familiar with this
HW semaphore can there be problems when IOSF_MBI is built as a module.
At least I'm getting similar sensible looking "punit semaphore
acquired/held for x ms" debug messages when I modprobe/rmmod
i2c_designware_platform independently is the CONFIG_IOSF_MBI=y or =m.
---
 drivers/i2c/busses/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Andy Shevchenko Dec. 10, 2015, 12:59 p.m. UTC | #1
On Thu, 2015-12-10 at 13:48 +0200, Jarkko Nikula wrote:
> I believe i2c-designware-baytrail.c doesn't have strict dependency
> that
> Intel SoC IOSF Sideband support must be always built-in in order to
> be
> able to compile support for Intel Baytrail I2C bus sharing HW
> semaphore.
> 
> Redefine build dependencies so that CONFIG_IOSF_MBI=y is required
> only
> when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.
> 
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
> Hi David. Can you ack/nak this patch as I'm not fully familiar with
> this
> HW semaphore can there be problems when IOSF_MBI is built as a
> module.


> At least I'm getting similar sensible looking "punit semaphore
> acquired/held for x ms" debug messages when I modprobe/rmmod
> i2c_designware_platform independently is the CONFIG_IOSF_MBI=y or =m.
> ---
>  drivers/i2c/busses/Kconfig | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index 69c46fe13777..76f4d024def0 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -490,7 +490,9 @@ config I2C_DESIGNWARE_PCI
>  
>  config I2C_DESIGNWARE_BAYTRAIL
>  	bool "Intel Baytrail I2C semaphore support"
> -	depends on I2C_DESIGNWARE_PLATFORM && IOSF_MBI=y && ACPI
> +	depends on ACPI
> +	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> +		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)

Would it be more readable in the following way

depends on ACPI
depends on I2C_DESIGNWARE_PLATFORM
depends on IOSF_MBI if I2C_DESIGNWARE_PLATFORM=m
depends on IOSF_MBI=y if I2C_DESIGNWARE_PLATFORM=y

>  	help
>  	  This driver enables managed host access to the PMIC I2C
> bus on select
>  	  Intel BayTrail platforms using the X-Powers AXP288 PMIC.
> It allows
Jarkko Nikula Dec. 10, 2015, 1:56 p.m. UTC | #2
On 12/10/2015 02:59 PM, Andy Shevchenko wrote:
> On Thu, 2015-12-10 at 13:48 +0200, Jarkko Nikula wrote:
>> I believe i2c-designware-baytrail.c doesn't have strict dependency
>> that
>> Intel SoC IOSF Sideband support must be always built-in in order to
>> be
>> able to compile support for Intel Baytrail I2C bus sharing HW
>> semaphore.
>>
>> Redefine build dependencies so that CONFIG_IOSF_MBI=y is required
>> only
>> when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.
>>
>> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
>> ---
>> Hi David. Can you ack/nak this patch as I'm not fully familiar with
>> this
>> HW semaphore can there be problems when IOSF_MBI is built as a
>> module.
>
>
>> At least I'm getting similar sensible looking "punit semaphore
>> acquired/held for x ms" debug messages when I modprobe/rmmod
>> i2c_designware_platform independently is the CONFIG_IOSF_MBI=y or =m.
>> ---
>>   drivers/i2c/busses/Kconfig | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
>> index 69c46fe13777..76f4d024def0 100644
>> --- a/drivers/i2c/busses/Kconfig
>> +++ b/drivers/i2c/busses/Kconfig
>> @@ -490,7 +490,9 @@ config I2C_DESIGNWARE_PCI
>>
>>   config I2C_DESIGNWARE_BAYTRAIL
>>   	bool "Intel Baytrail I2C semaphore support"
>> -	depends on I2C_DESIGNWARE_PLATFORM && IOSF_MBI=y && ACPI
>> +	depends on ACPI
>> +	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
>> +		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
>
> Would it be more readable in the following way
>
> depends on ACPI
> depends on I2C_DESIGNWARE_PLATFORM
> depends on IOSF_MBI if I2C_DESIGNWARE_PLATFORM=m
> depends on IOSF_MBI=y if I2C_DESIGNWARE_PLATFORM=y
>
For my eyes it looks a bit more complex but I think it's matter of 
taste. However, the syntax you are proposing is not supported for 
"depends on" like it is for "select" statements.
Wolfram Sang Jan. 4, 2016, 7:51 p.m. UTC | #3
On Thu, Dec 10, 2015 at 03:56:27PM +0200, Jarkko Nikula wrote:
> On 12/10/2015 02:59 PM, Andy Shevchenko wrote:
> >On Thu, 2015-12-10 at 13:48 +0200, Jarkko Nikula wrote:
> >>I believe i2c-designware-baytrail.c doesn't have strict dependency
> >>that
> >>Intel SoC IOSF Sideband support must be always built-in in order to
> >>be
> >>able to compile support for Intel Baytrail I2C bus sharing HW
> >>semaphore.
> >>
> >>Redefine build dependencies so that CONFIG_IOSF_MBI=y is required
> >>only
> >>when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.
> >>
> >>Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> >>---
> >>Hi David. Can you ack/nak this patch as I'm not fully familiar with
> >>this
> >>HW semaphore can there be problems when IOSF_MBI is built as a
> >>module.
> >
> >
> >>At least I'm getting similar sensible looking "punit semaphore
> >>acquired/held for x ms" debug messages when I modprobe/rmmod
> >>i2c_designware_platform independently is the CONFIG_IOSF_MBI=y or =m.
> >>---
> >>  drivers/i2c/busses/Kconfig | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> >>index 69c46fe13777..76f4d024def0 100644
> >>--- a/drivers/i2c/busses/Kconfig
> >>+++ b/drivers/i2c/busses/Kconfig
> >>@@ -490,7 +490,9 @@ config I2C_DESIGNWARE_PCI
> >>
> >>  config I2C_DESIGNWARE_BAYTRAIL
> >>  	bool "Intel Baytrail I2C semaphore support"
> >>-	depends on I2C_DESIGNWARE_PLATFORM && IOSF_MBI=y && ACPI
> >>+	depends on ACPI
> >>+	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> >>+		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
> >
> >Would it be more readable in the following way
> >
> >depends on ACPI
> >depends on I2C_DESIGNWARE_PLATFORM
> >depends on IOSF_MBI if I2C_DESIGNWARE_PLATFORM=m
> >depends on IOSF_MBI=y if I2C_DESIGNWARE_PLATFORM=y
> >
> For my eyes it looks a bit more complex but I think it's matter of taste.
> However, the syntax you are proposing is not supported for "depends on" like
> it is for "select" statements.

Any news? David?
David E. Box Jan. 5, 2016, 10:21 p.m. UTC | #4
Hi

Sorry I missed this discussion. I believe the following code in
i2c_dw_eval_lock_support() should make it so that it doesn't matter how
IOSF_MBI is built:

   if (!iosf_mbi_available())
           return -EPROBE_DEFER;

I added this to address i2c_designware probing before iosf_mbi. It worked but
I do not recall if IOSF_MBI=m was the problem scenario. If so you can just
change it to:

   depends in I2C_DESIGNWARE_PLATFORM && IOSF_MBI
    
Give me a few days to confirm on my Baytrail device. 

David

On Thu, Dec 10, 2015 at 01:48:44PM +0200, Jarkko Nikula wrote:
> I believe i2c-designware-baytrail.c doesn't have strict dependency that
> Intel SoC IOSF Sideband support must be always built-in in order to be
> able to compile support for Intel Baytrail I2C bus sharing HW semaphore.
> 
> Redefine build dependencies so that CONFIG_IOSF_MBI=y is required only
> when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.
> 
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
> Hi David. Can you ack/nak this patch as I'm not fully familiar with this
> HW semaphore can there be problems when IOSF_MBI is built as a module.
> At least I'm getting similar sensible looking "punit semaphore
> acquired/held for x ms" debug messages when I modprobe/rmmod
> i2c_designware_platform independently is the CONFIG_IOSF_MBI=y or =m.
> ---
>  drivers/i2c/busses/Kconfig | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index 69c46fe13777..76f4d024def0 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -490,7 +490,9 @@ config I2C_DESIGNWARE_PCI
>  
>  config I2C_DESIGNWARE_BAYTRAIL
>  	bool "Intel Baytrail I2C semaphore support"
> -	depends on I2C_DESIGNWARE_PLATFORM && IOSF_MBI=y && ACPI
> +	depends on ACPI
> +	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> +		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
>  	help
>  	  This driver enables managed host access to the PMIC I2C bus on select
>  	  Intel BayTrail platforms using the X-Powers AXP288 PMIC. It allows
> -- 
> 2.6.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang April 12, 2016, 9:27 p.m. UTC | #5
On Tue, Jan 05, 2016 at 02:21:00PM -0800, David E. Box wrote:
> Hi
> 
> Sorry I missed this discussion. I believe the following code in
> i2c_dw_eval_lock_support() should make it so that it doesn't matter how
> IOSF_MBI is built:
> 
>    if (!iosf_mbi_available())
>            return -EPROBE_DEFER;
> 
> I added this to address i2c_designware probing before iosf_mbi. It worked but
> I do not recall if IOSF_MBI=m was the problem scenario. If so you can just
> change it to:
> 
>    depends in I2C_DESIGNWARE_PLATFORM && IOSF_MBI
>     
> Give me a few days to confirm on my Baytrail device. 

What is the status here?
David E. Box April 12, 2016, 9:46 p.m. UTC | #6
On Thu, Dec 10, 2015 at 01:48:44PM +0200, Jarkko Nikula wrote:
> I believe i2c-designware-baytrail.c doesn't have strict dependency that
> Intel SoC IOSF Sideband support must be always built-in in order to be
> able to compile support for Intel Baytrail I2C bus sharing HW semaphore.
> 
> Redefine build dependencies so that CONFIG_IOSF_MBI=y is required only
> when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.
> 
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
> Hi David. Can you ack/nak this patch as I'm not fully familiar with this
> HW semaphore can there be problems when IOSF_MBI is built as a module.
> At least I'm getting similar sensible looking "punit semaphore
> acquired/held for x ms" debug messages when I modprobe/rmmod
> i2c_designware_platform independently is the CONFIG_IOSF_MBI=y or =m.
> ---
>  drivers/i2c/busses/Kconfig | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index 69c46fe13777..76f4d024def0 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -490,7 +490,9 @@ config I2C_DESIGNWARE_PCI
>  
>  config I2C_DESIGNWARE_BAYTRAIL
>  	bool "Intel Baytrail I2C semaphore support"
> -	depends on I2C_DESIGNWARE_PLATFORM && IOSF_MBI=y && ACPI
> +	depends on ACPI
> +	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> +		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
>  	help
>  	  This driver enables managed host access to the PMIC I2C bus on select
>  	  Intel BayTrail platforms using the X-Powers AXP288 PMIC. It allows
> -- 
> 2.6.2
> 
Acked-by: David Box <david.e.box@linux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang June 19, 2016, 5:31 p.m. UTC | #7
On Thu, Dec 10, 2015 at 01:48:44PM +0200, Jarkko Nikula wrote:
> I believe i2c-designware-baytrail.c doesn't have strict dependency that
> Intel SoC IOSF Sideband support must be always built-in in order to be
> able to compile support for Intel Baytrail I2C bus sharing HW semaphore.
> 
> Redefine build dependencies so that CONFIG_IOSF_MBI=y is required only
> when CONFIG_I2C_DESIGNWARE_PLATFORM is built-in.
> 
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

Finally applied to for-next, thanks!
diff mbox

Patch

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 69c46fe13777..76f4d024def0 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -490,7 +490,9 @@  config I2C_DESIGNWARE_PCI
 
 config I2C_DESIGNWARE_BAYTRAIL
 	bool "Intel Baytrail I2C semaphore support"
-	depends on I2C_DESIGNWARE_PLATFORM && IOSF_MBI=y && ACPI
+	depends on ACPI
+	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
+		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
 	help
 	  This driver enables managed host access to the PMIC I2C bus on select
 	  Intel BayTrail platforms using the X-Powers AXP288 PMIC. It allows