From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753053AbdCAScD (ORCPT ); Wed, 1 Mar 2017 13:32:03 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36808 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdCAScB (ORCPT ); Wed, 1 Mar 2017 13:32:01 -0500 Subject: Re: [PATCH fixes v2] pinctrl: Really force states during suspend/resume To: linux-kernel@vger.kernel.org, Linus Walleij References: <20170227230634.10688-1-f.fainelli@gmail.com> Cc: swarren@nvidia.com, andy.shevchenko@gmail.com, alcooperx@gmail.com, "open list:PIN CONTROL SUBSYSTEM" From: Florian Fainelli Message-ID: <9f02caa1-638a-cb72-c87f-69e4282ae67d@gmail.com> Date: Wed, 1 Mar 2017 10:29:00 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170227230634.10688-1-f.fainelli@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/27/2017 03:06 PM, Florian Fainelli wrote: > In case a platform only defaults a "default" set of pins, but not a > "sleep" set of pins, and this particular platform suspends and resumes > in a way that the pin states are not preserved by the hardware, when we > resume, we would call pinctrl_single_resume() -> pinctrl_force_default() > -> pinctrl_select_state() and the first thing we do is check that the > pins state is the same as before, and do nothing. > > In order to fix this, decouple pinctrl_select_state and make it become > pinctrl_commit_state(), taking an additional ignore_state_check boolean > which allows us to bypass the state check during suspend/resume, since > we really want to re-apply the previous pin states in these case. > > Fixes: 6e5e959dde0d ("pinctrl: API changes to support multiple states per device") > Signed-off-by: Florian Fainelli Linus, I have a better version of this coming where the p->state == state check is just moved into pinctrl_select_state() instead. -- Florian