Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2350376imm; Mon, 16 Jul 2018 06:39:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdFrYW2OLOYdb798JQ7dO3mQW7J9Sy3YxDFRJnrKGn6hHRnyFyhCz39evZZGrgkcKpkmAJL X-Received: by 2002:a63:4203:: with SMTP id p3-v6mr15514454pga.184.1531748371609; Mon, 16 Jul 2018 06:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531748371; cv=none; d=google.com; s=arc-20160816; b=lu73zY0MSMOlCrS4x6ijnivbE/EhhgHQFh2cAScHKmPJNjcf7slXu0F+JWssocmK3V 6uXzZ3hq5qUonOlCj++c6kCI6hBoIr5HFipXNScE7sT9DwvSt5t7mbGLkzAUYVXn+g47 n6wrCD9IwBVUl0pBOi+AzXztiHe1E9zP5GyD3EXINJpF6eXsmqDnVnp+3nQ7/85znnpC kMnDEH0HBXf1ANoF749jGEqbvOvcTLmWOvqLffmswsDjq83YDkEzmv/+Dr5tsbZ72m+2 pXUpHDiMi+dKAp6X+yNx3WNRvxzID4zvlCAsDhZ/2QWMWZvLcohgXusygfCV9j0HhsNw PHfQ== 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=8qlCWvDWIYLqnb/52ajjmDPS7btjyWK9eErzvLSinC0=; b=JM2qUCSCxSCTnepb75MM79JbkTCEx1gMxpcmebnxJ2kRi9UZoNeFIBOYaRbHGMi+29 Mer2RXbXeEH4DzZpBoJLfo3641RWG0OzkEkrVwRFMFzP04g6kzSUqG771XCZ7XMDBg+6 y4+m1p87amkkDJzDyy5PYID6asbm9VR/HrTlRHYvj7WCvu3eOO4Z3tA6ayPkAXz8q4Ep Lup9YsS8NF9mDm59RHGttFTdvztTE0NCiim6KBCG0s63g01dJYAgWAo3Dvy2Ae3xXsMI gXRPmDj+ItDdeygY8f/aiiHVKHvVIo4mLWV02VJbwwZ6CiCDuiueur2oYZzUWUYkHPIb E36Q== 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 s124-v6si4648814pfb.1.2018.07.16.06.39.16; Mon, 16 Jul 2018 06:39:31 -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 S1729927AbeGPOFS (ORCPT + 99 others); Mon, 16 Jul 2018 10:05:18 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:46651 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbeGPOFR (ORCPT ); Mon, 16 Jul 2018 10:05:17 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 6063B2800B1DC; Mon, 16 Jul 2018 15:37:46 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 05E9021C45A; Mon, 16 Jul 2018 15:37:45 +0200 (CEST) Date: Mon, 16 Jul 2018 15:37:45 +0200 From: Lukas Wunner To: Bjorn Helgaas Cc: Thomas Gleixner , Mika Westerberg , "Rafael J. Wysocki" , Ashok Raj , Keith Busch , Yinghai Lu , Sinan Kaya , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/32] genirq: Synchronize only with single thread on free_irq() Message-ID: <20180716133745.GA16346@wunner.de> References: <83cfe0c826f1d793e2ead9032ef2109b5efa403a.1529173804.git.lukas@wunner.de> <20180712222109.GE28466@bhelgaas-glaptop.roam.corp.google.com> <20180713072109.GA23955@wunner.de> <20180716123713.GJ28466@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180716123713.GJ28466@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 16, 2018 at 07:37:19AM -0500, Bjorn Helgaas wrote: > On Fri, Jul 13, 2018 at 09:21:09AM +0200, Lukas Wunner wrote: > > On Thu, Jul 12, 2018 at 05:21:09PM -0500, Bjorn Helgaas wrote: > > > On Sat, Jun 16, 2018 at 09:25:00PM +0200, Lukas Wunner wrote: > > > > When pciehp is converted to threaded IRQ handling, removal of unplugged > > > > devices below a PCIe hotplug port happens synchronously in the IRQ > > > > thread. Removal of devices typically entails a call to free_irq() by > > > > their drivers. > > > > > > > > If those devices share their IRQ with the hotplug port, free_irq() > > > > deadlocks because it calls synchronize_irq() to wait for all hard IRQ > > > > handlers as well as all threads sharing the IRQ to finish. > > > > > > > > Actually it's sufficient to wait only for the IRQ thread of the removed > > > > device, so call synchronize_hardirq() to wait for all hard IRQ handlers > > > > to finish, but no longer for any threads. Compensate by rearranging the > > > > control flow in irq_wait_for_interrupt() such that the device's thread > > > > is allowed to run one last time after kthread_stop() has been called. > > > > > > I assume this would need to be merged along with the rest of the > > > series, which should probably go through the PCI tree, but I'm > > > definitely not qualified to review this IRQ patch. And it would need > > > an ack from Thomas in any case. > > > > A v2 of this patch has already been merged through the tip tree on June 24, > > it's in linux-next as commit 519cc8652b3a, and ISTR that I marked this patch > > either as "Obsoleted" or "Not Applicable" in pci-patchwork. There was no > > build-dependency of the succeeding patches in the series on this patch, > > hence merging through a different tree was possible. > > Great! Do I need to make sure the tip tree is merged before the PCI > tree during the merge window? In theory the tip tree would have to be merged beforehand, but in practice the odds are extremely low that someone with an affected machine (primarily a Mac introduced 2011/2012) happens to unplug a PCI device during a bisect while running a kernel which has the pci tree merged but not the tip tree. So I wouldn't worry about it. Thanks, Lukas