From patchwork Thu Sep 24 11:05:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 11797069 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD6E459D for ; Thu, 24 Sep 2020 11:11:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7329421D91 for ; Thu, 24 Sep 2020 11:11:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OA5/UIPN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="hw3dFdzK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7329421D91 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synaptics.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DNAagw6A308xpf4Z2ro/92PhYPK3OvfpoCXh+rfvf6g=; b=OA5/UIPNTVmUn2aSIhNTiz9iu hpw1EX7jguPF6mv1HHwmJ8civt/sGHk68CKg/7JbtrBup9FKq1UumNwUpUI11g7DA8ZVe6GgDGK3o 6pYRSEXYl9wQ7YOh3+k9JnDlncmZH01fiVRVfJ7tfYfMMCnIqniBOBfdoIZ0NtKDjXB4ruv6l7s5y EVSwT1W3GwPS6B/d+7wUwOX3VV+RvrsUr0sj1uvPrOGTT6y7vs4/28rjOU6L/7Q/xfp361KymDjmB /rm2gkNMp4LAHavT2x1mtz8Y9HlYSZ25n6XaLwz2eZe2aUdj5KFzBN+DEu5iM1DxfeRPaspTfhqQR ke2iIlmww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLP8b-0002MW-En; Thu, 24 Sep 2020 11:10:09 +0000 Received: from mail-bn8nam08on2041.outbound.protection.outlook.com ([40.107.100.41] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLP8V-0002KP-He; Thu, 24 Sep 2020 11:10:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=myrwH2prxCysjqyRQ9NmsYKefdx6EODWmyKSiBkdJtjkP8jdNkWlQxd5GQ9RhOGUpNErPhkg8n/RANEnONJ4ha9YqSOtkklPYcRz/CBiuWejQdjyImM8JYyl5fADdU6StTryz7wrPjnSvhWgnf7BZPD1plmeRBXtlz4qK+7lGVPS6Y/4Ev0E5USerrUVJr3YkcEhQshe+2BLxja3RmcHlHnu4cKCyRi/jArBXJjAnYEAsi9GrNuNiFiCVRij3YmvKS+0pCxJXRgdfTLqhihCJYhozp4+Oe3KpTlLRErFpKwH4gKSgCE/FlvhrwfDziIZM5m62vHs0h0SDR+ra1KkAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4gr8URCQhuY2RFqeQmkI6Ro4/AoeXVwtQdjg2RLYvyI=; b=NM6mLQfxnoAj1COvU2IGRKDtm+RAc58kyQywpmA/KMTTHnQ9tiRidysor3272v50kaKgrZ4+emzmf7UzQZG2+BwlByXQkaph1O/xZ25Av5RmcW2mw9aLI8DBAy1dQtpqVP2dkirrZMFQGDZ0tOzN+6kAQxuwFDTJjm5v2AYOGtLRUnegOaIsO/j+AERdoZTGEfUJGgra9PcoQrz6jflGnlhJpd8GPuN3D5RgfeOt4j4/s4lUs9foEXVtfKKyT86GAMn8SXSE5DJeCfV1bySCr3o9cz3bUyhBedB2QnT9IimI0eo7ITbJQs1v45pIgIHGXnCsBqjmBkwy036ejEf2gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4gr8URCQhuY2RFqeQmkI6Ro4/AoeXVwtQdjg2RLYvyI=; b=hw3dFdzKT/m1Q4gd5j+bgyDBkJgEI7QnrDjIlZvgZ8n5VbDYw8ZAE+NO/dBB5ZAtjetqbC6urgpj/abyu8P6wFZS/AWMMiD/Jwsg5xC73QKmRI1zkLLbabVsc+ZFa+S04kenMrSTiC+KfhkjnsOGSbvg6CnQS1dbB9goJIweIH0= Authentication-Results: ti.com; dkim=none (message not signed) header.d=none;ti.com; dmarc=none action=none header.from=synaptics.com; Received: from DM6PR03MB4555.namprd03.prod.outlook.com (2603:10b6:5:102::17) by DM6PR03MB4698.namprd03.prod.outlook.com (2603:10b6:5:180::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Thu, 24 Sep 2020 11:10:01 +0000 Received: from DM6PR03MB4555.namprd03.prod.outlook.com ([fe80::e494:740f:155:4a38]) by DM6PR03MB4555.namprd03.prod.outlook.com ([fe80::e494:740f:155:4a38%7]) with mapi id 15.20.3391.027; Thu, 24 Sep 2020 11:10:01 +0000 Date: Thu, 24 Sep 2020 19:05:57 +0800 From: Jisheng Zhang To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Jingoo Han , Kukjin Kim , Krzysztof Kozlowski , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Yue Wang , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Jesper Nilsson , Gustavo Pimentel , Xiaowei Song , Binghui Wang , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Pratyush Anand , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masahiro Yamada Subject: [PATCH v2 1/5] PCI: dwc: Call dma_unmap_page() before freeing the msi page Message-ID: <20200924190557.48fddba5@xhacker.debian> In-Reply-To: <20200924190421.549cb8fc@xhacker.debian> References: <20200924190421.549cb8fc@xhacker.debian> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ClientProxiedBy: TYAPR01CA0072.jpnprd01.prod.outlook.com (2603:1096:404:2b::36) To DM6PR03MB4555.namprd03.prod.outlook.com (2603:10b6:5:102::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (124.74.246.114) by TYAPR01CA0072.jpnprd01.prod.outlook.com (2603:1096:404:2b::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Thu, 24 Sep 2020 11:09:49 +0000 X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Originating-IP: [124.74.246.114] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97e6328e-44ed-4b53-ea52-08d8607a61c6 X-MS-TrafficTypeDiagnostic: DM6PR03MB4698: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:341; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YLRK+Q860l81NtKAbjitc9IGolFRH2/MNFk2SU7s2/CkGHmGfJNTJsn60BEl29d84AT2Db26qrQjNCEvab3Bp1dVzqzH2o14UoUEQcJaKm+AfLgXg7udxbTuIgcBuQcCjJGxklnbq3i8Wt6wWi0pbh50nrOTJ/IRIC8C8GxvIloFHJQxm0Rd3c1rh39FCocssaOTjQDTSiAyV9GjXDgUbegc5H1StWugO1dPEow7/MIGG0JJgnfmR2RFaVP0rdFwt4MrClRvoTF8LvGIL6Yp8KRdLwSYO5yUSn7s2gLxAgOsE0j6cl45+a+4qAqr5mUY1FfLA2qDEkuuU67EIG5UpLvDBbJdqh36Eg2LENnypjgxgVGTrANAquXLPMEqaSxe X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR03MB4555.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(396003)(366004)(39860400002)(376002)(136003)(2906002)(86362001)(6506007)(52116002)(7696005)(83380400001)(478600001)(5660300002)(6666004)(186003)(4744005)(66556008)(16526019)(956004)(1076003)(26005)(316002)(66476007)(7406005)(66946007)(9686003)(55016002)(8676002)(8936002)(110136005)(4326008)(7416002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yBWSSQcE7+pQD/oYeVrS2GjzUN0irP0sYfuE8WT/gNfUdqPS2PXR2j0al1rVRoxbJef48hDMyFxZSJR4I7uv4Jyk2TwYgImaNcv1eYobXecCf9ju3tuYNswY8iSte4YSFZ3SSkSVHEf+MW0kHpygUDpeXB6N20r7nYYWzAWULFaGUtnujjTBEYLyf9MmarAvjG9OSs5oRF4oFKsfCFPBtus3JcBNN+StqRnsbxVDF2KhlUZsAuwnSAMiSOwLh079PgmIRZdx4V+Kvs2HcuA38QU2enPQpkJQKx664DIAo7vNqR5KnvHX39p6b6QhcP83K3htVeT1MA8EdaKd3LfO9T3eO2yCskjhmqWBdXbPYD4o5I4jcZzFFxubN+E0H4ENeyM7aVCg3VIzRdvhJj9At6nnEe60Dcb5QQxCY5SiZeyx0dqq2x7qX9H8uZ5csU2zWgGtWUc63WZqbwm966BjUXai/t1M9TXU8SNqiF/NV5FVBVofPAHTr3QYifKdUQmdx+ccJ7c46DuYGJ8SYosR7ZivpOxdVi+4CNjDrgsxL30oxlTKcGpZV7+fiCb5KkPfhuLLxMs9uqUay/r741atUoxApFkk8MaEMmNt5jq5GNGtDvuD5TSS6NnG/ZNoI3ipMfG73U2bSR+zVvBjbnjPkg== X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97e6328e-44ed-4b53-ea52-08d8607a61c6 X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4555.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2020 11:10:01.7916 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M6VpEICNadgMOphZdDbgMYnp3pOfn1ZKvcUI35slE0RXyQnC4/3nQlMoXR2HuIPnmzQf5Naix+x59047xx+VGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4698 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200924_071003_634663_6C47C8DA X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.100.41 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.100.41 listed in wl.mailspike.net] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In dw_pcie_free_msi(), call dma_unmap_page() before freeing. Signed-off-by: Jisheng Zhang Acked-by: Gustavo Pimentel --- drivers/pci/controller/dwc/pcie-designware-host.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 9dafecba347f..0a19de946351 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -288,8 +288,12 @@ void dw_pcie_free_msi(struct pcie_port *pp) irq_domain_remove(pp->msi_domain); irq_domain_remove(pp->irq_domain); - if (pp->msi_page) + if (pp->msi_page) { + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct device *dev = pci->dev; + dma_unmap_page(dev, pp->msi_data, PAGE_SIZE, DMA_FROM_DEVICE); __free_page(pp->msi_page); + } } void dw_pcie_msi_init(struct pcie_port *pp)