From patchwork Wed Nov 2 14:10:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 14255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3647052wru; Wed, 2 Nov 2022 07:17:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7tu4eoMHsLRtSQfw72MY0s0XuhFjSa7VrfVTac2fj/lQHUetWh4TX8X8DkIq1xd/j0EOC9 X-Received: by 2002:a05:6402:190f:b0:461:bd53:27c4 with SMTP id e15-20020a056402190f00b00461bd5327c4mr24436363edz.75.1667398651839; Wed, 02 Nov 2022 07:17:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667398651; cv=pass; d=google.com; s=arc-20160816; b=oqJd/zasFdFo7qFa+veh4tgYHlxASlzqFDtP2g3gxcjtBUB6DlyHL9RLsn4xAy9uni ZRr8T34DH06axamQEc2UUNoKClXLJPaGGD8wcDC3mULBMx9Ne/mNMwYcZ7ATZsd2HqzX XAH+/aCfDCijCObRznCKXpO4dYDNCUEjfnkemIBGdjqwF/rbB68eobbNjfGpEtx8LGjL S8E9WMxz9TYEv/v1isPIb8mCPLzXF7Mo016CvUUCoho0ts/2i4buayYhx/m3PUB2P5tU SCV8t0yBAL/Q0xbaD+OvsAc/5n+mWt6oIHIGUN8rVAY+740o23oxIg2wS4QKxjfLACgb B5mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ioq8i8JEn9HvTPMXs4bwgq2Vsrd8In4CWHIXoks/i+E=; b=EtjAxwESmpTw7Kusb8Q0Cn3QoEQnkFPUv4/hnsEK1bjw/PAkTvRQ0/Zb7AyYG710/C XXZjGyAFs5sQdIWBgVXAc26hnTJ3tMDr987czfJK9Lvvd9gwJMS7+fZnP4evQU1WxO7h an3gNziBEbIn9iEMeAvaEjlqGx7fBmIISunzmktzJUlC5hCnNDTUoudWY0RcgWqBGHa/ u1DwqmdVFEE8jtomjUJJeJ90GNk4ll51rPTlcR9FVc6ncj1HSWy+J3PV5fedAPYMCyXw vvk6zuE9fTNqIk+nxLWwVh17FTKnfa4SjQkhEciAPuHkKE0VCvlBWekT50omyt6YvYWM SLfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bKtPlPBr; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec1-20020a0564020d4100b0045d15f39bf4si13283198edb.479.2022.11.02.07.17.07; Wed, 02 Nov 2022 07:17:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bKtPlPBr; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbiKBOLY (ORCPT + 99 others); Wed, 2 Nov 2022 10:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbiKBOLE (ORCPT ); Wed, 2 Nov 2022 10:11:04 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2085.outbound.protection.outlook.com [40.107.21.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 787E527FF7; Wed, 2 Nov 2022 07:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N2/iev31pZsPprUyQfFELjT100QQ627d0u/PAEdFpExGBd/abvaxfRbMIxuHSmW4zbUvOCE8xdAf9gopv8tQytZAkgaeHfLZXNq9+xUB2qgVOWsXD4KSGxYk6YK2sKr1oUA31cOZd9H0TXo9qCo1+mKSeHvCAhGN7Yyf+rosavTl6GiHn6jAruQhi8PguH9v61FHWZDvgZxVCTrCVdmCBQg/3mkvYoF3yiDC8EVROUfolFdU7oJRf7TTSJv30sleOJ+sax3VtoceDskZ/rHLFQ3HPKKwOqic1lqrPLGGd86OlMri0ycQRQfOIDgJlKXtVkzPCc921dlT6dbVHlv7FQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ioq8i8JEn9HvTPMXs4bwgq2Vsrd8In4CWHIXoks/i+E=; b=LDWFetZAkf2tRxDww8cCCLxTIQpYc4DDYP7pho/hG6VlJEzYVc7am+yDVnFesGAqar/F+KspSvQ0C6M1qD1+dyzVnQZirokBrRxl6cT5QMg1rp+C2G1sWG7xfX0kc/vjanHsfFmOT63V1eGQ5jRIMNfV+m7AFMmhaLQx3uciet1MfBf50gOqnaahQ9ONe4ADtBLW6lK3FldgJQvFZtzzMflmFose3kfMyonUWNiy2pLYykHJBiid71PwBUkKw393uoKZRKeQJhAqgGRpP9hkEcQCDK79mhOEjyzLUzX5Thhz5JPyJL6ILMHcaD35N/ricSF3yyu1hMSz+cfVpZCStg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ioq8i8JEn9HvTPMXs4bwgq2Vsrd8In4CWHIXoks/i+E=; b=bKtPlPBrhpm42lTOiY63nfEDhHiis7ru3mJmIbfxfKLmiETJ0DdYD6add6K9/DPlwdl8U+L74hL2/lVZIhvxBx0OEJ4fBjwWPNv/IjcpVSWGtHMtS3sf5CDCG60OpVgm4PtUvyMaZDvFaZ2X0yN08AQ/Zt5Aqn17IvjpSWv+Kx8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from HE1PR0401MB2331.eurprd04.prod.outlook.com (2603:10a6:3:24::22) by DB9PR04MB8234.eurprd04.prod.outlook.com (2603:10a6:10:25d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20; Wed, 2 Nov 2022 14:10:56 +0000 Received: from HE1PR0401MB2331.eurprd04.prod.outlook.com ([fe80::44bb:8387:8f4b:6a28]) by HE1PR0401MB2331.eurprd04.prod.outlook.com ([fe80::44bb:8387:8f4b:6a28%11]) with mapi id 15.20.5769.021; Wed, 2 Nov 2022 14:10:56 +0000 From: Frank Li To: mani@kernel.org Cc: Frank.Li@nxp.com, allenbh@gmail.com, bhelgaas@google.com, dave.jiang@intel.com, helgaas@kernel.org, imx@lists.linux.dev, jdmason@kudzu.us, kw@linux.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, ntb@lists.linux.dev Subject: [PATCH v16 6/7] PCI: endpoint: pci-epf-vntb: fix sparse build warning at epf_db Date: Wed, 2 Nov 2022 10:10:13 -0400 Message-Id: <20221102141014.1025893-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221102141014.1025893-1-Frank.Li@nxp.com> References: <20221102141014.1025893-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR05CA0210.namprd05.prod.outlook.com (2603:10b6:a03:330::35) To HE1PR0401MB2331.eurprd04.prod.outlook.com (2603:10a6:3:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0401MB2331:EE_|DB9PR04MB8234:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fd3155d-3f46-4887-c17a-08dabcdc0f4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4+t9g0rQ+9sZasnpxkHyJBdTvyQ1iGyibo4hiOCbllEBnmcV1iZw1Er8JndysAVPMvgi474su5cMqwMZ3avuzGPEfswDiJInmu9DknqzVFZdryJRatxuAjUClZk4wBIgmVOk7PNVCA7hScv0GiUKfD1TXSZvZj3RZ1mjxYZohjtgWbcQh8jLboSRpU83gvyGjCGh7v1ux9TlzkMDMn4kIOJn/YuPXrq1C2IycQsiAcP3LScLs0uL1c7JEA5eRLzwBPlR8C5lhdQjuMCq8tmSKIKlrbariYaIGp+9l5XcaqFCcKCpdrZqITqjMSXSnHd+3buB/iWbAa8cDdyk7zi1Hy3sXSx+fu+JDWKNXiSv60u3GJNeidAaR7sapbJvyRM/gHMzb8HIkpZan6pwU5ql4qdX9UXs9iPPNEGnKf2WzZYVb6WjhUen8AgJpKa3mP/eN4ysXBRU77U67aUFAsEE+Ak+8Fvw7mIDZs1MCQEsbSY/lB6eVP4nzJ4l6Tj6cNCpUSJ6VerMKrnkoayoKkEUkwj+O4yKYDldnJsngLz39QFiGfpywjxKVf6xqjYUfdKClgdi4l4UUsfy7fgwW9gyMPp+AUHpPqoRO1NqvmBfYNvSdd0Ry5+juFdvZOCn32WyRsaVy9zwLdfcYwlUxrJLh1CcGpcPZ1AFun7jb/CEv6P+IeK0MQqraOeOmgp7XmxINxmjAqkaUDNNivo/j+AORVLVQxuL1exMocSpITgcWDkftayzCbI2SG4jCUhF24pYFn9rJ9E6dVWBn35nrVkVPQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0401MB2331.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(39860400002)(396003)(376002)(366004)(451199015)(36756003)(6916009)(6486002)(5660300002)(7416002)(83380400001)(478600001)(2906002)(41300700001)(66556008)(316002)(8676002)(66476007)(4326008)(66946007)(8936002)(26005)(6512007)(186003)(38100700002)(2616005)(1076003)(38350700002)(86362001)(6666004)(52116002)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V7mf4SDY/YTTpXsb6TXPIt9bB9ULodVDTWK5mH092NbkAexSJa5jatfETW1JI68sJjMeE6d03RLddzxXTnuWZB2t4IlVF2dTarO33I7nWJlixUMEoLIHmWQIk8qWYuUl3+x2iQ/oIKfBRv6bhbpl7KN3kwVwlTn7AXBLYupXKWI0bBM3tz4Jt7kJAkJwvfPMeG1Kb8gcWPSJMzswOeu+6kGr9hRGl02P276ils47wUBXdxSHkyVLeTJTUmsL/+BVD4rcWz0occA+DP9ZINmGxNGgGFztnRWu30GNUgfaYLjxVol/RuMw3dE1Id8bLLP6PqncK9gUp4oVbsQHodeID6r1XFcPjW25TxJhXhtDqeCI7yLUfYprn0fOQkwy32DDOa3jpjJOMzUJ3FYP+Gz76VfdtBbt6g17M29HCXxiyR7WHk+6Vq62kD/b+c8YJ+nsO8C+l6yepqlkMXbJ9IB12x4z7Kuds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KjMkBsOKLtFO6JM1TH6hjuQL3feELZnWklGdM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fd3155d-3f46-4887-c17a-08dabcdc0f4d X-MS-Exchange-CrossTenant-AuthSource: HE1PR0401MB2331.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2022 14:10:56.5208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R6plZ4XKfdgYgTeQk43lrI6xrWRIGsctwBSYHtplXPZsMQLbMLQMk3cO6fqqIMMVqvz1LTORCJw+sXMbqntWgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8234 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748394208670853532?= X-GMAIL-MSGID: =?utf-8?q?1748394208670853532?= From: Frank Li Using epf_db[i] instead of readl() because epf_db is in local system memory and allocated by dma_alloc_coherent(). Signed-off-by: Frank Li --- drivers/pci/endpoint/functions/pci-epf-vntb.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c index 54616281da9e..f896846ed970 100644 --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c @@ -136,7 +136,7 @@ struct epf_ntb { struct epf_ntb_ctrl *reg; - void __iomem *epf_db; + u32 *epf_db; phys_addr_t vpci_mw_phy[MAX_MW]; void __iomem *vpci_mw_addr[MAX_MW]; @@ -257,12 +257,10 @@ static void epf_ntb_cmd_handler(struct work_struct *work) ntb = container_of(work, struct epf_ntb, cmd_handler.work); for (i = 1; i < ntb->db_count; i++) { - if (readl(ntb->epf_db + i * sizeof(u32))) { - if (readl(ntb->epf_db + i * sizeof(u32))) - ntb->db |= 1 << (i - 1); - + if (ntb->epf_db[i]) { + ntb->db |= 1 << (i - 1); ntb_db_event(&ntb->ntb, i); - writel(0, ntb->epf_db + i * sizeof(u32)); + ntb->epf_db[i] = 0; } }