Received: by 10.192.165.148 with SMTP id m20csp3994168imm; Tue, 8 May 2018 00:43:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7XS5/gcssEQCASgKVrvo7WLKXLqnArY+ZzTdqtZDHq3l8Gx+YRMhddz2+zrXWWOgNkEG8 X-Received: by 10.98.74.136 with SMTP id c8mr39112870pfj.23.1525765384888; Tue, 08 May 2018 00:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525765384; cv=none; d=google.com; s=arc-20160816; b=mTqf1AgXcfL7hCtcS73QrAvVDDCNsd55alBavYX6lnHIfMAqcvzwq/HZelJAHUY5YW QQS4+mV3pNTMUjKMZr0EkHqZxm4+nH4FDxzBeYAQQbRexg/GQSf4JP4CMjVQ9f/ELYsc +zhVwGy87YNP3qQUWiAfyHI0gpsqXpZdtDrtN//KT81mPNZ2aP+GmuE+pb8qOLL86d8l nq0hcph8dTrf2fIG3HHX5PfJrPjj/lWdxsmTLrBfX1HfcKgZHXFqIN+WCCurKG9lVZUA qH7F6pcleRSj2HPiaqaKS+eqhD9HBey5Auv/eVS0cMOILxf2m7GKwcMZrqEl4/7eUnho 5L6A== 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:arc-authentication-results; bh=1UNxKv8okL9b/FD7Oa+zdJ1zq0AT1HuhwnWwVJIWKK8=; b=a4NoDvVDlxdbkPwAxz3MxkHqjBuAlF5i39Zc0WUCBxqTCiO0Ugpsf4UguvWnYq3AHR QAiQNgmSzU7YklB0dcWCEO+zFc+PQ6e7g/OMPv1qWi3dPXqQcVH2l1IOWS/aZvbimLBz uMb8I8iP5Q7a7IB6n5wYosHRnxmZ0YirzYGPSGuWM2XGIr+meKJUt9bbdCpzD9ejTpDG QdaopihY+Z3QPQCpqsCZH1a3FlAVsGzCUShsk2I6PFQy/wfjROlnTzBCABd8WXBUyvXZ MGis4kilFYkJaQZEB3LuG1NgnMW704ToKBe/UgWlPYpWvzv5NDOfSk5Bors1bEsbU870 KM2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Eu3JHgOS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21-v6si19124073pgn.276.2018.05.08.00.42.50; Tue, 08 May 2018 00:43:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Eu3JHgOS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754794AbeEHHmJ (ORCPT + 99 others); Tue, 8 May 2018 03:42:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:58942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754656AbeEHHmI (ORCPT ); Tue, 8 May 2018 03:42:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E988214D5; Tue, 8 May 2018 07:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525765327; bh=uAtjC1qKP7sRXcWPKok60RdfCwRxrh4UEHlNVY8Xp48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Eu3JHgOS7F+0WcSSCeGJax7bZo94K3aKgm2rXT3ldTKpBCKhKhhXAfgrDR599B/sn rpk1DEWglVVfAVlu7RxLlc6BqHl0Sv+JoEoZUKkRP6nco/Yc9cDOzNcuOFUPFeKzrY 1xzXa+zUsJmP3NYvHCPzGW5HG4SLS/YyEkpWBPYc= Date: Tue, 8 May 2018 09:41:55 +0200 From: Greg Kroah-Hartman To: Geert Uytterhoeven Cc: Michael Schmitz , Finn Thain , Linux/m68k , Linux Kernel Development Subject: Re: [PATCH] nubus: Unconditionally register bus type Message-ID: <20180508074155.GA8561@kroah.com> References: <5aee5ed3.1c69fb81.19d98.ef06SMTPIN_ADDED_MISSING@mx.google.com> <20180506045530.GA5328@kroah.com> <20180506202018.GC8924@kroah.com> <20180508070037.GA4792@kroah.com> <20180508072522.GA26568@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 08, 2018 at 09:35:10AM +0200, Geert Uytterhoeven wrote: > Hi Greg, > > On Tue, May 8, 2018 at 9:25 AM, Greg Kroah-Hartman > wrote: > > On Tue, May 08, 2018 at 09:07:27AM +0200, Geert Uytterhoeven wrote: > >> On Tue, May 8, 2018 at 9:00 AM, Greg Kroah-Hartman > >> wrote: > >> > On Mon, May 07, 2018 at 09:51:12AM +1200, Michael Schmitz wrote: > >> >> the BUG() was triggered by loading a Mac Nubus network card module on > >> >> a multiplatform kernel running on an Amiga machine. Up to Finn's Nubus > >> >> core rewrite (this February), we've seen no errors. Since then, Nubus > >> >> drivers fail to register because the Nubus bus is only registered on > >> >> Macs. > >> >> > >> >> Can't see link order involved here at all. > >> > > >> > The link order is totally involved here :) > >> > > >> > Link order determines the order in which init calls are run, so you need > >> > to ensure that your bus code comes before any drivers that use that bus > >> > code in link order. That way, at init time, your bus is created first, > >> > preventing this type of error to happen. > >> > >> The issue here is not due to link ordering, but due to the bus not being > >> registered on a system that doesn't have that particular bus. > > > > But how can that happen if the bus code is not present in the system at > > that point in time? Hardware doesn't matter at all here. > > The bus code is present in the system. > The bus is just not registered by the NuBus bus driver if the hardware > doesn't have a NuBus host. Ah, that sounds like some "tight" coupling that other bus cores do not have. That's the confusion here that I have, sorry. > >> Akin to booting a kernel on an old PC without PCI, and loading a driver > >> module for a PCI network card. I guess that doesn't crash (because no one > >> has a PC without PCI anymore? ;-) > > > > No, it should work just fine, try it! :) > > > > The driver will not bind to anything, but the bus code should work > > properly, as long as it is initialized before the driver tries to > > register with that specific bus type. > > Hence the NuBus bus code should register the bus irregardless of the > presence of the NuBus host hardware. Yes it should. Shouldn't cause any problems as long as you don't have any hardware specific code in your bus code. Because of this, I don't think the original patch would help at all here, as the error would still be the same. So add a "is bus registered" flag to your bus and all should be fine. thanks, greg k-h