Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2531581rwl; Fri, 6 Jan 2023 07:40:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXvBDmmdSomfSZigtxxrFfuAu34045hpDHpUslZap8OvNXC5hdjgyhZH7urBhNTW7GSoInA/ X-Received: by 2002:a17:907:6ea9:b0:7c0:e7ad:5296 with SMTP id sh41-20020a1709076ea900b007c0e7ad5296mr61152482ejc.55.1673019644619; Fri, 06 Jan 2023 07:40:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673019644; cv=none; d=google.com; s=arc-20160816; b=EBRTzL9FiMn3PHQzvt1MfRmmOb6xPt+dyURwncPfWTiwov79VJrp2TuyjE4/PjqwVD 8P57rP55J/39tcU+kOrHBpryCDi2gP0/36D0Di+pluGKxrFMTPdE8EMTnxS/IwTFvAao EnQIEkf79FTTi+MTTDfptLtU1tE6yl9o8QGfPGGV4Hl7Hi/ESz9WjmPeWbCNvSJuBN5G gES3CTBV2NEMwZMYmVC0nmlLSv9a+bIshyongh8lpRExi0xMI+UhyensX7sJJUtWAzvJ M5JuIzBPXigJgzH/F0Mf/YgKFs5KDU78Fwb8bfI4aQYtfuCwrAWn9kTEV93ok/4ihR3h VTiQ== 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=Qyg07ZlL4dwxu2vZBR1AwmHcjFZTqzkcbSf4f7UbhuA=; b=u9//TE4Q4x4PoDxzQNsfgkCA89NjMtgzHxnWRuv6X31TLP0LojUQZgEWn1HjqDlL1O uzEwVG+oWWJXvCHaCBQmMl0Lw2h2rnFWaxLjBzcLVMdyDhCighnx7pMD85dpawhD8QfZ +B8PpUWkqZAVrawlOjEUNoQyFbSLfwcv2oDfiBS6Q7xp0Lbl/YOAMv6CQXTuA8QhUMp8 fRFtDBJ9DZxamq5gWAE1jionO0ScbJrf6TUo/OlPPRfvl3yGqwTpgNcz9Iumy1RyRw/J g1tcCvYXWXmZQZh2Rgv1QPeLr+165kXD+pjpeomnmVaHgrpdRxsUN/JTicGsIMSeyYms vELw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F5qh+PV0; 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 xd9-20020a170907078900b007c10e7a7628si1638542ejb.839.2023.01.06.07.40.31; Fri, 06 Jan 2023 07:40:44 -0800 (PST) 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=F5qh+PV0; 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 S235401AbjAFPdX (ORCPT + 56 others); Fri, 6 Jan 2023 10:33:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235725AbjAFPc6 (ORCPT ); Fri, 6 Jan 2023 10:32:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7843C193DC; Fri, 6 Jan 2023 07:32: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 03B22618A2; Fri, 6 Jan 2023 15:32:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD0ABC433D2; Fri, 6 Jan 2023 15:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673019175; bh=MoJReKfnakkKkR+HCW1RUf/lLV/d/JIzG9RpdEBEcEE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F5qh+PV05KsdefxSqbA8fNXGIuCG7pUCkxsCuYnuj7Bu0c8Jt16/4eXDNjLxxmt4B vy/N9v454re2s/6tYP6PIq1J9hFrcw33IHV2/bCXItGgcoXjQjQD3xF5/a4aTrrest qaSrCbaTb8qtyn2IRRGeNnY4HJhdyMCgsPJbaaRs= Date: Fri, 6 Jan 2023 16:32:52 +0100 From: Greg Kroah-Hartman To: Matthias Kaehlcke Cc: Johan Hovold , linux-usb@vger.kernel.org, Stefan Wahren , Alexander Stein , Icenowy Zheng , Douglas Anderson , stable@vger.kernel.org, linux-kernel@vger.kernel.org, Ravi Chandra Sadineni Subject: Re: [PATCH 1/2] usb: misc: onboard_hub: Invert driver registration order Message-ID: References: <20230105230119.1.I75494ebee7027a50235ce4b1e930fa73a578fbe2@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230105230119.1.I75494ebee7027a50235ce4b1e930fa73a578fbe2@changeid> 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 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 Thu, Jan 05, 2023 at 11:03:28PM +0000, Matthias Kaehlcke wrote: > The onboard_hub 'driver' consists of two drivers, a platform > driver and a USB driver. Currently when the onboard hub driver > is initialized it first registers the platform driver, then the > USB driver. This results in a race condition when the 'attach' > work is executed, which is scheduled when the platform device > is probed. The purpose of fhe 'attach' work is to bind elegible > USB hub devices to the onboard_hub USB driver. This fails if > the work runs before the USB driver has been registered. > > Register the USB driver first, then the platform driver. This > increases the chances that the onboard_hub USB devices are probed > before their corresponding platform device, which the USB driver > tries to locate in _probe(). The driver already handles this > situation and defers probing if the onboard hub platform device > doesn't exist yet. > > Cc: stable@vger.kernel.org > Fixes: 8bc063641ceb ("usb: misc: Add onboard_usb_hub driver") > Link: https://lore.kernel.org/lkml/Y6W00vQm3jfLflUJ@hovoldconsulting.com/T/#m0d64295f017942fd988f7c53425db302d61952b4 > Reported-by: Alexander Stein > Signed-off-by: Matthias Kaehlcke > --- > > drivers/usb/misc/onboard_usb_hub.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Does this superseed this thread: Link: https://lore.kernel.org/r/20221222022605.v2.1.If5e7ec83b1782e4dffa6ea759416a27326c8231d@changeid or is that also needed? confused, greg k-h