Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38D772C89 for ; Tue, 5 Oct 2021 17:16:15 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id i4so90144692lfv.4 for ; Tue, 05 Oct 2021 10:16:15 -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=U6rjqsBNYobE1ctvTm0xhqOhQ8Wd15fgfe8ZAwtlfu9jeEL5+nF5ANc2ZerQiTeZ06 DHaOIUyvvWWwr2MidCYbq/wq44/aTi5Ae80M2LOLozyyBGXYbPTdR02DNG6EphyK387P GstxPx5OQEa4Eh+/p/omAoO9zNHFip4j7wujbeVhh3YP2NyzbrzNLiCvk+1hFO9Q/v+O u2F0R/2SD336kbafs+8G0syH6fYov4eakJyoB1phj9ACrIqjOyG2up3sAEYA8rjlnfPN dNS3HWEWpQUsH4rJR73bzFsFy8NJAerrdfFjc0j4D1YcWJMinr2JCBQG06bgxaEqo/CJ cWMA== X-Gm-Message-State: AOAM531s9BRELvrSws6ORV8ipJDY/5M5FtfPf/lJvKNUkpD2v7FQ+hOU mhps+3a2biXVKz4tu4pu2RA= X-Google-Smtp-Source: ABdhPJzFxn+EEvAfXINlDGqbDWfWJzkpl0QRwm+Z1jKxlyPCyoz5MyhKfZrnAr2zjaXtazuDCKJIlw== 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 Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit ... >> 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.