Received: by 10.192.165.148 with SMTP id m20csp3963141imm; Tue, 8 May 2018 00:02:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoxpCxLA1shpN15KCfRR6jHlbm9oAFATZ7Q0oZTchTBnzLJQVw9r7fZdUx9yU1ZEexpB8Mu X-Received: by 2002:a17:902:9042:: with SMTP id w2-v6mr39970551plz.34.1525762958229; Tue, 08 May 2018 00:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525762958; cv=none; d=google.com; s=arc-20160816; b=d0I22lbKZ1TwG+FM0Tq1okeZVtnnQaz4279gkWK/nZRX42ZwiUDI8DZbxXvrcv+XFL AxYOokLtaQM1fLk4W+6zYLvm5J4tpwc30TJz8mTymynbFeu7DVG+swdkeqW+5EWPK0Kd Edi8RsNdh9dijBdbUcnDgHGnqk2Jy6I79zxACYPvfTQmHAazmFsbku37Aj6RBwtIGE/1 htIiCjItd5jBdrcXRm5KFL2K8uCFv6tU2RsCpruz7A0gEDCBQklnk9quP+QeCJv2ctzx WFr8BFJMUsXoFc89Ey9gXLFmY/HBpXe3vJbKfEqgeV8J70A/ofzqrqeai7YiyJdr560/ drCw== 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=07Aa9HwdAXRFZagGtCBNMxB6YQPvTCbS/pMCH6jXr6k=; b=ghwPQTfzCNsRQwnmqSP1BElmI6JEJV/wiFTsDAxcn7LP8NpxSf8FIfabpTYu8Lsr/R kCIQS3hAVXNxNcH5l0g/yp3u+N7xmidlUwxb+Xl+hdhfUYJTAdSUTD8Q+9IQ1pZ/CxpR 8QcFBp+e66hSQNZCVpw57+ToXb4XqJ7DFg4meBLBwRuj+pOl/OG7Gu4+ubmHyCgmwQeu 5ZXedhb1qxhQ7oO9a9RRTLT9o/ktJvhxT71JIIx52c2vssIL6/cCubcO3cW/bB8NyyxP bT33nZJYDwGGlaXRtxycKIOOxkkrE0J6qlrwbWeWFsSAVSpHSQAREvEt5QgEvbX6PSJR dg0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=drdm68ya; 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 m3-v6si10003405pgs.165.2018.05.08.00.02.24; Tue, 08 May 2018 00:02:38 -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=drdm68ya; 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 S1754231AbeEHHAv (ORCPT + 99 others); Tue, 8 May 2018 03:00:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:40586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752214AbeEHHAu (ORCPT ); Tue, 8 May 2018 03:00:50 -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 581A0214D5; Tue, 8 May 2018 07:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525762849; bh=psClruV/USg5g/0P4WDEIjMLAO4GtXMgNVJ//P8p0c0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=drdm68yaW9jPcjht+KcSFlArma4Etknfti17tAv/qlv6KZHp061/Ym+ccfh2BH6St monrCSCt7R7hQdV9gv9YMonvWVo5jLX8X7JjqB4TKakGNxagRgcrFB+6VSuwISrLIm p3HqaP9GvU+vu8n58/ReTaAN3hiG5UNTjPr6EA4w= Date: Tue, 8 May 2018 09:00:37 +0200 From: Greg Kroah-Hartman To: Michael Schmitz Cc: Finn Thain , Geert Uytterhoeven , Linux/m68k , Linux Kernel Development Subject: Re: [PATCH] nubus: Unconditionally register bus type Message-ID: <20180508070037.GA4792@kroah.com> References: <5aee5ed3.1c69fb81.19d98.ef06SMTPIN_ADDED_MISSING@mx.google.com> <20180506045530.GA5328@kroah.com> <20180506202018.GC8924@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 Mon, May 07, 2018 at 09:51:12AM +1200, Michael Schmitz wrote: > Hi Greg, > > 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. > Safeguarding against this bug could be done by checking a > bus-is-registered flag, or checking what machine model the kernel runs > on. Simply registering the Nubus bus driver regardless of machine > model seemed the easiest way. If you really have this problem due to link ordering issues not being able to be worked around (due to different directories and the like), then put a "bus is registered" flag in your bus code. That will solve the initial BUG_ON() problem, and you should return an error that allows the driver code to probe your driver later on after your bus is enabled. Hope this helps, greg k-h