Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4441478yba; Wed, 17 Apr 2019 11:33:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjf0D7sJ8q4umtVdVXDjFaqjH2xfbr5iG95F4s7PjG+7aTJcjz2I0SQUGnjTbpcJUjXgRq X-Received: by 2002:a17:902:8604:: with SMTP id f4mr79999738plo.245.1555525986261; Wed, 17 Apr 2019 11:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555525986; cv=none; d=google.com; s=arc-20160816; b=AAxIWOBIjt2lKnsBe0R7uGB/9ANGBBV8b0G4Eh2fj2jnwtU+rQodMeAjyjOOp5pGRM rftfSNZGDTd6EBE4WOP+zu2EPooeQCzNPZKHdasWajPhIkn7+W0FkmDpErjODRnwBqTJ jPKKbQJ4pcdUWqf44Uthf0qxyM0cvgYyxOX4pcWCv20i2+hNQhIAOOJbrvO2+nX9pHSR FsNv2oYdXYMyIhvYMPytITVZGgt9mCph/3n6+SVKiegmj3pnnyHdGjb56SAoGXoK/5IE EZYv9dSUlrgsCrWkhzel7Zi/RxH3qoX5UohHQu4D4UG2LQjZTR77wdJ4sGgvCn9ncRO7 O5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QE+zGVHcn4rBOczPAxq5RUTI7rRUphfsm3Pb8osPQq8=; b=V0drtn9a58wy2Fa4VcABJmD4HeFqCkgJeG4HYrA+0ZKQLZ8FT+w9ltOof0+Jz2hWNj z2tqZEHHX08encSDrB6EJjEcm0qLxWN8wPaM8FQOyd0jybanNKynB/OLX64CbXl+2kVV 2mUCRUR2kEk7XNaQluBbEcuweZLtIZmYPJ7XrLm44ETniJTp1hmewq/TjbHSzh4bH4g/ WvG/gWBhtZKz9bgjWHQhstI6qJFobZTC6lTO3LP7B3XWE4878gUFEAt/lSdoziwEU3GV Q1AgDrnkmwp58oiXZrco5Wv7b4Zcl6L5v33PFYVswCtlrnDq2aDM5MZzG1NaIrHVugSc fwSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w70si46063312pgd.571.2019.04.17.11.32.50; Wed, 17 Apr 2019 11:33:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731869AbfDQSb7 (ORCPT + 99 others); Wed, 17 Apr 2019 14:31:59 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:39661 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728373AbfDQSb6 (ORCPT ); Wed, 17 Apr 2019 14:31:58 -0400 Received: by mail-it1-f195.google.com with SMTP id 139so6010132ita.4 for ; Wed, 17 Apr 2019 11:31:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QE+zGVHcn4rBOczPAxq5RUTI7rRUphfsm3Pb8osPQq8=; b=Q0lWj+8KIR1CGIK3iRV49IvWdLk2dfYNyzSMmFWdXgpfVyxeOQoWh82qPerdYbF5M4 xXch0ZSVQ9UStDwa3TzwSq5xFft+esvoX9x3uAcGh0bP1VKU2E3ZojP9/OoAWvR431Er 8WdF/9VktjpTCDdTmbylDv5Z6fwcV6QhL7gzhK+9VCH2YXV+jdDYhYpG2B1LvfOOFgMp WamPdUE2cenErVA2hMu++yiP4YpXxxQbOPjWq4f2e+oinX1TPll6PHEcLKEwf2cJICB6 r2jCfxTr1EAXPBeJthN/yRt3DuLer/bykQb9+vJCWAjLNGXiQ02W0tRgfsBeTWL/5csH ZFmw== X-Gm-Message-State: APjAAAWTmWsS5kbrKIe4C26ovgSSLbOUc1MIuyjeGzQc0i57IpYthaTn LBE52KeGdtElQTbCKSIqLZaOtg== X-Received: by 2002:a24:42ce:: with SMTP id i197mr4592itb.27.1555525917906; Wed, 17 Apr 2019 11:31:57 -0700 (PDT) Received: from google.com ([2620:15c:183:0:20b8:dee7:5447:d05]) by smtp.gmail.com with ESMTPSA id x10sm2711397ita.4.2019.04.17.11.31.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Apr 2019 11:31:56 -0700 (PDT) Date: Wed, 17 Apr 2019 12:31:52 -0600 From: Raul Rangel To: Alan Stern Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, groeck@chromium.org, oneukum@suse.com, djkurtz@chromium.org, zwisler@chromium.org, Sebastian Andrzej Siewior , Martin Blumenstingl , Dmitry Torokhov , Suwan Kim , linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Miquel Raynal , Johan Hovold , Mathias Nyman , Raul Rangel Subject: Re: [PATCH v2] usb/hcd: Send a uevent signaling that the host controller has died Message-ID: <20190417183152.GA118957@google.com> References: <20190417175300.GA74282@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 17, 2019 at 02:24:06PM -0400, Alan Stern wrote: > On Wed, 17 Apr 2019, Raul Rangel wrote: > > > > > Also where would be a good place to document this? > > > > > > Documentation/ABI/ is a good start. > > I'll add something to Documentation/ABI/testing/xhci-uevent > > Your patch will apply to all host controllers, not just xhci. The > documentation filename should reflect this. Perhaps "usb-uevent"? I realized that after I had sent the email :) I'll do usb-uevent. > > > > Why do you need to lock something that is "dead"? And why is the idr > > > lock the correct one here? > > We need to ensure that root_hub is not null. Though I'm not sure the > > lock is entirely necessary in this case. usb_remove_hcd stops the work > > item before it sets the rhdev to null. The reason I picked > > usb_bus_idr_lock was because it's the same lock that usb_remove_hcd uses > > when setting rhdev = NULL. > > > > Alan, what do you think? Should I remove the lock? > > You're both right; the lock isn't needed because the work is stopped > before the root hub gets removed. Acquiring the lock doesn't do any > harm, but it isn't needed so you probably should remove it. In fact, > you don't even need to test for whether hcd->self.root_hub is > non-NULL. Sounds good, I'll clean it up. > > Alan Stern > >