From: netdev-bot+sashiko@kernel.org
To: tianx@yunsilicon.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, jgg@ziepe.ca,
leon@kernel.org, huangjunxian6@hisilicon.com,
weihg@yunsilicon.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
kerneljasonxing@gmail.com
Subject: Re: [PATCH v2 01/11] net/xsc: add Yunsilicon XSC ethernet PCI driver
Date: Fri, 27 Nov 2026 15:57:49 +0000 [thread overview]
Message-ID: <179579506923.3135.15582286060392761620@kernel.org> (raw)
In-Reply-To: <20261126145711.70868-2-tianx@yunsilicon.com>
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 3
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In xsc_pci_init(), BAR0 is mapped with pci_ioremap_bar(),
which is a plain ioremap() of pdev->resource[0], but it is unmapped…
- [Low] The subject line is cut short.
- [Low] The new MAINTAINERS entry 'YUNSILICON XSC DRIVERS' has only 'F:
drivers/net/ethernet/yunsilicon/xsc'.
- [Low] xsc_pci_driver.name is "xsc-pci".
--
net/xsc: add Yunsilicon XSC ethernet PCI driver
This commit adds the Yunsilicon vendor Kconfig/Makefile glue and a
skeleton PCI driver for XSC ethernet devices. The PCI core enables the
device, requests and maps BAR0, and sets the DMA masks. The doorbell,
command queue and netdev layers come in later patches.
> net/xsc: add Yunsilicon XSC ethernet PCI driver
>
> skeleton
[Severity: Low]
This isn't a bug, but the subject line seems to have been split. The word
"skeleton" is now the first line of the body.
As a result the shortlog reads "net/xsc: add Yunsilicon XSC ethernet PCI
driver". The commit only adds a PCI skeleton with no netdev. Could
"skeleton" go back into the subject line?
> diff --git a/MAINTAINERS b/MAINTAINERS
> index bde216003f428..1cd2a0a6477c7 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -30909,6 +30909,13 @@ S: Maintained
> F: Documentation/input/devices/yealink.rst
> F: drivers/input/misc/yealink.*
>
> +YUNSILICON XSC DRIVERS
> +M: Honggang Wei <weihg@yunsilicon.com>
> +M: Xin Tian <tianx@yunsilicon.com>
> +L: netdev@vger.kernel.org
> +S: Maintained
> +F: drivers/net/ethernet/yunsilicon/xsc
[Severity: Low]
This isn't a bug, but should this F: entry be
drivers/net/ethernet/yunsilicon/ with a trailing slash?
As written it does not cover the vendor-level files this patch adds,
drivers/net/ethernet/yunsilicon/Kconfig and
drivers/net/ethernet/yunsilicon/Makefile. Changes to those files would not
be sent to the listed maintainers.
The new line in drivers/net/ethernet/Makefile is also out of order:
obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/
obj-$(CONFIG_NET_VENDOR_YUNSILICON) += yunsilicon/
obj-$(CONFIG_NET_VENDOR_XIRCOM) += xircom/
In drivers/net/ethernet/Kconfig the matching source line comes after
xircom. Both issues are still present at the end of the series.
> +
> ZD1211RW WIRELESS DRIVER
> L: linux-wireless@vger.kernel.org
> S: Orphan
[ ... ]
> diff --git a/drivers/net/ethernet/yunsilicon/xsc/pci/main.c b/drivers/net/ethernet/yunsilicon/xsc/pci/main.c
> new file mode 100644
> index 0000000000000..c926507a74b04
> --- /dev/null
> +++ b/drivers/net/ethernet/yunsilicon/xsc/pci/main.c
[ ... ]
> + bar_base = pci_ioremap_bar(pdev, bar_num);
> + if (!bar_base) {
> + pci_err(pdev, "failed to ioremap %s bar%d\n", KBUILD_MODNAME,
> + bar_num);
> + err = -ENOMEM;
> + goto err_clr_master;
> + }
> +
> + err = pci_save_state(pdev);
> + if (err) {
> + pci_err(pdev, "pci_save_state failed: err=%d\n", err);
> + goto err_io_unmap;
> + }
> +
> + xdev->bar_num = bar_num;
> + xdev->bar = bar_base;
> +
> + return 0;
> +
> +err_io_unmap:
> + pci_iounmap(pdev, bar_base);
[Severity: Medium]
Is pci_iounmap() the right call to undo pci_ioremap_bar()? It pairs with
pci_iomap(), while pci_ioremap_bar() is a plain ioremap(). xsc_pci_fini()
uses the same pairing on remove.
On s390 zPCI without MIO, the two calls are not symmetric.
zpci_map_resources() stores a cookie from pci_iomap_range_fh() in
resource[0].start, and that call takes the only reference.
pci_ioremap_bar() returns that cookie without taking a reference:
arch/s390/pci/pci.c:ioremap_prot() {
...
if (!static_branch_unlikely(&have_mio))
return (void __iomem *)phys_addr;
...
}
pci_iounmap() then calls pci_iounmap_fh(), which drops the reference that
zpci_map_resources() holds:
arch/s390/pci/pci.c:pci_iounmap_fh() {
...
WARN_ON(!zpci_iomap_start[idx].count);
if (!--zpci_iomap_start[idx].count) {
zpci_iomap_start[idx].fh = 0;
zpci_iomap_start[idx].bar = 0;
}
...
}
After one unbind, or one probe failure that reaches err_io_unmap, would
the next probe get a cookie whose fh is 0? Then every BAR0 readl()/writel()
would go to the wrong function handle.
When the device is finally removed, zpci_unmap_resources() calls
pci_iounmap_fh() again. That would trigger WARN_ON(!count) and underflow
the counter.
Later patches in the series add more ways to reach err_io_unmap, such as
xsc_cmd_init() failing.
Could this pair pci_ioremap_bar() with iounmap() instead? Another option is
to use pci_iomap()/pci_iounmap() or pcim_iomap_region().
> +err_clr_master:
> + pci_clear_master(pdev);
> + pci_release_region(pdev, bar_num);
> +err_disable:
> + pci_disable_device(pdev);
> +err_out:
> + return err;
> +}
> +
> +static void xsc_pci_fini(struct xsc_core_device *xdev)
> +{
> + struct pci_dev *pdev = xdev->pdev;
> +
> + pci_iounmap(pdev, xdev->bar);
> + pci_clear_master(pdev);
> + pci_release_region(pdev, xdev->bar_num);
> + pci_disable_device(pdev);
> +}
[ ... ]
> +static struct pci_driver xsc_pci_driver = {
> + .name = "xsc-pci",
[Severity: Low]
This isn't a bug, but the driver name here is "xsc-pci". The module is
called xsc_pci per the Kconfig help and the Makefile, and
pci_request_region() in xsc_pci_init() claims BAR0 under KBUILD_MODNAME
("xsc_pci").
So /sys/bus/pci/drivers/xsc-pci and the owner shown in /proc/iomem would
have different names. Later in the series xsc_core.h defines
XSC_PCI_DRV_NAME as "xsc_pci", but .name still uses the hyphenated string.
Would .name = KBUILD_MODNAME be more consistent?
> + .id_table = xsc_pci_id_table,
> + .probe = xsc_pci_probe,
> + .remove = xsc_pci_remove,
> +};
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126145711.70868-1-tianx%40yunsilicon.com
next prev parent reply other threads:[~2026-11-27 15:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 14:57 [PATCH v2 00/11] net/xsc: add the Yunsilicon XSC ethernet driver Xin Tian
2026-11-26 14:57 ` [PATCH v2 01/11] net/xsc: add Yunsilicon XSC ethernet PCI driver Xin Tian
2026-11-27 15:57 ` netdev-bot+sashiko [this message]
2026-11-26 14:57 ` [PATCH v2 02/11] net/xsc: add doorbell and cmdq MMIO accessors Xin Tian
2026-11-27 15:57 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 03/11] net/xsc: add the command queue Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:57 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 04/11] net/xsc: query HCA capabilities and reset function Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:57 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 05/11] net/xsc: add event queues and MSI-X Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:57 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 06/11] net/xsc: add CQ and QP helpers Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:57 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 07/11] net/xsc: add the ethernet netdev Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:57 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 08/11] net/xsc: add the single TX/RX channel Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:58 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 09/11] net/xsc: report link state changes Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:58 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 10/11] net/xsc: add the transmit path Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:58 ` netdev-bot+sashiko
2026-11-26 14:57 ` [PATCH v2 11/11] net/xsc: add the receive path Xin Tian
2026-11-27 14:58 ` sashiko-bot
2026-11-27 15:58 ` netdev-bot+sashiko
2026-11-27 14:58 ` [PATCH v2 00/11] net/xsc: add the Yunsilicon XSC ethernet driver sashiko-bot
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=179579506923.3135.15582286060392761620@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@ziepe.ca \
--cc=kerneljasonxing@gmail.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tianx@yunsilicon.com \
--cc=weihg@yunsilicon.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox