From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A573C432BE for ; Sat, 31 Jul 2021 10:32:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 494EA60F46 for ; Sat, 31 Jul 2021 10:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232508AbhGaKc6 (ORCPT ); Sat, 31 Jul 2021 06:32:58 -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--