Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp508025rwn; Thu, 8 Sep 2022 05:09:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR4aZpODgBObQ8HYtN/bsT7+Fc2SGOTuYhg1p02+Wn3XqUGHzxCCpKOCvPcj2Ps3eK+RgB4s X-Received: by 2002:a05:6402:2751:b0:443:d90a:43d4 with SMTP id z17-20020a056402275100b00443d90a43d4mr7074372edd.368.1662638997054; Thu, 08 Sep 2022 05:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662638997; cv=none; d=google.com; s=arc-20160816; b=uqVa1GNeSCh2yqzGi0AVWAmR8uWv+59/ZssuQyGRb45Lh8rivIs7TBHMBEtD7sG0Yt LZod+RYBufxzKLVd6O8DdjxmZQNtTdn080PWMwus5vxZbVXYGapU2r7lBuoJ9eCGwqhV 16HqzZ6uVoMGWpgJEH1Z3OSoiGR/GmfmrBTMiv8vndbUpa94JauqlCn77DN3Jn4Wf6jg +11dRFt5GRR20B9cihljtTlNaFF0YHI3zJWXYGpsLtUmM9RczBH0vWT9GTERr2eLXJql M7AHQu/zZ6ZmX7C/T3GLN+uZcF5gxI2BeRHSFAx1GtdHJaXoi3RINZj0ii3M5gMhqVjA yYUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JoYkHhKcNHSVnYXHTMziEev5Oup7HHXLR07vrdNYcRQ=; b=CHNx7UlcvItqdCZ+QI2tRoOgBBKL2boId/HT+pd6np05MB3vBfDSflcmByNUXQL5Qi bF9Cd6Dyxxi5xDgHw1L26vshvY7PjFQT0NHRryKu2ULfBjQszsKFvlrde5ojP+n5DF9R S28XwKELIxb4A01b/CR2wTcywZaKbQvDQT/SnXy/VO0aaqd87E5Hx+wqezg4oRbTrfkK w72J6jy8UM24lqX8fHJ4Ava3itgs/Xso2lm6FkAxoEO5Qz3EcrwAejCsZr7BXoyrHhSW XxXmrxqdPCkGNzoRsdCAPUWXRVEoPSaqKPIh4TlAxHFmk0Cw42nNqWUtdsu+cq+aKhFi fLng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QkYJAQhf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a05640234ca00b00450d093ab5dsi954177edc.329.2022.09.08.05.09.31; Thu, 08 Sep 2022 05:09:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QkYJAQhf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231533AbiIHLyf (ORCPT + 99 others); Thu, 8 Sep 2022 07:54:35 -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> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 :(