Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp160986pxy; Sat, 31 Jul 2021 03:33:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeaTm+Y467DXePPwJWYr49xxCxHFuGUziiHe4W7fWqDb9hy79HL8J62PP0nnWiZzq/B2K4 X-Received: by 2002:a02:ca58:: with SMTP id i24mr5779500jal.101.1627727636270; Sat, 31 Jul 2021 03:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627727636; cv=none; d=google.com; s=arc-20160816; b=HUHkhvZ7DZYhQMopHPJhc0q5P3a6tZ5CujAIl0waNBZbR5qNmDELENLoUFWtkPze5b 3DjLSfPREdx2W6XFdcOMI/9/fVWmRcxHdLlaQHDKalE8BAkeaVySV3QIOdweGLRmUp7v 9y/BJFsKk/LjZ6ClyGHKIy1lEVD9QIk2zQ2bIbOJB0b1A0IeJ9wDYmV5RNbZqPUVWsbL Krh0cC42/Pmq68y9PYqvxJDde+pxqHgVHu+GJozWd1hWil9+EgTMhdT6nni/YnlDzc5Z pG8xajW1r4Xn2TTO5BXAMns5qsjffr2sV9Ie0MWWO88q0h93aGlv71Zd6xI1rOdWZsHS 0vKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-id:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=d+NXTrGFKDqrfs1qtW7ghetxFZrLoqbnkx+91xB+FPY=; b=TnHBeh+/qBXderFDaeZMwKnYdEgm+RgcqMbGrkhSHGyzOoQmQeAfP+pIWLys82S3HW NeJZveE5EN3VHh/j40yynvO6uDSX3rLVI7BN8DvGWZlU9Zkd56XE/skYrL694O0/241O VrPrBw9VY0qpLcDKsBcRLXNd8wn50FszEiJ/MIK3z6dIgcZjM5RcAIiHOU4YJhPqIxn6 yKU5bBv4jVn808mgapbggZh7W9N3A6bYTr6JG42dQ39YOAf9Frq0rQ6WZkOCG3oZJFOb sP0f3cNmmsB4D/rwf2MqNtnL4FYRfkTXTHS0h7LGEWRHGnhbd1zF+KOAKBYd5QzI3sbu +vMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=kfb4Bn9I; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si5153905jav.53.2021.07.31.03.33.42; Sat, 31 Jul 2021 03:33:56 -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=@messagingengine.com header.s=fm3 header.b=kfb4Bn9I; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232294AbhGaKc5 (ORCPT + 99 others); Sat, 31 Jul 2021 06:32:57 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42399 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232182AbhGaKc4 (ORCPT ); Sat, 31 Jul 2021 06:32:56 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9226B5C007D; Sat, 31 Jul 2021 06:32:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 31 Jul 2021 06:32:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-id:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=d+NXTrGFKDqrfs1qtW7ghetxFZrLoqbnkx+91xB+FPY=; b=kfb4Bn9I UGMUGIuUQiUE6eCVdUVz+qzAFr9WUIABrED/3xZYAnGOhyTMeqBvRNpSHMAmm2/r YX/rWGut3o2XKx6k2wTNEI80xV50/wSUULTZnfhP5q15XXZc7v1xHgV6Gr59i3om LSGGT7oV3NzZ+CKbIAKxkE0r11EQvWbwTQBdOezZQicpkMmNKc3J82v/1zFu5NqA mq9UOjw3MzQ8vGh6AhTQ7moBGXxvfEnhhpj0k/I0AXil/DuTDpGSJQjHWdUToIQo hbNBDqhd0nCwCilXew4dadSGFzDStTkBPw14t0IaqxJz2heq25Xapxo75oIx7Fwp OR4DM5XdNWC0jw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrheejgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvufgjkfhfgggtsehmtderredttdejnecuhfhrohhmpefhihhnnhcuvfhh rghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrghtth gvrhhnpeefffejiefgheevheefvefhteeggfeijeeiveeihfffffdugfefkeelfffhgfeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfth hhrghinheslhhinhhugidqmheikehkrdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 31 Jul 2021 06:32:47 -0400 (EDT) Date: Sat, 31 Jul 2021 20:32:38 +1000 (AEST) From: Finn Thain To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= cc: Greg Kroah-Hartman , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH 1/5] nubus: Simplify check in remove callback In-Reply-To: <20210727114220.7drjl6xvvlwetaod@pengutronix.de> Message-ID: <4b44c8a4-7d2b-83d-60fa-2d4e4f8284db@linux-m68k.org> References: <20210727080840.3550927-1-u.kleine-koenig@pengutronix.de> <20210727080840.3550927-2-u.kleine-koenig@pengutronix.de> <20210727114220.7drjl6xvvlwetaod@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="-1463811774-1671877625-1627726966=:27" Content-ID: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811774-1671877625-1627726966=:27 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: <8cd094c5-f4b-ada3-cacd-f77e4f8772f@nippy.intranet> On Tue, 27 Jul 2021, Uwe Kleine-K=C3=B6nig wrote: > On Tue, Jul 27, 2021 at 07:50:39PM +1000, Finn Thain wrote: > > On Tue, 27 Jul 2021, Uwe Kleine-K=C3=B6nig wrote: > >=20 > > > The driver core only calls a remove callback when the device was=20 > > > successfully bound (aka probed) before. So dev->driver is never=20 > > > NULL. > >=20 > > Are you sure dev->driver is non-NULL for the lifetime of the device? A= =20 > > quick glance at device_reprobe() makes me wonder about that. >=20 > Not for the lifetime of the device, but as long as a driver is bound to= =20 > the device. device_reprobe() calls device_driver_detach() after which=20 > the driver is considered unbound and dev->driver is assigned NULL. (via= =20 > device_driver_detach -> device_release_driver_internal ->=20 > __device_release_driver) >=20 Are you saying that this situation does not presently apply to nubus,=20 zorro or superhyway? Or are you saying that the remove callback will never= =20 be called in this situation? Perhaps the device_reprobe() API should be documented accordingly, so that= =20 a missing NULL check can be added if need be. Perhaps it is better to just= =20 leave this pattern as is (i.e. keep the NULL check). ---1463811774-1671877625-1627726966=:27--