Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5148665rdb; Tue, 12 Dec 2023 23:26:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeEHeIa+v7DnnK9zps5d2G2oQb+fySvZR40Gl8OuEWytXgdkswYANJHE0XKRp8ZWTcpTtn X-Received: by 2002:a05:6808:3849:b0:3ba:f4a:4326 with SMTP id ej9-20020a056808384900b003ba0f4a4326mr6478169oib.116.1702452400957; Tue, 12 Dec 2023 23:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702452400; cv=none; d=google.com; s=arc-20160816; b=df7qfzg0q3AZfrybkdYoXg+2Q1Zn95Z99yRuGbkibL9SZs+uWEreGceIdv+dam3enj 6Em6xVHaFwseG5wwjMtW/pJxtz7m1zGulX4rnboBh6DcwOgCw7zA6+YXY7DPJ0K4c/7A D0uZKqaWvt0iUc8utQwvusOLHdOZlfHOYD6TlXruoS7HzyxFQd/w5YrGZeO3d0R5czQh srUk1LpePMdd7pBSq38UNwhibFQPc2Zrvt6hsbEPSZiETUpWvntffE6Kjt6VajSabUZz DtGREpJdMhNL2+Veg2fQqbTcMe7S3xpHOT3btb7MDy4Mdg7fO5JOwH6W+4QLr1gXEjfx dejg== 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=b0yGtsyCFA3IwRnv/RhqxR8wtESp1qr9J0qY5Ya8pAU=; fh=1qeGCfbWZV4N2xAlIkWNCbq/syzsYiOV8r94u6dtrj4=; b=aoYv5KQYQg08mNFpTw0+jsvhCM2B57iKtl/sBozt6MthAozaWBWn7TiKsdVWKDPqDP /Ue9tL/QWqtp68Cpnyu2UqcDQuFy0T1qNdeKNKrxdZmCqAKi1ciw7pq+Hp9yRQuTep+O AEXMaEEsBGihhiCVfl0O9h9hJzRqPTIN+KHplYAem2ndT9KbWvclHUoI2UcM7Who9K9G MrBSISgxMX5jMO8g9TZ3+heYC1CGKOet18YzW2u5QDnQ/gA56GamriWOs2UrnC38n9OP zlZOdzOvGirxJ/z5odtLXaBh7MypGBZq709LSqLnzAb9tRmCuPEkfxE4EnKSZwweaoXY SsYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o7KlIn0S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id f5-20020a056a0022c500b006ce99793b9dsi8971445pfj.75.2023.12.12.23.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 23:26:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o7KlIn0S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 11ED78051CB5; Tue, 12 Dec 2023 23:26:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233201AbjLMH0Z (ORCPT + 99 others); Wed, 13 Dec 2023 02:26:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbjLMH0Y (ORCPT ); Wed, 13 Dec 2023 02:26:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED1EAD for ; Tue, 12 Dec 2023 23:26:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C9ADC433C7; Wed, 13 Dec 2023 07:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702452390; bh=76OJVqmnozrsnIZlwxGqTR/mpG0Abmmm32RAtiZ6W+M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o7KlIn0S1Hpqs8X1x8ZQp5yK2Q09F2mVnQ56btuzJyny0Gewb2PB8TvdDEDW9BYYZ iGbx/j27UdO53hdQnvB2R4g3yV2Cbc50kAb64IwIOok0MYUsO0JjS8+xn1QmQCQ/Cf E85+4GrJzX66OeaX2QlF3E/9FcBnQk2dFgMGF3PI= Date: Wed, 13 Dec 2023 08:26:28 +0100 From: Greg KH To: Igor Mammedov Cc: linux-kernel@vger.kernel.org, Dongli Zhang , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, mst@redhat.com, rafael@kernel.org, lenb@kernel.org, bhelgaas@google.com, mika.westerberg@linux.intel.com, boris.ostrovsky@oracle.com, joe.jin@oracle.com, stable@vger.kernel.org, Fiona Ebner , Thomas Lamprecht Subject: Re: [RFC 2/2] PCI: acpiphp: slowdown hotplug if hotplugging multiple devices at a time Message-ID: <2023121321-politely-creamer-fbad@gregkh> References: <20231213003614.1648343-1-imammedo@redhat.com> <20231213003614.1648343-3-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231213003614.1648343-3-imammedo@redhat.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 23:26:38 -0800 (PST) On Wed, Dec 13, 2023 at 01:36:14AM +0100, Igor Mammedov wrote: > previous commit ("PCI: acpiphp: enable slot only if it hasn't been enabled already" > introduced a workaround to avoid a race between SCSI_SCAN_ASYNC job and > bridge reconfiguration in case of single HBA hotplug. > However in virt environment it's possible to pause machine hotplug several > HBAs and let machine run. That can hit the same race when 2nd hotplugged > HBA will start re-configuring bridge. > Do the same thing as SHPC and throttle down hotplug of 2nd and up > devices within single hotplug event. > > Signed-off-by: Igor Mammedov > --- > drivers/pci/hotplug/acpiphp_glue.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c > index 6b11609927d6..30bca2086b24 100644 > --- a/drivers/pci/hotplug/acpiphp_glue.c > +++ b/drivers/pci/hotplug/acpiphp_glue.c > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > > #include "../pci.h" > #include "acpiphp.h" > @@ -700,6 +701,7 @@ static void trim_stale_devices(struct pci_dev *dev) > static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) > { > struct acpiphp_slot *slot; > + int nr_hp_slots = 0; > > /* Bail out if the bridge is going away. */ > if (bridge->is_going_away) > @@ -723,6 +725,10 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) > > /* configure all functions */ > if (slot->flags != SLOT_ENABLED) { > + if (nr_hp_slots) > + msleep(1000); > + > + ++nr_hp_slots; > enable_slot(slot, true); > } > } else { > -- > 2.39.3 > > This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.