Received: by 10.192.165.156 with SMTP id m28csp2396620imm; Thu, 12 Apr 2018 13:38:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx490mpX8lSNV0W1p+8V+xG7Ka1426cFhb/bCqOWORL7wgyz2/Phbi0I+3CkJ2G+qlO9qqM2A X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr2515852plo.73.1523565494128; Thu, 12 Apr 2018 13:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523565494; cv=none; d=google.com; s=arc-20160816; b=JkMClwY4woqk/ezWtizMc0HbjZOgG27ohq4s4hgAAxJjYkVo/Snj16YurXQ1MBaafX cAp0r0wfeixVy6y87iudifanHw/kLSxKtWwmf+ouGhXT3jTwX3WaotVYnLbMxkOdKfFO 61N0aqtgwd1rt7NK2dFAiTP9tzp6jnfQRBoQ3ezS6OFnQcW2bEPHJI+bJ/SIxkLx8/G8 pa5r91k20BsBfwxkyZ88o0CbhI7CHWIAaJmwYvws8pcy0rzdjiIbpB0bgeTz/KzDhvzV +C81GVdB3WrpQAjqPWVCbeYFpPHCoH/UUgRDryjW7aBNQLtriZs5rRxn3eUfnCkLZ9fY xyFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=My3i2KYDePyYkcwy8gsQLJ54B3ngUF4jdhTrHp1j7dE=; b=YCVFU54GJG53cyjKHX701qPaIqFQOdYZgPUEJkgSSb+0wGY8iVhxmBlYFE7AmeXGmp pNBfdA2gI0DJeSdQRS/j4FLxR5TvYx5lS0RlrOO8erfdnrijMWVehYyCdTWoEZPqOY1J SHs2AYl1utX+oeo+0/whi0LGGPskd/5URJkTN9WE+sZuW5MM5vmi1Lfe8SkWI5HAtFfX YlohD4OWsR0wvvLBRZ1TYUlmTkNq+afSwraRcEE4Nxv/XYZjxxLCTn1jYlhKDKdf8vUC tcGcRdFurNLsuOWnMEj72exUnNIBQAUo7/NfJKUknthkgWQi8P6KCAcW4gulLCdQ1jw7 2pyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pr2xwjsf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14si2787564pgs.190.2018.04.12.13.38.00; Thu, 12 Apr 2018 13:38:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pr2xwjsf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751775AbeDLUK4 (ORCPT + 99 others); Thu, 12 Apr 2018 16:10:56 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:43977 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbeDLUKz (ORCPT ); Thu, 12 Apr 2018 16:10:55 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3CKAYZP000600; Thu, 12 Apr 2018 15:10:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523563834; bh=37o7V2l6T7t1ia4Y8AD50ega+21dLBijP0V9aMSzEyY=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=pr2xwjsfXJNflI9dUQkAH99zjM63Plnf11kKbc0SgZypKdeOkmQKynyPoHuBFuPnE 1A7f/IPEetSzb6bRQtfBp5HeepvZCZpsVZbGHU9XhOR+7pYVaWDUvY9l6D2z6BgDqK GojnNtrKE62CR+0edUsqNA+UI4KN5eN7YuCgdOx4= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3CKAYZ0015863; Thu, 12 Apr 2018 15:10:34 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 12 Apr 2018 15:10:34 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 12 Apr 2018 15:10:34 -0500 Received: from [128.247.59.147] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3CKAYMZ015169; Thu, 12 Apr 2018 15:10:34 -0500 Subject: Re: [PATCH 10/14] gpio: omap: Drop the concept of gpio banks not being able to lose context. To: Tony Lindgren , Keerthy CC: , , , , , , , , References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> <1523505239-16229-11-git-send-email-j-keerthy@ti.com> <20180412142257.GW5700@atomide.com> From: Grygorii Strashko Message-ID: <3b01e345-6939-f28c-c648-7316d0a410c4@ti.com> Date: Thu, 12 Apr 2018 15:10:34 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180412142257.GW5700@atomide.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/2018 09:22 AM, Tony Lindgren wrote: > * Keerthy [180412 03:56]: >> From: Russ Dill >> --- a/drivers/gpio/gpio-omap.c >> +++ b/drivers/gpio/gpio-omap.c >> @@ -68,7 +68,7 @@ struct gpio_bank { >> bool dbck_enabled; >> bool is_mpuio; >> bool dbck_flag; >> - bool loses_context; >> + >> bool context_valid; >> int stride; >> u32 width; > > For some SoCs GPIO bank1 won't lose the context ever. So I'd like to > keep loses_context flag around to avoid pointless save and restore. > But maybe this still happens with get_context_loss_count and I'm > misreading this patch? > Agree with Tony here. More over, even if platform supports RTC suspend (gpio1 context loss) it might support suspend to RAM - gpio1 will not lose context. Not sure how to handle this correctly now - always-on gpio bank should not be touched by omap device framework during suspend otherwise it may hit "in transition" state forever. From another side it must be handled the same way as other gpio banks in case of RTC suspend. Q: How to know if current suspend is RTC suspend and not regular suspend to mem? > However.. > >> @@ -1198,15 +1198,9 @@ static int omap_gpio_probe(struct platform_device *pdev) >> #ifdef CONFIG_OF_GPIO >> bank->chip.of_node = of_node_get(node); >> #endif >> - if (node) { >> - if (!of_property_read_bool(node, "ti,gpio-always-on")) >> - bank->loses_context = true; >> - } else { >> - bank->loses_context = pdata->loses_context; >> - >> - if (bank->loses_context) >> - bank->get_context_loss_count = >> - pdata->get_context_loss_count; >> + if (!node) { >> + bank->get_context_loss_count = >> + pdata->get_context_loss_count; >> } >> >> if (bank->regs->set_dataout && bank->regs->clr_dataout) > > .. I do have a patch ready here that I'll post after -rc1 to remove > CONFIG_OMAP_PM_NOOP related stuff, turns out that's noop anyways :) > > So yeah the pdata->get_context_loss_count parts are noop and can > be just removed. > -- regards, -grygorii