[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <vzmacvzafgrtxupg6cmm2bi5kxuzyeoeod56qzp5ftlnh4txlj@xni5cok2lj3j>
Date: Tue, 13 Jan 2026 13:44:00 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Sivareddy Surasani <sivareddy.surasani@....qualcomm.com>
Cc: Jonathan Corbet <corbet@....net>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
Upal Kumar Saha <upal.saha@....qualcomm.com>, Himanshu Shukla <quic_himashuk@...cinc.com>,
Vivek Pernamitta <vivek.pernamitta@....qualcomm.com>
Subject: Re: [PATCH 07/11] bus: mhi: host: core: Add overflow disable flag
On Thu, Dec 11, 2025 at 01:37:39PM +0530, Sivareddy Surasani wrote:
> From: Vivek Pernamitta <vivek.pernamitta@....qualcomm.com>
>
> When the client transfers a large packet, the host may set
> overflow events if the packet size exceeds the transfer ring
> element size. Add a flag to disable overflow events.
>
> Scenario: A device sends a packet of 5000 bytes. The host has
> buffers of 2048 bytes, so the packet is split across three
> buffers. The host expects one event for the entire packet, but
> three events are generated: two marked as overflow and the
> third as end of packet. The client driver wants only one
> callback for the EOT event, not for overflow events. This
> change prevents host channels from generating overflow events.
>
> Signed-off-by: Vivek Pernamitta <vivek.pernamitta@....qualcomm.com>
Great, you just broke bisectability. This patch should come before 06/11 which
uses this flag.
- Mani
> Signed-off-by: Sivareddy Surasani <sivareddy.surasani@....qualcomm.com>
> ---
> drivers/bus/mhi/common.h | 3 ++-
> drivers/bus/mhi/host/init.c | 3 +++
> drivers/bus/mhi/host/internal.h | 1 +
> include/linux/mhi.h | 2 ++
> 4 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mhi/common.h b/drivers/bus/mhi/common.h
> index 58f27c6ba63e..31ff4d2e6eba 100644
> --- a/drivers/bus/mhi/common.h
> +++ b/drivers/bus/mhi/common.h
> @@ -282,7 +282,8 @@ struct mhi_event_ctxt {
> #define CHAN_CTX_CHSTATE_MASK GENMASK(7, 0)
> #define CHAN_CTX_BRSTMODE_MASK GENMASK(9, 8)
> #define CHAN_CTX_POLLCFG_MASK GENMASK(15, 10)
> -#define CHAN_CTX_RESERVED_MASK GENMASK(31, 16)
> +#define CHAN_CTX_OVF_DISABLE_MASK GENMASK(17, 16)
> +#define CHAN_CTX_RESERVED_MASK GENMASK(31, 18)
> struct mhi_chan_ctxt {
> __le32 chcfg;
> __le32 chtype;
> diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c
> index 4c092490c9fd..50f96f2c823f 100644
> --- a/drivers/bus/mhi/host/init.c
> +++ b/drivers/bus/mhi/host/init.c
> @@ -340,6 +340,8 @@ static int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl)
> tmp |= FIELD_PREP(CHAN_CTX_BRSTMODE_MASK, mhi_chan->db_cfg.brstmode);
> tmp &= ~CHAN_CTX_POLLCFG_MASK;
> tmp |= FIELD_PREP(CHAN_CTX_POLLCFG_MASK, mhi_chan->db_cfg.pollcfg);
> + tmp &= ~CHAN_CTX_OVF_DISABLE_MASK;
> + tmp |= FIELD_PREP(CHAN_CTX_OVF_DISABLE_MASK, mhi_chan->db_cfg.ovf_dis);
> chan_ctxt->chcfg = cpu_to_le32(tmp);
>
> chan_ctxt->chtype = cpu_to_le32(mhi_chan->type);
> @@ -870,6 +872,7 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl,
>
> mhi_chan->ee_mask = ch_cfg->ee_mask;
> mhi_chan->db_cfg.pollcfg = ch_cfg->pollcfg;
> + mhi_chan->db_cfg.ovf_dis = ch_cfg->ovf_disable;
> mhi_chan->lpm_notify = ch_cfg->lpm_notify;
> mhi_chan->offload_ch = ch_cfg->offload_channel;
> mhi_chan->db_cfg.reset_req = ch_cfg->doorbell_mode_switch;
> diff --git a/drivers/bus/mhi/host/internal.h b/drivers/bus/mhi/host/internal.h
> index 97bf6a70b9fa..db00ede0aa48 100644
> --- a/drivers/bus/mhi/host/internal.h
> +++ b/drivers/bus/mhi/host/internal.h
> @@ -189,6 +189,7 @@ struct db_cfg {
> bool reset_req;
> bool db_mode;
> u32 pollcfg;
> + bool ovf_dis;
> enum mhi_db_brst_mode brstmode;
> dma_addr_t db_val;
> void (*process_db)(struct mhi_controller *mhi_cntrl,
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index 299216b5e4de..926a20835467 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -215,6 +215,7 @@ enum mhi_db_brst_mode {
> * @ee_mask: Execution Environment mask for this channel
> * @pollcfg: Polling configuration for burst mode. 0 is default. milliseconds
> for UL channels, multiple of 8 ring elements for DL channels
> + * @ovf_disbale: Overflow disable flag
> * @doorbell: Doorbell mode
> * @lpm_notify: The channel master requires low power mode notifications
> * @offload_channel: The client manages the channel completely
> @@ -232,6 +233,7 @@ struct mhi_channel_config {
> enum mhi_ch_type type;
> u32 ee_mask;
> u32 pollcfg;
> + bool ovf_disable;
> enum mhi_db_brst_mode doorbell;
> bool lpm_notify;
> bool offload_channel;
>
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists