Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4788372pxb; Tue, 5 Oct 2021 10:18:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC5pToaLZiiBIxcWnPZlGCGySzweerhn9kVK8EDI48zy/+rGxnJ6kKXK47nbjbc7+yHmSK X-Received: by 2002:a17:906:d975:: with SMTP id rp21mr10072616ejb.104.1633454306915; Tue, 05 Oct 2021 10:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633454306; cv=none; d=google.com; s=arc-20160816; b=ADthaK3TgufOKvqQizLqKJgO+o7upTlChK23UtIfw8xAv7knle16FBOeOtxkkIc8CC f16LXvmXrOMQW53LqEVHaBk4oTgMmiBQhCEvt3zwDVexxKIJTaSJpqIlkZc9QMP0vJL+ 7BW/fcOnrxHtmzOVOZ5lbr4GV6tzCrwcshWSOk8Nyb8ePTebRqrJU8iO8F33qR5QJlZm KqbyrAJvY4QLS9rNnJDhO2oUHwL+H3gRIg6on1kMAQdCbU7fyQEyjJP/1xmBJDon9aIw CayuJZkOxqdb5YEGE/QsmsysK2LN9XyWcV12Zm8i7XOE8iFb+fqMCr8DxQl9o0iouX8v FxAw== 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:from:references :cc:to:subject:dkim-signature; bh=v4VMlYai/5OJD6I0jXVUBp7T7QQDEKF1EDfzlyrXPNg=; b=ayswQVKdLCmNsjJiERRlBagSiagN/h2YM5UEz3nCpOYg23k3QRjJLn+P1E54PM5dq5 6osOMVYXUJT4iW6o7XOi6gtcsUaNwCkjkO/eVCLFLgyjbv13i+wdbQak7TGBzJKT8ps4 jNNmzbNI9CZRZ8xiUFrtl8Ok94f+iPkBzVVVjEtrxNL7p7hrwnb3bh2JV6NTu8fadxk3 Q3ilgZSehMbRED0Cltz22oX9DZc8yd1kF0tYmdvaiKiPFDtan2lkG2P6Q3odJ07fpw+I rz3ktP4TXYY3/12B0g7wrpb+I0uBK79ohcYI5LLWP3+U2XnVpdoUndnsfH2wOZ0FN2wZ FPog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=W2HYfURk; 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 b12si15403787edx.412.2021.10.05.10.18.02; Tue, 05 Oct 2021 10:18:26 -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=W2HYfURk; 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 S235954AbhJERSI (ORCPT + 99 others); Tue, 5 Oct 2021 13:18:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236636AbhJERSF (ORCPT ); Tue, 5 Oct 2021 13:18:05 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D97E5C061749; Tue, 5 Oct 2021 10:16:14 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id u18so89541742lfd.12; Tue, 05 Oct 2021 10:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=v4VMlYai/5OJD6I0jXVUBp7T7QQDEKF1EDfzlyrXPNg=; b=W2HYfURkJzDMqxvMvdLnaSxyL8uT7r1csfbSZPSbXORQw+cwWFtMynJRUEG4LiQrHQ y3v5acYIRN1Eb0FbSRLCSIRtUZRGATp/wXu0GpAF7MIKkyEe30yYqs44aRZ5hx7PQUf8 KTIq6kvEdh07WxUJ9lahyZFbc91AomDi579Y3/gpCjlzb6mopUwQ7ho2PCW0cuccDWMY /i99LFk5tTWbSOuutGf0fRJHd37tPZRn46J6NSoa+sUFqOvBAVR+EQT9iPI/71vRNDUs E1DUIcTLGVE0YH8x38A9SKJivF5TQbdR1jagf785PZye81GIeWabHB+XUJ5q/1UXW+WG AQEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=v4VMlYai/5OJD6I0jXVUBp7T7QQDEKF1EDfzlyrXPNg=; b=DuF4QpkjwFbd4dwlYAhig4rmQJm8ielyZnZ9Ys+SAdiAecq64Ir6wFBUuPbV4j1M+n l8WZxK7bHDsWhMoefwJ8ThuVZM6f2HxW6SJP+kANUWoH6YuK7xvfuAofdrEp+uPjbDQt e2JlK9dJNKr5t7emnh1CplDlaTY+g0h+lGvquMTkLSNTGGSaona6zhrrvCtDWTpQeoF8 QNlx7oJuIC2y+Kr52lLRm+BSzcT2/n3hzqhc/wxoPLMLqcZ4IiNofE3rn4A0ThxHZhb+ hwVsNNjbCj25/cAMYZBmkAeSgI+512ATeaK867OLdlENIY7XmKIqAT9NIGCr+lslVwWu 6dlQ== X-Gm-Message-State: AOAM530Y30SpHEqmWsHTtTGfeSHetiuNcwwgRNU1PxSomh39kkYnrjs/ 4rL44LG/rgUyZvo76ZOMgsQ= X-Received: by 2002:a05:6512:10d0:: with SMTP id k16mr4573650lfg.530.1633454173285; Tue, 05 Oct 2021 10:16:13 -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 o12sm2013505lft.254.2021.10.05.10.16.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 10:16:12 -0700 (PDT) Subject: Re: [PATCH v13 13/35] drm/tegra: gr2d: Support generic power domain and runtime PM To: Ulf Hansson Cc: "Rafael J. Wysocki" , 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-14-digetx@gmail.com> <8d75436d-864a-7ce0-ba53-daa8b663035a@gmail.com> From: Dmitry Osipenko Message-ID: <65f5ea6a-5d04-57cc-f4e4-bf29f22af7f0@gmail.com> Date: Tue, 5 Oct 2021 20:16:11 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ... >> It's not a problem to change this patchset. The problem is that if >> you'll grep mainline for 'pm_runtime_disable', you will find that there >> are a lot of drivers in a potential trouble. > > Let's start by fixing this patchset, please - then we can consider > what to do with the other cases separately. Yeah, should be better to discuss it separately. ... >> void __pm_runtime_disable(struct device *dev, bool check_resume) >> { >> + flush_work(&dev->power.work); >> + > > What about the latency this may introduce? I am not sure that is > acceptable here!? I'm not aware about any code which relies on the original 'cancelling' behaviour, perhaps Rafael should have more insight. ... >> The sysfs rpm-forbid is a separate problem and it's less troublesome >> since it requires root privileges. It's also not something that >> userspace touches casually. For now I don't know what could be done >> about it. > > As I said, the common method to address this problem is to run the > following sequence: > > pm_runtime_get_sync() > "power off the device" > pm_runtime_disable() > pm_runtime_put_noidle() > > This works even if user space, via sysfs, has triggered a call to > pm_runtime_forbid(). Or doesn't it? > > If you don't like it, pm_runtime_force_suspend() should work too, at > least for your cases, I believe. I'll update the patches, thank you.