Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3589603pxj; Tue, 11 May 2021 07:44:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf26LF0kZi4MneCYdSUK8sXfU8mZYtxcN+w6XpySxFY2+VnSsGIOmseP5iOaAWBR1HZDSk X-Received: by 2002:a17:906:1f54:: with SMTP id d20mr13582398ejk.94.1620744273271; Tue, 11 May 2021 07:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620744273; cv=none; d=google.com; s=arc-20160816; b=iDrnte6k18lEXwtaXGoB7/R1De4dqy1ga6uaRWI43bHabNLrAiPaiIUVO24WufTKPH o6L/C3B53DSCZDG3IOXUIqRrAETTiMYdcH/7871QpPxljDVV+HBRCHtbwEJDRIRkfQHv KbsooXhCh/y7pTVFpelMlR790lcdbPT3NvLbincmivReeZPkhHjCE/Fa7m7qWgRxe4HJ EWTm4WP/38ohnVm5QsZXpI686/XtC8iXMtbS/xF8BnRwkRpOGXFuMUOM83ZQ3QLgAlMl anUVr7sCwkmXtckleLm/XTHUUhCayG9tmidIH/YjM+FBzsxtPR0e6T8C4JFc0mzz9XdX pvzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VpdWWPVwCDuLCQx48KbKcWauncgjWTUPNT/nkVmSq+A=; b=kkODM9bgo/UJopLEu71dcpnmaureX9rzHI7+JHmonjnqAs5znJeUNBdwdK72ReZ0WO xm8aQTT9yAwrL58r003VmYlUm2h4+B4crogWRcjL2XI8s/8UIHzONyCX6vKZLwLnJujj BVTZe6qJvYI2ffGKwdqH1iNPfMt37F7gkJcnDbNOVcfu3E7L6wLK6ULZnkBH/Yo1LM4c zkjU5DgdH7cAnehxHwJ/DoGwDc1eNEbPswGrzSQ09AKipWncqLXRJm+rL+mSgm5vaYau 5Qnwg9hC20X66bBsjwxCOmmuxazJzPPf/1cboPdFMhGxJsxu7SSUM8mwsAlVhNUriTXs kZVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=SY5mhMbt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si17278893edd.343.2021.05.11.07.44.07; Tue, 11 May 2021 07:44:33 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=SY5mhMbt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbhEKOnt (ORCPT + 99 others); Tue, 11 May 2021 10:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbhEKOnq (ORCPT ); Tue, 11 May 2021 10:43:46 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 531D8C061574 for ; Tue, 11 May 2021 07:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VpdWWPVwCDuLCQx48KbKcWauncgjWTUPNT/nkVmSq+A=; b=SY5mhMbtH/IaXs+wEFCoh9Q0X ZO+jjAzbV+jlgKtzJuoZZo4GheG7V8l45AD1VbRUJqjpjOCYgny5YoGeu0kE8U4+LQ+hgKqQePbrY sjfUDxWO/whyJLJAnJOmyl/6SNY6649Q9L4PeWoMAZ5DePOAssq0DZz1w45ZBHJmbohyNzZZt+RoG FePwHQQmmNwoLeniH4L60tglhKGP0W/bx5qe/485ze5uQpHyIU0wy/VM52nLQAJMqJ4oz2wlsjdmD xLsXIfraewgVZNVNRMbSXRODnM49GoPQOLv3uh1nmPz9vNMewplbOiFxZDdoGEUnjEgVujSb+0l9V xWBg6znvg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:43862) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgTan-0002k7-NT; Tue, 11 May 2021 15:42:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lgTan-0001AK-3C; Tue, 11 May 2021 15:42:37 +0100 Date: Tue, 11 May 2021 15:42:37 +0100 From: Russell King - ARM Linux admin To: Stephen Boyd Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Daniel Vetter , Rob Clark , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] component: Move host device to end of device lists on binding Message-ID: <20210511144236.GL1336@shell.armlinux.org.uk> References: <20210508074118.1621729-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210508074118.1621729-1-swboyd@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 08, 2021 at 12:41:18AM -0700, Stephen Boyd wrote: > Within the component device framework this usually isn't that bad > because the real driver work is done at bind time via > component{,master}_ops::bind(). It becomes a problem when the driver > core, or host driver, wants to operate on the component device outside > of the bind/unbind functions, e.g. via 'remove' or 'shutdown'. The > driver core doesn't understand the relationship between the host device > and the component devices and could possibly try to operate on component > devices when they're already removed from the system or shut down. You really are not supposed to be doing anything with component devices once they have been unbound. You can do stuff with them only between the bind() and the unbind() callbacks for the host device. Access to the host devices outside of that is totally undefined and should not be done. The shutdown callback should be fine as long as the other devices are still bound, but there will be implications if the shutdown order matters. However, randomly pulling devices around in the DPM list sounds to me like a very bad idea. What happens if such re-orderings result in a child device being shutdown after a parent device has been shut down? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!