From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934717AbdK2Rik (ORCPT ); Wed, 29 Nov 2017 12:38:40 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:41295 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934224AbdK2Rha (ORCPT ); Wed, 29 Nov 2017 12:37:30 -0500 X-Google-Smtp-Source: AGs4zMZ4aXikmmuFngyN3cxFRuNaJU4VlkjbxqowuDuZAdoxv3F2IXSP4Tl3RxgwGoeX4a7eGVveXg== Subject: Re: [PATCH v2 2/2] pinctrl: Allow indicating loss of pin states during low-power To: Tony Lindgren , Linus Walleij Cc: Florian Fainelli , linux-gpio@vger.kernel.org, Rob Herring , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , Charles Keepax , Charles Keepax , Stephen Warren , Andy Shevchenko , Al Cooper , bcm-kernel-feedback-list References: <20171102231551.16220-1-f.fainelli@gmail.com> <20171102231551.16220-3-f.fainelli@gmail.com> <20171129170247.GI28152@atomide.com> From: Florian Fainelli Message-ID: <96cf5d74-3acf-07b9-9ad8-1011cd99a860@gmail.com> Date: Wed, 29 Nov 2017 09:37:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20171129170247.GI28152@atomide.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/2017 09:02 AM, Tony Lindgren wrote: > * Linus Walleij [171129 13:03]: >> On Fri, Nov 3, 2017 at 12:15 AM, Florian Fainelli wrote: >> >>> Some platforms (e.g: Broadcom STB: BMIPS_GENERIC/ARCH_BRCMSTB) will lose >>> their register contents when entering their lower power state. In such a >>> case, the pinctrl-single driver that is used will not be able to restore >>> the power states without telling the core about it and having >>> pinctrl_select_state() check for that. >>> >>> This patch adds a new optional boolean property that Device Tree can >>> define in order to obtain exactly that and having the core pinctrl code >>> take that into account. >>> >>> Signed-off-by: Florian Fainelli >> >> Florian, I'm really sorry for losing track of this patch set, it's >> important stuff and I see why systems are dependent on something >> like this. >> >> Tony: can you look at this from a pinctrl-single point of view? >> This is the intended consumer: pinctrl-single users that lose the >> hardware state over suspend/resume. >> >> How do you see this working with other pinctrl-single users? > > Hmm well typically a device driver that loses it's context just does > save and restore of the registers in runtime PM suspend/resume > as needed. In this case it would mean duplicating the state for > potentially for hundreds of registers.. So using the existing > state in the pinctrl subsystem totally makes sense for the pins. > > Florian do you have other reasons why this should be done in the > pinctrl framework instead of the driver? Might be worth describing > the reasoning in the patch descriptions :) The pinctrl provider driver that I am using is pinctrl-single, which has proper suspend/resume callbacks but those are not causing any HW programming to happen because of the (p->state == state) check, hence this patch series. > > So as long as the pinctrl framework state is used to restore the > state by the pinctrl driver instead of the pinctrl consumer drivers, > I don't have issues with this patchset. So probably just improving > the patch messages a bit should do it. > > FYI, on omaps, the PRCM hardware saves and restores the pinctrl > state so this has not been so far an issue. > > Regards, > > Tony > > -- Florian