From: sashiko-bot@kernel.org
To: peng.guo@montage-tech.com
Cc: linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: Add MMIO Capabilities Register Block definitions
Date: Sun, 16 Aug 2026 09:15:31 +0000 [thread overview]
Message-ID: <20260816091531.F25321F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260816084957.3316727-2-peng.guo@montage-tech.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The PCI_MCAP_HDR_BASE(n) macro incorrectly calculates the capability header base offset by omitting the 8-byte MCAP Array Header size.
--
--- Patch [1]: [PATCH 1/2] PCI: Add MMIO Capabilities Register Block definitions ---
commit 20bc3890e7eab9f1dcc6c8e26abf81734aa23ac0
Author: pguo <peng.guo@montage-tech.com>
PCI: Add MMIO Capabilities Register Block definitions
This commit adds definitions for the PCIe Management Message Passthrough
via MMIO Mailbox ECN. It introduces the MMIO Capabilities Register Block
array and capability headers.
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
[ ... ]
> +/* MMIO Capabilities Register Block (MCAP) */
> +#define PCI_MCAP_ARRAY_1 0x00
> +#define PCI_MCAP_ARRAY_ID __GENMASK(15, 0)
> +#define PCI_MCAP_ARRAY_VERSION __GENMASK(23, 16)
> +#define PCI_MCAP_ARRAY_TYPE __GENMASK(27, 24)
> +#define PCI_MCAP_ARRAY_TYPE_CLASS_CODE 0x0
> +#define PCI_MCAP_ARRAY_2 0x04
> +#define PCI_MCAP_ARRAY_COUNT __GENMASK(15, 0)
> +
> +#define PCI_MCAP_HDR_SIZEOF 0x10
> +#define PCI_MCAP_HDR_BASE(n) ((n) * PCI_MCAP_HDR_SIZEOF)
[Severity: Medium]
Does this macro calculation correctly account for the MCAP Array Header size?
Since PCI_MCAP_ARRAY_1 and PCI_MCAP_ARRAY_2 occupy the first 8 bytes of the
block, calculating PCI_MCAP_HDR_BASE(0) as 0x00 causes the capability
headers to directly overlap with the array header registers instead of
starting at the correct offset.
Should this macro include an 8-byte offset for the array header?
> +#define PCI_MCAP_HDR_REG_1 0x00
> +#define PCI_MCAP_CAP_ID __GENMASK(15, 0)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260816084957.3316727-1-peng.guo@montage-tech.com?part=1
next prev parent reply other threads:[~2026-08-16 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-16 8:49 [PATCH 0/2] PCI/CXL: Distinguish CXL capabilities in MCAP peng.guo
2026-08-16 8:49 ` [PATCH 1/2] PCI: Add MMIO Capabilities Register Block definitions peng.guo
2026-08-16 9:15 ` sashiko-bot [this message]
2026-08-16 11:19 ` Lukas Wunner
2026-08-16 8:49 ` [PATCH 2/2] cxl/core: Skip non-CXL capabilities in MCAP peng.guo
2026-08-16 9:19 ` sashiko-bot
2026-08-16 11:22 ` Lukas Wunner
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=20260816091531.F25321F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=peng.guo@montage-tech.com \
--cc=sashiko-reviews@lists.linux.dev \
/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.