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 86B96C4332F for ; Wed, 4 Jan 2023 14:31:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233514AbjADOa7 (ORCPT ); Wed, 4 Jan 2023 09:30:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjADOa5 (ORCPT ); Wed, 4 Jan 2023 09:30:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13282CC7 for ; Wed, 4 Jan 2023 06:30:56 -0800 (PST) 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 A22A261745 for ; Wed, 4 Jan 2023 14:30:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADFD2C433EF; Wed, 4 Jan 2023 14:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672842655; bh=PcqNv/cKb2by1TU+928JFHeyXLp3bk0CXGOyh5yAbJk=; h=Subject:To:Cc:From:Date:From; b=uDiUW0wr8YaaW3vk2/mF3fecRk1yo6Q5jjzwfaqFZ05WdFej9/0IfwY6lY+f0Wdai TOKswWG0L9ilYxZdUTotCZ68mrw1jIHiNuYmweH/UbZhR4hQuqt5EwoLMPyUqSluEx KD7U7t46T+JXQYofGU0aE59O/FcMP7jyrFZTXA0s= Subject: FAILED: patch "[PATCH] driver core: Fix bus_type.match() error handling in" failed to apply to 4.19-stable tree To: isaacmanjarres@google.com, gregkh@linuxfoundation.org, saravanak@google.com Cc: From: Date: Wed, 04 Jan 2023 15:30:49 +0100 Message-ID: <167284264958125@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: 27c0d217340e ("driver core: Fix bus_type.match() error handling in __driver_attach()") eb7fbc9fb118 ("driver core: Add missing '\n' in log messages") 64c775fb4b21 ("driver core: Rename deferred_probe_timeout and make it global") 0e9f8d09d280 ("driver core: Remove driver_deferred_probe_check_state_continue()") e2cec7d68537 ("driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set") c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") 4c002c978b7f ("device.h: move 'struct driver' stuff out to device/driver.h") a8ae608529ab ("device.h: move 'struct class' stuff out to device/class.h") 5aee2bf2629d ("device.h: move 'struct bus' stuff out to device/bus.h") fc5a251d0fd7 ("driver core: Add sync_state driver/bus callback") e2ae9bcc4aaa ("driver core: Add support for linking devices during device addition") 372a67c0c5ef ("driver core: Add fwnode_to_dev() to look up device from fwnode") bfb3943bed67 ("Revert "driver core: Add support for linking devices during device addition"") 33cbfe544993 ("Revert "driver core: Add edit_links() callback for drivers"") bcca686c11cd ("Revert "driver core: Add sync_state driver/bus callback"") 1f573cce48a2 ("device.h: Fix warnings for mismatched parameter names in comments") 97e2551de3f9 ("Merge tag 'dev_groups_all_drivers' into driver-core-next") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 27c0d217340e47ec995557f61423ef415afba987 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 20 Sep 2022 17:14:13 -0700 Subject: [PATCH] driver core: Fix bus_type.match() error handling in __driver_attach() When a driver registers with a bus, it will attempt to match with every device on the bus through the __driver_attach() function. Currently, if the bus_type.match() function encounters an error that is not -EPROBE_DEFER, __driver_attach() will return a negative error code, which causes the driver registration logic to stop trying to match with the remaining devices on the bus. This behavior is not correct; a failure while matching a driver to a device does not mean that the driver won't be able to match and bind with other devices on the bus. 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 Signed-off-by: Isaac J. Manjarres Link: https://lore.kernel.org/r/20220921001414.4046492-1-isaacmanjarres@google.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 4001e22617ab..e9b2f9c25efe 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -1162,7 +1162,11 @@ static int __driver_attach(struct device *dev, void *data) return 0; } else if (ret < 0) { dev_dbg(dev, "Bus failed to match device: %d\n", ret); - return ret; + /* + * Driver could not match with device, but may match with + * another device on the bus. + */ + return 0; } /* ret > 0 means positive match */ if (driver_allows_async_probing(drv)) {