From patchwork Fri Oct 9 07:53:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 11825141 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 3CA96139F for ; Fri, 9 Oct 2020 07:57:01 +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 F0BB422267 for ; Fri, 9 Oct 2020 07:57:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tInofBlC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="oTUnpYMK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0BB422267 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=odBUakUUyNlC+UCqFxdUqwBKd2xeiDtDFFyltuFcsz0=; b=tInofBlC7rmB196HtJL9Ue6JFO ZWLIIauSNVfix4706DCFPaZhzwMKBwvTIJiaW2MLJPXtB+wTPRNJZusDBrjlgrHlRmcw/j6YCUDEA /nw3P8LGbXDgBxNIix4+v6fzjiGmetPROQodR9YESOKMzhJV2rugDUf36OADSrEO4aS5lZg4lYzL9 Dpehzse0Wn759hcN8XyFLOZACEYXnz/tQ5fM0txRaAkEAkvMvOHT8eGvRAXJO50gGvxu/JYfFd31z ZTE4OGVMA6Pj5lblBVrm8mPJoT3BxqI0E/XdWLiaJ+ZJ6VM+dbw2ZEuBBVpBBwLenj829f+KlB0qT XMAhG8lw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQnGg-00017U-L3; Fri, 09 Oct 2020 07:56:46 +0000 Received: from mail-bn8nam11on2058.outbound.protection.outlook.com ([40.107.236.58] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQnGd-00015k-83 for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2020 07:56:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f1azaWBRrpvbqIasm0FfeKTz7tAkycvz208c/4tbHb3uicsoV2t7W4z0S+ssdsqjiGcdQKU4/uDbWy3tkVVO6a+NJq1rhUA6XO0VsoWExXc0NedhxLH7wrPdBD2am34Tu/npvSzj6ayQFgjLIWDPLfR3PnV8Z0nxaAF4WrI6Mgi9vbUyw3b/xxsi2uCJ9Yu9Av7EVHKrXr/iBi5dTF9H7NqS9a5kfjZd1qigFsAT/T2vtkiEARcBF9ORbKXHe8UrNY60XxWIA0QBkE6EMv/6j2W2oUoY+SaCYzWpbxA15oQCJ5GhWB33lBJKE8y5k5EbL/DlbZnkw9/DtWlAMbn+Cw== 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=it498sSJxLGotkiY3lUHwEdRwd7dx1ITYgD80sa2CUo=; b=k/bWypEPWjXtxVUpEkcMfT/rRDrbCbEIenMfbUrNuwYGW4ONYLnoQ2o4UBLXy+9ddvGvcaBqlVt8DQXBMkF325e/6+kJ1hJPMXZXxRtwwK+LKeqj3V+7XnxHS9EVME9a+xh5A6n+SALXjhl+RXIkuzmoCuxF091x6wCoLBDh0IQYyFCaiFwJSgv3hJZANeG2FfVgeIKrZjhG2cMUicB44DUNgUFRgpiN+QWlp99r6XJvX9/aj/yiUGlwAaiurYYybFWqDUFG8q9nzgw8BT9EOmw75FOfC9+3oM2FRyQDQSZ6tBsv+J0AYfoo/AD1XrfbCHrYtCFmCyTRfBp2hCPVSQ== 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=it498sSJxLGotkiY3lUHwEdRwd7dx1ITYgD80sa2CUo=; b=oTUnpYMKdAie0Jh3DE9rkAnag8fZ2XXuD2O64yX9t6dKTDerM+no/GEdcA7/I7VYa8ODZ0uYBEUUBLXYbCHBpXmYFtcQRTxJQpa/c/5Tpbekqjfx+qGLDtfCVdqR4QYT99c80hACYyCS33ai1ZlEqscT0jMa4bmEIAcIy/D3JZw= 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 DM5PR03MB2683.namprd03.prod.outlook.com (2603:10b6:3:47::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23; Fri, 9 Oct 2020 07:56:41 +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.046; Fri, 9 Oct 2020 07:56:41 +0000 Date: Fri, 9 Oct 2020 15:53:11 +0800 From: Jisheng Zhang To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel Subject: [PATCH v7 0/2] PCI: dwc: fix two MSI issues Message-ID: <20201009155311.22d3caa5@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: TY1PR01CA0164.jpnprd01.prod.outlook.com (2603:1096:402::16) 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 TY1PR01CA0164.jpnprd01.prod.outlook.com (2603:1096:402::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22 via Frontend Transport; Fri, 9 Oct 2020 07:56:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0631e0b-2b03-417a-b0b6-08d86c28dbba X-MS-TrafficTypeDiagnostic: DM5PR03MB2683: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R5bRzPlYydQp3nO4aPZEo5OQ+AWi3VhbCGN6Vg/q4YTRl3r/ESVf1SpK8FJWJXZyKwR7wLH5cclNkQoK8rEkzWqn4W0oKfnFN5E6NP01/kf6Gcmi7V1w11kxAKcEQAWwAL+xI3pzUMk9Nyt2/0BCTWaSit/nxlcN3590rcLgc4q2ryigFh2gINdOnJ4jJEC6nHEgc641JhlHuq/uFiMkRRc1XDhaLOSuTZMhpwNlyvzq8il5xsrLPNq02SgxQRhxf8dV/bRSxBI32LUA1fEH/6zB4xmL+sQQ0WoQbba3rWMPjvTU726/onU6NyPiBal0 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:(4636009)(376002)(396003)(366004)(346002)(136003)(39850400004)(5660300002)(6666004)(956004)(8676002)(66946007)(7416002)(86362001)(83380400001)(4326008)(55016002)(8936002)(110136005)(2906002)(16526019)(316002)(186003)(6506007)(66556008)(478600001)(1076003)(52116002)(9686003)(66476007)(26005)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HQXc41+YNqOqUMX+faj+F6aBuw0/y40UjBWThFu0cRm9eQ617v0uNmiF3LURA1zKQP8XaVHWmojYgkW6DFBRVsiIBfJIS1BNJ/qtARZnYH+wNYErHsyrlDVJFn8zoEsK595+Al8pP6djTbcuDQL2qEudXyLlVuraZqgfMoEcwdF7gAtFRXvLWNNrQefHsxFW0jpJYBfxi+0b2Bd4oZzz3ZDnS+SYM7T74UvdKKLJRMAybwDsG6mIUe+tXcdp25grTJeWXsuHagZvsFIiBJIyU317eweWsBk78YBLA7qYGNsTxfRmHh0dBF6ISll7EMyxvlg8Dyp7HgKZr/xlsUBK3EF8p/Av9HnTDkF0eqKLMLF6AslzxjP1HuXCxIf2ESgiBmgFO6I5Kejode22zcy54637EPlNunTQMUOsJnv5/r7tgRE7s7W9Hcr+fH+z5wpT/j6JrbS18aYQDlzImDsvPyIQ04FIbPO2D+tl3zAcI7Drlpch1zaYyIX6Qudrf9UAT+ukCgL2dZmk5AFc25HGlTCa++IXdJJC3ln9JETZ49h/g0nGk2UERxCuhe15oa00HZ8LmqNxmDOWNNemifVPDPYfo4/Jh24k5Ii4rr2RqvtzFwq4Vlwt6ZPz47MZ6Tv1b7Ovg4ztHQjTYKc928Etiw== X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0631e0b-2b03-417a-b0b6-08d86c28dbba X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4555.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2020 07:56:41.6340 (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: oPd2D2s7Nmq3EzmsS16rkEJ0x3wHdsLY+8pPdopNsuxrUs/gm15zGwU7wn7XIg8p1NBVFDqezvk521xOo/swIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2683 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201009_035643_311801_F3CBD0FD X-CRM114-Status: GOOD ( 12.71 ) 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.236.58 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.236.58 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-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 v6: - Keep the IS_ENABLED(CONFIG_PCI_MSI) check in dw_pcie_msi_init(). Since v5: - rebase on pci/dwc branch - add Acked-by tag 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 separate 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 | 35 ++++++++++--------- drivers/pci/controller/dwc/pcie-designware.h | 2 +- 3 files changed, 37 insertions(+), 18 deletions(-)