From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758732AbdJMPv2 (ORCPT ); Fri, 13 Oct 2017 11:51:28 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:43126 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758666AbdJMPvZ (ORCPT ); Fri, 13 Oct 2017 11:51:25 -0400 X-Google-Smtp-Source: AOwi7QDBuwS3Q43j1ldQiG1tA49yLZlk6bgkDp/ei8qIY/Kb57bOWkMigGhaDCPK1jhwU2bFjfzHZA== Date: Fri, 13 Oct 2017 08:51:21 -0700 From: Brian Norris 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 Subject: Re: [RESEND PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Message-ID: <20171013155120.GA137489@google.com> References: <20171013104138.3216-1-jeffy.chen@rock-chips.com> <20171013104138.3216-2-jeffy.chen@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > > --- > > > > 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 Date: Mon Apr 11 13:51:03 2016 +0200 spi: let SPI masters ignore their children for PM Brian