From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1084B35F5E3 for ; Mon, 4 May 2026 10:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777889017; cv=none; b=cDRaAnlm3gyuxIngazT5XagoyjW+KQ5sAJjqOKsZaQenc3HZKEQjLg+tD7C/jO2ShlBoN25xUts7WkwQfu8aSnpXgoyKRVcqUissyMK2nEwfHEYXFo1lWY99dos3XKoEx3s81kRdo5X63LO3C0YRKUQXkYzLR+ZNEqtQi2OEQQA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777889017; c=relaxed/simple; bh=pYwlRQbtoXTLc/WNhpltEoiImuA4HQaKY4NST2HL0zw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BcYTfzddNxZKSqSTxYQxtfds5DGUaI6Y5MT23UnfiOQn93tbAyMIJit2oF2OxUsjI4a+CtnP5CSfYQkuUlz+mM8RCqRr6ezLw7RcHIFXuvKDyYAqo1qqTTsW0u73lsUr5k/kXQQwab/xTxzYi3vnhHHv0aYpjmGXkD0fBdXMiOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gib9peEp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gib9peEp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC1A0C2BCB8; Mon, 4 May 2026 10:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777889016; bh=pYwlRQbtoXTLc/WNhpltEoiImuA4HQaKY4NST2HL0zw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gib9peEpe9TLJPKti2SbUQEmP8xSC47xa4Z/IjqVE5OxA8gmLK9g+9aQnsbHMifR+ t8quIu4fBO7n9re2LDm1g33TrUSzeoqA0+PwfEUwDaLXlN/c0ETOmRxcPkKg2YIlIr M33eeHDpndwPStZ9j6FZM6jt5sy1puynl8JAwVB7GLb05AxRkAf5tbPVLpSxbDpH/i 0YsDq+8tjg33snIxqfi4Vk/jFfQwM0aY0TRiNE/pQl8QWSi0f6UtIiX6cIi/q+7V3l oOiA0S4X95qt4G3foI7HZJ1ORNpx9bbAPFj8CqIMBEN+3yvYxAuRJxU3vwtflr8Xhm 88b0T9oRZLlgA== Received: from johan by xi.lan with local (Exim 4.98.2) (envelope-from ) id 1wJq9G-00000001mc7-1lqp; Mon, 04 May 2026 12:03:34 +0200 Date: Mon, 4 May 2026 12:03:34 +0200 From: Johan Hovold To: Finn Thain Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nubus: switch to dynamic root device Message-ID: References: <20260424104011.2616970-1-johan@kernel.org> <92e2b920-041a-78a4-e4b6-c5a7c579ade7@linux-m68k.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Apr 28, 2026 at 05:24:31PM +1000, Finn Thain wrote: > On Mon, 27 Apr 2026, Johan Hovold wrote: > > On Sat, Apr 25, 2026 at 02:07:10PM +1000, Finn Thain wrote: > > > On Fri, 24 Apr 2026, Johan Hovold wrote: > > > > > > > Driver core expects devices to be dynamically allocated and will, > > > > for example, complain loudly if a device that lacks a release > > > > function is ever freed. > > > Yes, in drivers/base/core.c, there is a warning in device_release(). > > > > > > WARN(1, KERN_ERR "Device '%s' does not have a release() > > > function, it is broken and must be fixed. See > > > Documentation/core-api/kobject.rst.\n", > > > > > > But there's no way for the refcount for the nubus parent device to > > > reach zero that I can see. Did I miss something? > > > > It will if registration ever fails (e.g. due to fault injection or name > > collision): > > > > err = device_register(&nubus_parent); > > if (err) { > > put_device(&nubus_parent); > > return err; > > } > > > > In that situation the kernel error message would say the device "is broken > and must be fixed" when it was deliberately broken by fault injection. > I think the commit log should state that the aim of your patch is to avoid > that error message for that use-case. No, the aim is to git rid of statically allocated device structures. The error message is there to notify people that the driver model expects dynamically allocated objects (e.g. as documented in kobject.rst) even if you're unlikely to hit it with this particular module. > Aside from that quibble, the patch looks fine to me. > > Acked-by: Finn Thain Thanks for taking a look. Johan