From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934688AbbKSWbL (ORCPT ); Thu, 19 Nov 2015 17:31:11 -0500 Received: from mail-oi0-f41.google.com ([209.85.218.41]:35369 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933972AbbKSWbI (ORCPT ); Thu, 19 Nov 2015 17:31:08 -0500 MIME-Version: 1.0 In-Reply-To: References: <1447936001-21420-1-git-send-email-irina.tirdea@intel.com> <1447936001-21420-5-git-send-email-irina.tirdea@intel.com> <20151119182433.GB24773@dtor-ws> Date: Thu, 19 Nov 2015 14:31:07 -0800 Message-ID: Subject: Re: [PATCH v11 4/8] Input: goodix - add power management support From: Dmitry Torokhov To: "Rafael J. Wysocki" Cc: Irina Tirdea , Bastien Nocera , Aleksei Mamlin , Karsten Merker , "linux-input@vger.kernel.org" , Mark Rutland , Rob Herring , Octavian Purdila , Linux Kernel Mailing List , "devicetree@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2015 at 2:18 PM, Rafael J. Wysocki wrote: > Hi, > > On Thu, Nov 19, 2015 at 7:24 PM, Dmitry Torokhov > wrote: >> On Thu, Nov 19, 2015 at 02:26:37PM +0200, Irina Tirdea wrote: >>> Implement suspend/resume for goodix driver. >>> > > [cut] > >>> >>> +static int __maybe_unused goodix_suspend(struct device *dev) >>> +{ >>> + struct i2c_client *client = to_i2c_client(dev); >>> + struct goodix_ts_data *ts = i2c_get_clientdata(client); >>> + int error; >>> + >>> + /* We need gpio pins to suspend/resume */ >>> + if (!ts->gpiod_int || !ts->gpiod_rst) >>> + return 0; >>> + >>> + wait_for_completion(&ts->firmware_loading_complete); >> >> This is not that nice as it may lead to angry splats from the PM core if >> firmware loading takes too long and we start suspending before it >> completes. > > What exactly do you mean? The suspend watchdog or something else? I was thinking about dpm watchdog that will panic the system if suspend takes too long. Hmm, this is debug facility and the default timeout is 60 seconds, so I guess we can ignore my concern. > >> Rafael, if we issue pm_stay_awake() before requesting firmware and >> pm_relax() once it is done, will this prevent the current suspend >> timeouts? > > pm_stay_awake() only works if the checking of wakeup sources is > enabled which generally depends on what user space does. I see. Thanks. -- Dmitry