Message ID | 20221028155703.318928-7-Frank.Li@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp910920wru; Fri, 28 Oct 2022 09:02:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LIF2xJ6qXVVSMDiPxjKHSuMgLvH4maEl8R14Eu/EDyrr/0H4dfFBf1YLDKvaIYIlXQdFp X-Received: by 2002:a17:90b:3d1:b0:212:732d:a1c8 with SMTP id go17-20020a17090b03d100b00212732da1c8mr16573252pjb.189.1666972922435; Fri, 28 Oct 2022 09:02:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666972922; cv=pass; d=google.com; s=arc-20160816; b=TNS6iKoYQZZfJxT5LBBVHBDVOT8PxZV6WBbq4yge7hvUXZBqV2GxKL8G4aL+QSblZP 5H2lMjYC7YzPEXarOY1vHM/LpXyGwzMjeVP0Ge3XfWdI+Jev17RL63iyhRnV0CFoFTyY g0/dK2Qs7nn0AmOvFyzXwXHu8KVx+Ujd3uZYkFG6m0HfVjXMY9I/f5SDKRk8OHdUlo/h Eali5k+jsnh9EiaWwMDTxQjTi4iHiyV9uACPYhtRjyS4BHQkEeB99vyRU0vqFsmkCxDw pT+o3OqskUpSbjOuiRmVjouT/ZCOnW3u6S6fniSPo2MBoYwt4uazVCTLbQfy1XLtoRRk yvGg== 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=ISp0+2tC4tqTg7n9XUBvv+tk4luKaKnb+U8EtfJbPY0=; b=drK2UHe+EXLmGMlntgBexgX76c5/2P/UmOEc//xt5em6NY2pIvzGuytyIp8KDdDF6p dFT6MRbRC9kdoRKBhI/ZahOpa5bIO5vlu/9/BgfhTCp4VHP2oPoW5qy/34w+6KcXaJfL +YLFIbrVh1TyAHdSqNwmE4RmJIoxWbdbPabPv5Y82J0loeV5DYcxa5Hw6Bh/15SeXZNZ qtpsvjH804Lo1bBKJfrid/JV9AXz/h0lY+QjHEWgLTdXtG9IRAGTtObu8BNUfysRhzp1 3/LeM8hQ+Ov9MKoHtcJeT/e6IjAlpouGi9UM9aqbd1ZzC83sP6gkrk6KQowOn67ONA/I SJgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Fqznp7BT; 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 l15-20020a056a00140f00b00565eb80af7fsi6246911pfu.343.2022.10.28.09.01.47; Fri, 28 Oct 2022 09:02:02 -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=Fqznp7BT; 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 S230390AbiJ1QA4 (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Fri, 28 Oct 2022 12:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbiJ1P7E (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Oct 2022 11:59:04 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2046.outbound.protection.outlook.com [40.107.104.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4DA21CD49; Fri, 28 Oct 2022 08:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cxbYpR/F7j9rqLmAZcGkcFrhF/bX3S9u+uYKWaGSkXiFDsyzEkLSsmFJjLdBFEPI9ttkM/W2iTs0lNw8WAW0omssLY66Kq4PoKCfBx5HRegrO5PLkXZzC2teGODvyM3DGHOqVj1KmYMtmPfEfgRyoFT1GjtgCMgCO5zSwzb5r1UtAG59LyYkkWmJ9iRsTi4Oo0EIkXen0d62h2NrI56fh+nCabDT/VQAxZITtWujjKK/63JfShx8q/3HYp5StydK7KkjSTuT7VGFhNrJUc7CoFU5mMyK5yNMecSxDhd0Ou6P/+WfepZai2XEa5ZFjN0oIZpbCbQ+3h2VNi1VFX3imA== 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=ISp0+2tC4tqTg7n9XUBvv+tk4luKaKnb+U8EtfJbPY0=; b=m7zRTJCVfqGIegqJwPictk5rqAJF+eKsW7VkfBic1pDI3RMuK64qrtkY7jJvlhvKXWBy0EMV9PgzbQ1Hb8mvQO67tct0D14UtOxdRecLHK4mTviZjfJFCSGZJ7zgy5hm8m4JONO8Thk38YMew3oFeDmm1wDzJZ+7jSFDpswvulKFVINf7lRBvkFlBNVx5UVgulEcRfkgdlxpHzrng0jg4C5OyBRuKDeyBZ9HcvFy+h2Wi1VI2S8ydau0ySiFKpgWzdrHukfHAlIylaCz0CKe24hlkPZa5z8lYAkyesy4CG9DzjyhyN/0kpV+lIL2q5ZGLZud+tb92fQpxKFH9lbCiw== 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=ISp0+2tC4tqTg7n9XUBvv+tk4luKaKnb+U8EtfJbPY0=; b=Fqznp7BT0vADP0TwQO8/TE1vTA6dsE5lOESBTZ/cQjQncG3eI7YmXqWJsYO6+AiOZvakToB8EwODWOEO2krcdwDNL0Rkz0OLq9cExr4wj+3AaWHvA0AvhIdJN0CxYN3myOoino+0tn7Xr+zVKYvD8jKMB+7JyQXdXDxvZB/sgk0= 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 AM9PR04MB8323.eurprd04.prod.outlook.com (2603:10a6:20b:3e5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Fri, 28 Oct 2022 15:57:49 +0000 Received: from HE1PR0401MB2331.eurprd04.prod.outlook.com ([fe80::44bb:8387:8f4b:6a28]) by HE1PR0401MB2331.eurprd04.prod.outlook.com ([fe80::44bb:8387:8f4b:6a28%10]) with mapi id 15.20.5746.028; Fri, 28 Oct 2022 15:57:49 +0000 From: Frank Li <Frank.Li@nxp.com> To: frank.li@nxp.com Cc: 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, mani@kernel.org, ntb@lists.linux.dev Subject: [PATCH v14 6/7] PCI: endpoint: pci-epf-vntb: fix sparse build warning at epf_db Date: Fri, 28 Oct 2022 11:57:02 -0400 Message-Id: <20221028155703.318928-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028155703.318928-1-Frank.Li@nxp.com> References: <20221028155703.318928-1-Frank.Li@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR02CA0010.namprd02.prod.outlook.com (2603:10b6:a02:ee::23) To HE1PR0401MB2331.eurprd04.prod.outlook.com (2603:10a6:3:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0401MB2331:EE_|AM9PR04MB8323:EE_ X-MS-Office365-Filtering-Correlation-Id: e35caa52-4f82-41a0-6359-08dab8fd29c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BDrlXnMeUR6PEJ4nsiZnaZAw5G2NE3mKxw+BswJr6j/wZymrRTPrOk0IruGfvjtwsaey0EH5/flPpLcqV8jhh8CdmQCmjzPB2R00m210D5A1T82+YtFjo87/S+6n85TqZRfbgiK53yghy+UzGETEBfk03QrYU0y8zPI8/F01u89RhlNKr8ruw5iE6dGAi1RorxDPmIijuU8m71qbaAm5KaO5wVNKvcxm7mzAqfE3uFm2hKER1wjUnVU0b34QxdPn5mFEPhIfrSGoEIiTWxOoJMqZFE9GBK1Fipbh1yA/5QDtHBuvo2Hz+WuX9OPFb4gTi/sWI/3CeDNLAgqISbbioeI9b+9BxUrR6b8OpZaqMu/Gu2TEinyNqetv+HilrASTqDeJysEtTD5IPjAT2W3y8u3nQTe2csOR0EZbi5SiM+dNeZFLqTDjtSa3Hq+8c1d21M3TyfpgCDpxhV2EKwrp4sfoYn1+m6bcHYP80SC3NXeBCEKfe+jsHF4bXBHUn4eP3W6WMe4DR+q4KQC4APLfm0ftj619b7XKokJxMZn8qmjQY69AQqzPthM1HMUvaC9YbVSGH6275P1ZoS67KiPYMipuKOnGL1K5TQIwh8z/f5OCHjeQZXiZbinef7md3UsNE8DoWaLTku2YGpeWlqwZMweRPhX9h1fzonG7Jzqs0MikayAP1j3fhWVtKK3bWjA/9ObCtJd7tbKxNo+q6LZSqu7/PXL7zvmcYSCQWT7hqh11fibuujXNH2rsvFg8o43xlu6HJpU6jOMqEhMV5k2qoQ== 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)(136003)(346002)(366004)(396003)(39860400002)(376002)(451199015)(6666004)(316002)(37006003)(34206002)(8936002)(5660300002)(4326008)(2616005)(186003)(1076003)(7416002)(8676002)(52116002)(36756003)(6506007)(66476007)(66946007)(66556008)(6512007)(26005)(41300700001)(83380400001)(86362001)(38100700002)(2906002)(38350700002)(6486002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pEGKrOd6yV+FxK6qvvveABchbCdq0uOTaZTW44XQts4wzGImg544Bo2P5zqWg2vGKGK1VCz+J+2mpn0dsOJt0wXbcz0CndogwdqJVDkCJOA6FomkEp1z1/eWUhmk1RNTA9Eqfq9aQqliriIfGJem7DU8UrdssslaxcUgTWI4rKiB5p5fN1byWgFx8PGjsONrt10pcxof4RHJN1DW+6olb4r3RmeTTsMTXx7WTuSrXxpe2wWCaY2kgnci8C4BJCuqEFk4gvWFg+QjPAcR5jCgCV9uKhaTCbEsecpn/zO82coMdkKsBAhA82628QbcTZNM7fWL53FNxxT5eJIs3oKf2KQR72RsNaB+Lb756nWd12Ma0TN1Y8b9ytyg9rbQTsxyZDxLyLxaqPD6cI5yJ8mFy1vCoeEm6r+atHY/2zj46XtpIa3rGO1RlOP064NRDNyZB6UW3J82+m/vL3Y8H8dOORhgUUgZq7rEn0guFJhpmYBiFHBWNYoB+ezccnGOJsLY2glJveRt23xs+nnQS/adZSzBCRnTg9Fq38gAWU5ZDVBpapHbYKFSViIiWK56bs04X2Bft453c3fhCspX01LPCLNlur3hIraskVbkvFwlpdAo5EqmgzoMP7/GVRxUC56RGaJmaeJF3p8U260UNuH994AIDS0IxbDPRXH/N1qnW7fiG9FfS8tbPmb5ZWuorJcKqO9SYAZIT1mIBz68B1rIMvTenIDJacMlit22Zjq3HbyHYG7nlVwi3stXofANZHa0AsMrQ/RZoUfKjutyOCw9nIXYWGPYQjWAGhutZNRVRg9K5n1MeOyAWNurLxU7nQWl5he47upvFIWaNqu42q+Vh25oVAtOGy+LH5q3msHo2wDWesEhS40UPLyMsVLZjWvYVW5Ihl1IPKCMzBmlTSjzz2crNwfjS5ziHqp78DpT+iCNxrh93ySze7MbRvB3UOVVBINL85i+j/IN76CZErG1Q61nxAPALcUO6NRljXTyvmF1XQO/5sJlH0mxIqDCMabZFjMWq87COKtCf2lf5Tyg1LIGojr1ZrhtcpyLcB6htg2Zu0mPKftiwMPufV01Uwl5pO4nQdC10zeTfnk2OtQdA9TS3bp5Vnz4/zFQkV0Cst9V9vWjEI+sn/n1KM8NbvFXmXBMo7/zsg7mZRzKDvJO1TLnJWQrI0SiBGdsTV2mzK47vOkCsmjjYWwom8id6PXE0CFUdzU10YvceehxXP5Iwq1FMymdXCQ66lxN28VR0F1Hi5FniE+Pq6AuSnas0FrQSZfK95dIoVwMoNS2cv2tAzwxNkYl6JaXuSnn7n4rgXalmhnKSJZj7ClJMUBicOnW+pnex6GjVq6vHsbaCtJgsmqG7o8WRuivFZqSBbFUZxVQnrah+u/TrHnoXuBHvzF0kY9ACh7tkY+cL+Y6S8icch8HIi1M6QEzg3PtR/zyEpQLjCiV1mIckcobjZK/BC+vF42H7woATrM2qsXwub7OGRqGEAVAucngtm5wKayOJAWmKDlvjhJGFB5lXBAEPcSnMo8Gq7NHoSwTn20HDd9WG92/tPeDRAm0hUJiuaY02ik= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e35caa52-4f82-41a0-6359-08dab8fd29c8 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0401MB2331.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 15:57:49.6862 (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: fbfMMjdriX4L8qHmYvwhsErmFdarJ72NluRdSbyD3sOF993Hqk9bij5wHYXa63rJbkoAE7tWy1eaGy7qywG+rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8323 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_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747947799489100064?= X-GMAIL-MSGID: =?utf-8?q?1747947799489100064?= |
Series |
pci-epf-vntb clean up
|
|
Commit Message
Frank Li
Oct. 28, 2022, 3:57 p.m. UTC
From: Frank Li <frank.li@nxp.com> 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 <frank.li@nxp.com> --- drivers/pci/endpoint/functions/pci-epf-vntb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Comments
On Fri, Oct 28, 2022 at 11:57:02AM -0400, Frank Li wrote: > From: Frank Li <frank.li@nxp.com> > > 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 <frank.li@nxp.com> > --- > drivers/pci/endpoint/functions/pci-epf-vntb.c | 9 +++------ > 1 file changed, 3 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..db3455c1589b 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,9 @@ 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); Why did you remove above line? Thanks, Mani > - > + if (ntb->epf_db[i]) { > ntb_db_event(&ntb->ntb, i); > - writel(0, ntb->epf_db + i * sizeof(u32)); > + ntb->epf_db[i] = 0; > } > } > > -- > 2.34.1 >
Hi Frank,
I love your patch! Perhaps something to improve:
[auto build test WARNING on jonmason-ntb/ntb-next]
[also build test WARNING on linus/master v6.1-rc3 next-20221101]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Frank-Li/pci-epf-vntb-clean-up/20221029-000245
base: https://github.com/jonmason/ntb ntb-next
patch link: https://lore.kernel.org/r/20221028155703.318928-7-Frank.Li%40nxp.com
patch subject: [PATCH v14 6/7] PCI: endpoint: pci-epf-vntb: fix sparse build warning at epf_db
config: ia64-randconfig-s043-20221031
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/04d4831353640b04e4f670c2b30e2ed12ef647d6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Frank-Li/pci-epf-vntb-clean-up/20221029-000245
git checkout 04d4831353640b04e4f670c2b30e2ed12ef647d6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/pci/controller/ drivers/pci/endpoint/functions/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/pci/endpoint/functions/pci-epf-vntb.c:552:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __iomem *mw_addr @@ got void * @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:552:17: sparse: expected void [noderef] __iomem *mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:552:17: sparse: got void *
>> drivers/pci/endpoint/functions/pci-epf-vntb.c:558:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [usertype] *epf_db @@ got void [noderef] __iomem *mw_addr @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:558:21: sparse: expected unsigned int [usertype] *epf_db
drivers/pci/endpoint/functions/pci-epf-vntb.c:558:21: sparse: got void [noderef] __iomem *mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:570:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got void [noderef] __iomem *mw_addr @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:570:38: sparse: expected void *addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:570:38: sparse: got void [noderef] __iomem *mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:1123:33: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got struct epf_ntb_ctrl *reg @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:1123:33: sparse: expected void [noderef] __iomem *base
drivers/pci/endpoint/functions/pci-epf-vntb.c:1123:33: sparse: got struct epf_ntb_ctrl *reg
drivers/pci/endpoint/functions/pci-epf-vntb.c:1134:33: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got struct epf_ntb_ctrl *reg @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:1134:33: sparse: expected void [noderef] __iomem *base
drivers/pci/endpoint/functions/pci-epf-vntb.c:1134:33: sparse: got struct epf_ntb_ctrl *reg
drivers/pci/endpoint/functions/pci-epf-vntb.c:1145:33: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got struct epf_ntb_ctrl *reg @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:1145:33: sparse: expected void [noderef] __iomem *base
drivers/pci/endpoint/functions/pci-epf-vntb.c:1145:33: sparse: got struct epf_ntb_ctrl *reg
drivers/pci/endpoint/functions/pci-epf-vntb.c:1157:33: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got struct epf_ntb_ctrl *reg @@
drivers/pci/endpoint/functions/pci-epf-vntb.c:1157:33: sparse: expected void [noderef] __iomem *base
drivers/pci/endpoint/functions/pci-epf-vntb.c:1157:33: sparse: got struct epf_ntb_ctrl *reg
vim +558 drivers/pci/endpoint/functions/pci-epf-vntb.c
e35f56bb03304a Frank Li 2022-02-22 519
e35f56bb03304a Frank Li 2022-02-22 520 /**
e35f56bb03304a Frank Li 2022-02-22 521 * epf_ntb_db_bar_init() - Configure Doorbell window BARs
693ca189095cb2 Frank Li 2022-10-28 522 * @ntb: NTB device that facilitates communication between HOST and VHOST
693ca189095cb2 Frank Li 2022-10-28 523 *
693ca189095cb2 Frank Li 2022-10-28 524 * Returns: Zero for success, or an error code in case of failure
e35f56bb03304a Frank Li 2022-02-22 525 */
e35f56bb03304a Frank Li 2022-02-22 526 static int epf_ntb_db_bar_init(struct epf_ntb *ntb)
e35f56bb03304a Frank Li 2022-02-22 527 {
e35f56bb03304a Frank Li 2022-02-22 528 const struct pci_epc_features *epc_features;
e35f56bb03304a Frank Li 2022-02-22 529 u32 align;
e35f56bb03304a Frank Li 2022-02-22 530 struct device *dev = &ntb->epf->dev;
e35f56bb03304a Frank Li 2022-02-22 531 int ret;
e35f56bb03304a Frank Li 2022-02-22 532 struct pci_epf_bar *epf_bar;
e35f56bb03304a Frank Li 2022-02-22 533 void __iomem *mw_addr;
e35f56bb03304a Frank Li 2022-02-22 534 enum pci_barno barno;
38cb263ec6bff3 Frank Li 2022-10-28 535 size_t size = sizeof(u32) * ntb->db_count;
e35f56bb03304a Frank Li 2022-02-22 536
e35f56bb03304a Frank Li 2022-02-22 537 epc_features = pci_epc_get_features(ntb->epf->epc,
e35f56bb03304a Frank Li 2022-02-22 538 ntb->epf->func_no,
e35f56bb03304a Frank Li 2022-02-22 539 ntb->epf->vfunc_no);
e35f56bb03304a Frank Li 2022-02-22 540 align = epc_features->align;
e35f56bb03304a Frank Li 2022-02-22 541
e35f56bb03304a Frank Li 2022-02-22 542 if (size < 128)
e35f56bb03304a Frank Li 2022-02-22 543 size = 128;
e35f56bb03304a Frank Li 2022-02-22 544
e35f56bb03304a Frank Li 2022-02-22 545 if (align)
e35f56bb03304a Frank Li 2022-02-22 546 size = ALIGN(size, align);
e35f56bb03304a Frank Li 2022-02-22 547 else
e35f56bb03304a Frank Li 2022-02-22 548 size = roundup_pow_of_two(size);
e35f56bb03304a Frank Li 2022-02-22 549
e35f56bb03304a Frank Li 2022-02-22 550 barno = ntb->epf_ntb_bar[BAR_DB];
e35f56bb03304a Frank Li 2022-02-22 551
e35f56bb03304a Frank Li 2022-02-22 552 mw_addr = pci_epf_alloc_space(ntb->epf, size, barno, align, 0);
e35f56bb03304a Frank Li 2022-02-22 553 if (!mw_addr) {
e35f56bb03304a Frank Li 2022-02-22 554 dev_err(dev, "Failed to allocate OB address\n");
e35f56bb03304a Frank Li 2022-02-22 555 return -ENOMEM;
e35f56bb03304a Frank Li 2022-02-22 556 }
e35f56bb03304a Frank Li 2022-02-22 557
e35f56bb03304a Frank Li 2022-02-22 @558 ntb->epf_db = mw_addr;
e35f56bb03304a Frank Li 2022-02-22 559
e35f56bb03304a Frank Li 2022-02-22 560 epf_bar = &ntb->epf->bar[barno];
e35f56bb03304a Frank Li 2022-02-22 561
e35f56bb03304a Frank Li 2022-02-22 562 ret = pci_epc_set_bar(ntb->epf->epc, ntb->epf->func_no, ntb->epf->vfunc_no, epf_bar);
e35f56bb03304a Frank Li 2022-02-22 563 if (ret) {
e35f56bb03304a Frank Li 2022-02-22 564 dev_err(dev, "Doorbell BAR set failed\n");
e35f56bb03304a Frank Li 2022-02-22 565 goto err_alloc_peer_mem;
e35f56bb03304a Frank Li 2022-02-22 566 }
e35f56bb03304a Frank Li 2022-02-22 567 return ret;
e35f56bb03304a Frank Li 2022-02-22 568
e35f56bb03304a Frank Li 2022-02-22 569 err_alloc_peer_mem:
20ecc991a4fdac Frank Li 2022-10-28 570 pci_epf_free_space(ntb->epf, mw_addr, barno, 0);
e35f56bb03304a Frank Li 2022-02-22 571 return -1;
e35f56bb03304a Frank Li 2022-02-22 572 }
e35f56bb03304a Frank Li 2022-02-22 573
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c index 54616281da9e..db3455c1589b 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,9 @@ 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_event(&ntb->ntb, i); - writel(0, ntb->epf_db + i * sizeof(u32)); + ntb->epf_db[i] = 0; } }