All of lore.kernel.org
 help / color / mirror / Atom feed
* i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
@ 2018-02-17 13:25 Dominik Brodowski
  2018-02-17 15:02 ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Dominik Brodowski @ 2018-02-17 13:25 UTC (permalink / raw)
  To: tim, jarkko.nikula, andriy.shevchenko, preid, wsa; +Cc: linux-i2c, linux-kernel

Dear all,

on v4.16-rc1+, sound does not work any more on my Dell XPS 13;
suspend-to-RAM hangs as well. I have bisected this problem down to
commit ca382f5b38f3; reverting this on top of Linus' latest (1e3510b2b053)
fixes these issues. A bit info on the system (from a working kernel):

00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09)

ls -l /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-INT343A:00 
total 0
lrwxrwxrwx 1 root root    0 Feb 17 14:20 driver -> ../../../../../bus/i2c/drivers/rt286
lrwxrwxrwx 1 root root    0 Feb 17 14:20 firmware_node -> ../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT3432:00/INT343A:00
-r--r--r-- 1 root root 4096 Feb 17 14:20 modalias
-r--r--r-- 1 root root 4096 Feb 17 14:20 name
drwxr-xr-x 2 root root    0 Feb 17 14:19 power
lrwxrwxrwx 1 root root    0 Feb 17 14:10 subsystem -> ../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Feb 17 14:20 uevent

>From a working dmesg:

	sst-acpi INT3438:00: DesignWare DMA Controller, 8 channels
	haswell-pcm-audio haswell-pcm-audio: Direct firmware load for intel/IntcPP01.bin failed with error -2
	haswell-pcm-audio haswell-pcm-audio: fw image intel/IntcPP01.bin not available(-2)
	haswell-pcm-audio haswell-pcm-audio: FW loaded, mailbox readback FW info: type 01, - version: 00.00, build 77, source commit id: 876ac6906f31a43b6772b23c7c983ce9dcb18a19
	broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok
	broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok
	broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok
	broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok
	broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok
	input: broadwell-rt286 Headset as /devices/pci0000:00/INT3438:00/broadwell-audio/sound/card1/input15

And a few snippets from a broken kernel dmesg:

	i2c_designware: probe of INT3432:00 failed with error -38
	i2c_designware: probe of INT3433:00 failed with error -38
	broadwell-audio broadwell-audio: ASoC: CPU DAI System Pin not registered
	broadwell-audio broadwell-audio: ASoC: CODEC DAI rt286-aif1 not registered
	
Ideas on how to fix this properly?

Thanks,
	Dominik

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-17 13:25 i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option) Dominik Brodowski
@ 2018-02-17 15:02 ` Andy Shevchenko
  2018-02-17 15:09   ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2018-02-17 15:02 UTC (permalink / raw)
  To: Dominik Brodowski, tim, jarkko.nikula, preid, wsa; +Cc: linux-i2c, linux-kernel

On Sat, 2018-02-17 at 14:25 +0100, Dominik Brodowski wrote:

> on v4.16-rc1+, sound does not work any more on my Dell XPS 13;
> suspend-to-RAM hangs as well. I have bisected this problem down to
> commit ca382f5b38f3; reverting this on top of Linus' latest
> (1e3510b2b053)
> fixes these issues.

> And a few snippets from a broken kernel dmesg:
> 
> 	i2c_designware: probe of INT3432:00 failed with error -38
> 	i2c_designware: probe of INT3433:00 failed with error -38

ENOSYS here at probe time, taking into account the commit you think is a
culprit, can be passed from gpiod_get() calls only.

> Ideas on how to fix this properly?

Enable CONFIG_DEBUG_GPIO first and share through some service the dmesg.
(it might be good idea to add 'ignore_loglevel initcall_debug' to the
kernel command line)

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-17 15:02 ` Andy Shevchenko
@ 2018-02-17 15:09   ` Andy Shevchenko
  2018-02-17 16:58     ` Dominik Brodowski
  2018-02-19 17:38     ` Dominik Brodowski
  0 siblings, 2 replies; 10+ messages in thread
From: Andy Shevchenko @ 2018-02-17 15:09 UTC (permalink / raw)
  To: Dominik Brodowski, tim, jarkko.nikula, preid, wsa; +Cc: linux-i2c, linux-kernel

On Sat, 2018-02-17 at 17:02 +0200, Andy Shevchenko wrote:
> On Sat, 2018-02-17 at 14:25 +0100, Dominik Brodowski wrote:
> 
> > on v4.16-rc1+, sound does not work any more on my Dell XPS 13;
> > suspend-to-RAM hangs as well. I have bisected this problem down to
> > commit ca382f5b38f3; reverting this on top of Linus' latest
> > (1e3510b2b053)
> > fixes these issues.
> > And a few snippets from a broken kernel dmesg:
> > 
> > 	i2c_designware: probe of INT3432:00 failed with error -38
> > 	i2c_designware: probe of INT3433:00 failed with error -38
> 
> ENOSYS here at probe time, taking into account the commit you think is
> a
> culprit, can be passed from gpiod_get() calls only.
> 
> > Ideas on how to fix this properly?
> 
> Enable CONFIG_DEBUG_GPIO first and share through some service the
> dmesg.
> (it might be good idea to add 'ignore_loglevel initcall_debug' to the
> kernel command line)

And tell if the following patch helps.

--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -644,7 +644,7 @@ static int i2c_dw_init_recovery_info(struct
dw_i2c_dev *dev)
        gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH);
        if (IS_ERR(gpio)) {
                r = PTR_ERR(gpio);
-               if (r == -ENOENT)
+               if (r == -ENOENT || r == -ENOSYS)
                        return 0;
                return r;
        }

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-17 15:09   ` Andy Shevchenko
@ 2018-02-17 16:58     ` Dominik Brodowski
  2018-02-17 20:57       ` Andy Shevchenko
  2018-02-19 17:38     ` Dominik Brodowski
  1 sibling, 1 reply; 10+ messages in thread
From: Dominik Brodowski @ 2018-02-17 16:58 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: tim, jarkko.nikula, preid, wsa, linux-i2c, linux-kernel

On Sat, Feb 17, 2018 at 05:09:40PM +0200, Andy Shevchenko wrote:
> On Sat, 2018-02-17 at 17:02 +0200, Andy Shevchenko wrote:
> > On Sat, 2018-02-17 at 14:25 +0100, Dominik Brodowski wrote:
> > 
> > > on v4.16-rc1+, sound does not work any more on my Dell XPS 13;
> > > suspend-to-RAM hangs as well. I have bisected this problem down to
> > > commit ca382f5b38f3; reverting this on top of Linus' latest
> > > (1e3510b2b053)
> > > fixes these issues.
> > > And a few snippets from a broken kernel dmesg:
> > > 
> > > 	i2c_designware: probe of INT3432:00 failed with error -38
> > > 	i2c_designware: probe of INT3433:00 failed with error -38
> > 
> > ENOSYS here at probe time, taking into account the commit you think is
> > a
> > culprit, can be passed from gpiod_get() calls only.
> > 
> > > Ideas on how to fix this properly?
> > 
> > Enable CONFIG_DEBUG_GPIO first and share through some service the
> > dmesg.
> > (it might be good idea to add 'ignore_loglevel initcall_debug' to the
> > kernel command line)
> 
> And tell if the following patch helps.
> 
> --- a/drivers/i2c/busses/i2c-designware-master.c
> +++ b/drivers/i2c/busses/i2c-designware-master.c
> @@ -644,7 +644,7 @@ static int i2c_dw_init_recovery_info(struct
> dw_i2c_dev *dev)
>         gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH);
>         if (IS_ERR(gpio)) {
>                 r = PTR_ERR(gpio);
> -               if (r == -ENOENT)
> +               if (r == -ENOENT || r == -ENOSYS)
>                         return 0;
>                 return r;
>         }
> 

This patch fixes the issue, thanks. Do you still need the DEBUG_GPIO output?

Thanks,	
	Dominik

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-17 16:58     ` Dominik Brodowski
@ 2018-02-17 20:57       ` Andy Shevchenko
  2018-02-18  9:41         ` Dominik Brodowski
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2018-02-17 20:57 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: tim, jarkko.nikula, preid, wsa, linux-i2c, linux-kernel

On Sat, 2018-02-17 at 17:58 +0100, Dominik Brodowski wrote:
> On Sat, Feb 17, 2018 at 05:09:40PM +0200, Andy Shevchenko wrote:

> This patch fixes the issue, thanks.

I will send it soon out.

>  Do you still need the DEBUG_GPIO output?

It would be nice to have, though if it makes difficulties to you, then
don't bother.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-17 20:57       ` Andy Shevchenko
@ 2018-02-18  9:41         ` Dominik Brodowski
  2018-02-18 14:23           ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Dominik Brodowski @ 2018-02-18  9:41 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: tim, jarkko.nikula, preid, wsa, linux-i2c, linux-kernel

On Sat, Feb 17, 2018 at 10:57:01PM +0200, Andy Shevchenko wrote:
> On Sat, 2018-02-17 at 17:58 +0100, Dominik Brodowski wrote:
> > On Sat, Feb 17, 2018 at 05:09:40PM +0200, Andy Shevchenko wrote:
> 
> > This patch fixes the issue, thanks.
> 
> I will send it soon out.
> 
> >  Do you still need the DEBUG_GPIO output?
> 
> It would be nice to have, though if it makes difficulties to you, then
> don't bother.

Note that I have to enable CONFIG_GPIOLIB before I can enable DEBUG_GPIO;
CONFIG_PINCTRL was off as well. Maybe some "SELECT" is missing for
CONFIG_I2C_DESIGNWARE_BAYTRAIL ?

The following output is with your patch applied. Do you need it without
your fixup patch as well?

$ dmesg | egrep -i "(gpio|pinctrl|i2c|broadw)"
[    0.591578] calling  dw_i2c_init_driver+0x0/0x13 @ 1
[    0.625040] i2c_designware INT3432:00: GPIO lookup for consumer scl
[    0.625073] i2c_designware INT3432:00: using ACPI for GPIO lookup
[    0.625102] acpi INT3432:00: GPIO: looking up scl-gpios
[    0.625129] acpi INT3432:00: GPIO: looking up scl-gpio
[    0.625154] i2c_designware INT3432:00: using lookup tables for GPIO lookup
[    0.625202] i2c_designware INT3432:00: lookup for GPIO scl failed
[    0.678297] i2c_designware INT3433:00: GPIO lookup for consumer scl
[    0.678326] i2c_designware INT3433:00: using ACPI for GPIO lookup
[    0.678353] acpi INT3433:00: GPIO: looking up scl-gpios
[    0.678376] acpi INT3433:00: GPIO: looking up scl-gpio
[    0.678398] i2c_designware INT3433:00: using lookup tables for GPIO lookup
[    0.678427] i2c_designware INT3433:00: lookup for GPIO scl failed
[    0.701403] initcall dw_i2c_init_driver+0x0/0x13 returned 0 after 107421 usecs
[    1.711543] calling  gpio_clk_driver_init+0x0/0x13 @ 1
[    1.712419] initcall gpio_clk_driver_init+0x0/0x13 returned 0 after 44 usecs
[    1.933569] calling  synaptics_i2c_driver_init+0x0/0x13 @ 1
[    1.933602] initcall synaptics_i2c_driver_init+0x0/0x13 returned 0 after 30 usecs
[    1.933996] calling  rmi_i2c_driver_init+0x0/0x13 @ 1
[    1.934060] initcall rmi_i2c_driver_init+0x0/0x13 returned 0 after 59 usecs
[    1.935852] calling  i2c_i801_init+0x0/0xc9 @ 1
[    1.957452] initcall i2c_i801_init+0x0/0xc9 returned 0 after 21089 usecs
[    1.977716] calling  i2c_hid_driver_init+0x0/0x13 @ 1
[    2.025330] input: DLL0665:01 06CB:76AD Touchpad as /devices/pci0000:00/INT3433:00/i2c-1/i2c-DLL0665:01/0018:06CB:76AD.0001/input/input9
[    2.025853] hid-multitouch 0018:06CB:76AD.0001: input: I2C HID v1.00 Mouse [DLL0665:01 06CB:76AD] on i2c-DLL0665:01
[    2.026376] initcall i2c_hid_driver_init+0x0/0x13 returned 0 after 47514 usecs
[    2.065027] calling  max98090_i2c_driver_init+0x0/0x13 @ 1
[    2.065075] initcall max98090_i2c_driver_init+0x0/0x13 returned 0 after 44 usecs
[    2.065077] calling  rt286_i2c_driver_init+0x0/0x13 @ 1
[    2.118805] initcall rt286_i2c_driver_init+0x0/0x13 returned 0 after 52461 usecs
[    2.118809] calling  rt5640_i2c_driver_init+0x0/0x13 @ 1
[    2.118853] initcall rt5640_i2c_driver_init+0x0/0x13 returned 0 after 38 usecs
[    2.118856] calling  rt5651_i2c_driver_init+0x0/0x13 @ 1
[    2.118894] initcall rt5651_i2c_driver_init+0x0/0x13 returned 0 after 34 usecs
[    2.165208] calling  broadwell_audio_init+0x0/0x13 @ 1
[    2.167941] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok
[    2.168171] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok
[    2.168377] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok
[    2.168575] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok
[    2.170833] broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok
[    2.179624] input: broadwell-rt286 Headset as /devices/pci0000:00/INT3438:00/broadwell-audio/sound/card1/input15
[    2.180363] initcall broadwell_audio_init+0x0/0x13 returned 0 after 14793 usecs

Thanks,
	Dominik

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-18  9:41         ` Dominik Brodowski
@ 2018-02-18 14:23           ` Andy Shevchenko
  2018-02-18 16:32             ` Dominik Brodowski
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2018-02-18 14:23 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Andy Shevchenko, tim, Jarkko Nikula, Phil Reid, Wolfram Sang,
	linux-i2c, Linux Kernel Mailing List

On Sun, Feb 18, 2018 at 11:41 AM, Dominik Brodowski
<linux@dominikbrodowski.net> wrote:
> On Sat, Feb 17, 2018 at 10:57:01PM +0200, Andy Shevchenko wrote:
>> On Sat, 2018-02-17 at 17:58 +0100, Dominik Brodowski wrote:

>> >  Do you still need the DEBUG_GPIO output?
>>
>> It would be nice to have, though if it makes difficulties to you, then
>> don't bother.
>
> Note that I have to enable CONFIG_GPIOLIB before I can enable DEBUG_GPIO;
> CONFIG_PINCTRL was off as well. Maybe some "SELECT" is missing for
> CONFIG_I2C_DESIGNWARE_BAYTRAIL ?

Ah, so, your configuration misses pin control driver. You need to
enable it in order to get GPIOs working.
It might fix your issue w/o my patch.

> The following output is with your patch applied.

...which is useless.

> Do you need it without
> your fixup patch as well?

Yes, and with enabled pin control driver.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-18 14:23           ` Andy Shevchenko
@ 2018-02-18 16:32             ` Dominik Brodowski
  2018-02-19 14:01               ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Dominik Brodowski @ 2018-02-18 16:32 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Andy Shevchenko, tim, Jarkko Nikula, Phil Reid, Wolfram Sang,
	linux-i2c, Linux Kernel Mailing List

On Sun, Feb 18, 2018 at 04:23:41PM +0200, Andy Shevchenko wrote:
> On Sun, Feb 18, 2018 at 11:41 AM, Dominik Brodowski
> <linux@dominikbrodowski.net> wrote:
> > On Sat, Feb 17, 2018 at 10:57:01PM +0200, Andy Shevchenko wrote:
> >> On Sat, 2018-02-17 at 17:58 +0100, Dominik Brodowski wrote:
> 
> >> >  Do you still need the DEBUG_GPIO output?
> >>
> >> It would be nice to have, though if it makes difficulties to you, then
> >> don't bother.
> >
> > Note that I have to enable CONFIG_GPIOLIB before I can enable DEBUG_GPIO;
> > CONFIG_PINCTRL was off as well. Maybe some "SELECT" is missing for
> > CONFIG_I2C_DESIGNWARE_BAYTRAIL ?
> 
> Ah, so, your configuration misses pin control driver. You need to
> enable it in order to get GPIOs working.

Well, I did not need it in the past to have working sound and working
suspend to RAM. And it already works if 

	CONFIG_PINCTRL=y
	CONFIG_DEBUG_PINCTRL=y

	CONFIG_GPIOLIB=y
	CONFIG_GPIO_ACPI=y
	CONFIG_DEBUG_GPIO=y

are set (but no PINCTRL or GPIO drivers!).

So I'd suggest to

(a) keep your fixup patch (as things work as previously then),

(b) to have CONFIG_I2C_DESIGNWARE_BAYTRAIL select the appropriate options from
    above [and CONFIG_XPOWER_PMIC_OPREGION ?] (or depend on it?), or

(c) (probably best) both.


> It might fix your issue w/o my patch.
> 
> > The following output is with your patch applied.
> 
> ...which is useless.
> 
> > Do you need it without
> > your fixup patch as well?
> 
> Yes, and with enabled pin control driver.

Well, I've reverted your fixup patch locally and enabled all drivers that I
could -- including CONFIG_XPOWER_PMIC_OPREGION, CONFIG_MFD_AXP20X, and
CONFIG_MFD_AXP20X_I2C. But I'm not sure at all that a driver actually became
active...

$ dmesg | egrep -i "(gpio|pinctrl|i2c|broadw)"
[    0.031029] Performance Events: PEBS fmt2+, Broadwell events, 16-deep LBR, full-width counters, Intel PMU driver.
[    0.079300] pinctrl core: initialized pinctrl subsystem
[    0.105267] gpio-f7188x: Not a Fintek device at 0x0000002e
[    0.105285] gpio-f7188x: Not a Fintek device at 0x0000004e
[    0.621048] i2c_designware INT3432:00: GPIO lookup for consumer scl
[    0.621053] i2c_designware INT3432:00: using ACPI for GPIO lookup
[    0.621057] acpi INT3432:00: GPIO: looking up scl-gpios
[    0.621062] acpi INT3432:00: GPIO: looking up scl-gpio
[    0.621065] i2c_designware INT3432:00: using lookup tables for GPIO lookup
[    0.621087] i2c_designware INT3432:00: lookup for GPIO scl failed
[    0.682478] i2c_designware INT3433:00: GPIO lookup for consumer scl
[    0.682482] i2c_designware INT3433:00: using ACPI for GPIO lookup
[    0.682486] acpi INT3433:00: GPIO: looking up scl-gpios
[    0.682490] acpi INT3433:00: GPIO: looking up scl-gpio
[    0.682493] i2c_designware INT3433:00: using lookup tables for GPIO lookup
[    0.682497] i2c_designware INT3433:00: lookup for GPIO scl failed
[    1.208551] gpio_it87: Unknown Chip found, Chip 1d00 Revision 0
[    1.870861] input: DLL0665:01 06CB:76AD Touchpad as /devices/pci0000:00/INT3433:00/i2c-1/i2c-DLL0665:01/0018:06CB:76AD.0001/input/input9
[    1.871601] hid-multitouch 0018:06CB:76AD.0001: input: I2C HID v1.00 Mouse [DLL0665:01 06CB:76AD] on i2c-DLL0665:01
[    2.015224] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok
[    2.015433] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok
[    2.015642] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok
[    2.015839] broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok
[    2.017899] broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok
[    2.025473] input: broadwell-rt286 Headset as /devices/pci0000:00/INT3438:00/broadwell-audio/sound/card1/input15

Thanks,
	Dominik

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-18 16:32             ` Dominik Brodowski
@ 2018-02-19 14:01               ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2018-02-19 14:01 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Andy Shevchenko, tim, Jarkko Nikula, Phil Reid, Wolfram Sang,
	linux-i2c, Linux Kernel Mailing List

On Sun, Feb 18, 2018 at 6:32 PM, Dominik Brodowski
<linux@dominikbrodowski.net> wrote:
> On Sun, Feb 18, 2018 at 04:23:41PM +0200, Andy Shevchenko wrote:
>> On Sun, Feb 18, 2018 at 11:41 AM, Dominik Brodowski
>> <linux@dominikbrodowski.net> wrote:
>> > On Sat, Feb 17, 2018 at 10:57:01PM +0200, Andy Shevchenko wrote:
>> >> On Sat, 2018-02-17 at 17:58 +0100, Dominik Brodowski wrote:
>>
>> >> >  Do you still need the DEBUG_GPIO output?
>> >>
>> >> It would be nice to have, though if it makes difficulties to you, then
>> >> don't bother.
>> >
>> > Note that I have to enable CONFIG_GPIOLIB before I can enable DEBUG_GPIO;
>> > CONFIG_PINCTRL was off as well. Maybe some "SELECT" is missing for
>> > CONFIG_I2C_DESIGNWARE_BAYTRAIL ?
>>
>> Ah, so, your configuration misses pin control driver. You need to
>> enable it in order to get GPIOs working.
>
> Well, I did not need it in the past to have working sound and working
> suspend to RAM. And it already works if
>
>         CONFIG_PINCTRL=y
>         CONFIG_DEBUG_PINCTRL=y
>
>         CONFIG_GPIOLIB=y
>         CONFIG_GPIO_ACPI=y
>         CONFIG_DEBUG_GPIO=y
>
> are set (but no PINCTRL or GPIO drivers!).
>
> So I'd suggest to
>
> (a) keep your fixup patch (as things work as previously then),

You may answer to mail with the patch by giving a Tested-by tag.

> (b) to have CONFIG_I2C_DESIGNWARE_BAYTRAIL select the appropriate options from
>     above [and CONFIG_XPOWER_PMIC_OPREGION ?] (or depend on it?), or

I don't think there is such dependency.

Jarkko, what do you think?

>> Yes, and with enabled pin control driver.
>
> Well, I've reverted your fixup patch locally and enabled all drivers that I
> could -- including CONFIG_XPOWER_PMIC_OPREGION, CONFIG_MFD_AXP20X, and
> CONFIG_MFD_AXP20X_I2C. But I'm not sure at all that a driver actually became
> active...

-ENOSYS is returned when !GPIOLIB. That what made behaviour different
in the first place.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
  2018-02-17 15:09   ` Andy Shevchenko
  2018-02-17 16:58     ` Dominik Brodowski
@ 2018-02-19 17:38     ` Dominik Brodowski
  1 sibling, 0 replies; 10+ messages in thread
From: Dominik Brodowski @ 2018-02-19 17:38 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: tim, jarkko.nikula, preid, wsa, linux-i2c, linux-kernel

On Sat, Feb 17, 2018 at 05:09:40PM +0200, Andy Shevchenko wrote:
> On Sat, 2018-02-17 at 17:02 +0200, Andy Shevchenko wrote:
> > On Sat, 2018-02-17 at 14:25 +0100, Dominik Brodowski wrote:
> > 
> > > on v4.16-rc1+, sound does not work any more on my Dell XPS 13;
> > > suspend-to-RAM hangs as well. I have bisected this problem down to
> > > commit ca382f5b38f3; reverting this on top of Linus' latest
> > > (1e3510b2b053)
> > > fixes these issues.
> > > And a few snippets from a broken kernel dmesg:
> > > 
> > > 	i2c_designware: probe of INT3432:00 failed with error -38
> > > 	i2c_designware: probe of INT3433:00 failed with error -38
> > 
> > ENOSYS here at probe time, taking into account the commit you think is
> > a
> > culprit, can be passed from gpiod_get() calls only.
> > 
> > > Ideas on how to fix this properly?
> > 
> > Enable CONFIG_DEBUG_GPIO first and share through some service the
> > dmesg.
> > (it might be good idea to add 'ignore_loglevel initcall_debug' to the
> > kernel command line)
> 
> And tell if the following patch helps.
> 
> --- a/drivers/i2c/busses/i2c-designware-master.c
> +++ b/drivers/i2c/busses/i2c-designware-master.c
> @@ -644,7 +644,7 @@ static int i2c_dw_init_recovery_info(struct
> dw_i2c_dev *dev)
>         gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH);
>         if (IS_ERR(gpio)) {
>                 r = PTR_ERR(gpio);
> -               if (r == -ENOENT)
> +               if (r == -ENOENT || r == -ENOSYS)
>                         return 0;
>                 return r;
>         }
> 

Fixes: ca382f5b38f3 ("i2c: designware: add i2c gpio recovery option")
Tested-and-reported-by: Dominik Brodowski <linux@dominikbrodowski.net>

Thanks,
	Dominik

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

end of thread, other threads:[~2018-02-19 17:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-17 13:25 i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option) Dominik Brodowski
2018-02-17 15:02 ` Andy Shevchenko
2018-02-17 15:09   ` Andy Shevchenko
2018-02-17 16:58     ` Dominik Brodowski
2018-02-17 20:57       ` Andy Shevchenko
2018-02-18  9:41         ` Dominik Brodowski
2018-02-18 14:23           ` Andy Shevchenko
2018-02-18 16:32             ` Dominik Brodowski
2018-02-19 14:01               ` Andy Shevchenko
2018-02-19 17:38     ` Dominik Brodowski

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.