From: Manivannan Sadhasivam <mani@kernel.org>
To: Qiang Yu <quic_qianyu@quicinc.com>
Cc: quic_jhugo@quicinc.com, mhi@lists.linux.dev,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
quic_cang@quicinc.com, quic_mrana@quicinc.com
Subject: Re: [PATCH v3 2/3] bus: mhi: host: Add a new API for getting channel doorbell address
Date: Mon, 15 Apr 2024 17:32:37 +0530 [thread overview]
Message-ID: <20240415120237.GG7537@thinkpad> (raw)
In-Reply-To: <1713170945-44640-3-git-send-email-quic_qianyu@quicinc.com>
On Mon, Apr 15, 2024 at 04:49:04PM +0800, Qiang Yu wrote:
> Some controllers may want to know the address of a certain doorbell. Hence
> add a new API where we read CHDBOFF register to get the base address of
> doorbell, so that the controller can calculate the address of the doorbell
> it wants by adding additional offset.
>
> Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com>
> ---
> drivers/bus/mhi/host/main.c | 17 +++++++++++++++++
> include/linux/mhi.h | 7 +++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> index 15d657a..947b5ec 100644
> --- a/drivers/bus/mhi/host/main.c
> +++ b/drivers/bus/mhi/host/main.c
> @@ -1691,3 +1691,20 @@ void mhi_unprepare_from_transfer(struct mhi_device *mhi_dev)
> }
> }
> EXPORT_SYMBOL_GPL(mhi_unprepare_from_transfer);
> +
> +int mhi_get_channel_doorbell(struct mhi_controller *mhi_cntrl, u32 *chdb_offset)
s/mhi_get_channel_doorbell/mhi_get_channel_doorbell_offset
> +{
> + struct device *dev = &mhi_cntrl->mhi_dev->dev;
> + void __iomem *base = mhi_cntrl->regs;
> + int ret;
> +
> + /* Read channel db offset */
No need of this comment.
> + ret = mhi_read_reg(mhi_cntrl, base, CHDBOFF, chdb_offset);
> + if (ret) {
> + dev_err(dev, "Unable to read CHDBOFF register\n");
> + return -EIO;
> + }
> +
> + return 0;
> +}
Why can't you use this API in mhi_init_mmio()?
> +EXPORT_SYMBOL_GPL(mhi_get_channel_doorbell);
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index 8280545..1135142 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -816,4 +816,11 @@ int mhi_queue_skb(struct mhi_device *mhi_dev, enum dma_data_direction dir,
> */
> bool mhi_queue_is_full(struct mhi_device *mhi_dev, enum dma_data_direction dir);
>
> +/**
> + * mhi_get_channel_doorbell - read channel doorbell offset register to get
'Get the channel doorbell offset'
> + * channel doorbell address
> + * @mhi_cntrl: MHI controller
> + * @chdb_offset: channel doorbell address
s/channel doorbell address/Channel doorbell offset
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-04-15 12:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 8:49 [PATCH v3 0/3] Add sysfs entry to EDL mode Qiang Yu
2024-04-15 8:49 ` [PATCH v3 1/3] bus: mhi: host: Add sysfs entry to force device to enter EDL Qiang Yu
2024-04-15 11:56 ` Manivannan Sadhasivam
2024-04-16 5:45 ` Qiang Yu
2024-04-22 7:24 ` Manivannan Sadhasivam
2024-04-22 12:13 ` Qiang Yu
2024-04-15 8:49 ` [PATCH v3 2/3] bus: mhi: host: Add a new API for getting channel doorbell address Qiang Yu
2024-04-15 12:02 ` Manivannan Sadhasivam [this message]
2024-04-15 8:49 ` [PATCH v3 3/3] bus: mhi: host: pci_generic: Add edl callback to enter EDL Qiang Yu
2024-04-15 12:12 ` Manivannan Sadhasivam
2024-04-15 23:53 ` Mayank Rana
2024-04-16 3:50 ` Qiang Yu
2024-04-16 18:12 ` Mayank Rana
2024-04-17 3:01 ` Qiang Yu
2024-04-17 4:41 ` Qiang Yu
2024-04-18 17:37 ` Mayank Rana
2024-04-22 8:08 ` Manivannan Sadhasivam
2024-04-22 12:06 ` Qiang Yu
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=20240415120237.GG7537@thinkpad \
--to=mani@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhi@lists.linux.dev \
--cc=quic_cang@quicinc.com \
--cc=quic_jhugo@quicinc.com \
--cc=quic_mrana@quicinc.com \
--cc=quic_qianyu@quicinc.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 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.