linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kvijayab@amd.com>
To: Frank Li <Frank.Li@nxp.com>, manivannan.sadhasivam@linaro.org
Cc: aisheng.dong@nxp.com, bhelgaas@google.com,
	devicetree@vger.kernel.org, festevam@gmail.com,
	imx@lists.linux.dev, jdmason@kudzu.us, kernel@pengutronix.de,
	kishon@kernel.org, kw@linux.com,
	linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	lorenzo.pieralisi@arm.com, lpieralisi@kernel.org, maz@kernel.org,
	s.hauer@pengutronix.de, shawnguo@kernel.org, tglx@linutronix.de
Subject: Re: [PATCH v2 3/5] PCI: endpoint: pci-epf-test: add doorbell test
Date: Fri, 29 Sep 2023 15:03:35 +0530	[thread overview]
Message-ID: <f89afd2c-8870-077c-b4b4-368784f6d54c@amd.com> (raw)
In-Reply-To: <20230911220920.1817033-4-Frank.Li@nxp.com>

Hi Frank,

On 9/12/2023 3:39 AM, Frank Li wrote:
> Add three register: doorbell_bar, doorbell_addr, doorbell_data,
> doorbell_done. Call pci_epf_alloc_doorbell() all a doorbell address space.
> 
> Root complex(RC) side driver can trigger pci-epc-test's doorbell callback
> handler by write doorbell_data to mapped doorbell_bar's address space.
> 
> pci-epc-test will set doorbell_done in doorbell callback.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>   drivers/pci/endpoint/functions/pci-epf-test.c | 59 ++++++++++++++++++-
>   1 file changed, 58 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 1f0d2b84296a3..566549919b87b 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -11,6 +11,7 @@
>   #include <linux/dmaengine.h>
>   #include <linux/io.h>
>   #include <linux/module.h>
> +#include <linux/msi.h>
>   #include <linux/slab.h>
>   #include <linux/pci_ids.h>
>   #include <linux/random.h>
> @@ -39,17 +40,21 @@
>   #define STATUS_IRQ_RAISED		BIT(6)
>   #define STATUS_SRC_ADDR_INVALID		BIT(7)
>   #define STATUS_DST_ADDR_INVALID		BIT(8)
> +#define STATUS_DOORBELL_SUCCESS		BIT(9)
>   
>   #define FLAG_USE_DMA			BIT(0)
>   
>   #define TIMER_RESOLUTION		1
>   
> +#define MAGIC_VERSION_MASK		GENMASK(7, 0)
> +
>   static struct workqueue_struct *kpcitest_workqueue;
>   
>   struct pci_epf_test {
>   	void			*reg[PCI_STD_NUM_BARS];
>   	struct pci_epf		*epf;
>   	enum pci_barno		test_reg_bar;
> +	enum pci_barno		doorbell_bar;
>   	size_t			msix_table_offset;
>   	struct delayed_work	cmd_handler;
>   	struct dma_chan		*dma_chan_tx;
> @@ -74,6 +79,9 @@ struct pci_epf_test_reg {
>   	u32	irq_type;
>   	u32	irq_number;
>   	u32	flags;
> +	u32	doorbell_bar;

You could extend test_reg_bar for doorbell to avoid using additional BAR.


> +	u32	doorbell_addr;
> +	u32	doorbell_data;
>   } __packed;
>   

Thanks,
Kishon

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-09-29  9:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 22:09 [PATCH v2 0/5] Add RC-to-EP doorbell with platform MSI controller Frank Li
2023-09-11 22:09 ` [PATCH v2 1/5] PCI: endpoint: Add RC-to-EP doorbell support using " Frank Li
2023-09-29  9:30   ` Kishon Vijay Abraham I
2023-09-29 14:39     ` Frank Li
2023-10-17 18:37   ` Manivannan Sadhasivam
2023-10-17 18:55     ` Frank Li
2023-10-19 15:04       ` Manivannan Sadhasivam
2023-10-19 16:00         ` Frank Li
2023-10-19 17:23           ` Manivannan Sadhasivam
2023-10-19 18:11             ` [PATCH v2 1/5] PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controllery Frank Li
2023-10-20 17:12               ` Manivannan Sadhasivam
2023-10-20 18:00                 ` Frank Li
2023-10-20 18:10                   ` Manivannan Sadhasivam
2023-09-11 22:09 ` [PATCH v2 2/5] PCI: dwc: add doorbell support by use MSI controller Frank Li
2023-09-11 22:09 ` [PATCH v2 3/5] PCI: endpoint: pci-epf-test: add doorbell test Frank Li
2023-09-29  9:33   ` Kishon Vijay Abraham I [this message]
2023-09-29 14:26     ` Frank Li
2023-10-20 17:44   ` Manivannan Sadhasivam
2023-09-11 22:09 ` [PATCH v2 4/5] misc: pci_endpoint_test: Add doorbell test case Frank Li
2023-10-20 17:53   ` Manivannan Sadhasivam
2023-10-20 18:01     ` Manivannan Sadhasivam
2023-10-20 18:07       ` Frank Li
2023-10-20 18:26         ` Manivannan Sadhasivam
2023-10-30 18:33           ` Frank Li
2023-11-02 17:58             ` Manivannan Sadhasivam
2023-11-09  4:44   ` Kishon Vijay Abraham I
2023-09-11 22:09 ` [PATCH v2 5/5] tools: PCI: Add 'B' option for test doorbell Frank Li
2023-10-20 17:55   ` Manivannan Sadhasivam
2023-09-20 21:39 ` [PATCH v2 0/5] Add RC-to-EP doorbell with platform MSI controller Frank Li
2023-09-30  9:02   ` Manivannan Sadhasivam
2023-10-10 14:21     ` Frank Li
2023-10-16 14:50       ` Frank Li
2023-10-16 17:16         ` Manivannan Sadhasivam
2024-10-09 16:01 ` Niklas Cassel
2024-10-09 16:20   ` Frank Li

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=f89afd2c-8870-077c-b4b4-368784f6d54c@amd.com \
    --to=kvijayab@amd.com \
    --cc=Frank.Li@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=jdmason@kudzu.us \
    --cc=kernel@pengutronix.de \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=maz@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).