Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp318502pxb; Wed, 6 Oct 2021 05:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtTs5N8fWxuytePpgwho4ttgWhb9D21IZIYwerJLrRnkVf0UtilxoqlpO0nQgVzxiPcLtL X-Received: by 2002:a62:d11e:0:b0:446:d705:7175 with SMTP id z30-20020a62d11e000000b00446d7057175mr36767879pfg.74.1633524385918; Wed, 06 Oct 2021 05:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633524385; cv=none; d=google.com; s=arc-20160816; b=hXiT0A1FB6N0DfTUevpLJf55HLpKuB0d4TfBU+kMA/55PhLzYalLaIYGFoN/l7tGpL ml4ZnlDdy4gmBBDKZ6DIeQKyiWqFl1tdhKzWvTcTg5shXhFV0tF90TvC1zl06IG0HOLO PotIy4fXH9QOELgld52I9ptF6Up7Ft/KaAY6t34hgw7FDA4y6E+H2GXxYobFOjuMa2Dt VdvPzkh7crjc18uU4bgeTWxbTcsNkmsgB4XQ0o5jsB4X0iesBKYnugs+w7b0nu1w8kE1 RIAYCLU0/UWN6++zAbfTZCdRDNHfjjGup4/jKQ77uzkasbjDtuVD3XsDCZ82V6QtDuZw UZgQ== 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=ZKqaWxUs3sgD4tdQBsKfjQHFZ50A1AY57zWO3HzEaz0=; b=WQAn1EewQ/Br++e/FbviiP/BFl1/AHdpuGZQTJJZiIVmPgMLnP/XNic7182HCyoUji ka0uOTSGtBt/lr4bDxx0JKvZDOv6k9K1h+VpR0zEG3/bEDw+xivwiIDeP7ATjq8UnvBP pqbXHC59a9907fxGAxa+mLRXRlV/Bnwlrhn08laK7GJC3mDQNgbsZ69zO8Zc5kAc2hCF Cj1VmJuBKhvARHYiSaPYH+Gk5IHfk5Zgq26caMIU1tx8LLLbWdkYmvJDfR7xS8Q8szNW zNL26OBUU9gL0ToT/9NNEoKW5e4SP1xXB2HVnWmKZSRiSIR/ibTmqYjuMfdmXN0XGSwm uVOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p7O7r3g8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f187si7376322pfg.87.2021.10.06.05.46.06; Wed, 06 Oct 2021 05:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p7O7r3g8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238458AbhJFMqO (ORCPT + 99 others); Wed, 6 Oct 2021 08:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238471AbhJFMqM (ORCPT ); Wed, 6 Oct 2021 08:46:12 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFCD8C061762 for ; Wed, 6 Oct 2021 05:44:19 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id y15so9906812lfk.7 for ; Wed, 06 Oct 2021 05:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZKqaWxUs3sgD4tdQBsKfjQHFZ50A1AY57zWO3HzEaz0=; b=p7O7r3g85OL9vVkRCa3Pfl3C5X1Jfj9eXjPMKWVLsEhkWogxYEcClklxYGVWQq8A2P lEHLpYxRHgQW4uXVDoPHoUArsfuteRAt1b6CIA3FJ+EjNOe5zUT+AAgMFYGSzljSZ6TO KoFs69gM6EHycwixuzD1lK9+dV8Me5UuqmZ9rtY57gAwYRrE057gkoCf0Uoi9LCBgyR9 7atsGho2QXhE+dDu8BmXr5Ur/SWTeiQD4sTYuNaaOKKOVXapsZOBOVO1z6VNsE4WUUbL lGzoNXh0xJAquXu3k8a0vYJYpOb6yc9cyGw4+SDPKUnM/cHV804+EyEdWXyu6r4B41NO 0G0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZKqaWxUs3sgD4tdQBsKfjQHFZ50A1AY57zWO3HzEaz0=; b=P3FTcPpIGubyeMfBudn8kdWcvD+h8dMw4Ek7Q7FBXmHeqX1gnyc/zXSygy/2b5Ks8i wW67fHaK2daCfEOM3KFOiJontlQ/iOEq2diU3kB7sZFs5IK9bajhKpYvrt/srbtoOIJr u1sqaokQ+65EXMSsBmHYvfkJPKxZEmPuvkrCJaeUj/iciRbIEG2iP9Wb1RfIC2kqLrbF nn7wjw9QeBDjTD/uCvXiKN1Qw7tbq5HUZw24EwW9SOwjXSe6RpRDYDWdbmAOWJW1KABF EgWb8kVAaj5OclfvBJ/mRN4B6Hob+d4eQ7KZUMUKvOdm7/Y9vYwbUXHnrMNmdzsOM/3j Vikw== X-Gm-Message-State: AOAM532XoRDhHsqC9kvLUU9ywHg+zTTuoW+70B4i5DFRs//Jv0UyGan+ OvT0hpz/00km9dwl+y17eC4SpUdS4ixEShyLE0pWcw== X-Received: by 2002:ac2:4157:: with SMTP id c23mr9458293lfi.184.1633524257867; Wed, 06 Oct 2021 05:44:17 -0700 (PDT) MIME-Version: 1.0 References: <20210926224058.1252-1-digetx@gmail.com> <20210926224058.1252-7-digetx@gmail.com> <24101cd6-d3f5-1e74-db39-145ecd30418b@gmail.com> <4bdba8a2-4b9b-ed7d-e6ca-9218d8200a85@gmail.com> <74a47158-e2e4-5fd0-3f37-0b50d4ead4d9@gmail.com> In-Reply-To: <74a47158-e2e4-5fd0-3f37-0b50d4ead4d9@gmail.com> From: Ulf Hansson Date: Wed, 6 Oct 2021 14:43:41 +0200 Message-ID: Subject: Re: [PATCH v13 06/35] clk: tegra: Support runtime PM and power domain To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Viresh Kumar , Stephen Boyd , Peter De Schrijver , Mikko Perttunen , Peter Chen , Lee Jones , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Nishanth Menon , Adrian Hunter , Michael Turquette , Linux Kernel Mailing List , linux-tegra , Linux PM , Linux USB List , linux-staging@lists.linux.dev, linux-pwm@vger.kernel.org, linux-mmc , dri-devel , DTML , linux-clk , Mark Brown , Vignesh Raghavendra , Richard Weinberger , Miquel Raynal , Lucas Stach , Stefan Agner , Mauro Carvalho Chehab , David Heidelberg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Oct 2021 at 00:43, Dmitry Osipenko wrote: > > 06.10.2021 01:19, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > ... > > I reproduced the OFF problem by removing the clk prepare/unprepare from > > the suspend/resume of the clk driver and making some extra changes to > > clock tree topology and etc to trigger the problem on Nexus 7. > > > > tegra-pmc 7000e400.pmc: failed to turn off PM domain heg: -13 > > > > It happens from genpd_suspend_noirq() -> tegra_genpd_power_off() -> clk > > -> GENPD -> I2C -> runtime-pm. > > > > -13 is EACCES, it comes from the runtime PM of I2C device. RPM is > > prohibited/disabled during late (NOIRQ) suspend by the drivers core. > > My bad, I double-checked and it's not I2C RPM that is failing now, but > the clock's RPM [1], which is also unavailable during NOIRQ. Yes, that sounds reasonable. You would then need a similar patch for the tegra clock driver as I suggested for tegra I2C driver. That should solve the problem, I think. > > [1] > https://elixir.free-electrons.com/linux/v5.15-rc4/source/drivers/clk/clk.= c#L116 > > Previously it was I2C RPM that was failing in a similar way, but code > changed a tad since that time. Alright. In any case, as long as the devices gets suspended in the correct order, I think it should be fine to cook a patch along the lines of what I suggest for the I2C driver as well. It should work, I think. Although, maybe you want to avoid runtime resuming the I2C device, unless it's the device belonging to the PMIC interface, if there is a way to distinguish that for the driver. Kind regards Uffe