Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3722255pxj; Tue, 11 May 2021 10:26:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu4yaeH9/AZf/T4Xnqczk55WKEy0i7HGmhH5QG/G1OTjszfdsIbPIxKfUkldObaXrCxTAd X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr37721077edx.130.1620754017222; Tue, 11 May 2021 10:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620754017; cv=none; d=google.com; s=arc-20160816; b=eqK+X3tcgN2sSETyxA1emd0Y+/CzpNtSSjd7h7HtDNbSwr4hj9txtGOq9QEOJycnxM mxynGpJMF8OfxwT4aJlWfVBXy446b5lKMDkpDGP7KHE/1wAekNq5j/kE2r0KeANTCh2N 9TBfJnfiBYgwtBOjIYVmJ7HtgY8M8qhwpSkty291AdlWxDsW3M1AgpTzl2AHVT/uU9r+ iu5ER5404DcAFR6BBjR+l6FJyz3BVVf0fAC4GXmjixYJ2Jk8mlLkxzxZ0sN4kZ9MHcdl 2X2VLZ53tEfdMGarpBlmIeDAXzXe8myEjTnHgzDvhSEjkFehSHto5KnMgsp4mmi2OAWJ d5/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=NT873CRC73MULIODsKALHoOFZyeiGEpUp1yrXXnTdgQ=; b=zVuPWx0zeOrOi45DOcLrZ99IcfxuuBDnRd3fn4yIm9/+cTDqEajbV2+GGJc8CV9LL/ M5uVSkQiApbSX/HA+A5y04iMuNgOXTm1nqoon/upRTgruURYDXMypBckCYhHGCfLyltJ DwS4rx+/MArWRdD3Gi33ssu83WaczPD03kaGYrBfn+XriDSCEvpyKKlXK7CUcyde4Kq3 TlgP/gTf289eNz+pYU7Q53qyFjrxMiozmAXqRpwPqJqUx73eqcl0d7jSFURNwGQr321z trgRreNTVU7hRMosSLPWTymaS2z9bA+0imbxAW/LgP6iVOSQ20lkQrnszNWJIMvB6ofj GP+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=AGQcAsbF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm5si16477555ejc.282.2021.05.11.10.26.32; Tue, 11 May 2021 10:26:57 -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=@ffwll.ch header.s=google header.b=AGQcAsbF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231589AbhEKR0o (ORCPT + 99 others); Tue, 11 May 2021 13:26:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231230AbhEKR0n (ORCPT ); Tue, 11 May 2021 13:26:43 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22659C061574 for ; Tue, 11 May 2021 10:25:37 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id w3so30951820ejc.4 for ; Tue, 11 May 2021 10:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=NT873CRC73MULIODsKALHoOFZyeiGEpUp1yrXXnTdgQ=; b=AGQcAsbF+a+4xzPcqRdR8yzPkOwwDE2BXsPHEw/Z0Db7353BQ4U6TL0Wwz4aAPjHJC rvcWddDvcxZGkBgVZowHe5+v7QXMX7ztTzpJIenK+J9RnhlAPha4XMMyvTfwpeOhXnU3 E4S4s21eB6TqQAX1kMC/D/e/qijeUlTYmGsEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=NT873CRC73MULIODsKALHoOFZyeiGEpUp1yrXXnTdgQ=; b=QW651TrrI27khnaqh+xVoN9/DWCv4hexCaBxUevoWvzMymfRkutBC1Aks5SzjFXhho Nx0lulvDx3wLPIJbEzD/K5NqxfbgIz10llWlQ3XuIY1qTyf+MyvrU+xhYb+k7Y+LKMB/ r/8nETzBPW/sJd/d0YdcjWXIBZKdcVxwqltVw3iTDd+AlCwo8X8DUnXNjwheqKtAkmZC OnHrLdsiWY+hLuymCo8rffY2i7hTWxOziWIPpekb5Zsj98e4vvoaGH+wdTPtZKEYGn3w WDRl72f18WattGi5yHHfryDeeP5Ku7SAeSWLE5hhAoIJz4/X/i9tpbPwmhrcnfBfImgD 8psQ== X-Gm-Message-State: AOAM532eoQtuGugp0TgmwFaIkGj/Th8cQvDxKFqN8AMEZX/b24wlR2yS d0fET+0VuLkXH2ZDB4sm4P4cPA== X-Received: by 2002:a17:906:d1d1:: with SMTP id bs17mr4282814ejb.492.1620753935803; Tue, 11 May 2021 10:25:35 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y25sm281749edr.63.2021.05.11.10.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 10:25:35 -0700 (PDT) Date: Tue, 11 May 2021 19:25:33 +0200 From: Daniel Vetter To: Stephen Boyd Cc: Daniel Vetter , "Rafael J. Wysocki" , Greg Kroah-Hartman , Linux Kernel Mailing List , Russell King , Rob Clark , dri-devel Subject: Re: [PATCH] component: Move host device to end of device lists on binding Message-ID: Mail-Followup-To: Stephen Boyd , "Rafael J. Wysocki" , Greg Kroah-Hartman , Linux Kernel Mailing List , Russell King , Rob Clark , dri-devel References: <20210508074118.1621729-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.32scarlett+ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 10:19:09AM -0700, Stephen Boyd wrote: > Quoting Daniel Vetter (2021-05-11 06:39:36) > > On Tue, May 11, 2021 at 12:52 PM Rafael J. Wysocki wrote: > > > > > > On Mon, May 10, 2021 at 9:08 PM Stephen Boyd wrote: > > > > > > [cut] > > > > > > > > > > > > > > > > > > I will try it, but then I wonder about things like system wide > > > > > > suspend/resume too. The drm encoder chain would need to reimplement the > > > > > > logic for system wide suspend/resume so that any PM ops attached to the > > > > > > msm device run in the correct order. Right now the bridge PM ops will > > > > > > run, the i2c bus PM ops will run, and then the msm PM ops will run. > > > > > > After this change, the msm PM ops will run, the bridge PM ops will run, > > > > > > and then the i2c bus PM ops will run. It feels like that could be a > > > > > > problem if we're suspending the DSI encoder while the bridge is still > > > > > > active. > > > > > > > > > > Yup suspend/resume has the exact same problem as shutdown. > > > > > > > > I think suspend/resume has the exact opposite problem. At least I think > > > > the correct order is to suspend the bridge, then the encoder, i.e. DSI, > > > > like is happening today. It looks like drm_atomic_helper_shutdown() > > > > operates from the top down when we want bottom up? I admit I have no > > > > idea what is supposed to happen here. > > > > > > Why would the system-wide suspend ordering be different from the > > > shutdown ordering? > > > > At least my point was that both shutdown and suspend/resume have the > > same problem, and the righ fix is (I think at least) to add these > > hooks to the component.c aggregate ops structure. Hence just adding > > new callbacks for shutdown will be an incomplete solution. > > To add proper hooks to component.c we'll need to make the aggregate > device into a 'struct device' and make a bus for them that essentially > adds the aggregate device to the bus once all the components are > registered. The bind/unbind can be ported to probe/remove, and then the > aggregate driver can get PM ops that run before the component devices > run their PM ops. > > Let me go try it out and see if I can make it minimally invasive so that > the migration path is simple. Thanks for volunteeering. Please cc Greg KH so we make sure we're not doing this wrongly wrt the device model. -Daniel > > I don't feel like changing the global device order is the right > > approach, since essentially that's what component was meant to fix. > > Except it's incomplete since it only provides a solution for > > bind/unbind and not for shutdown or suspend/resume as other global > > state changes. I think some drivers "fixed" this by putting stuff like > > drm_atomic_helper_shutdown/suspend/resume into early/late hooks, to > > make sure that everything is ready with that trick. But that doesn't > > compose very well :-/ > > Yeah it looks like msm is using prepare/complete for this so that it can > jump in early and suspend the display pipeline before the components > suspend themselves. The shutdown path only has one callback so we can't > play the same games. Yeah there's tons of hacks. i915 component usage with audio has similar tricks to make suspend/resume work. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch