From: Manivannan Sadhasivam <mani@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>,
Hemant Kumar <quic_hemantk@quicinc.com>,
linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev
Subject: Re: [PATCH v5] bus: mhi: host: make mhi_controller_config::event_cfg const
Date: Wed, 31 Aug 2022 13:43:12 +0530 [thread overview]
Message-ID: <20220831081312.GA5076@thinkpad> (raw)
In-Reply-To: <20220830171147.24338-1-quic_jjohnson@quicinc.com>
On Tue, Aug 30, 2022 at 10:11:47AM -0700, Jeff Johnson wrote:
> Currently the event_cfg pointer in struct mhi_controller_config is not
> defined as a const pointer. This prevents clients from registering a
> read-only configuration unless they use a typecast. Since the
> event_cfg should not be modified once registered, add the const
> qualifier to event_cfg. This is aligned with the definition of ch_cfg.
>
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Thanks,
Mani
> ---
> v5: corrected mhi_foxconn_sdx55_events[]
>
> v4: updated subject, rebased to v6.0-rc3
>
> v3: added pci_generic.c change
>
> v2: added S-O-B
>
> drivers/bus/mhi/host/pci_generic.c | 14 +++++++-------
> include/linux/mhi.h | 2 +-
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index 9e545f2a5a26..0db437ac3ba4 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -238,7 +238,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3),
> };
>
> -static struct mhi_event_config modem_qcom_v1_mhi_events[] = {
> +static const struct mhi_event_config modem_qcom_v1_mhi_events[] = {
> /* first ring is control+data ring */
> MHI_EVENT_CONFIG_CTRL(0, 64),
> /* DIAG dedicated event ring */
> @@ -305,7 +305,7 @@ static const struct mhi_channel_config mhi_quectel_em1xx_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
> };
>
> -static struct mhi_event_config mhi_quectel_em1xx_events[] = {
> +static const struct mhi_event_config mhi_quectel_em1xx_events[] = {
> MHI_EVENT_CONFIG_CTRL(0, 128),
> MHI_EVENT_CONFIG_DATA(1, 128),
> MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
> @@ -344,7 +344,7 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
> };
>
> -static struct mhi_event_config mhi_foxconn_sdx55_events[] = {
> +static const struct mhi_event_config mhi_foxconn_sdx55_events[] = {
> MHI_EVENT_CONFIG_CTRL(0, 128),
> MHI_EVENT_CONFIG_DATA(1, 128),
> MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
> @@ -391,7 +391,7 @@ static const struct mhi_channel_config mhi_mv3x_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 512, 3),
> };
>
> -static struct mhi_event_config mhi_mv3x_events[] = {
> +static const struct mhi_event_config mhi_mv3x_events[] = {
> MHI_EVENT_CONFIG_CTRL(0, 256),
> MHI_EVENT_CONFIG_DATA(1, 256),
> MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
> @@ -438,7 +438,7 @@ static const struct mhi_channel_config mhi_sierra_em919x_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 512, 2),
> };
>
> -static struct mhi_event_config modem_sierra_em919x_mhi_events[] = {
> +static const struct mhi_event_config modem_sierra_em919x_mhi_events[] = {
> /* first ring is control+data and DIAG ring */
> MHI_EVENT_CONFIG_CTRL(0, 2048),
> /* Hardware channels request dedicated hardware event rings */
> @@ -472,7 +472,7 @@ static const struct mhi_channel_config mhi_telit_fn980_hw_v1_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 2),
> };
>
> -static struct mhi_event_config mhi_telit_fn980_hw_v1_events[] = {
> +static const struct mhi_event_config mhi_telit_fn980_hw_v1_events[] = {
> MHI_EVENT_CONFIG_CTRL(0, 128),
> MHI_EVENT_CONFIG_HW_DATA(1, 1024, 100),
> MHI_EVENT_CONFIG_HW_DATA(2, 2048, 101)
> @@ -511,7 +511,7 @@ static const struct mhi_channel_config mhi_telit_fn990_channels[] = {
> MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
> };
>
> -static struct mhi_event_config mhi_telit_fn990_events[] = {
> +static const struct mhi_event_config mhi_telit_fn990_events[] = {
> MHI_EVENT_CONFIG_CTRL(0, 128),
> MHI_EVENT_CONFIG_DATA(1, 128),
> MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index a5441ad33c74..ada2f18af4d6 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -281,7 +281,7 @@ struct mhi_controller_config {
> u32 num_channels;
> const struct mhi_channel_config *ch_cfg;
> u32 num_events;
> - struct mhi_event_config *event_cfg;
> + const struct mhi_event_config *event_cfg;
> bool use_bounce_buf;
> bool m2_no_db;
> };
> --
> 2.37.0
>
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2022-08-31 8:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 21:02 [PATCH v3] bus: mhi: make mhi_controller_config::event_cfg const Jeff Johnson
2022-08-19 21:08 ` Jeffrey Hugo
2022-08-19 21:15 ` Jeff Johnson
2022-08-27 18:43 ` Jeff Johnson
2022-08-29 17:31 ` Manivannan Sadhasivam
2022-08-29 20:51 ` [PATCH v4] bus: mhi: host: " Jeff Johnson
2022-08-30 7:46 ` Manivannan Sadhasivam
2022-08-30 17:12 ` Jeff Johnson
2022-08-30 17:11 ` [PATCH v5] " Jeff Johnson
2022-08-31 8:13 ` Manivannan Sadhasivam [this message]
2022-09-07 8:00 ` Manivannan Sadhasivam
2022-11-08 13:33 ` Kalle Valo
2022-11-08 14:39 ` Manivannan Sadhasivam
2022-11-08 14:58 ` Kalle Valo
2022-11-09 7:45 ` Manivannan Sadhasivam
2022-11-09 15:26 ` Jeff Johnson
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=20220831081312.GA5076@thinkpad \
--to=mani@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=mhi@lists.linux.dev \
--cc=quic_hemantk@quicinc.com \
--cc=quic_jjohnson@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 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).