Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp693210pxb; Wed, 11 Nov 2020 13:56:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA7aN4VtZHKYk7cCEEZqpY7b8BkO3JXuwP1ZYbkCjF0NmjDW03OpMXqJo/5HaAHL2adiw3 X-Received: by 2002:a50:9f2b:: with SMTP id b40mr1807849edf.20.1605131803908; Wed, 11 Nov 2020 13:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605131803; cv=none; d=google.com; s=arc-20160816; b=bAjyPTBuJrCUfSuWrPKWvEZkN54RM/thl4YIGQqymMRydHB0wjpnr9Ny+WYwkm2jqV yM3re+EKHAEpSMENQWM5pSejLof6PpDjIScIpxqCpWqurLExRunp3XF86C/e8QEojWO0 AjlfEMfbbSW/wCWrFOdao5ejGv6O8zuFMrM9JPM4BasNM+NAwL0l/OecC0dZkzZHV3bx 1pUUcZbDdnEdsEvdeGx5Tvpi3zdhfaXBIyHRiSLEVgVxZQsH4lZ1poWqKRIYwyfI1VXb QmYz7cPdks4WODFNQB1FkXpGNC8HqmKbPg5bvKwgQvV2Nk9VU5K3A8H6NpR3eG9znZ7a tFSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=78PEX9tuoPQIKEzg+5Ty/0KEjiWq1+jQ5AlyPNSbMpc=; b=Xd4itfWkksTPy5wQ0UxjViMBYAvoUKduVucwSCVXhTm+9C++HFo4T8qrt8fbEfN3+c PuL2JHURbR6tkHDedIn/p35H/JQ6tx9mlNz7/8lPZvYD2CLNyGRMU2M+e78rw6giU1Ep tZYG+/gXq6uj2iPxVAzRWQdG/syZ7VEN6E7ESo4o0+bLz+QunwBMF+pXVzFP0IvTgSGW kwJ319+OOzWkg4eQ7RwpsfIi7Iwgtt0Lf+NHDoR7lPnqI80jxOGLWXNS809fCgFowErw BZ9y92K1TrYOzkG0H2q79F/lG3q1wujYBgowilFWTuXkmP4PkHRlqVXHpOq2cz2vqdeR 9jyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si2350561edp.146.2020.11.11.13.56.21; Wed, 11 Nov 2020 13:56:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbgKKVyp (ORCPT + 99 others); Wed, 11 Nov 2020 16:54:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbgKKVyp (ORCPT ); Wed, 11 Nov 2020 16:54:45 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1595FC0613D1; Wed, 11 Nov 2020 13:54:45 -0800 (PST) Received: from dslb-094-219-035-043.094.219.pools.vodafone-ip.de ([94.219.35.43] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kcy4c-0003Vw-C2; Wed, 11 Nov 2020 22:54:38 +0100 From: Martin Kaiser To: Nicolas Saenz Julienne , Lorenzo Pieralisi , Bjorn Helgaas , Florian Fainelli Cc: bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2] PCI: brcmstb: Fix race in removing chained IRQ handler Date: Wed, 11 Nov 2020 22:53:55 +0100 Message-Id: <20201111215354.21961-1-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201108184208.19790-1-martin@kaiser.cx> References: <20201108184208.19790-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call irq_set_chained_handler_and_data() to clear the chained handler and the handler's data under irq_desc->lock. See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained IRQ handler"). Signed-off-by: Martin Kaiser Acked-by: Florian Fainelli --- v2: - rewrite the commit message to clarify that this is a bugfix drivers/pci/controller/pcie-brcmstb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index bea86899bd5d..7c666f4deb47 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -606,8 +606,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie) if (!msi) return; - irq_set_chained_handler(msi->irq, NULL); - irq_set_handler_data(msi->irq, NULL); + irq_set_chained_handler_and_data(msi->irq, NULL, NULL); brcm_free_domains(msi); } -- 2.20.1