From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61BEBC4332F for ; Wed, 6 Oct 2021 12:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43C4161139 for ; Wed, 6 Oct 2021 12:44:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238541AbhJFMqO (ORCPT ); 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-Google-Smtp-Source: ABdhPJyXxeHpfLtxmaaabzboN40a7mbS25hsa4pgTQ9RD1C7UcaYr5BpIOQmIiI1EQ4OQX0iO/sLUK+eeOQGXFL/ZtE= 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