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 89C84C3DA7A for ; Fri, 6 Jan 2023 16:14:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235315AbjAFQNq (ORCPT ); Fri, 6 Jan 2023 11:13:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235610AbjAFQNl (ORCPT ); Fri, 6 Jan 2023 11:13:41 -0500 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4008D7620E for ; Fri, 6 Jan 2023 08:13:40 -0800 (PST) Received: by mail-il1-x12d.google.com with SMTP id u8so1168169ilq.13 for ; Fri, 06 Jan 2023 08:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eXx0iBa6ViIHYuwColwZmoSS+/fQ6cQ84A5vNmlRsTI=; b=nlcWyiDO7MGfoHvK4pgyUGDpHFFkPAczwmrqEeEsJRsTwZjdSWJtjVqYw9zLOC8C+u cSf2j/RQPoaEOuRHj5KB6lNWm6TvnNI4UGY/QVggn8PGQjUgeafEWDIY7PoZo8+P1XcC HDJpFarnU3SjaSCn4IA00U+BDwMax9Vnv5+a4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eXx0iBa6ViIHYuwColwZmoSS+/fQ6cQ84A5vNmlRsTI=; b=OHr/cO1lync1qCX2+ye5EXQMzgqb+iVGI9Wd9x5lJGv8bhI3Ci0BM2xswPGo6pSEY7 tHGhNF+spJciGul11L5laH+PGWhNTLdn9YGASkrtgiPePJgR0WhpnrcLufGhAzZHKp0u vlffp+qkf/bhJDurB7Gy3vVQwidNDbNkFPYKULQTyv648uLb3rWYVjTTqGWJI13EQjcK Umn+3R4Hc7kWbKZsZ4aDYSEMHAC2/Z4WvEgrPqLTG1MnDNqz7/CZngDWrAzs/BPXpe8D CyxNmx+wFbV68s4V+yzE8NC1tHOB3ZocjROYVQ/Rc8zxNacT7KAM3PqFc9FxQ2wXM0gx SiNQ== X-Gm-Message-State: AFqh2kpwskwBdeqwQ5BlEfOgoxLNr7JUEVCRFckFlk6pALGLwz/wemp/ iLVq4hmR5hnosZGZHz1nw5scFA== X-Google-Smtp-Source: AMrXdXuj7LF9VtW5dlQvsWsu4WiPuQZugekoMZXaUNeIxPHYr71Ul0XbJbv9/eG4Ll/4PMjtHOunPg== X-Received: by 2002:a92:c151:0:b0:302:9dde:679d with SMTP id b17-20020a92c151000000b003029dde679dmr40362399ilh.17.1673021619603; Fri, 06 Jan 2023 08:13:39 -0800 (PST) Received: from localhost (30.23.70.34.bc.googleusercontent.com. [34.70.23.30]) by smtp.gmail.com with UTF8SMTPSA id t17-20020a92c911000000b002fa9a1fc421sm478364ilp.45.2023.01.06.08.13.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Jan 2023 08:13:39 -0800 (PST) Date: Fri, 6 Jan 2023 16:13:38 +0000 From: Matthias Kaehlcke To: Greg Kroah-Hartman 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=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 06, 2023 at 04:32:52PM +0100, Greg Kroah-Hartman wrote: > 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 This series ("usb: misc: onboard_hub: Invert driver registration order" et al) fixes the race condition mentioned in the commit message of the other series ("usb: misc: onboard_usb_hub: Don't create platform devices for DT nodes without 'vdd-supply'" et al), plus another race that was reported later (this patch). > or is that also needed? This series is (mostly) independent from the other one, it should fix the issue that was reported for the RPi 3 B+. It can be landed even if the other one is abandonded. With this series the other one doesn't fix or mitigate any actual issue (AFAIK), it would only be an optimization (don't instantiate the onboard_hub drivers if they'd do nothing). > confused Sorry, hope this clarifies things a bit.