Received: by 10.213.65.68 with SMTP id h4csp307589imn; Fri, 16 Mar 2018 03:55:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELtgIE8liblDomSpo2MNedyUgkKel2UGnFhCIAPFGmZ27257MIa+QZzBfl3gOZCE2Mh54whT X-Received: by 2002:a17:902:7c84:: with SMTP id y4-v6mr1615303pll.305.1521197748492; Fri, 16 Mar 2018 03:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521197748; cv=none; d=google.com; s=arc-20160816; b=AJGUMxNZf48eTvVSmho1km75Eo0nLrrPfihgFEYdYOJmHTr/5fKXwnMFEYvTkbaFUa AderLh+oecg9amayAayN2kZgctCs5hzKfqLIl48YKEV2LEWpYU41ENe1nvIB6Jppw2+R QWtOXnMpwfpWVQoG+P/bR7nD5k0ARLGcyIW4/8nCOohDoi8Ifr9H0lLY7txJYd229+KJ HGnw/ItfwCfq4vuPNtzKcFZfWZ9tWsnsJnyDYLMD4BB0ighD9r5OiuK7yFvcJCrBZ6I0 54OC2LZ7JaUxxiXzZcEx0hnjdTsMuuMpeZJvx9dCR17yv01CVt2ZT9vmp0yBbtKGHeqZ l86Q== 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:arc-authentication-results; bh=LLQilbDcm4b9H1nAhBC83kJmhkTUiDDCXfiWEGEUFe0=; b=fYo0X17U5F32Bx6S4PP3/aNs2QpmfT+xGU0NeaOw3fb64cplNPrdvDiF2/YxSmYfoR pDyd4OgSXvTUNuaONa05UXFrskKiB0gXheaLv9RQgC0oYyKdEcV04eYJTs2N13PTFfXE IWykLNSuSrlssA5B0NB3LxFPvj6qyVtDyhXTzN5yx2L2+Oq3jnP3Fr1ZcZhw4XcIvu1S NWJRwLhI87z2OOWICfRcvS6+uY3/uDJqWw0J8U6Fv6Y+xak3F9NUOFYRmEkysmrx1gV/ OhFUGiffa7lMZrXFuF/xi3uj4/6JwdvNkDI2SHV1dMOwU6/YUJOmI7sS35j3V4EoyjRN lTPA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si4524566pfm.366.2018.03.16.03.55.34; Fri, 16 Mar 2018 03:55:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753624AbeCPKyf (ORCPT + 99 others); Fri, 16 Mar 2018 06:54:35 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54216 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753449AbeCPKye (ORCPT ); Fri, 16 Mar 2018 06:54:34 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4C0301529; Fri, 16 Mar 2018 03:54:33 -0700 (PDT) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.207.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E53D83F25D; Fri, 16 Mar 2018 03:54:30 -0700 (PDT) Date: Fri, 16 Mar 2018 10:54:24 +0000 From: Lorenzo Pieralisi To: Dexuan Cui Cc: "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , KY Srinivasan , Stephen Hemminger , "linux-kernel@vger.kernel.org" , "driverdev-devel@linuxdriverproject.org" , Haiyang Zhang , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , "vkuznets@redhat.com" , "marcelo.cerri@canonical.com" , "Michael Kelley (EOSG)" Subject: Re: [PATCH v4 3/4] PCI: hv: Remove hbus->enum_sem Message-ID: <20180316105424.GA24198@e107981-ln.cambridge.arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 02:21:51PM +0000, Dexuan Cui wrote: > Since we serialize the present/eject work items now, we don't need the > semaphore any more. > > Signed-off-by: Dexuan Cui > Reviewed-by: Michael Kelley > Acked-by: Haiyang Zhang > Cc: Vitaly Kuznetsov > Cc: Jack Morgenstein > Cc: Stephen Hemminger > Cc: K. Y. Srinivasan > --- > drivers/pci/host/pci-hyperv.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) Dexuan, while applying/updating these patches I notice this one may be squashed into: https://patchwork.ozlabs.org/patch/886266/ since they logically belong in the same patch. Are you OK with me doing that ? Is my reading correct ? Thanks, Lorenzo > diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c > index 1d2e1cb617f4..0dc2ecdbbe45 100644 > --- a/drivers/pci/host/pci-hyperv.c > +++ b/drivers/pci/host/pci-hyperv.c > @@ -447,7 +447,6 @@ struct hv_pcibus_device { > spinlock_t device_list_lock; /* Protect lists below */ > void __iomem *cfg_addr; > > - struct semaphore enum_sem; > struct list_head resources_for_children; > > struct list_head children; > @@ -1648,12 +1647,8 @@ static struct hv_pci_dev *get_pcichild_wslot(struct hv_pcibus_device *hbus, > * It must also treat the omission of a previously observed device as > * notification that the device no longer exists. > * > - * Note that this function is a work item, and it may not be > - * invoked in the order that it was queued. Back to back > - * updates of the list of present devices may involve queuing > - * multiple work items, and this one may run before ones that > - * were sent later. As such, this function only does something > - * if is the last one in the queue. > + * Note that this function is serialized with hv_eject_device_work(), > + * because both are pushed to the ordered workqueue hbus->wq. > */ > static void pci_devices_present_work(struct work_struct *work) > { > @@ -1674,11 +1669,6 @@ static void pci_devices_present_work(struct work_struct *work) > > INIT_LIST_HEAD(&removed); > > - if (down_interruptible(&hbus->enum_sem)) { > - put_hvpcibus(hbus); > - return; > - } > - > /* Pull this off the queue and process it if it was the last one. */ > spin_lock_irqsave(&hbus->device_list_lock, flags); > while (!list_empty(&hbus->dr_list)) { > @@ -1695,7 +1685,6 @@ static void pci_devices_present_work(struct work_struct *work) > spin_unlock_irqrestore(&hbus->device_list_lock, flags); > > if (!dr) { > - up(&hbus->enum_sem); > put_hvpcibus(hbus); > return; > } > @@ -1782,7 +1771,6 @@ static void pci_devices_present_work(struct work_struct *work) > break; > } > > - up(&hbus->enum_sem); > put_hvpcibus(hbus); > kfree(dr); > } > @@ -2516,7 +2504,6 @@ static int hv_pci_probe(struct hv_device *hdev, > spin_lock_init(&hbus->config_lock); > spin_lock_init(&hbus->device_list_lock); > spin_lock_init(&hbus->retarget_msi_interrupt_lock); > - sema_init(&hbus->enum_sem, 1); > init_completion(&hbus->remove_event); > hbus->wq = alloc_ordered_workqueue("hv_pci_%x", 0, > hbus->sysdata.domain); > -- > 2.7.4 >