Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp248022pxb; Mon, 25 Oct 2021 07:34:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytzADikj+s6Q4kczlYSRyWIaixekh4V1z4hBuFdS9uVU0oBKDiZVKni5ygdw08hCw/c7mH X-Received: by 2002:a17:90b:1b0b:: with SMTP id nu11mr20425035pjb.103.1635172465978; Mon, 25 Oct 2021 07:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635172465; cv=none; d=google.com; s=arc-20160816; b=StzEiR3ZBS/UR9Y9TMKMfVve7zc8dMf3Vcrt8rgD/R1O4YP6+DimHqjTp+ABJy0Bc8 Y1wKZN6mlRl/4WKHeDtAgIPS0fHwxMXuyKqRQ4SIkZowC8S80xSuUsXGE9IeEX35xNKt /jIKu4DQ4nb8/SdcaxMZGLnsgswGfriENTU0sy2ntpt0ZJPab9t8/9+e4NL0fpuNIfbG dKUzc3zUDrJm0sdHWzgW9doT4BE3pRAGz7qqDJpp1MO9njJkPJGN6qvVZiuDQO1uF3Gs 2iJgCbCx5E8DHVUG6dSrYgcM9FADN9ESIXcJc/iIlON7RoZ83Aqo/gMJ8NEISutOCNFy Jyxw== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=38lobw9Q9tpsAFtghPE1cRqIIuabIvUWySh4tTV/r7c=; b=Rxo8BJ8bRFTD23sEC93QPRzCsyMBxjlZESKKRGGeLBd9hoHHI3aIjCslMojYRwPhWV PsbZJ/jtz0XiEdLu4/fsfWF3Fs+8txRRmb8ElmatzbdG0vAr741wFMb+pSnQq+8ikwON c5x8rbqq8qnQaCFK6AFvQh5uTxl2MzTASX8A3dHJC/WLLDqucsMZyCOETJ71L5Sr10Ly T+3KaKTBM67dyFq8is5tjassRniDX2GgodJEMjMv0rKnseLuV0eOjhiEy9Y+eMuiMAM2 w0VF0NCGu+o6CKLA7DmtcxK/UWH5BibaUy475fRBgxM3FuH0aCeLgtEDu/7uIvHIuURa 766A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XBxJJmEP; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si22128317pjc.153.2021.10.25.07.34.13; Mon, 25 Oct 2021 07:34:25 -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=@linuxfoundation.org header.s=korg header.b=XBxJJmEP; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233327AbhJYOM0 (ORCPT + 99 others); Mon, 25 Oct 2021 10:12:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:54886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbhJYOMY (ORCPT ); Mon, 25 Oct 2021 10:12:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A8B860F70; Mon, 25 Oct 2021 14:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635171002; bh=keekYHdYAWdyATEPVva/BLVQO6EKoTmmk3kBb7KadD8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XBxJJmEPAXirY/tRVpXuJnIeh0slTyHNA95Ovi49PA5U63ohfmz3WuMZLCiyIc9n2 IaoxVT1evX8GtEwThTfwpaycwgwr9lo3SyMekZYko/T6kWJN8V7UdDHig+8qKnkNoq NvA/6Nx4qGIvRfBzPaEpi5OlMuu/+inZXvjn3oTk= Date: Mon, 25 Oct 2021 16:09:59 +0200 From: Greg Kroah-Hartman To: Patrick Williams Cc: Andy Shevchenko , Frank Rowand , Zev Weiss , kvm@vger.kernel.org, "Rafael J. Wysocki" , Kirti Wankhede , Jeremy Kerr , Rajat Jain , Jianxiong Gao , Dave Jiang , Saravana Kannan , Mauro Carvalho Chehab , openbmc@lists.ozlabs.org, devicetree@vger.kernel.org, Konrad Rzeszutek Wilk , Alex Williamson , Rob Herring , Bhaskar Chowdhury , Thomas Gleixner , Andrew Jeffery , Cornelia Huck , linux-kernel@vger.kernel.org, Vinod Koul , dmaengine@vger.kernel.org Subject: Re: [PATCH 4/5] driver core: inhibit automatic driver binding on reserved devices Message-ID: References: <627101ee-7414-57d1-9952-6e023b8db317@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 09:02:40AM -0500, Patrick Williams wrote: > On Mon, Oct 25, 2021 at 03:34:05PM +0200, Greg Kroah-Hartman wrote: > > On Mon, Oct 25, 2021 at 08:20:05AM -0500, Patrick Williams wrote: > > > On Mon, Oct 25, 2021 at 03:58:25PM +0300, Andy Shevchenko wrote: > > > > On Mon, Oct 25, 2021 at 06:44:26AM -0500, Patrick Williams wrote: > > > > > On Mon, Oct 25, 2021 at 08:15:41AM +0200, Greg Kroah-Hartman wrote: > > > > > > On Mon, Oct 25, 2021 at 12:38:08AM -0500, Frank Rowand wrote: > > > > > > > On 10/23/21 3:56 AM, Greg Kroah-Hartman wrote: > > > > > > > > > > > We have the bind/unbind ability today, from userspace, that can control > > > > > > this. Why not just have Linux grab the device when it boots, and then > > > > > > when userspace wants to "give the device up", it writes to "unbind" in > > > > > > sysfs, and then when all is done, it writes to the "bind" file and then > > > > > > Linux takes back over. > > > > > > > > > > > > Unless for some reason Linux should _not_ grab the device when booting, > > > > > > then things get messier, as we have seen in this thread. > > > > > > > > > > This is probably more typical on a BMC than atypical. The systems often require > > > > > the BMC (running Linux) to be able to reboot independently from the managed host > > > > > (running anything). In the example Zev gave, the BMC rebooting would rip away > > > > > the BIOS chip from the running host. > > > > > > > > > > The BMC almost always needs to come up in a "I don't know what could possibly be > > > > > going on in the system" state and re-discover where the system was left off. > > > > > > > > Isn't it an architectural issue then? > > > > > > I'm not sure what "it" you are referring to here. > > > > > > I was trying to explain why starting in "bind" state is not a good idea for a > > > BMC in most of these cases where we want to be able to dynamically add a device. > > > > I think "it" is "something needs to be the moderator between the two > > operating systems". What is the external entity that handles the > > switching between the two? > > Ah, ok. > > Those usually end up being system / device specific. In the case of the BIOS > flash, most designs I've seen use a SPI mux between the BMC and the host > processor or IO hub (PCH on Xeons). The BMC has a GPIO to control the mux. > > As far as state, the BMC on start-up will go through a set of discovery code to > figure out where it left the system prior to getting reset. That involves > looking at the power subsystem and usually doing some kind of query to the host > to see if it is alive. These queries are mostly system / host-processor design > specific. I've seen anything from an IPMI/IPMB message alert from the BMC to > the BIOS to ask "are you alive" to reading host processor state over JTAG to > figure out if the processors are "making progress". But which processor is "in control" here over the hardware? What method is used to pass the device from one CPU to another from a logical point of view? Sounds like it is another driver that needs to handle all of this, so why not have that be the one that adds/removes the devices under control here? thanks, greg k-h