Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbdIUAZC (ORCPT ); Wed, 20 Sep 2017 20:25:02 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:36397 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbdIUAZA (ORCPT ); Wed, 20 Sep 2017 20:25:00 -0400 X-Google-Smtp-Source: AOwi7QBWwHhJ0I58csaadh9Uit8cGG5vVS+hyT8T9Mv+Exj3Js1QWKYNe9dz1azvJLQ+ood7gioEg3ypqYvPQIFUx0c= MIME-Version: 1.0 In-Reply-To: <20170920223152.100641-1-rajatja@google.com> References: <20170920223152.100641-1-rajatja@google.com> From: "Rafael J. Wysocki" Date: Thu, 21 Sep 2017 02:24:59 +0200 X-Google-Sender-Auth: 91TC6p77yvAy52YRssyuSSKrmGs Message-ID: Subject: Re: [PATCH 1/2] i2c: designware: switch to suspend_late/resume_early To: Rajat Jain Cc: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c , Linux Kernel Mailing List , Lee Jones , "Wysocki, Rafael J" , "Rafael J. Wysocki" , Linux PM , Len Brown , furquan@google.com, rajatxjain@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 37 On Thu, Sep 21, 2017 at 12:31 AM, Rajat Jain wrote: > Ref: https://lkml.org/lkml/2017/9/19/649 > > The bus controllers should suspend the bus operations only after > all of the devices on the bus have suspended their device > completely. Since the i2c_client drivers could be talking to > their devices in their suspend_late() calls, lets ensure that the > bus is alive by that time. Thus moving the controller suspend logic to > suspend_late(). > > Signed-off-by: Rajat Jain > --- > drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c > index 0e65b97842b4..66dd7f844c40 100644 > --- a/drivers/i2c/busses/i2c-designware-platdrv.c > +++ b/drivers/i2c/busses/i2c-designware-platdrv.c > @@ -468,7 +468,7 @@ static int dw_i2c_plat_suspend(struct device *dev) > static const struct dev_pm_ops dw_i2c_dev_pm_ops = { > .prepare = dw_i2c_plat_prepare, > .complete = dw_i2c_plat_complete, > - SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) > + SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) > SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, > dw_i2c_plat_resume, > NULL) No, you can't just do that. I sent patches to do it properly before my trip to LA last week, it shouldn't be overly difficult to find them in the mailing list archives. I can look them up tomorrow if need be. Thanks, Rafael