Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1974545ioo; Mon, 23 May 2022 07:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJB6zMAUc0UPcO1DHRtKdJJFxClwWnOotVNpWek/QgVAB0KgtBMxc9mdT2UBRHw5aT0wCx X-Received: by 2002:a05:6a00:198f:b0:50e:7e6:6d5c with SMTP id d15-20020a056a00198f00b0050e07e66d5cmr23654833pfl.20.1653315808677; Mon, 23 May 2022 07:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653315808; cv=none; d=google.com; s=arc-20160816; b=KoU1ZinL0NAQN7+rxbYLrl7ONLU0wv+qanXkO+vaCC60uJjw3YBybv8oUfnHQmT8j0 KtvTLH1d9RYwtrKRD7Qx8f+wx91ow3utr6M0M0jGhbW2bwfoB0BmcayG9xNSCpK4E3YW khYLiVyybYBClyFMw+2a427JONDYMoniZNvD2/foD2MhXVsW1yTcc88/CheXxdyMmk5O oMMH1Q+Ze4nngC+DD9BPg44JNieHqEvmwOGzNCH0Aac9mE5SetZ+BNUlsqipv329Exwc mx/tjdB7qaGt9k8ggP9fPfclfg+Jmb6n70Xem5FZBbey3+IB+yDeqN+DN/cA8tuo6gtD rKTg== 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=Owbjvsnhvojvt0H89kmZn3fSba6CezwEhqk2lgJ3EFk=; b=MeavJkHshvuXPwCMPAOezecJ7o1FLvSK65hiU4sPR+NlS9BARddxhA/IfI4RsGXDt9 Mv5Q9LA65jk/qJpoqoiSC9b+ceotVnzlOzqwdS+Njtybmf96Ec5KSF6u0ebx1JWokuL7 sybUne/7FMCeg37nmumR0Xkk1q+Kms5cyRxLl9+Mozd0JeZiIQFIkdHQmx4/ayp0GW0l zNeveDeSNfAkDM+wHth7HmLxeILKEX3LeILM4ibOmVb8fhwk6N2JH6vb2KMDSfVy8KmN oCsiwR81mNL2LvN2DjWBvW2qyn6IKQ+JEKlmGIj5R5EJ7C37nwGGqbZKELOXXVXJtZoX kPgQ== 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 z71-20020a63334a000000b003dafb5664a4si10376573pgz.590.2022.05.23.07.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 07:23:28 -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 55CF01F626; Mon, 23 May 2022 07:21:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237108AbiEWOU4 (ORCPT + 99 others); Mon, 23 May 2022 10:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235987AbiEWOUp (ORCPT ); Mon, 23 May 2022 10:20:45 -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 0B5C75A17A; Mon, 23 May 2022 07:20:43 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (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 4D8E1100D5844; Mon, 23 May 2022 16:20:42 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 13E602ED3E7; Mon, 23 May 2022 16:20:42 +0200 (CEST) Date: Mon, 23 May 2022 16:20:42 +0200 From: Lukas Wunner To: Sheng Bi Cc: Bjorn Helgaas , Alex Williamson , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: Fix no-op wait after secondary bus reset Message-ID: <20220523142042.GA19286@wunner.de> References: <20220516165740.6256af51.alex.williamson@redhat.com> <20220518115432.76183-1-windy.bi.enflame@gmail.com> <20220520064148.GA20418@wunner.de> <20220521124910.GA13556@wunner.de> 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) 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 Sun, May 22, 2022 at 01:37:50AM +0800, Sheng Bi wrote: > On Sat, May 21, 2022 at 8:49 PM Lukas Wunner wrote: > > On Sat, May 21, 2022 at 04:36:10PM +0800, Sheng Bi wrote: > > > If so, I also want to align the polling things mentioned in the > > > question from Alex, since pci_dev_wait() is also used for reset > > > functions other than SBR. To Bjorn, Alex, Lucas, how do you think if > > > we need to change the polling in pci_dev_wait() to 20ms intervals, or > > > keep binary exponential back-off with probable unexpected extra > > > timeout delay. > > > > The exponential backoff should probably be capped at some point > > to avoid excessive wait delays. I guess the rationale for > > exponential backoff is to not poll too frequently. > > Capping at 20 msec or 100 msec may be reasonable, i.e.: > > > > - delay *= 2; > > + delay = min(delay * 2, 100); > > Capping at 20 or 100 msec seems reasonable to me. Btw, since 20 msec > is not a long time in these scenarios, how about changing to a fixed > 20 msec interval? The callers of pci_dev_wait() seem to wait for the spec-defined delay and only call pci_dev_wait() to allow for an additional period that non-compliant devices may need. That extra delay can be expected to be low, which is why it makes sense to start with a short poll interval and gradually extend it. So the algorithm seems to be reasonable and I wouldn't recommend changing it to a constant interval unless that fixes something which is currently broken. Thanks, Lukas