Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp823480rdb; Thu, 30 Nov 2023 22:09:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8Ga3lUQ7ddth+8VXl0eF/ZueLkIZH0Oto0GxTE9R2sg355UeUUV9BxMU2U6mpYDyXGpPi X-Received: by 2002:a17:90b:3846:b0:285:6d72:fd7 with SMTP id nl6-20020a17090b384600b002856d720fd7mr26271877pjb.26.1701410942311; Thu, 30 Nov 2023 22:09:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701410942; cv=none; d=google.com; s=arc-20160816; b=ZAjG26Bwo8e2rAu4m6h3yE/9YdGMbvMI+GnAcvv2l1S34qvjdGiAUrNkuts5DxcmPz 0k86SSeSib9hBTRvFHC4oroP5QOFR2wJtUMDYvkyRweMmsYwf37DRnRnz5yTVimlvxBX wHwlQ+OA+ABXSI1HSQ97loC751jAA8WZrg9pMrN+ydzpgZmFyDLgTp14cbBEuRoY3kgt wsFq3OM7Xers89kLf+rGtAiDOfC+Fh2khCB1uTfddNRvqQe5yqMjct7i+0LqLgd1Tszo thXNJg6Jal+TWpN1eRwtBeniGVd1Lzd5d6V3alQgm5xMCfxISCO3QW5DVaL/Tx2sirG+ z1Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VLKk6oTrF6fAB77fJv+EXNaWWOWxqJcPWfPyun45kVU=; fh=+64VB62ki0/wzI0M2pDc+uL0XgiHHZdTGEs0RdSUOfE=; b=GPjs8qrkYhXOSFKA1Sss+0Lv0By0vs2UTGO4pygbmAj0PLptHoaxftff4E3oocm9bD 5za5VU8Ca9GD6JcDALF8U9+O62IkikWThrih/p3Fy419R/EjmV4AWOJMxQSdjr94gLLg s8XBFyE2oPxt3RLyi6Ao2leqxuk27N61Q5ZLFcbFqx4UKz84bpWkZMzDmzuPYY5m7jFv 7B2/TLAwCv6fzzq2GtUak4XVsu/IVhcOvLW1I9JH6278IhtRPkp/uGzhJgWC6SdFs1u+ a6DyeP1tsMYhWHa8MwaDPKEX0TaxFkNoClueR/HRI0MH3biK7KpQV5op2m+rYanwWZTE UEEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="hw3a/Iiu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id px17-20020a17090b271100b002774d978e19si2859153pjb.175.2023.11.30.22.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 22:09:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="hw3a/Iiu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9C5588317573; Thu, 30 Nov 2023 22:08:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377402AbjLAGIp (ORCPT + 99 others); Fri, 1 Dec 2023 01:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjLAGIo (ORCPT ); Fri, 1 Dec 2023 01:08:44 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4D01711 for ; Thu, 30 Nov 2023 22:08:50 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a18f732dc83so217446266b.1 for ; Thu, 30 Nov 2023 22:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701410929; x=1702015729; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VLKk6oTrF6fAB77fJv+EXNaWWOWxqJcPWfPyun45kVU=; b=hw3a/IiuNAnC+jktLUMQwxMJJxSsuhtheUQy/QDLOtazclZckiUTw+X2XAr1zNv8Vz +PwbJ+MZGlWvjF3KJCVA/pL9fF97vLJX3ZbCNxFT1IrjrKcSIBN+1VUvbxI2+j/FFI9e y7HGsjc/Rv8YcPEeOfKY5S7RrEt7KT5JJQZ4wXDfOGWCuKkt56aJ861wxNgKsjMGjw8U MhNIA5v70TMLViCmFKoId+Exmp5FyIosp2jIeCBf/VlLzV0gJKUCG7vOx8mihueVVGqr Q2g+Y+/VJ53geb3c1dJBuUas63dqCzDi2j2/QFTlA1azWEIE/cH4j2Kv7rjmGrupvfaL 40Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701410929; x=1702015729; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VLKk6oTrF6fAB77fJv+EXNaWWOWxqJcPWfPyun45kVU=; b=bqbTuaasSnI0Z7/EgQ53Tx40+/ZD2/OCIbLSiOTwgDDKALE5RnuOtTFCxvOcKhO0xg NM/zfyY3JugScnxwjl1vkfSJI3N6i5ag0TF7I81gWWc0RmSmwX8DAP2NbsF6Bt1VM+Wt AxXqaO1omgKsCqnc+0jckpx4iv/piTCFOFHjOV/63Dz3EqOg0RZCn17QzB3E6/Eag0X4 MRhagoFv/9U4kClo2JfqUMN6u9Sq2g7w+h2wwH4RUvpwQlEefRHV4DJwqBDcKFd9SanQ i1bxRSV8R4+sOpeLVgnmxVLglLH103L+e3Q0qqJqRe71Q2rJTGfZ0kVAYhYdggKrrfPj zKrA== X-Gm-Message-State: AOJu0YzTD9gdAM5nPSCLJrEBsKGmkNr7EUuyxVhGStOrMQPYpPq1+OhB wfnn1E0AY6P0JHDCV3iiatgkOhz64HaYC6zi6VMCeA== X-Received: by 2002:a17:906:738f:b0:a18:5ec7:b8af with SMTP id f15-20020a170906738f00b00a185ec7b8afmr702085ejl.29.1701410928802; Thu, 30 Nov 2023 22:08:48 -0800 (PST) MIME-Version: 1.0 References: <20231110102054.1393570-1-joychakr@google.com> In-Reply-To: From: Joy Chakraborty Date: Fri, 1 Dec 2023 11:38:36 +0530 Message-ID: Subject: Re: [RFC PATCH] PM: runtime: Apply pinctrl settings if defined To: Linus Walleij Cc: andy.shevchenko@gmail.com, Greg Kroah-Hartman , "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, manugautam@google.com, aniketmaurya@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 22:08:58 -0800 (PST) On Fri, Nov 17, 2023 at 1:30=E2=80=AFAM Linus Walleij wrote: > > On Thu, Nov 16, 2023 at 4:34=E2=80=AFPM Joy Chakraborty wrote: > > > I tried to place the calls to set the pinctrl states after driver/user > > callback based on my understanding of runtime code so that existing > > users do get a chance to set the state with any special sequence that > > needs to be performed post which doing another call to set the state > > would be ignored in the pinctrl framework. > > This makes sense. (And also is in the original commit.) > > I think you should actually over-document this by also mentioning > this in the kerneldoc above each of the *_try_* callbacks so > users simply can't miss this point. > > > But this only would be possible with the assumption that even in any > > special sequences executed by users they set nothing but "default" > > state in runtime_resume, "idle" state in runtime_idle and "'sleep" > > state in their runtime suspend callbacks. > > And like Andy mentions about "->prepare callback", if there are > > drivers that are setting pinctrl state "default", "sleep" or "idle" > > from any callback but > > ... > > int (*runtime_suspend)(struct device *dev); > > int (*runtime_resume)(struct device *dev); > > int (*runtime_idle)(struct device *dev); > > ... > > it could indeed be a problem. > > I'll dig into users of pinctrl_select_sleep/default/idle and see if > > there are such cases or if it could be done in some other way. > > It's worth a check but I doubt much will turn up. The "idle" and > "sleep" states are simply not used much in the kernel. > Right, I will look into this. > Your users will likely be the first. > > So which hardware target will use this? > It's immensely useful to have a good example to point at: > that device use "defaul", "sleep", "idle" the idiomatic way. I see some upstreaming activity on gs101 SOC. I think gs101 and follow on SOCs could use this, I will find that out and get back. > > Yours, > Linus Walleij Thanks a lot for your feedback Joy Joy