From: Frank Li <frank.li@nxp.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: RE: [EXT] [bug report] PCI: endpoint: Support NTB transfer between RC and EP
Date: Fri, 12 Aug 2022 17:58:09 +0000 [thread overview]
Message-ID: <PAXPR04MB918619FB78A49CA8E79A41F388679@PAXPR04MB9186.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <YvTeWal8mQg56xMA@kili>
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Sent: Thursday, August 11, 2022 5:48 AM
> To: Frank Li <frank.li@nxp.com>
> Cc: linux-pci@vger.kernel.org
> Subject: [EXT] [bug report] PCI: endpoint: Support NTB transfer between RC
> and EP
>
> Caution: EXT Email
>
> Hello Frank Li,
>
> The patch e35f56bb0330: "PCI: endpoint: Support NTB transfer between
> RC and EP" from Feb 22, 2022, leads to the following Smatch static
> checker warning:
[Frank Li] Thanks, I think my MSI patch is under review. I will squash fixed
Patch at next version.
>
> drivers/pci/endpoint/functions/pci-epf-vntb.c:560 epf_ntb_db_bar_init()
> error: uninitialized symbol 'align'.
>
> drivers/pci/endpoint/functions/pci-epf-vntb.c
> 539 static int epf_ntb_db_bar_init(struct epf_ntb *ntb)
> 540 {
> 541 const struct pci_epc_features *epc_features;
> 542 u32 align;
> ^^^^^
> 543 struct device *dev = &ntb->epf->dev;
> 544 int ret;
> 545 struct pci_epf_bar *epf_bar;
> 546 void __iomem *mw_addr = NULL;
> 547 enum pci_barno barno;
> 548 size_t size;
> 549
> 550 epc_features = pci_epc_get_features(ntb->epf->epc,
> 551 ntb->epf->func_no,
> 552 ntb->epf->vfunc_no);
> 553
> 554 size = epf_ntb_db_size(ntb);
> 555
> 556 barno = ntb->epf_ntb_bar[BAR_DB];
> 557 epf_bar = &ntb->epf->bar[barno];
> 558
> 559 if (!ntb->epf_db_phy) {
> --> 560 mw_addr = pci_epf_alloc_space(ntb->epf, size, barno, align,
> 0);
> ^^^^^
> Never initialized.
>
> 561 if (!mw_addr) {
> 562 dev_err(dev, "Failed to allocate OB address\n");
> 563 return -ENOMEM;
> 564 }
> 565 } else {
> 566 epf_bar->phys_addr = ntb->epf_db_phy;
> 567 epf_bar->barno = barno;
> 568 epf_bar->size = size;
> 569 }
> 570
> 571 ntb->epf_db = mw_addr;
> 572
> 573 ret = pci_epc_set_bar(ntb->epf->epc, ntb->epf->func_no, ntb-
> >epf->vfunc_no, epf_bar);
> 574 if (ret) {
> 575 dev_err(dev, "Doorbell BAR set failed\n");
> 576 goto err_alloc_peer_mem;
> 577 }
> 578 return ret;
> 579
> 580 err_alloc_peer_mem:
> 581 pci_epc_mem_free_addr(ntb->epf->epc, epf_bar->phys_addr,
> mw_addr, epf_bar->size);
> 582 return -1;
> 583 }
>
> regards,
> dan carpenter
prev parent reply other threads:[~2022-08-12 17:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 10:47 [bug report] PCI: endpoint: Support NTB transfer between RC and EP Dan Carpenter
2022-08-12 17:58 ` Frank Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PAXPR04MB918619FB78A49CA8E79A41F388679@PAXPR04MB9186.eurprd04.prod.outlook.com \
--to=frank.li@nxp.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.