From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91B2CC43381 for ; Wed, 13 Mar 2019 10:06:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6142C2184C for ; Wed, 13 Mar 2019 10:06:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ICSaI3TU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="FosqpDgx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6142C2184C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AQlwLJKtQxa1d6Y5eM/doZehsJoxky+W8AqBuE0l1PA=; b=ICSaI3TUoItMBy 5Yv+a10gL700rHR9P3Df45/4C+8W0H6FKmRmxmTgNPcj70a6WTlnPOJdzw17M4tGsVc/F5blMyZ8D Y4fXJ7JryRrDBUqX15rvxbjbPO3M0341Nd3+uQjb6JIf7JFPJKjY7bzrVQV1zrupLLtxD4+Hs21vJ UBGQ//zLFe5gkkuWMU9X9gdjLFQOiJnTlgLZAuDqXk1iHydATzSVIUEZ+EYGVCw8ar2yJpOCkhbPN OkwkOVocBUxjDabKriJI00YInhTViADy/JyAFsHFMDPPFkZibJ6vM4o20Sq7lUEpjfwy4B00JxmoJ Ne+FO6MvCdUzLFrpICDQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h40mK-00079x-0O; Wed, 13 Mar 2019 10:06:28 +0000 Received: from smtprelay.synopsys.com ([198.182.60.111]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h40lV-0006MA-43 for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2019 10:05:38 +0000 Received: from mailhost.synopsys.com (badc-mailhost2.synopsys.com [10.192.0.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id BA6E010C1E4D; Wed, 13 Mar 2019 03:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1552471533; bh=Z+xGZYnutxceKMnuby8zql687TXvUYPRaNKAXZ01Y6g=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=FosqpDgxeKrSY29WtJoqACzFROVzFVlYv4Joq1OYq3u74vavqCOi/Z3yTd/pZpOga NzJmH2T6KSFVwiN0b00IWy/KjG0MDpMNraH7+o3tiDgSVwibWl/Kca/yLOX5PuCB+e rEmvNYTTrfA/8nJdNX6wP35xe4qHUa1lTiyQsvufwhfAkVskRs+730dJQXTxVyK/uL ChzBEtcayStLh0ACIotW+0JUGx/kM7DZqk+qcadha2aHJtJr+fE0HVjIWsRp1gOuFT vt+7Sfg5E4emPukNlaSrSk2plnQXpF8zz2ixXVmce4qcKrj0dSfUIpnlQpp0soTHGw BZ3NP8so/EjDQ== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 57B52A0067; Wed, 13 Mar 2019 10:05:28 +0000 (UTC) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 03:05:28 -0700 Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by DE02WEHTCB.internal.synopsys.com (10.225.19.94) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 11:05:26 +0100 Received: from [10.107.19.55] (10.107.19.55) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 11:05:25 +0100 Subject: Re: [PATCH v2 1/5] PCI: dwc: Fix dw_pcie_free_msi() if msi_irq is invalid To: Jisheng Zhang , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Bjorn Helgaas References: <20190301125510.4e2ee985@xhacker.debian> <20190301125625.4e15d869@xhacker.debian> From: Gustavo Pimentel Message-ID: <8a0bda6b-6879-e4ac-cfe6-171abbd72abd@synopsys.com> Date: Wed, 13 Mar 2019 10:05:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190301125625.4e15d869@xhacker.debian> Content-Language: en-US X-Originating-IP: [10.107.19.55] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190313_030537_199107_3554D11A X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 01/03/2019 05:03, Jisheng Zhang wrote: > We should check msi_irq before calling irq_set_chained_handler() and > irq_set_handler_data(). > > Signed-off-by: Jisheng Zhang > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index 0c18ab63811f..a94d3530b694 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -298,8 +298,10 @@ int dw_pcie_allocate_domains(struct pcie_port *pp) > > void dw_pcie_free_msi(struct pcie_port *pp) > { > - irq_set_chained_handler(pp->msi_irq, NULL); > - irq_set_handler_data(pp->msi_irq, NULL); > + if (pp->msi_irq) { > + irq_set_chained_handler(pp->msi_irq, NULL); > + irq_set_handler_data(pp->msi_irq, NULL); > + } > > irq_domain_remove(pp->msi_domain); > irq_domain_remove(pp->irq_domain); > Sounds good. Acked-by: Gustavo Pimentel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel