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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47146C54EE9 for ; Thu, 8 Sep 2022 11:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231263AbiIHLyg (ORCPT ); Thu, 8 Sep 2022 07:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbiIHLyQ (ORCPT ); Thu, 8 Sep 2022 07:54:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42ED312757C; Thu, 8 Sep 2022 04:54:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7507C61CC6; Thu, 8 Sep 2022 11:54:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 461CDC433D6; Thu, 8 Sep 2022 11:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662638047; bh=iiEBvciCeys3gtNspnepmP6eJ/Mf/38J0dP2ivXXIYs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QkYJAQhfBqVVCCn2E/HHX1LfiMNrg2bdNDa1T3LLxknRjXXBNoHpF6xw2vnmnGHmC LQhZjrI5a5xuZa2zerlbjXq+ybuaf2VUZnfTWgdDEpMVRzs4L8d37/lKCsZK9XNFEK L669PiyLaLj5tssCZ+Hkmz/3sJg537xJIAOLoSWE= Date: Thu, 8 Sep 2022 13:54:29 +0200 From: Greg Kroah-Hartman To: "Isaac J. Manjarres" Cc: "Rafael J. Wysocki" , Marek Szyprowski , Tomeu Vizoso , Russell King , Ulf Hansson , stable@vger.kernel.org, Saravana Kannan , Guenter Roeck , Linus Walleij , kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH stable-4.19/4.14/4.9] driver core: Don't probe devices after bus_type.match() probe deferral Message-ID: References: <20220906172933.410698-1-isaacmanjarres@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220906172933.410698-1-isaacmanjarres@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 06, 2022 at 10:29:33AM -0700, Isaac J. Manjarres wrote: > commit 25e9fbf0fd38868a429feabc38abebfc6dbf6542 upstream. > > Both __device_attach_driver() and __driver_attach() check the return > code of the bus_type.match() function to see if the device needs to be > added to the deferred probe list. After adding the device to the list, > the logic attempts to bind the device to the driver anyway, as if the > device had matched with the driver, which is not correct. > > If __device_attach_driver() detects that the device in question is not > ready to match with a driver on the bus, then it doesn't make sense for > the device to attempt to bind with the current driver or continue > attempting to match with any of the other drivers on the bus. So, update > the logic in __device_attach_driver() to reflect this. > > If __driver_attach() detects that a driver tried to match with a device > that is not ready to match yet, then the driver should not attempt to bind > with the device. However, the driver can still attempt to match and bind > with other devices on the bus, as drivers can be bound to multiple > devices. So, update the logic in __driver_attach() to reflect this. > > Fixes: 656b8035b0ee ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()") > Cc: stable@vger.kernel.org > Cc: Saravana Kannan > Reported-by: Guenter Roeck > Tested-by: Guenter Roeck > Tested-by: Linus Walleij > Reviewed-by: Saravana Kannan > Signed-off-by: Isaac J. Manjarres > --- > drivers/base/dd.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) Applied to 4.19.y, but did not apply to 4.14.y or 4.9.y :(