Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2286650imm; Mon, 16 Jul 2018 05:38:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDQadvDpiD45zeZ+EMskuuflILmQQVaSURV1dmWxpU061ZJCM044d3rODCiYNSdbeAxI19 X-Received: by 2002:a62:954:: with SMTP id e81-v6mr17853569pfd.231.1531744693130; Mon, 16 Jul 2018 05:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531744693; cv=none; d=google.com; s=arc-20160816; b=aVvGfWFWtvZBliejxq7o9fkztVsjPfvNhgFJTUNF/PEmjFji90n4zd+3aTbILfHv64 N/2o/ZUUZtRe5jvo6HDq+tx8vWIKegbda0x7tRBkzPi8i+/vaQC/PhQ1pDmoG+90CvGq 6JRdQuWg/K3bP5V4YDbwyzp/Z245f+MTbOSE5pukM2ET3jtpQdqv3Ql2HuqBAqj7U+lQ MVsAxiEQR4AsQQRLGE94Fpg20zRMDzgQZusorgS05TfKPEnE6U1j5AyTUfZG1NT57iPs j3dssI5UAk31XDCp3vHwCI1bC8xpShx4/+LpCbJIZQbI9bFTV1LgHh5Do6l1q3gWm3cw gq9A== 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:dkim-signature:arc-authentication-results; bh=6NypUJfWXD5qO4NOSsek3VAUQu4ydqQemQ/xX2qK2QY=; b=IN+XSt0uA2AlY96Fuo1jkUgt8tWxagzvjNUOftvNrsUKmPCagl7TTTR7RenFhbCSFf 76/3c4OZ5EJoubggBdfNtKJW5mCafyBPb+CpTvwk5ZcLuRkJUqPKG2rrI8Jh1+yuAip6 G3ct6tZNCdTIdXgvns15d5rmMiqBCkC9JN9CpZ+q8e7JhXJrDMk29mqHU0QrIB/ejMIy lIuZSTwG8BTgMF5xxCLJ/xN6P0of4P4TuFub+g6Zx/sLAbT9eA2ncPsER13pqMhBQZzG BAtdUC/kybgJd8xOXgzLSIAw5q8B2gyutDATMGJIOR4qlpkf16xAeCeMNjIOWcf1jfHf vBIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CFmBeWmf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w188-v6si17049554pfw.307.2018.07.16.05.37.57; Mon, 16 Jul 2018 05:38:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=CFmBeWmf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729834AbeGPNEh (ORCPT + 99 others); Mon, 16 Jul 2018 09:04:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:53694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbeGPNEh (ORCPT ); Mon, 16 Jul 2018 09:04:37 -0400 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81666208E9; Mon, 16 Jul 2018 12:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531744641; bh=DuNUcIb9RG1Aau7igPxVJJPoDEhLzV7YeNJhpyrcFwU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CFmBeWmfAI3g1Y4DXcIGszq0JtjsilDw0VUH8fMY5QT2biqYXLaaY9xvL2TYISqcS LRcq0Y7OTBRMbJHSYnv71Lk9i9y7CDQP3uiXSVE39EpkK7HZsWJHCuUvySwX2+C3rC hkJaBwaQscHrLjSDIOEf1Szaf5SMoPF6uWyAzes8= Date: Mon, 16 Jul 2018 07:37:19 -0500 From: Bjorn Helgaas To: Lukas Wunner 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: <20180716123713.GJ28466@bhelgaas-glaptop.roam.corp.google.com> References: <83cfe0c826f1d793e2ead9032ef2109b5efa403a.1529173804.git.lukas@wunner.de> <20180712222109.GE28466@bhelgaas-glaptop.roam.corp.google.com> <20180713072109.GA23955@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180713072109.GA23955@wunner.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?