From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Li Zhijian <lizhijian@fujitsu.com>
Cc: <qemu-devel@nongnu.org>, Fan Ni <fan.ni@samsung.com>,
<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 3/3] hw/mem/cxl_type3: Ensure errp is set on realization failure
Date: Tue, 21 Jan 2025 14:59:56 +0000 [thread overview]
Message-ID: <20250121145956.00007e66@huawei.com> (raw)
In-Reply-To: <20250120030947.254930-3-lizhijian@fujitsu.com>
On Mon, 20 Jan 2025 11:09:47 +0800
Li Zhijian <lizhijian@fujitsu.com> wrote:
> Simply pass the errp to its callee which will set errp if needed, to
> enhance error reporting for CXL Type 3 device initialization by setting
> the errp when realization functions fail.
>
> Previously, failing to set `errp` could result in errors being overlooked,
> causing the system to mistakenly treat failure scenarios as successful and
> potentially leading to redundant cleanup operations in ct3_exit().
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Looks good to me so just that reordering issue in patch 2.
Thanks for fixing this up.
Jonathan
> ---
> hw/mem/cxl_type3.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
> index 9eb3d0979cf5..c3b6a1d6a612 100644
> --- a/hw/mem/cxl_type3.c
> +++ b/hw/mem/cxl_type3.c
> @@ -883,7 +883,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
> &ct3d->cxl_dstate.device_registers);
>
> /* MSI(-X) Initialization */
> - rc = msix_init_exclusive_bar(pci_dev, CXL_T3_MSIX_VECTOR_NR, 4, NULL);
> + rc = msix_init_exclusive_bar(pci_dev, CXL_T3_MSIX_VECTOR_NR, 4, errp);
> if (rc) {
> goto err_free_special_ops;
> }
> @@ -904,7 +904,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
>
> pcie_cap_deverr_init(pci_dev);
> /* Leave a bit of room for expansion */
> - rc = pcie_aer_init(pci_dev, PCI_ERR_VER, 0x200, PCI_ERR_SIZEOF, NULL);
> + rc = pcie_aer_init(pci_dev, PCI_ERR_VER, 0x200, PCI_ERR_SIZEOF, errp);
> if (rc) {
> goto err_release_cdat;
> }
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Li Zhijian <lizhijian@fujitsu.com>
Cc: <qemu-devel@nongnu.org>, Fan Ni <fan.ni@samsung.com>,
<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 3/3] hw/mem/cxl_type3: Ensure errp is set on realization failure
Date: Tue, 21 Jan 2025 14:59:56 +0000 [thread overview]
Message-ID: <20250121145956.00007e66@huawei.com> (raw)
In-Reply-To: <20250120030947.254930-3-lizhijian@fujitsu.com>
On Mon, 20 Jan 2025 11:09:47 +0800
Li Zhijian <lizhijian@fujitsu.com> wrote:
> Simply pass the errp to its callee which will set errp if needed, to
> enhance error reporting for CXL Type 3 device initialization by setting
> the errp when realization functions fail.
>
> Previously, failing to set `errp` could result in errors being overlooked,
> causing the system to mistakenly treat failure scenarios as successful and
> potentially leading to redundant cleanup operations in ct3_exit().
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Looks good to me so just that reordering issue in patch 2.
Thanks for fixing this up.
Jonathan
> ---
> hw/mem/cxl_type3.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
> index 9eb3d0979cf5..c3b6a1d6a612 100644
> --- a/hw/mem/cxl_type3.c
> +++ b/hw/mem/cxl_type3.c
> @@ -883,7 +883,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
> &ct3d->cxl_dstate.device_registers);
>
> /* MSI(-X) Initialization */
> - rc = msix_init_exclusive_bar(pci_dev, CXL_T3_MSIX_VECTOR_NR, 4, NULL);
> + rc = msix_init_exclusive_bar(pci_dev, CXL_T3_MSIX_VECTOR_NR, 4, errp);
> if (rc) {
> goto err_free_special_ops;
> }
> @@ -904,7 +904,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
>
> pcie_cap_deverr_init(pci_dev);
> /* Leave a bit of room for expansion */
> - rc = pcie_aer_init(pci_dev, PCI_ERR_VER, 0x200, PCI_ERR_SIZEOF, NULL);
> + rc = pcie_aer_init(pci_dev, PCI_ERR_VER, 0x200, PCI_ERR_SIZEOF, errp);
> if (rc) {
> goto err_release_cdat;
> }
next prev parent reply other threads:[~2025-01-21 15:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 3:09 [PATCH 1/3] hw/mem/cxl_type3: Add paired msix_uninit_exclusive_bar() call Li Zhijian
2025-01-20 3:09 ` Li Zhijian via
2025-01-20 3:09 ` [PATCH 2/3] hw/mem/cxl_type3: Fix special_ops memory leak on msix_init_exclusive_bar() failure Li Zhijian
2025-01-20 3:09 ` Li Zhijian via
2025-01-21 14:58 ` Jonathan Cameron
2025-01-21 14:58 ` Jonathan Cameron via
2025-01-21 15:19 ` Jonathan Cameron
2025-01-21 15:19 ` Jonathan Cameron via
2025-01-22 0:56 ` Zhijian Li (Fujitsu)
2025-01-22 0:56 ` Zhijian Li (Fujitsu) via
2025-01-20 3:09 ` [PATCH 3/3] hw/mem/cxl_type3: Ensure errp is set on realization failure Li Zhijian
2025-01-20 3:09 ` Li Zhijian via
2025-01-21 14:59 ` Jonathan Cameron [this message]
2025-01-21 14:59 ` Jonathan Cameron via
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=20250121145956.00007e66@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=fan.ni@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=lizhijian@fujitsu.com \
--cc=qemu-devel@nongnu.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.