Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2634856iof; Wed, 8 Jun 2022 08:55:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFbjaxC49ltbiEd0PigPi3TfTs1aVgehmdMiHkghlMj/ekS2uXTsi5//FL2NKnzOaz+PCh X-Received: by 2002:a17:90a:aa8a:b0:1c9:bfd8:9a90 with SMTP id l10-20020a17090aaa8a00b001c9bfd89a90mr38565205pjq.118.1654703747961; Wed, 08 Jun 2022 08:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654703747; cv=none; d=google.com; s=arc-20160816; b=GpDr3z8i7jQN3PWTnA3pG2LS+Zi/VGQ3y6znQwc/bu1QmNoXPEmWbCdQ4FJSvEsXFt AZa8cNerxqQLUZnFcFTZMDqRt+dUmp3PT/2J19Rnp2zG0IggBOwwsdp0N8umUdIRgDOD b0GQoaBa5HN37MG67FQwmZ9RGrsClxh3Je4kpXuONs15Kr5VSYfGMoMATjkidDK640Tx dJNGhYV6/zvCnUsmDyBY7KMTW8C76CrPM99O+aN8D+oMJEm3vMEtqi2RnEsE6OSAmdAc yGXdT56SpjUgpkeaFyoSjPNWU5u6eJ5Av+uvHYIbqKDHHwz1EwmwzaMfxIMjZskbZdSP G5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TAY6LRV7U3BRJMm8/1WQZ5aNbGV95JkOJgy1NMp1Z/4=; b=OB1SUr/yk++FTffK2XE6DMbb/21id2K0/BKgVolrlluftaiLl8MzcGNdm4ieUff8bh U22CC9Q7J37kWO8MxqjUygCrDbi8FPhwJBdvq/VGpS6xRNljU0X82KgQsVTmWOSoW9sx uz8fsddnSmCOgWahawgUkJghruQbjEggp+Ggu7bmEVg8oeh6dbpYksikOp1ZyRc+kjEJ DXsuW/w7VSMzsxwUYSl6UwHvr3w2FO+hOUjFc+tsRqLeY37ql364JUzEdylP+YMpyVSN xJUGG4jzmVG+M8s/U37QV/57l8XaI/hkaCQIVR0zz7qkWZtaD9oMOUCM9I8lD76IWYBi g7Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id me18-20020a17090b17d200b001df95edac97si35751395pjb.4.2022.06.08.08.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 08:55:47 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A9168156B41; Wed, 8 Jun 2022 08:28:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244255AbiFHP1q (ORCPT + 99 others); Wed, 8 Jun 2022 11:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244379AbiFHP1c (ORCPT ); Wed, 8 Jun 2022 11:27:32 -0400 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f23e:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C94F46B1B; Wed, 8 Jun 2022 08:23:46 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id E59AD10045BFB; Wed, 8 Jun 2022 17:23:44 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id AE3DF2ED3A3; Wed, 8 Jun 2022 17:23:44 +0200 (CEST) Date: Wed, 8 Jun 2022 17:23:44 +0200 From: Lukas Wunner To: Sheng Bi Cc: helgaas@kernel.org, bhelgaas@google.com, alex.williamson@redhat.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] PCI: Fix no-op wait after secondary bus reset Message-ID: <20220608152344.GA17064@wunner.de> References: <20220523171517.32407-1-windy.bi.enflame@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220523171517.32407-1-windy.bi.enflame@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, May 24, 2022 at 01:15:17AM +0800, Sheng Bi wrote: > pci_bridge_secondary_bus_reset() triggers SBR followed by 1 second sleep, > and then uses pci_dev_wait() for waiting device ready. The dev parameter > passes to the wait function is currently the bridge itself, but not the > device been reset. > > If we call pci_bridge_secondary_bus_reset() to trigger SBR to a device, > there is 1 second sleep but not waiting device ready, since the bridge > is always ready while resetting downstream devices. pci_dev_wait() here > is a no-op actually. This would be risky in the case which the device > becomes ready after more than 1 second, especially while hotplug enabled. > The late coming hotplug event after 1 second will trigger hotplug module > to remove/re-insert the device. > > Instead of waiting ready of bridge itself, changing to wait all the > downstream devices become ready with timeout PCIE_RESET_READY_POLL_MS > after SBR, considering all downstream devices are affected during SBR. > Once one of the devices doesn't reappear within the timeout, return > -ENOTTY to indicate SBR doesn't complete successfully. > > Fixes: 6b2f1351af56 ("PCI: Wait for device to become ready after secondary bus reset") > Signed-off-by: Sheng Bi Reviewed-by: Lukas Wunner Cc: stable@vger.kernel.org # v4.17+ Code-wise, this LGTM. There are a few things that could be improved in the commit message, e.g. in the last paragraph, "changing" (gerund form) is not proper English and the imperative form "change" would be correct here. However, these details are difficult to get right for anyone who is not an English native speaker and often Bjorn will wordsmith the commit message to perfect it. See here for some of the things Bjorn looks for: https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/ Bjorn may not find the time to look over your patch immediately, so please be patient. Thanks! Lukas