From patchwork Thu Sep 24 11:05:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 11797061 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 0020D59D for ; Thu, 24 Sep 2020 11:11:11 +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 B9BF12395B for ; Thu, 24 Sep 2020 11:11:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="auh2GM+6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="VzSGm3FU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9BF12395B 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: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:In-Reply-To:References:List-Owner; bh=2eEteUC12trx6Lo1DP8VbPsnoiXY/MRZ2mIgOgS1JHM=; b=auh2GM+6zWLKpuRT1LJrqHYQSf 62Pm/pYFJER0RNmfMbcLu3U45ncXVIMOxjuM4v0RXh2/Xkv+jnGPisSvdyfxl2arPqSr+a66ve1Mj IwH1uqcdpU+pJck03yaYG6FrrQZVct/r3C0ev8Th2SDfujZZZI6/rApTLtBQoD/LN3cNjLYAHYA/0 dvmKvzQ87+IFpkQdtcyzD6bRIr90XFluQpXlVUSlJ1QauFVuEipreog2P1RCvssJp8qQPEKcuMezz y/nqop1YqnA3fu539bJde+m3wQrnzhFyMEGHhXk2uxysCywLY6fL+kg6SlVaT+xegULalZGrsVk/S slIUQZtQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLP85-00025n-1r; Thu, 24 Sep 2020 11:09:37 +0000 Received: from mail-bn8nam08on2060.outbound.protection.outlook.com ([40.107.100.60] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLP7w-00022i-Cx; Thu, 24 Sep 2020 11:09:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XaH05Wjnvw6vkNjudNpLeXLMElDoACnGW/PUDIZgpbrBnb9mvmzKAhKWI3QpgsyrVtBCfEi6VrgzM1zSs81Lly6OzFL/uHA9mFYH6JNp3Me90H2H8ARVz0MsnKIekxrdgHIQHA68scMu/b2O/w/O9cliRARonCKSAV7+K7MWQmkBGVA6nMvoJP7mf7MDzVrGmdmmFZI0MLx+HccGUru8cgLK/vMiylsqG2HWMV1/8l0A/v4xNGEisOIOG4FqJx3c/JO33V75/PgCX67B+cFS3MPhEoiy2hO3MpuSJH4N31/NsgtwSoqwN/8dCPoRtfVwr0YkPePzAol+XI4Izodgjw== 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=5/XfW+d2ccySJec181Cd3HFaKQHRrJtIlLvMou+83PI=; b=jGruw0HWEXbi/cmSxQZDo2KuOAPXCPBIGqLv0qTOxcJcKJsAXLDfbjMMVlnScCn+AaXhYYNYhENCsTSK/zxCCbxYNQnc3Q1xW0H5oSsEC1p+HOJytP6hYEHGPb0qhCwThFKsR+T9SeCUfF20WXhAo3PK6IeyYzNBmZOhcYzoxjsqu4gphHOqBFTS5yz5nLz8q9MvX7yeCCeEQoJgvJ0bxhVgvO9riAZl9kIXiu6TBj2bJ8OKRSlHVGeiiZYpQSXVPULfn3bq1fmOE48jy/0SHmspXCZjGDTJW/xYYbDVjOmjMQCDmtMHgnh5uHv/fkKASpr4TRRkAq7KWVWrwZrCIA== 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=5/XfW+d2ccySJec181Cd3HFaKQHRrJtIlLvMou+83PI=; b=VzSGm3FUnqYYrpJ0Zmh2kzfthdYA6EVnL0HWrxXFVV+bSXkK85DUEyAiL8IFligLkq9jFHdN16gi8ig8l2GlV21kN8gCMh5D+4+qjyHPjkvBy4bV1Aw8wtH0LqPvoDR85GrxIPOb+D849/mKffylzeQkMGM+1yUgGzxwYiOrlsE= 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:09:26 +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:09:26 +0000 Date: Thu, 24 Sep 2020 19:05:14 +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 0/5] PCI: dwc: improve msi handling Message-ID: <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:14 +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: 02a99038-efe4-4220-3b33-08d8607a4c95 X-MS-TrafficTypeDiagnostic: DM6PR03MB4698: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HCyi8jhamBFq+Mm2cirI3hJwb318yvz08vVGjxIoVCIbct/GVtsDb/Fu9Qv7jxspAz/ZnOWuxd5YGJ/KdlfxHuZamGQHcSnkpt9oPJ8N4kJuqcBmDPUeB2H9t/n5cdY8y/fkN48mQbQU+GbugiI+MiSdLtS1M/HE897FNtO5aq4VZ2IqYVakG+WzcpPOpGzbp4z5kU1cY2aSz3BD8Le4dEtLDOVoxM8Ki3k8Jpn8aIYOm3CewlbCG4uswYD8WTDHf8eshfGRnngkWi/dEAMW/RPCl3dQqLwe75+c2aTV1Mj8rXS0+0zHMEeylCdzsydvVFy/lIEf0qRITTwvs5hgYZF1GXnO6pUKyJHKUNda7Jl5YINSIxdDl9zZZ9WD0sWe 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)(186003)(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: vcbm7GI5dcr4QE9YADmqEQa8Py0TNqyjX9X7srnnrUhZqQOJxxV/VFNqtRiNOZF1DBuDu6FQ9OwwRdywG987+BDO884jQHpX9yaiFp5blavEZK480MeIv6m+sIoW5JzGE1vUBWYLYLC8je7CWJqJ0ULnN3vrMsGZ8aWjglJXXh9a6tac2fu36vnfn6JhfEWwaePlpIlOK4BHmdNIRgefw+bmXol4DC4f4U2HhnMkELD3CS7P9O6JdwS59faGQz/K7q+2x2Hz7ZiCUmOJGGX1VFJsPZgnlPhAoOHjAse5ZSkypETQQf+laWEEPyXv+4j7+bIzeaZCPss7JQlPRquvJD2/ApFJuF5DkAMnGXnKuI/kD9N0QaxAJPedQhAYpjDlmRw7sCwOTVYYLf2NVegs5OqoFARyrOunT8wdcCDKF6/mWLa/50kJD4rf7Po6Wdmm9rWsvCWfWlaTQ5GQWnve9tw2N37NDqaml0H+0fKh9FAsbpimtiyn/QkP6gcjaOZlnHteN75IrKv3Ga4mRBb/DLB9NaWKm/WE3FsgkNuXKERf3aO5Zi6NB9uzrUBEhePuqFlStxTu1vYfTkxVk7AfRDy8mciHqwf95qPpt182xlyRSWTluuSMDA9HgAO97AzrRMzrafteEVkaXfSepO0OQQ== X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02a99038-efe4-4220-3b33-08d8607a4c95 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:09:26.2009 (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: COEQ8Non1hWcp9jtTpHBgb+h7ZDwAU4wXYuB78qdJpDJYlorF07b1sHsYCHL4bzJUXxLj73t/UVNbl6c6a3aow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4698 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200924_070929_092415_5C134F5E X-CRM114-Status: GOOD ( 11.27 ) 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.60 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.100.60 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -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 Improve the msi code: 1. Add proper error handling. 2. Move dw_pcie_msi_init() from each users to designware host to solve msi page leakage in resume path. Since v1: - add proper error handling patches. - solve the msi page leakage by moving dw_pcie_msi_init() from each users to designware host Jisheng Zhang (5): PCI: dwc: Call dma_unmap_page() before freeing the msi page PCI: dwc: Check alloc_page() return value PCI: dwc: Rename dw_pcie_free_msi to dw_pcie_msi_deinit PCI: dwc: Skip PCIE_MSI_INTR0* programming if MSI is disabled PCI: dwc: Move dw_pcie_msi_init() from each users to designware host drivers/pci/controller/dwc/pci-dra7xx.c | 1 + drivers/pci/controller/dwc/pci-exynos.c | 2 - drivers/pci/controller/dwc/pci-imx6.c | 3 -- drivers/pci/controller/dwc/pci-meson.c | 8 ---- drivers/pci/controller/dwc/pcie-artpec6.c | 10 ----- .../pci/controller/dwc/pcie-designware-host.c | 43 +++++++++++++------ .../pci/controller/dwc/pcie-designware-plat.c | 3 -- drivers/pci/controller/dwc/pcie-designware.h | 9 +++- drivers/pci/controller/dwc/pcie-histb.c | 3 -- drivers/pci/controller/dwc/pcie-kirin.c | 3 -- drivers/pci/controller/dwc/pcie-qcom.c | 3 -- drivers/pci/controller/dwc/pcie-spear13xx.c | 1 - drivers/pci/controller/dwc/pcie-tegra194.c | 2 - drivers/pci/controller/dwc/pcie-uniphier.c | 9 +--- 14 files changed, 38 insertions(+), 62 deletions(-)