Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp685327imm; Fri, 13 Jul 2018 04:45:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdiiWEXLVpBZAPzQb1f+3XmubvJmscYd7erxWjap+vQeizOWssvwY6da0LWHfMW/zgHZoZU X-Received: by 2002:a63:c60:: with SMTP id 32-v6mr5858561pgm.155.1531482301968; Fri, 13 Jul 2018 04:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531482301; cv=none; d=google.com; s=arc-20160816; b=Rp2MatoDxvBnXePag2WgqSrPm/Q4RWkj1jDeL3RfHsohEF2o1P/GtMQwXu39RbCp5+ mejIP4/nAaHQr6eJe2sk+PJfl4y93bRELc/U54t/vm17zavA9gT6GavgNUb0ZmFsDih5 yhCWfxQ6jvTu2ddT6mR0QtJ4DRuXgxHupYcmf+Vul0j6GM/xIALO0yUcVDEM7D/YX9i+ Ke5ORzOC9YpjF67mZXV++4ElTT5gH8JPiAcR4QfAyuVMbpxAXWMhJ2+YT/LaO6TZ5is0 Sm579yd6ommeNYaUPupPcNeb6SoggxTgAOJCTeFnnMisN2RO3/012UoK2C7dDYkz841v n1XQ== 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=v1sfCUpl/p9iUEc0zvXk86Uqa5rpDtKH5jofXBu6hDk=; b=t9xUXoCX5idbJle7CUKVBAJpdUyq0dgUcWPMtvcuqVpJ9fvtnYmIxv0SWOgZFuCJzz CbguBTkPw/Ww5yoUdqVFQdfbVXAtSTszWKSeIvALGcpj899JGP4+KI5GqMxiUNO8szhy QxV7Gi7Nh2vO54Pivhnw6trVsTTMajb+ishlKXO0k2yJMXFVZp515nyuT6v/LMvwBFxK VPmYbthUW8gNZvPbrfuPZph9FjU1FdlotNKnWzf+Y1UKKFrb0VARlje9N44ZOHDaF+wx Rtn0XlOk0uiyek9Fnoaj4AzagjHCnqakh1eZpaZ1srXhM5h33s5KhKypNpB2rCReQhn/ z88A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=krJGiWUJ; 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 h2-v6si23561381pls.245.2018.07.13.04.44.46; Fri, 13 Jul 2018 04:45:01 -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=krJGiWUJ; 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 S1728327AbeGML6c (ORCPT + 99 others); Fri, 13 Jul 2018 07:58:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:42968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727283AbeGML6c (ORCPT ); Fri, 13 Jul 2018 07:58:32 -0400 Received: from localhost (unknown [69.71.4.100]) (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 D6E9920883; Fri, 13 Jul 2018 11:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531482253; bh=LcgSB0A1aVRF+YyZBiD9PH3nrlyOocBPWcYYWw82uFE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=krJGiWUJNLMYpJlQPqbQFImUx0kOunBKZFTdbNtr317MKwCYMCEo+YBx2X0nWndB4 DDEAVmzDZBtrq6q26+Th9bX1Ra1fXgAsrLWZqtl4BUbmgc7DzzH+5dPGU7b7LC9b33 x3Co5+SrOgZjvpG5Rnhvk49dLB4qnweiNt/kfJdE= Date: Fri, 13 Jul 2018 06:44:11 -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: <20180713114411.GI28466@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. Perfect, thanks!