i2c-designware: sound and s2ram broken on Broadwell-U system since commit ca382f5b38f367b6 (add i2c gpio recovery option)
Subsystems (3)
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
Quoted 1 line
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
Andy Shevchenko
reviewerQuoted 10 lines · Dominik Brodowski
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.
Quoted 1 line
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)
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Andy Shevchenko
reviewerQuoted 16 lines · Andy Shevchenko
Quoted 9 lines · Dominik Brodowski
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 -38ENOSYS here at probe time, taking into account the commit you think is a
culprit, can be passed fromgpiod_get()calls only.
Quoted 6 lines
Quoted 1 line
Ideas on how to fix this properly?
Enable
CONFIG_DEBUG_GPIOfirst and share through some service the dmesg.
(it might be good idea to add 'ignore_loglevelinitcall_debug' to the kernel command line)
And tell if the following patch helps.
drivers/i2c/busses/i2c-designware-master.c +0 -0
@@ -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;
}Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Quoted 37 lines · Andy Shevchenko
Quoted 16 lines · Andy Shevchenko
Quoted 9 lines · Dominik Brodowski
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 -38ENOSYS here at probe time, taking into account the commit you think is a
culprit, can be passed fromgpiod_get()calls only.Quoted 6 lines
Quoted 1 line
Ideas on how to fix this properly?
Enable
CONFIG_DEBUG_GPIOfirst and share through some service the dmesg.
(it might be good idea to add 'ignore_loglevelinitcall_debug' to the kernel command line)And tell if the following patch helps.
drivers/i2c/busses/i2c-designware-master.c +1
-1@@ -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;
Quoted 2 lines
}
This patch fixes the issue, thanks. Do you still need the DEBUG_GPIO output?
Thanks,
Dominik
Andy Shevchenko
reviewerQuoted 3 lines · Dominik Brodowski
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.
Quoted 1 line
Do you still need the
DEBUG_GPIOoutput?
It would be nice to have, though if it makes difficulties to you, then don't bother.
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Quoted 11 lines · Andy Shevchenko
Quoted 3 lines · Dominik Brodowski
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.
Quoted 1 line
Do you still need the
DEBUG_GPIOoutput?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
Quoted 11 lines · Dominik Brodowski
Quoted 6 lines · Andy Shevchenko
Quoted 1 line · Dominik Brodowski
Do you still need the
DEBUG_GPIOoutput?It would be nice to have, though if it makes difficulties to you, then don't bother.
Note that I have to enable
CONFIG_GPIOLIBbefore I can enableDEBUG_GPIO;CONFIG_PINCTRLwas off as well. Maybe some "SELECT" is missing forCONFIG_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.
Quoted 1 line
The following output is with your patch applied.
...which is useless.
Quoted 2 lines
Do you need it without
your fixup patch as well?
Yes, and with enabled pin control driver.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Dominik Brodowski
Quoted 6 lines · Andy Shevchenko
Quoted 1 line · Dominik Brodowski
Do you still need the
DEBUG_GPIOoutput?It would be nice to have, though if it makes difficulties to you, then don't bother.
Quoted 6 lines
Quoted 3 lines
Note that I have to enable
CONFIG_GPIOLIBbefore I can enableDEBUG_GPIO;CONFIG_PINCTRLwas off as well. Maybe some "SELECT" is missing forCONFIG_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.
Quoted 10 lines
It might fix your issue w/o my patch.
Quoted 1 line
The following output is with your patch applied.
...which is useless.
Quoted 2 lines
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
Quoted 28 lines · Dominik Brodowski
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Dominik Brodowski
Quoted 6 lines · Andy Shevchenko
Quoted 1 line · Dominik Brodowski
Do you still need the
DEBUG_GPIOoutput?It would be nice to have, though if it makes difficulties to you, then don't bother.
Quoted 6 lines
Quoted 3 lines
Note that I have to enable
CONFIG_GPIOLIBbefore I can enableDEBUG_GPIO;CONFIG_PINCTRLwas off as well. Maybe some "SELECT" is missing forCONFIG_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
Quoted 5 lines
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.
Quoted 2 lines
(b) to have
CONFIG_I2C_DESIGNWARE_BAYTRAILselect the appropriate options from above [andCONFIG_XPOWER_PMIC_OPREGION?] (or depend on it?), or
I don't think there is such dependency.
Jarkko, what do you think?
Quoted 6 lines
Quoted 1 line
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, andCONFIG_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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 37 lines · Andy Shevchenko
Quoted 16 lines · Andy Shevchenko
Quoted 9 lines · Dominik Brodowski
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 -38ENOSYS here at probe time, taking into account the commit you think is a
culprit, can be passed fromgpiod_get()calls only.Quoted 6 lines
Quoted 1 line
Ideas on how to fix this properly?
Enable
CONFIG_DEBUG_GPIOfirst and share through some service the dmesg.
(it might be good idea to add 'ignore_loglevelinitcall_debug' to the kernel command line)And tell if the following patch helps.
drivers/i2c/busses/i2c-designware-master.c +1
-1@@ -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;
Quoted 2 lines
}
Thanks,
Dominik