* [RESEND PATCH 0/2] rockchip: kevin: Enable edp display @ 2017-10-13 10:41 Jeffy Chen 2017-10-13 10:41 ` [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Jeffy Chen [not found] ` <20171013104138.3216-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 0 siblings, 2 replies; 16+ messages in thread From: Jeffy Chen @ 2017-10-13 10:41 UTC (permalink / raw) To: linux-kernel-u79uwXL29TY76Z2rM5mHXA Cc: briannorris-F7+t8E8rja9g9hUCZPvPmw, broonie-DgEjT+Ai2ygdnm+yROfE0A, dianders-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen, Matthias Kaehlcke, Heiko Stuebner, devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, linux-spi-u79uwXL29TY76Z2rM5mHXA, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring, Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Make edp display works on chromebook kevin. Jeffy Chen (2): spi: rockchip: Convert to late and early system PM callbacks arm64: dts: rockchip: Enable edp disaplay on kevin arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 29 +++++++++++++++++++++++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 16 +++++++++++++ drivers/spi/spi-rockchip.c | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" 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] 16+ messages in thread
* [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 10:41 [RESEND PATCH 0/2] rockchip: kevin: Enable edp display Jeffy Chen @ 2017-10-13 10:41 ` Jeffy Chen 2017-10-13 15:32 ` Doug Anderson [not found] ` <20171013104138.3216-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 1 sibling, 1 reply; 16+ messages in thread From: Jeffy Chen @ 2017-10-13 10:41 UTC (permalink / raw) To: linux-kernel Cc: briannorris, broonie, dianders, Jeffy Chen, Heiko Stuebner, linux-spi, linux-rockchip, linux-arm-kernel Currently we are suspending the spi master in it's ->suspend callback, which is racy as some other drivers may still want to transmit messages on the bus(e.g. spi based pwm backlight). Convert to late and early system PM callbacks to avoid the race. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> --- drivers/spi/spi-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index fdcf3076681b..ae539c735ea6 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -914,7 +914,7 @@ static int rockchip_spi_runtime_resume(struct device *dev) #endif /* CONFIG_PM */ static const struct dev_pm_ops rockchip_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) + SET_LATE_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) SET_RUNTIME_PM_OPS(rockchip_spi_runtime_suspend, rockchip_spi_runtime_resume, NULL) }; -- 2.11.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 10:41 ` [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Jeffy Chen @ 2017-10-13 15:32 ` Doug Anderson 2017-10-13 15:51 ` Brian Norris 0 siblings, 1 reply; 16+ messages in thread From: Doug Anderson @ 2017-10-13 15:32 UTC (permalink / raw) To: Jeffy Chen Cc: linux-kernel@vger.kernel.org, Brian Norris, Mark Brown, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel@lists.infradead.org Hi, On Fri, Oct 13, 2017 at 3:41 AM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote: > Currently we are suspending the spi master in it's ->suspend callback, > which is racy as some other drivers may still want to transmit messages > on the bus(e.g. spi based pwm backlight). > > Convert to late and early system PM callbacks to avoid the race. > > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> > --- > > drivers/spi/spi-rockchip.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) It shouldn't hurt to do this, but I'm curious if you did any digging about why this happens? As I understood it suspend order is supposed to be opposite of probe order. Thus anything that was able to get a reference to the cros-ec PWM at its probe time should get suspended before cros-ec suspends. -Doug ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 15:32 ` Doug Anderson @ 2017-10-13 15:51 ` Brian Norris [not found] ` <20171013155120.GA137489-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 16+ messages in thread From: Brian Norris @ 2017-10-13 15:51 UTC (permalink / raw) To: Doug Anderson Cc: Jeffy Chen, linux-kernel@vger.kernel.org, Mark Brown, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel@lists.infradead.org, Dmitry Torokhov Hi, On Fri, Oct 13, 2017 at 08:32:12AM -0700, Doug Anderson wrote: > Hi, > > On Fri, Oct 13, 2017 at 3:41 AM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote: > > Currently we are suspending the spi master in it's ->suspend callback, > > which is racy as some other drivers may still want to transmit messages > > on the bus(e.g. spi based pwm backlight). > > > > Convert to late and early system PM callbacks to avoid the race. > > > > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> > > --- > > > > drivers/spi/spi-rockchip.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > It shouldn't hurt to do this, but I'm curious if you did any digging > about why this happens? As I understood it suspend order is supposed > to be opposite of probe order. Thus anything that was able to get a > reference to the cros-ec PWM at its probe time should get suspended > before cros-ec suspends. Yes, this does seem odd to me too. This looks like an arms race hack that should be avoided unless we know a legit root cause. Also, "probe order implies suspend order" doesn't quite work for async suspend anyway, so we'd probably want to express the dependency properly anyway. Any chance this is related? Seems like that might break the parent/child relationship for master/slave: commit d7e2ee257038baeb03baef602500368a51ee9eef Author: Linus Walleij <linus.walleij@linaro.org> Date: Mon Apr 11 13:51:03 2016 +0200 spi: let SPI masters ignore their children for PM Brian ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <20171013155120.GA137489-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>]
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks [not found] ` <20171013155120.GA137489-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> @ 2017-10-13 16:42 ` Mark Brown 2017-10-13 18:19 ` jeffy 0 siblings, 1 reply; 16+ messages in thread From: Mark Brown @ 2017-10-13 16:42 UTC (permalink / raw) To: Brian Norris Cc: Doug Anderson, Jeffy Chen, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Dmitry Torokhov [-- Attachment #1: Type: text/plain, Size: 1083 bytes --] On Fri, Oct 13, 2017 at 08:51:21AM -0700, Brian Norris wrote: > Yes, this does seem odd to me too. This looks like an arms race hack > that should be avoided unless we know a legit root cause. Also, > "probe order implies suspend order" doesn't quite work for async suspend > anyway, so we'd probably want to express the dependency properly > anyway. Yeah, it's the same stuff as we get with initcall ordering. This sort of thing does happen with things like PMICs which tend to have hardware that the system wants to manipulate in the IRQs off part of suspend. Ideally the dependency annotation stuff would figure things out though I'm not sure what the status of that is. > Any chance this is related? Seems like that might break the parent/child > relationship for master/slave: > commit d7e2ee257038baeb03baef602500368a51ee9eef > Author: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Date: Mon Apr 11 13:51:03 2016 +0200 > spi: let SPI masters ignore their children for PM That's for runtime PM, I'd not expect it to affect system suspend. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 16:42 ` Mark Brown @ 2017-10-13 18:19 ` jeffy [not found] ` <59E103B0.8060705-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 0 siblings, 1 reply; 16+ messages in thread From: jeffy @ 2017-10-13 18:19 UTC (permalink / raw) To: Mark Brown, Brian Norris Cc: Doug Anderson, linux-kernel@vger.kernel.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel@lists.infradead.org, Dmitry Torokhov Hi guys, it looks like the suspend sequence depends on the dt node sequence, and we are putting display-subsystem dt node above spi dt node, so it would be earlier in the device list, then got suspended later than spi device. the pwm backlight and cros_ec_spi pwm are very interesting, not only about suspend dependency... if we unbind cros_ec_spi pwm, the pwm backlight would still hold a reference to it, and crash the kernel later. On 10/14/2017 12:42 AM, Mark Brown wrote: > On Fri, Oct 13, 2017 at 08:51:21AM -0700, Brian Norris wrote: > >> Yes, this does seem odd to me too. This looks like an arms race hack >> that should be avoided unless we know a legit root cause. Also, >> "probe order implies suspend order" doesn't quite work for async suspend >> anyway, so we'd probably want to express the dependency properly >> anyway. > > Yeah, it's the same stuff as we get with initcall ordering. This sort > of thing does happen with things like PMICs which tend to have hardware > that the system wants to manipulate in the IRQs off part of suspend. > Ideally the dependency annotation stuff would figure things out though > I'm not sure what the status of that is. > >> Any chance this is related? Seems like that might break the parent/child >> relationship for master/slave: > >> commit d7e2ee257038baeb03baef602500368a51ee9eef >> Author: Linus Walleij <linus.walleij@linaro.org> >> Date: Mon Apr 11 13:51:03 2016 +0200 > >> spi: let SPI masters ignore their children for PM > > That's for runtime PM, I'd not expect it to affect system suspend. > ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <59E103B0.8060705-TNX95d0MmH7DzftRWevZcw@public.gmane.org>]
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks [not found] ` <59E103B0.8060705-TNX95d0MmH7DzftRWevZcw@public.gmane.org> @ 2017-10-13 18:25 ` jeffy 2017-10-13 18:30 ` Dmitry Torokhov 2017-10-13 18:30 ` Dmitry Torokhov 1 sibling, 1 reply; 16+ messages in thread From: jeffy @ 2017-10-13 18:25 UTC (permalink / raw) To: Mark Brown, Brian Norris Cc: Doug Anderson, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Dmitry Torokhov On 10/14/2017 02:19 AM, jeffy wrote: > > > it looks like the suspend sequence depends on the dt node sequence, and > we are putting display-subsystem dt node above spi dt node, so it would > be earlier in the device list, then got suspended later than spi device. > > the pwm backlight and cros_ec_spi pwm are very interesting, not only > about suspend dependency... if we unbind cros_ec_spi pwm, the pwm > backlight would still hold a reference to it, and crash the kernel later. or maybe we should move device_pm_add() from device_add() to driver_bound()? -- To unsubscribe from this list: send the line "unsubscribe linux-spi" 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] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 18:25 ` jeffy @ 2017-10-13 18:30 ` Dmitry Torokhov 0 siblings, 0 replies; 16+ messages in thread From: Dmitry Torokhov @ 2017-10-13 18:30 UTC (permalink / raw) To: jeffy Cc: Mark Brown, Brian Norris, Doug Anderson, linux-kernel@vger.kernel.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel@lists.infradead.org On Sat, Oct 14, 2017 at 02:25:48AM +0800, jeffy wrote: > On 10/14/2017 02:19 AM, jeffy wrote: > > > > > > it looks like the suspend sequence depends on the dt node sequence, and > > we are putting display-subsystem dt node above spi dt node, so it would > > be earlier in the device list, then got suspended later than spi device. > > > > the pwm backlight and cros_ec_spi pwm are very interesting, not only > > about suspend dependency... if we unbind cros_ec_spi pwm, the pwm > > backlight would still hold a reference to it, and crash the kernel later. > > or maybe we should move device_pm_add() from device_add() to driver_bound()? You do not necessarily need to have a driver to power the dveice on and off. -- Dmitry ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks [not found] ` <59E103B0.8060705-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 2017-10-13 18:25 ` jeffy @ 2017-10-13 18:30 ` Dmitry Torokhov 2017-10-13 18:37 ` Mark Brown 2017-10-13 18:44 ` jeffy 1 sibling, 2 replies; 16+ messages in thread From: Dmitry Torokhov @ 2017-10-13 18:30 UTC (permalink / raw) To: jeffy Cc: Mark Brown, Brian Norris, Doug Anderson, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Sat, Oct 14, 2017 at 02:19:28AM +0800, jeffy wrote: > Hi guys, > > it looks like the suspend sequence depends on the dt node sequence, and we > are putting display-subsystem dt node above spi dt node, so it would be > earlier in the device list, then got suspended later than spi device. Would it not get a deferral when trying to get resource reference, which would cause it bumped down to the end of dpm list? > > the pwm backlight and cros_ec_spi pwm are very interesting, not only about > suspend dependency... if we unbind cros_ec_spi pwm, the pwm backlight would > still hold a reference to it, and crash the kernel later. That would be a bug in PWM/cors_ec and it should keep the PWM object until last reference drops and simply error out on all requests. > > On 10/14/2017 12:42 AM, Mark Brown wrote: > > On Fri, Oct 13, 2017 at 08:51:21AM -0700, Brian Norris wrote: > > > > > Yes, this does seem odd to me too. This looks like an arms race hack > > > that should be avoided unless we know a legit root cause. Also, > > > "probe order implies suspend order" doesn't quite work for async suspend > > > anyway, so we'd probably want to express the dependency properly > > > anyway. > > > > Yeah, it's the same stuff as we get with initcall ordering. This sort > > of thing does happen with things like PMICs which tend to have hardware > > that the system wants to manipulate in the IRQs off part of suspend. > > Ideally the dependency annotation stuff would figure things out though > > I'm not sure what the status of that is. I'd say non-existent for resources such as regulators, pwms, clocks, etc. I do not think many places call device_link_add()... I think adding this to devm_* APIs might be easiest to get the ball going as they naturally have consumer device and can easily figure out the supplier side. > > > > > Any chance this is related? Seems like that might break the parent/child > > > relationship for master/slave: > > > > > commit d7e2ee257038baeb03baef602500368a51ee9eef > > > Author: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > > > Date: Mon Apr 11 13:51:03 2016 +0200 > > > > > spi: let SPI masters ignore their children for PM > > > > That's for runtime PM, I'd not expect it to affect system suspend. > > > > Thanks. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-spi" 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] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 18:30 ` Dmitry Torokhov @ 2017-10-13 18:37 ` Mark Brown [not found] ` <20171013183750.piabs7m3dnpabnkm-7j8lgAiuQgnQXOPxS62xeg@public.gmane.org> 2017-10-13 18:44 ` jeffy 1 sibling, 1 reply; 16+ messages in thread From: Mark Brown @ 2017-10-13 18:37 UTC (permalink / raw) To: Dmitry Torokhov Cc: jeffy, Brian Norris, Doug Anderson, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 1070 bytes --] On Fri, Oct 13, 2017 at 11:30:06AM -0700, Dmitry Torokhov wrote: > On Sat, Oct 14, 2017 at 02:19:28AM +0800, jeffy wrote: > > > Yeah, it's the same stuff as we get with initcall ordering. This sort > > > of thing does happen with things like PMICs which tend to have hardware > > > that the system wants to manipulate in the IRQs off part of suspend. > > > Ideally the dependency annotation stuff would figure things out though > > > I'm not sure what the status of that is. > I'd say non-existent for resources such as regulators, pwms, clocks, > etc. I do not think many places call device_link_add()... I think adding > this to devm_* APIs might be easiest to get the ball going as they > naturally have consumer device and can easily figure out the supplier > side. Hrm, are things in a state where we're supposed to be doing that? I've not seen anyone even trying which is a bit odd, I'd thought there was some core work still ongoing (and it wasn't clear to me if we were going to try to do things like use DT/ACPI cross references to figure this stuff out). [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <20171013183750.piabs7m3dnpabnkm-7j8lgAiuQgnQXOPxS62xeg@public.gmane.org>]
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks [not found] ` <20171013183750.piabs7m3dnpabnkm-7j8lgAiuQgnQXOPxS62xeg@public.gmane.org> @ 2017-10-13 23:45 ` Dmitry Torokhov 2017-10-14 0:15 ` Rafael J. Wysocki 0 siblings, 1 reply; 16+ messages in thread From: Dmitry Torokhov @ 2017-10-13 23:45 UTC (permalink / raw) To: Mark Brown, Rafael J. Wysocki Cc: jeffy, Brian Norris, Doug Anderson, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Fri, Oct 13, 2017 at 07:37:50PM +0100, Mark Brown wrote: > On Fri, Oct 13, 2017 at 11:30:06AM -0700, Dmitry Torokhov wrote: > > On Sat, Oct 14, 2017 at 02:19:28AM +0800, jeffy wrote: > > > > > Yeah, it's the same stuff as we get with initcall ordering. This sort > > > > of thing does happen with things like PMICs which tend to have hardware > > > > that the system wants to manipulate in the IRQs off part of suspend. > > > > Ideally the dependency annotation stuff would figure things out though > > > > I'm not sure what the status of that is. > > > I'd say non-existent for resources such as regulators, pwms, clocks, > > etc. I do not think many places call device_link_add()... I think adding > > this to devm_* APIs might be easiest to get the ball going as they > > naturally have consumer device and can easily figure out the supplier > > side. > > Hrm, are things in a state where we're supposed to be doing that? I've > not seen anyone even trying which is a bit odd, I'd thought there was > some core work still ongoing (and it wasn't clear to me if we were going > to try to do things like use DT/ACPI cross references to figure this > stuff out). Not sure, adding Rafael... -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-spi" 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] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 23:45 ` Dmitry Torokhov @ 2017-10-14 0:15 ` Rafael J. Wysocki [not found] ` <1617641.TtuYKIH8aZ-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org> 0 siblings, 1 reply; 16+ messages in thread From: Rafael J. Wysocki @ 2017-10-14 0:15 UTC (permalink / raw) To: Dmitry Torokhov Cc: Mark Brown, jeffy, Brian Norris, Doug Anderson, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Saturday, October 14, 2017 1:45:11 AM CEST Dmitry Torokhov wrote: > On Fri, Oct 13, 2017 at 07:37:50PM +0100, Mark Brown wrote: > > On Fri, Oct 13, 2017 at 11:30:06AM -0700, Dmitry Torokhov wrote: > > > On Sat, Oct 14, 2017 at 02:19:28AM +0800, jeffy wrote: > > > > > > > Yeah, it's the same stuff as we get with initcall ordering. This sort > > > > > of thing does happen with things like PMICs which tend to have hardware > > > > > that the system wants to manipulate in the IRQs off part of suspend. > > > > > Ideally the dependency annotation stuff would figure things out though > > > > > I'm not sure what the status of that is. > > > > > I'd say non-existent for resources such as regulators, pwms, clocks, > > > etc. I do not think many places call device_link_add()... I think adding > > > this to devm_* APIs might be easiest to get the ball going as they > > > naturally have consumer device and can easily figure out the supplier > > > side. > > > > Hrm, are things in a state where we're supposed to be doing that? I've > > not seen anyone even trying which is a bit odd, I'd thought there was > > some core work still ongoing (and it wasn't clear to me if we were going > > to try to do things like use DT/ACPI cross references to figure this > > stuff out). > > Not sure, adding Rafael... The infrastructure in the core is there, the part related to getting that information from firmware is (mostly) missing. Still, moving system suspend/resume callbacks to the late/early phases may be a good idea anyway. Thanks, Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-spi" 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] 16+ messages in thread
[parent not found: <1617641.TtuYKIH8aZ-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org>]
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks [not found] ` <1617641.TtuYKIH8aZ-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org> @ 2017-10-14 8:59 ` Mark Brown 0 siblings, 0 replies; 16+ messages in thread From: Mark Brown @ 2017-10-14 8:59 UTC (permalink / raw) To: Rafael J. Wysocki Cc: Dmitry Torokhov, jeffy, Brian Norris, Doug Anderson, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 410 bytes --] On Sat, Oct 14, 2017 at 02:15:34AM +0200, Rafael J. Wysocki wrote: > The infrastructure in the core is there, the part related to getting that > information from firmware is (mostly) missing. Ah, yes - now I remember. We want this for probe ordering so we don't really want to be doing it in the subsystems when they request resources as that's too late (though I guess duplication there won't hurt). Fun. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 18:30 ` Dmitry Torokhov 2017-10-13 18:37 ` Mark Brown @ 2017-10-13 18:44 ` jeffy 2017-10-13 19:01 ` jeffy 1 sibling, 1 reply; 16+ messages in thread From: jeffy @ 2017-10-13 18:44 UTC (permalink / raw) To: Dmitry Torokhov Cc: Mark Brown, Brian Norris, Doug Anderson, linux-kernel@vger.kernel.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel@lists.infradead.org Hi Dmitry, On 10/14/2017 02:30 AM, Dmitry Torokhov wrote: > On Sat, Oct 14, 2017 at 02:19:28AM +0800, jeffy wrote: >> Hi guys, >> >> it looks like the suspend sequence depends on the dt node sequence, and we >> are putting display-subsystem dt node above spi dt node, so it would be >> earlier in the device list, then got suspended later than spi device. > > Would it not get a deferral when trying to get resource reference, which > would cause it bumped down to the end of dpm list? hmm, right, check again, the rockchip drm would not depend on spi, but the edp driver does. so the drm driver(display-subsystem) would probed before spi, but try to control the backlight in the suspend/resume... so i was wrong in the commit message, will fix it in next version. > >> >> the pwm backlight and cros_ec_spi pwm are very interesting, not only about >> suspend dependency... if we unbind cros_ec_spi pwm, the pwm backlight would >> still hold a reference to it, and crash the kernel later. > > That would be a bug in PWM/cors_ec and it should keep the PWM object > until last reference drops and simply error out on all requests. right, and maybe try to refresh the pwm reference when we bind it again > >> >> On 10/14/2017 12:42 AM, Mark Brown wrote: >>> On Fri, Oct 13, 2017 at 08:51:21AM -0700, Brian Norris wrote: >>> >>>> Yes, this does seem odd to me too. This looks like an arms race hack >>>> that should be avoided unless we know a legit root cause. Also, >>>> "probe order implies suspend order" doesn't quite work for async suspend >>>> anyway, so we'd probably want to express the dependency properly >>>> anyway. >>> >>> Yeah, it's the same stuff as we get with initcall ordering. This sort >>> of thing does happen with things like PMICs which tend to have hardware >>> that the system wants to manipulate in the IRQs off part of suspend. >>> Ideally the dependency annotation stuff would figure things out though >>> I'm not sure what the status of that is. > > I'd say non-existent for resources such as regulators, pwms, clocks, > etc. I do not think many places call device_link_add()... I think adding > this to devm_* APIs might be easiest to get the ball going as they > naturally have consumer device and can easily figure out the supplier > side. > >>> >>>> Any chance this is related? Seems like that might break the parent/child >>>> relationship for master/slave: >>> >>>> commit d7e2ee257038baeb03baef602500368a51ee9eef >>>> Author: Linus Walleij <linus.walleij@linaro.org> >>>> Date: Mon Apr 11 13:51:03 2016 +0200 >>> >>>> spi: let SPI masters ignore their children for PM >>> >>> That's for runtime PM, I'd not expect it to affect system suspend. >>> >> >> > > Thanks. > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks 2017-10-13 18:44 ` jeffy @ 2017-10-13 19:01 ` jeffy 0 siblings, 0 replies; 16+ messages in thread From: jeffy @ 2017-10-13 19:01 UTC (permalink / raw) To: Dmitry Torokhov Cc: Mark Brown, Brian Norris, Doug Anderson, linux-kernel@vger.kernel.org, Heiko Stuebner, linux-spi, open list:ARM/Rockchip SoC..., linux-arm-kernel@lists.infradead.org, sean Paul Hi guys, so what happens here is: 1/ we put display-subsystem dt node before spi node, which cause rockchip drm driver probed before spi(also before edp driver/vop driver...) 2/ rockchip drm driver bound after spi/edp/vop... drivers probed 3/ in rockchip drm driver's resume callback, it would try to enable edp panel backlight(through spi), but spi master is still suspended, then we got these errors: 1970-01-01T08:02:59.607315+08:00 ERR kernel: [ 178.754005] cros-ec-spi spi2.0: spi transfer failed: -108 1970-01-01T08:02:59.607320+08:00 ERR kernel: [ 178.760102] cros-ec-spi spi2.0: cs- deassert spi transfer failed: -108 1970-01-01T08:02:59.607325+08:00 ERR kernel: [ 178.767380] cros-ec-spi spi2.0: Com mand xfer error (err:-108) 1970-01-01T08:02:59.607331+08:00 ERR kernel: [ 178.773963] cros-ec-spi spi2.0: spi transfer failed: -108 1970-01-01T08:02:59.607336+08:00 ERR kernel: [ 178.780066] cros-ec-spi spi2.0: cs- deassert spi transfer failed: -108 1970-01-01T08:02:59.607341+08:00 ERR kernel: [ 178.787359] cros-ec-spi spi2.0: Com mand xfer error (err:-108) so other than move spi master suspend to late suspend, maybe we could defer rockchip drm driver probe after it's component drivers somehow? On 10/14/2017 02:44 AM, jeffy wrote: > Hi Dmitry, > > On 10/14/2017 02:30 AM, Dmitry Torokhov wrote: >> On Sat, Oct 14, 2017 at 02:19:28AM +0800, jeffy wrote: >>> Hi guys, >>> >>> it looks like the suspend sequence depends on the dt node sequence, >>> and we >>> are putting display-subsystem dt node above spi dt node, so it would be >>> earlier in the device list, then got suspended later than spi device. >> >> Would it not get a deferral when trying to get resource reference, which >> would cause it bumped down to the end of dpm list? > hmm, right, check again, the rockchip drm would not depend on spi, but > the edp driver does. > > so the drm driver(display-subsystem) would probed before spi, but try to > control the backlight in the suspend/resume... > > so i was wrong in the commit message, will fix it in next version. >> >>> >>> the pwm backlight and cros_ec_spi pwm are very interesting, not only >>> about >>> suspend dependency... if we unbind cros_ec_spi pwm, the pwm backlight >>> would >>> still hold a reference to it, and crash the kernel later. >> >> That would be a bug in PWM/cors_ec and it should keep the PWM object >> until last reference drops and simply error out on all requests. > right, and maybe try to refresh the pwm reference when we bind it again >> >>> >>> On 10/14/2017 12:42 AM, Mark Brown wrote: >>>> On Fri, Oct 13, 2017 at 08:51:21AM -0700, Brian Norris wrote: >>>> >>>>> Yes, this does seem odd to me too. This looks like an arms race hack >>>>> that should be avoided unless we know a legit root cause. Also, >>>>> "probe order implies suspend order" doesn't quite work for async >>>>> suspend >>>>> anyway, so we'd probably want to express the dependency properly >>>>> anyway. >>>> >>>> Yeah, it's the same stuff as we get with initcall ordering. This sort >>>> of thing does happen with things like PMICs which tend to have hardware >>>> that the system wants to manipulate in the IRQs off part of suspend. >>>> Ideally the dependency annotation stuff would figure things out though >>>> I'm not sure what the status of that is. >> >> I'd say non-existent for resources such as regulators, pwms, clocks, >> etc. I do not think many places call device_link_add()... I think adding >> this to devm_* APIs might be easiest to get the ball going as they >> naturally have consumer device and can easily figure out the supplier >> side. >> >>>> >>>>> Any chance this is related? Seems like that might break the >>>>> parent/child >>>>> relationship for master/slave: >>>> >>>>> commit d7e2ee257038baeb03baef602500368a51ee9eef >>>>> Author: Linus Walleij <linus.walleij@linaro.org> >>>>> Date: Mon Apr 11 13:51:03 2016 +0200 >>>> >>>>> spi: let SPI masters ignore their children for PM >>>> >>>> That's for runtime PM, I'd not expect it to affect system suspend. >>>> >>> >>> >> >> Thanks. >> > ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <20171013104138.3216-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>]
* Re: [RESEND PATCH 0/2] rockchip: kevin: Enable edp display [not found] ` <20171013104138.3216-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org> @ 2017-10-13 15:34 ` Doug Anderson 0 siblings, 0 replies; 16+ messages in thread From: Doug Anderson @ 2017-10-13 15:34 UTC (permalink / raw) To: Jeffy Chen Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Brian Norris, Mark Brown, Matthias Kaehlcke, Heiko Stuebner, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Arnd Bergmann, linux-spi, open list:ARM/Rockchip SoC..., Rob Herring, Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Sean Paul, Alexandru M Stan Hi, On Fri, Oct 13, 2017 at 3:41 AM, Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org> wrote: > > Make edp display works on chromebook kevin. > > > Jeffy Chen (2): > spi: rockchip: Convert to late and early system PM callbacks > arm64: dts: rockchip: Enable edp disaplay on kevin > > arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 29 +++++++++++++++++++++++ > arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 16 +++++++++++++ > drivers/spi/spi-rockchip.c | 2 +- > 3 files changed, 46 insertions(+), 1 deletion(-) Presumably including Sean Paul would be a wise idea on future patches trying to make eDP work well upstream since he's worked on supporting rk3399 eDP in the past. I think Alexandru has also expressed interest in this area, too. -Doug -- 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] 16+ messages in thread
end of thread, other threads:[~2017-10-14 8:59 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-10-13 10:41 [RESEND PATCH 0/2] rockchip: kevin: Enable edp display Jeffy Chen 2017-10-13 10:41 ` [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Jeffy Chen 2017-10-13 15:32 ` Doug Anderson 2017-10-13 15:51 ` Brian Norris [not found] ` <20171013155120.GA137489-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> 2017-10-13 16:42 ` Mark Brown 2017-10-13 18:19 ` jeffy [not found] ` <59E103B0.8060705-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 2017-10-13 18:25 ` jeffy 2017-10-13 18:30 ` Dmitry Torokhov 2017-10-13 18:30 ` Dmitry Torokhov 2017-10-13 18:37 ` Mark Brown [not found] ` <20171013183750.piabs7m3dnpabnkm-7j8lgAiuQgnQXOPxS62xeg@public.gmane.org> 2017-10-13 23:45 ` Dmitry Torokhov 2017-10-14 0:15 ` Rafael J. Wysocki [not found] ` <1617641.TtuYKIH8aZ-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org> 2017-10-14 8:59 ` Mark Brown 2017-10-13 18:44 ` jeffy 2017-10-13 19:01 ` jeffy [not found] ` <20171013104138.3216-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 2017-10-13 15:34 ` [RESEND PATCH 0/2] rockchip: kevin: Enable edp display Doug Anderson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).