From: Neil Armstrong <neil.armstrong@linaro.org>
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Jeff Johnson" <jjohnson@kernel.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev,
linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
qiang.yu@oss.qualcomm.com,
Miaoqing Pan <quic_miaoqing@quicinc.com>
Subject: Re: [PATCH v5 5/6] wifi: ath11k: Add support for MHI bandwidth scaling
Date: Tue, 1 Sep 2026 16:45:30 +0200 [thread overview]
Message-ID: <5b10cb13-77e6-4754-a885-92c873866ef4@linaro.org> (raw)
In-Reply-To: <20260819-bwscale-v5-5-6dea79786b37@oss.qualcomm.com>
Hi,
On 8/19/26 15:25, Krishna Chaitanya Chundru wrote:
> From: Miaoqing Pan <quic_miaoqing@quicinc.com>
>
> Add support for MHI bandwidth scaling, which will reduce power consumption
> if WLAN operates with lower bandwidth. This feature is only enabled for
> QCA6390.
>
> Bandwidth scaling is initiated by the endpoint firmware based upon the
> bandwidth requirements, if there is high bandwidth data endpoint requests
> for higher data rates or if there is less bandwidth they request for lower
> data rates to reduce power. Endpoint initiates this through MHI protocol.
>
> Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04546-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
Somehow unrelated, but I added this to the ath12k to test on an WCN785x and I just
got a single event to set the speed to 5GT/s and no further event whatever the state
of the Wireless link is.
Is there anything required on the ath12k side to allow lowering the speed to 2.5GT/s ?
Thanks,
Neil
>
> Signed-off-by: Miaoqing Pan <quic_miaoqing@quicinc.com>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath11k/mhi.c | 38 +++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
> index a6c9ff112c68..9bff4c4bca3b 100644
> --- a/drivers/net/wireless/ath/ath11k/mhi.c
> +++ b/drivers/net/wireless/ath/ath11k/mhi.c
> @@ -20,6 +20,7 @@
> #define MHI_TIMEOUT_DEFAULT_MS 20000
> #define RDDM_DUMP_SIZE 0x420000
> #define MHI_CB_INVALID 0xff
> +#define MHI_BW_SCALE_CHAN_DB 126
>
> static const struct mhi_channel_config ath11k_mhi_channels_qca6390[] = {
> {
> @@ -71,6 +72,17 @@ static struct mhi_event_config ath11k_mhi_events_qca6390[] = {
> .client_managed = false,
> .offload_channel = false,
> },
> + {
> + .num_elements = 8,
> + .irq_moderation_ms = 0,
> + .irq = 1,
> + .mode = MHI_DB_BRST_DISABLE,
> + .data_type = MHI_ER_BW_SCALE,
> + .priority = 2,
> + .hardware_event = false,
> + .client_managed = false,
> + .offload_channel = false,
> + },
> };
>
> static const struct mhi_controller_config ath11k_mhi_config_qca6390 = {
> @@ -311,6 +323,30 @@ static void ath11k_mhi_op_write_reg(struct mhi_controller *mhi_cntrl,
> writel(val, addr);
> }
>
> +static int ath11k_mhi_op_get_misc_doorbell(struct mhi_controller *mhi_cntrl,
> + enum mhi_er_data_type type)
> +{
> + if (type == MHI_ER_BW_SCALE)
> + return MHI_BW_SCALE_CHAN_DB;
> +
> + return -EOPNOTSUPP;
> +}
> +
> +static int ath11k_mhi_op_bw_scale(struct mhi_controller *mhi_cntrl,
> + struct mhi_link_info *link_info)
> +{
> + enum pci_bus_speed speed = pci_lnkctl2_bus_speed(link_info->target_link_speed);
> + struct ath11k_base *ab = dev_get_drvdata(mhi_cntrl->cntrl_dev);
> + struct pci_dev *pci_dev = to_pci_dev(ab->dev);
> + struct pci_dev *pdev;
> +
> + pdev = pci_upstream_bridge(pci_dev);
> + if (!pdev)
> + return -ENODEV;
> +
> + return pcie_set_target_speed(pdev, speed, true);
> +}
> +
> static int ath11k_mhi_read_addr_from_dt(struct mhi_controller *mhi_ctrl)
> {
> struct device_node *np;
> @@ -387,6 +423,8 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
> mhi_ctrl->status_cb = ath11k_mhi_op_status_cb;
> mhi_ctrl->read_reg = ath11k_mhi_op_read_reg;
> mhi_ctrl->write_reg = ath11k_mhi_op_write_reg;
> + mhi_ctrl->bw_scale = ath11k_mhi_op_bw_scale;
> + mhi_ctrl->get_misc_doorbell = ath11k_mhi_op_get_misc_doorbell;
>
> switch (ab->hw_rev) {
> case ATH11K_HW_QCN9074_HW10:
>
next prev parent reply other threads:[~2026-09-01 14:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 13:25 [PATCH v5 0/6] bus: mhi: host: Add support for mhi bus bw Krishna Chaitanya Chundru
2026-08-19 13:25 ` [PATCH v5 1/6] PCI/bwctrl: Set host bridge OPP and optionally disable ASPM around link retraining Krishna Chaitanya Chundru
2026-09-01 7:42 ` Manivannan Sadhasivam
2026-09-02 4:52 ` Krishna Chaitanya Chundru
2026-10-07 9:11 ` Val Packett
2026-10-08 5:52 ` Krishna Chaitanya Chundru
2026-08-19 13:25 ` [PATCH v5 2/6] PCI: Export pci_set_target_speed() Krishna Chaitanya Chundru
2026-09-01 7:44 ` Manivannan Sadhasivam
2026-08-19 13:25 ` [PATCH v5 3/6] PCI: Add pci_lnkctl2_bus_speed() to convert lnkctl2speed to pci_bus_speed Krishna Chaitanya Chundru
2026-09-01 7:50 ` Manivannan Sadhasivam
2026-08-19 13:25 ` [PATCH v5 4/6] bus: mhi: host: Add support for Bandwidth scale Krishna Chaitanya Chundru
2026-09-01 8:06 ` Manivannan Sadhasivam
2026-09-02 5:00 ` Krishna Chaitanya Chundru
2026-08-19 13:25 ` [PATCH v5 5/6] wifi: ath11k: Add support for MHI bandwidth scaling Krishna Chaitanya Chundru
2026-09-01 14:45 ` Neil Armstrong [this message]
2026-09-02 5:30 ` Krishna Chaitanya Chundru
2026-08-19 13:25 ` [PATCH v5 6/6] PCI: qcom: Enable ASPM disabling during link retraining Krishna Chaitanya Chundru
2026-09-01 8:08 ` Manivannan Sadhasivam
2026-09-02 5:22 ` Krishna Chaitanya Chundru
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=5b10cb13-77e6-4754-a885-92c873866ef4@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=ath11k@lists.infradead.org \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jingoohan1@gmail.com \
--cc=jjohnson@kernel.org \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=qiang.yu@oss.qualcomm.com \
--cc=quic_miaoqing@quicinc.com \
--cc=robh@kernel.org \
/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®