mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ALOK TIWARI <alok.a.tiwari@oracle.com>
To: Koichiro Den <den@valinux.co.jp>,
	jingoohan1@gmail.com, mani@kernel.org, lpieralisi@kernel.org,
	kwilczynski@kernel.org, robh@kernel.org, bhelgaas@google.com,
	kishon@kernel.org, jdmason@kudzu.us, dave.jiang@intel.com,
	allenbh@gmail.com, cassel@kernel.org, Frank.Li@nxp.com,
	shinichiro.kawasaki@wdc.com, christian.bruel@foss.st.com
Cc: mmaddireddy@nvidia.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, ntb@lists.linux.dev
Subject: Re: [PATCH v9 5/7] PCI: endpoint: pci-epf-vntb: Reuse pre-exposed doorbells and IRQ flags
Date: Thu, 19 Feb 2026 22:00:19 +0530	[thread overview]
Message-ID: <9067af7b-9794-4313-aec2-98c2c5e018b2@oracle.com> (raw)
In-Reply-To: <20260219081318.4156901-6-den@valinux.co.jp>



On 2/19/2026 1:43 PM, Koichiro Den wrote:
>   static int epf_ntb_db_bar_init_msi_doorbell(struct epf_ntb *ntb,
>   					    struct pci_epf_bar *db_bar,
>   					    const struct pci_epc_features *epc_features,

The return value of pci_epc_get_features() seems to be used here
without checking for NULL.

Since this function can return NULL, and other EPF drivers
(pci-epf-test.c, pci-epf-ntb.c) handle that case,
is VNTB assuming that epc_features is always non-NULL,
or should a defensive NULL check be added for pci_epc_get_features()?

> @@ -533,9 +549,24 @@ static int epf_ntb_db_bar_init_msi_doorbell(struct epf_ntb *ntb,
>   	if (ret)
>   		return ret;
>   
> +	/*
> +	 * The doorbell target may already be exposed by a platform-owned fixed
> +	 * BAR. In that case, we must reuse it and the requested db_bar must
> +	 * match.
> +	 */
> +	if (epf->db_msg[0].bar != NO_BAR && epf->db_msg[0].bar != barno) {
> +		ret = -EINVAL;
> +		goto err_free_doorbell;
> +	}
> +
>   	for (req = 0; req < ntb->db_count; req++) {
> +		/* Avoid requesting duplicate handlers */
> +		if (epf_ntb_db_irq_is_duplicated(epf, req))
> +			continue;
> +
>   		ret = request_irq(epf->db_msg[req].virq, epf_ntb_doorbell_handler,
> -				  0, "pci_epf_vntb_db", ntb);
> +		


Thanks,
Alok

  reply	other threads:[~2026-02-19 16:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  8:13 [PATCH v9 0/7] PCI: endpoint: pci-ep-msi: Add embedded doorbell fallback Koichiro Den
2026-02-19  8:13 ` [PATCH v9 1/7] PCI: endpoint: Add auxiliary resource query API Koichiro Den
2026-02-19  8:13 ` [PATCH v9 2/7] PCI: dwc: Record integrated eDMA register window Koichiro Den
2026-02-19  8:13 ` [PATCH v9 3/7] PCI: dwc: ep: Expose integrated eDMA resources via EPC aux-resource API Koichiro Den
2026-02-19  8:13 ` [PATCH v9 4/7] PCI: endpoint: pci-ep-msi: Refactor doorbell allocation for new backends Koichiro Den
2026-02-19  8:13 ` [PATCH v9 5/7] PCI: endpoint: pci-epf-vntb: Reuse pre-exposed doorbells and IRQ flags Koichiro Den
2026-02-19 16:30   ` ALOK TIWARI [this message]
2026-02-20  3:35     ` Koichiro Den
2026-02-20 10:27       ` Niklas Cassel
2026-02-20 17:53         ` Koichiro Den
2026-02-20 15:14       ` ALOK TIWARI
2026-02-19  8:13 ` [PATCH v9 6/7] PCI: endpoint: pci-epf-test: Reuse pre-exposed doorbell targets Koichiro Den
2026-02-19  8:13 ` [PATCH v9 7/7] PCI: endpoint: pci-ep-msi: Add embedded doorbell fallback Koichiro Den
2026-02-20 17:42   ` Koichiro Den
2026-02-20 17:59     ` Koichiro Den
2026-02-27 15:34     ` Niklas Cassel
2026-02-28 16:33       ` Koichiro Den
2026-02-27 15:06 ` [PATCH v9 0/7] " Niklas Cassel

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=9067af7b-9794-4313-aec2-98c2c5e018b2@oracle.com \
    --to=alok.a.tiwari@oracle.com \
    --cc=Frank.Li@nxp.com \
    --cc=allenbh@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=christian.bruel@foss.st.com \
    --cc=dave.jiang@intel.com \
    --cc=den@valinux.co.jp \
    --cc=jdmason@kudzu.us \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=ntb@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=shinichiro.kawasaki@wdc.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

all inboxes | Powered by JetHome®