From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Wunner Subject: Re: [Nouveau] [PATCH 1/5] drm/nouveau: Prevent RPM callback recursion in suspend/resume paths Date: Wed, 18 Jul 2018 10:36:01 +0200 Message-ID: <20180718083601.GC16072@wunner.de> References: <20180716235936.11268-1-lyude@redhat.com> <20180716235936.11268-2-lyude@redhat.com> <20180717071641.GA5411@wunner.de> <20180717182041.GA18363@wunner.de> <20180718082505.GB16072@wunner.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <20180718082505.GB16072@wunner.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: "Rafael J. Wysocki" Cc: Linux PM , David Airlie , nouveau@lists.freedesktop.org, Linux Kernel Mailing List , dri-devel , Ben Skeggs List-Id: linux-pm@vger.kernel.org T24gV2VkLCBKdWwgMTgsIDIwMTggYXQgMTA6MjU6MDVBTSArMDIwMCwgTHVrYXMgV3VubmVyIHdy b3RlOgo+IFRoZSBHUFUgY29udGFpbnMgYW4gaTJjIHN1YmRldmljZSBmb3IgZWFjaCBjb25uZWN0 b3Igd2l0aCBEREMgbGluZXMuCj4gSSBiZWxpZXZlIHRob3NlIGFyZSBtb2RlbGxlZCBhcyBjaGls ZHJlbiBvZiB0aGUgR1BVJ3MgUENJIGRldmljZSBhcwo+IHRoZXkncmUgYWNjZXNzZWQgdmlhIG1t aW8gb2YgdGhlIFBDSSBkZXZpY2UuCj4gCj4gVGhlIHByb2JsZW0gaGVyZSBpcyB0aGF0IHdoZW4g dGhlIEdQVSdzIFBDSSBkZXZpY2UgcnVudGltZSBzdXNwZW5kcywKPiBpdHMgaTJjIGNoaWxkIGRl dmljZSBuZWVkcyB0byBiZSBydW50aW1lIGFjdGl2ZSB0byBzdXNwZW5kIHRoZSBNU1QKPiB0b3Bv bG9neS4gIENhdGNoLTIyL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0aGF0IHdlIGhhdmUgdGhpcwppbiB0aGUgZG9jdW1lbnRhdGlvbjoKCiAgICA4LiAiTm8t Q2FsbGJhY2siIERldmljZXMKCiAgICBTb21lICJkZXZpY2VzIiBhcmUgb25seSBsb2dpY2FsIHN1 Yi1kZXZpY2VzIG9mIHRoZWlyIHBhcmVudCBhbmQgY2Fubm90IGJlCiAgICBwb3dlci1tYW5hZ2Vk IG9uIHRoZWlyIG93bi4gWy4uLl0KCiAgICBTdWJzeXN0ZW1zIGNhbiB0ZWxsIHRoZSBQTSBjb3Jl IGFib3V0IHRoZXNlIGRldmljZXMgYnkgY2FsbGluZwogICAgcG1fcnVudGltZV9ub19jYWxsYmFj a3MoKS4KClNvIGl0IG1pZ2h0IGFjdHVhbGx5IGJlIHN1ZmZpY2llbnQgdG8ganVzdCBjYWxsIHBt X3J1bnRpbWVfbm9fY2FsbGJhY2tzKCkKZm9yIHRoZSBpMmMgZGV2aWNlcy4uLgoKTHVrYXMKX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVsIG1h aWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlzdHMu ZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== 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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 391B0ECDFB8 for ; Wed, 18 Jul 2018 08:36:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECF852084E for ; Wed, 18 Jul 2018 08:36:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECF852084E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730349AbeGRJMv (ORCPT ); Wed, 18 Jul 2018 05:12:51 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:49803 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbeGRJMv (ORCPT ); Wed, 18 Jul 2018 05:12:51 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 5090E100BE789; Wed, 18 Jul 2018 10:36:02 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id DE36071E27; Wed, 18 Jul 2018 10:36:01 +0200 (CEST) Date: Wed, 18 Jul 2018 10:36:01 +0200 From: Lukas Wunner To: "Rafael J. Wysocki" Cc: Lyude Paul , nouveau@lists.freedesktop.org, David Airlie , Linux Kernel Mailing List , dri-devel , Ben Skeggs , Linux PM Subject: Re: [Nouveau] [PATCH 1/5] drm/nouveau: Prevent RPM callback recursion in suspend/resume paths Message-ID: <20180718083601.GC16072@wunner.de> References: <20180716235936.11268-1-lyude@redhat.com> <20180716235936.11268-2-lyude@redhat.com> <20180717071641.GA5411@wunner.de> <20180717182041.GA18363@wunner.de> <20180718082505.GB16072@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718082505.GB16072@wunner.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 10:25:05AM +0200, Lukas Wunner wrote: > The GPU contains an i2c subdevice for each connector with DDC lines. > I believe those are modelled as children of the GPU's PCI device as > they're accessed via mmio of the PCI device. > > The problem here is that when the GPU's PCI device runtime suspends, > its i2c child device needs to be runtime active to suspend the MST > topology. Catch-22. > > I don't know whether or not it's necessary to suspend the MST topology. > I'm not an expert on DisplayPort MultiStream transport. > > BTW Lyude, in patch 4 and 5 of this series, you're runtime resuming > pad->i2c->subdev.device->dev. Is this the PCI device or is it the i2c > device? I'm always confused by nouveau's structs. In nvkm_i2c_bus_ctor() > I can see that the device you're runtime resuming is the parent of the > i2c_adapter: > > struct nvkm_device *device = pad->i2c->subdev.device; > [...] > bus->i2c.dev.parent = device->dev; > > If the i2c_adapter is a child of the PCI device, it's sufficient > to runtime resume the i2c_adapter, i.e. bus->i2c.dev, and this will > implicitly runtime resume its parent. Actually, having written all this I just remembered that we have this in the documentation: 8. "No-Callback" Devices Some "devices" are only logical sub-devices of their parent and cannot be power-managed on their own. [...] Subsystems can tell the PM core about these devices by calling pm_runtime_no_callbacks(). So it might actually be sufficient to just call pm_runtime_no_callbacks() for the i2c devices... Lukas