From patchwork Wed Sep 30 01:12:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 11807511 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 849B9618 for ; Wed, 30 Sep 2020 01:17:20 +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 513D020B1F for ; Wed, 30 Sep 2020 01:17:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Df8Uhi7H"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="PT27d+LE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 513D020B1F 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=DZhEx+x/OfcZNPdeEWOGCvR5CuOkdB96zAXLMBTii0U=; b=Df8Uhi7HRcyxflAdSNu94/OzoQ wBZ+ytNbsdoF2WQXVhFDHkfY31WlDdOHSyQGcnXspEpYqrWve6UEpniSeAWIDmOW9iyemV/ArJ7vS xBqemWB7lcxy6hrao3HecIMwwUX3VPFKswRxBCPZJ0LpB1r7n5tEDsbJuVxb8YdHoUSBemW9k2w22 YJ/ELLAzb9Vbv2BfFCWqYrQ5pkRgh/XUViqUCo3tQMC+S70HMRe1JWMeiEzirct+ERHgyhw9ZEwNj 7e0n/uL7lYgQaqavnreeglmwXPP+lIzY17+QJo0A0z476fGat1TVSljbGl8Es9JGJDWwUkN6rnkHG 98BHg+zg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNQjk-000615-WD; Wed, 30 Sep 2020 01:16:53 +0000 Received: from mail-dm6nam12on2065.outbound.protection.outlook.com ([40.107.243.65] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNQjh-00060K-Qr for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 01:16:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bSei3e70z/SC7UdcBPu5bTBQ9j092kXgM6BNibrNqIM40GFwzhT/ffISGvOLvriueBRV8rS30p+UlvpSBclPr/sQ/LalnRKEwS+hDEUDAlAho02wiYGTVP8dGmKmk7awB7CLvy+YPiOaoAVebUzc2qOUThl7lzaUcYhjuIkluAD4r4fINpsJkohteaR+/09v8UvzCNuPouXTwXE/kZGyZlIkRHKkSAyKsrW+d+KeLEgEsviGwfqy+W6pD65SBWvG0uiECeiEVg9JvWOwAS/O223yVoEsHT3/F3ndWCNgtUeS1uIKXiGN0qHjaRwN6TBcU0ebgWCSlK0FzP1n4LOMiA== 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=cZ1mg79nd2coqgMKTnUBB7fmiA8/KnEIFzlWy2mhIWQ=; b=Re0Z5WTi2fZAlXiWRdLuR+pFuo5yWH3jdL+nGYuU+uKeu6JqI0vZHm42I2iXWedCRizRMQydCeKIMKUaRf5QeX1/54tDZ4PtE3V4Rh39bsj3q25NYYcLqjbauaTxR6PEHGK/B/uWBcWrb/qUpEbmcgS0oWHaUqrf3T1hAGkFGMlQVzosAzGKPHEo7qILGZV4EXvdwApKXVu/fVpKjSBAl4f8vgZt4lPELVzRwZDrf2lEt6aiDjmck46B5AV80s42qkQRwFxvvRQ7WKCnouLEjR9yRLZQmrm8Hw+mfpU95antOJWrobrpiaXIytyFiZEa2iYMAAvWEFhTBNRrO6tr4A== 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=cZ1mg79nd2coqgMKTnUBB7fmiA8/KnEIFzlWy2mhIWQ=; b=PT27d+LEUM1T9qqjnp2Y66q0/xt54YL9sG8TNc1hDRAiGioK7VfqRansLecWV+X2zpU3uIv28fgwupA2X18RoaJAThMViioYaz3qmWQ0xhGCKqWVl4k6+6BptBBV2+bI5A+TtX+yKtz0h45Gnvmnt6OAsZ/VflucDTnIet1Cis8= 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 DM6PR03MB5145.namprd03.prod.outlook.com (2603:10b6:5:1e9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.35; Wed, 30 Sep 2020 01:16:40 +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.3433.032; Wed, 30 Sep 2020 01:16:40 +0000 Date: Wed, 30 Sep 2020 09:12:05 +0800 From: Jisheng Zhang To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel Subject: [PATCH v5 0/2] PCI: dwc: fix two MSI issues Message-ID: <20200930091205.792d6c7c@xhacker.debian> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: HK2PR0302CA0004.apcprd03.prod.outlook.com (2603:1096:202::14) 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 HK2PR0302CA0004.apcprd03.prod.outlook.com (2603:1096:202::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.18 via Frontend Transport; Wed, 30 Sep 2020 01:16:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 892c29ee-563a-4ff2-3f40-08d864de7c53 X-MS-TrafficTypeDiagnostic: DM6PR03MB5145: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IS9N0I/16SHJUF3RN+AS0OIJoJAnyis8mdBVB+kvzbZM+PybQmFn7bT7k3kPLbdbHFD/0OkwyQdSm+zemjk6gklziUgBWcwc5U04zRK6N8d5VUFx2vOFoP8sZwNKlE2LmUmDyyCEqbMm4M0K0hTvtuOE615oNgMP5/k8JNIFbXZUgX3IS0gbG+xkXGDIKcWE23PwR4YylPOZPs1zIUcQA9OfD8l+dtJ9qdhYE7ORe8ye7tTHcswkCMJ5cSW9GfAHW+Z3zAVs/wh7iKBp33wOiOeyY2FgqrjgOJbm8dimx8Efq2m/P8Wb9Z6HG1dJGlbsiYC5ZmZBHNZzfuE/L5jlqA== 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:(366004)(6506007)(956004)(55016002)(5660300002)(6666004)(8676002)(498600001)(4326008)(8936002)(83380400001)(110136005)(66946007)(66556008)(66476007)(86362001)(1076003)(7416002)(186003)(7696005)(9686003)(2906002)(16526019)(26005)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: d8HFMUcbO6XojAUV5tw3iAQEK9J4oTerlldNMyXS4cMObuAVYqrt2t2DpQRlW412p0TX/KUm1Nc6BkaytoGjzRLzAxicQQpE8q6zK6aORpsock5Pjf4yg6evTFUqKgOU7UsFQ2ihBWHNMaQL1OQuhC7JYD7ZA2NWwl2hh57YE9uFDMIqRQ+iAFh4ocn+NrixwsfB8sHZHCqVG57PknPt1HlSgo/B1tHJYIU1Q49zEgmD2JxMQ5LhUv2aAtB0ij8ZtPZKrekYMn64f+N9mfJtjwwku6XvFNSe8JTjtF7kgNv2F34lZk9EavGACexCRU07CWvaezZGCXwsjl0zfOZdGw3/apnb6S3AlK0VJ4kA7nI3Vn216EV9M+zGAgwqqfMiSZRDtCvUKGyWvg0rSKA2KKpBazqj3/N/ck1prIWmmqmh3OZfeDlI8ta5VZKVTxZXvvm1n31x7VKvFyRp7Uzo4J3YIiPUERCizD9gaux6xj8O/t5fLdEya90M9DhAJnVRHNKAwHn7rSKDfzfo69GH4IdusXM/mG/6B+8dSpy9yFgQ0RMcFUiRr1XINMxI8yeqq8gm23oRXa2TUbIFCpEKM1xTfaweCbkOtAE2ThYO7WWwRmlxZMH1Vo1sW3qZ8Gwwr5GURMGw2YHf7+Td1leNYQ== X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 892c29ee-563a-4ff2-3f40-08d864de7c53 X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4555.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2020 01:16:40.8110 (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: kAjP/Px5EBvV4AdRVuaRSk5UG89Lt8cwJud+6zYg043J9XGPDVsbLDBiN5cEGcD4MYmI7B/aXGWzG+lxU5RvoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5145 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_211649_885283_B1282E31 X-CRM114-Status: GOOD ( 12.57 ) X-Spam-Score: -0.6 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.65 listed in list.dnswl.org] -0.6 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.65 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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-pci@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@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 Fix two MSI issues. One to skip PCIE_MSI_INTR0* programming if MSI is disabled, another to use an address in the driver data for MSI address, to fix the MSI page leakage during suspend/resume. Since v4: - fix pci-dra7xx.c Since v3: - add Acked-by tag - change patch2 commit msg to make it clear - map the MSI msg with dma_map_single_attrs() for some platforms which either has seperate addrs for dma and phy or has mem access limitation for the PCIe. Since v2: - add Acked-by tag - use an address in the driver data for MSI address. Thank Ard and Rob for pointing out this correct direction. - Since the MSI page has gone, the leak issue doesn't exist anymore, remove unnecessary patches. - Remove dw_pcie_free_msi rename and the last patch. They could be targeted to next. So will send out patches in a separate series. 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 (2): PCI: dwc: Skip PCIE_MSI_INTR0* programming if MSI is disabled PCI: dwc: Fix MSI page leakage in suspend/resume drivers/pci/controller/dwc/pci-dra7xx.c | 18 +++++++++- .../pci/controller/dwc/pcie-designware-host.c | 34 +++++++++---------- drivers/pci/controller/dwc/pcie-designware.h | 2 +- 3 files changed, 35 insertions(+), 19 deletions(-)