Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp5168010pxb; Tue, 5 Oct 2021 19:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRN+FLOv+eCRsbleIlurzh25E8ZFgLD6rCTdwioJ/zTJfYuilkkSrERhOtxj/NFSDwJdYp X-Received: by 2002:a17:90b:1885:: with SMTP id mn5mr8000803pjb.75.1633488158926; Tue, 05 Oct 2021 19:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633488158; cv=none; d=google.com; s=arc-20160816; b=zrM+QfZrLag+nMxQU6xCSff9zOXnsyOICkNzOdb1J7a6hcTqhMJCoxfQlWX7OuQ267 qsCXeXvW8RLqNQu4BEG0p6JlEe13zqMJA7qEdBi8FnO1pLAAkAM7gD2yV4zm7yII9YKb RQnGqwhHU6JkEtqAdAHznG3YNZ1g5rurDmUpsvIhm2+arCdAGobGjRztdh5DDYhwwfXe eHVySJbyESy13INNHGheWkQQoGoqY4hOlmHnfXlx25AoeMGQcpOBW2qJC7wzeAMZan10 ukSieQSVXtON0lgiNCENNYVtxobf1A2aLGhr3ScFMN5Cj18HJXK7DvwkI+kzZtN2AO9t 6JJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=jBjl2SKIDUWdGGNNCdNQzm0sXvagxduES6I98oCU5Y8=; b=KWmRZi0MH9nt2PX75GN99sBk1KnKZYdvCD9no7mlEbY0L6f4iv9jNpnliLlPttQDrU HojlwN8S7A/uidmvbeWruvSJhmNAvw+DUV9de+RE2XnWVoTg1m57pZVTOnLy1IxJzz/5 9H+6lIy1+5T5XdflB7F6Gw5q6gYchdmCZ2noZqx7eztq12CO+5IHTgfYwB3I2gmLuoKD gBn9AmCknCKx3a+uFFEgY/5uu8RnHk6zTDL/7V5W2kelwfN2OLozbhs+vsdkUyaDv/ZP 5b6UXKPWJduR/FAQhDQjw1ufhUAzEeRx16ewM3NBADHwR5qDRGRhIYXBGJ2TsUqNr+pI gRFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=chv8eTFs; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m126si24706463pfb.100.2021.10.05.19.42.09; Tue, 05 Oct 2021 19:42:38 -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=@gmail.com header.s=20210112 header.b=chv8eTFs; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237201AbhJFCl6 (ORCPT + 99 others); Tue, 5 Oct 2021 22:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbhJFCl5 (ORCPT ); Tue, 5 Oct 2021 22:41:57 -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 41FB3C061749; Tue, 5 Oct 2021 19:40:06 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id t9so4046677lfd.1; Tue, 05 Oct 2021 19:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jBjl2SKIDUWdGGNNCdNQzm0sXvagxduES6I98oCU5Y8=; b=chv8eTFsLZvhIeL+hkzvYI0WTv6C1hQt4IbTe+2xmGQkTHoN3MvZ0Jtjaf5nJ60yH8 Qll610va/L7nfzXyHi9q5H18Ow+SshG+eVNj+gSdDfOq3y7RXIcXU17IFSrdKUsqMGDl Bns94mjB430lIX1L+jpyb63pJy7SuBLUq2Zz5gUmkoa+ld9TdVOzDhd/itLWhWEQUYh6 w/ij/t35/Agn1d9bEjw9KP0FJwCJbX0TIcoQQ9rohRXEEbOoZw69in/qeyGnWiJ4R/RF +DxmiKiv3q4SpB4Czd0/XkoQ7itREY7Ra4KeHWPZGr13fZLG2O0bWXrsMD3HPPH5buvd Yn0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jBjl2SKIDUWdGGNNCdNQzm0sXvagxduES6I98oCU5Y8=; b=4WZuTi/aFT8t0rIWmsNGXbNserSJoChOakY8uTfD8c8w09DW6C1uX9c7zH0O4LT5h6 h80Q8hc8S6aBiPGZ+lhWX14WVOyTvrZfEVeaeTUoJ5/KJf0D6u3FsSatLSMjFGJpICso FBFho8zQsDwUsH/9b9QpmvquzW5dZwDdIZCtuYi69Inkm5G4s+XXQzEIpPPNMnrinYkq gpzl+UNoK4YmYwNmPlylIWBxCk/1GRUFWfnECkvCbk9O6EPAV8Nh/HNqv5txVl/oWMF+ Yj6wzFjpXEIbULx1tjyJ6VEw1oftLzUZ+Uni2NVOpXDzjd7MC8+yakgjPWBuOHATu0zq Tv7Q== X-Gm-Message-State: AOAM5332YZQX7BPuAOuuaHrL9W/Gy61+C/YFzKU72Q1m4YAMBi8dnrdg mOS2Q8XKGdkNNoZJBEjbiXo= X-Received: by 2002:a2e:91d4:: with SMTP id u20mr25686467ljg.81.1633488004426; Tue, 05 Oct 2021 19:40:04 -0700 (PDT) Received: from [192.168.2.145] (79-139-163-57.dynamic.spd-mgts.ru. [79.139.163.57]) by smtp.googlemail.com with ESMTPSA id o19sm2137695lfg.68.2021.10.05.19.40.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 19:40:03 -0700 (PDT) Subject: Re: [PATCH v13 06/35] clk: tegra: Support runtime PM and power domain From: Dmitry Osipenko To: Ulf Hansson Cc: Thierry Reding , Jonathan Hunter , Viresh Kumar , Stephen Boyd , Peter De Schrijver , Mikko Perttunen , Peter Chen , Lee Jones , =?UTF-8?Q?Uwe_Kleine-K=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 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> Message-ID: <8597d539-311b-4f04-481c-b48e6a5a882a@gmail.com> Date: Wed, 6 Oct 2021 05:40:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <74a47158-e2e4-5fd0-3f37-0b50d4ead4d9@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 06.10.2021 01:43, Dmitry Osipenko пишет: > 06.10.2021 01:19, Dmitry Osipenko пишет: > ... >> 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. > > [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. > Just in case, I checked that the suspension order isn't somehow the source of the problem by adding links to device tree in order to always suspend clocks after the rest of devices and still GENPD gets -EACCESS from clk_pm_runtime_get(). RPM is disabled by dpm_suspend_late(), which is invoked before dpm_suspend_noirq() [1]. Hence RPM is unavailable in NOIRQ phase in any case. [1] https://elixir.bootlin.com/linux/v5.15-rc4/source/kernel/power/suspend.c#L399