From: "Slark Xiao" <slark_xiao@163.com>
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: mani@kernel.org, jeff.hugo@oss.qualcomm.com, mhi@lists.linux.dev,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re:Re: [PATCH] bus: mhi: host: pci_generic: Add autosuspend_delay customized support
Date: Wed, 23 Sep 2026 17:49:00 +0800 (CST) [thread overview]
Message-ID: <114d4e42.8e22.1a0cdab2583.Coremail.slark_xiao@163.com> (raw)
In-Reply-To: <2b0d3e13-96fa-437a-9de9-4a61911fe232@oss.qualcomm.com>
At 2026-09-23 11:54:55, "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com> wrote:
>
>
>On 9/22/2026 5:09 PM, Slark Xiao wrote:
>> At 2026-09-22 12:12:35, "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com> wrote:
>>>
>>> On 9/19/2026 3:25 PM, Slark Xiao wrote:
>>>> For some WWAN device, it may get a SYS ERROR issue when resuming
>>>> from suspend state frequently. Refer to the Qualcomm Windows
>>>> driver, the default value of autosuspend_delay_ms is set as 5000
>>>> ms. But in Linux side, all WWAN device were set as 2000ms. We
>>>> tried to set this value to 5000ms and we can get a positive test
>>>> result.
>>>>
>>>> So we add a support to allow vendor to set a difference value for
>>>> specific WWAN device.
>>> you can change auto suspend delay from sysfs, please use that way instead of
>>> doing in the driver.
>>>
>>> - Krishna Chaitanya.
>> Yes, we can do this by setting the sysfs API . However, not all users
>> are aware of this method. Additionally, this approach is only
>> effective for a single instance; it requires reconfiguration after each
>> restart, which is quite inconvenient.
>you can have udev rule to set this without any user intervention.
>> Though I want to set the default value from 2000 to 5000, refer to
>> the Qualcomm Windows driver, I don't want this change to affect
>> the default configuration of other vendors.
>>
>> This attribute should belong to specific WWAN devices, such as
>> SDX65, SDX72 or QDU100, rather than to the same category of
>> devices, like all MHI devices sharing a single setting.
>>
>> BTW, I saw some one add 'no_m3' flag for their SDX7X device.
>> Why can they disable suspend on the same SDX7X device, while
>> I can't adjust the suspend delay time? That's curious.
>no_m3 flag is for qdu100 target, where the target itself will not support M3.
>It is not just disabling suspend but also make sure device never enters m3 even
>in system suspend case.
>
>There is already support from sysfs to change the time, doing again that in
>the driver is just duplication of work.
>
>- Krishna Chaitanya.
I mean another device, you can refer to below link:
https://lore.kernel.org/mhi/20260701095344.309409-1-zwq2226404116@163.com/
Anyway, if the kernel design is not allowed vendor to set the autosuspend
delay as a customized item, I will follow this.
Oh wait, I am not sure if you have been confused by the title. You may think that
this customized support method has conflicted with the sysfs API. But actually,
this patch would not be the only patch for this feature. We may provide more
settings for our device, like we set the T99W696 as 2000ms, DW5934e as 5000
ms.....
This customization is for different WWAN device(with different default settings),
not for a single device during different scenario.
I hope the above explanation helps you understand the intention behind
my submitted patch. Thank you once again!
>>
>> Thanks
>>>> BTW, based on the principle of structure alignment, I moved the
>>>> location of 'trigger_edl'.
>>>>
>>>> Signed-off-by: Slark Xiao <slark_xiao@163.com>
>>>> ---
>>>> drivers/bus/mhi/host/pci_generic.c | 14 +++++++++++---
>>>> 1 file changed, 11 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
>>>> index b636e2c23b4d..3339b9b2d16d 100644
>>>> --- a/drivers/bus/mhi/host/pci_generic.c
>>>> +++ b/drivers/bus/mhi/host/pci_generic.c
>>>> @@ -23,6 +23,8 @@
>>>>
>>>> #define HEALTH_CHECK_PERIOD (HZ * 2)
>>>>
>>>> +#define AUTOSUSPEND_DELAY_MS 2000
>>>> +
>>>> /* PCI VID definitions */
>>>> #define PCI_VENDOR_ID_THALES 0x1269
>>>> #define PCI_VENDOR_ID_QUECTEL 0x1eac
>>>> @@ -38,11 +40,12 @@
>>>> * @name: name of the PCI module
>>>> * @fw: firmware path (if any)
>>>> * @edl: emergency download mode firmware path (if any)
>>>> - * @edl_trigger: capable of triggering EDL mode in the device (if supported)
>>>> * @bar_num: PCI base address register to use for MHI MMIO register space
>>>> * @dma_data_width: DMA transfer word size (32 or 64 bits)
>>>> * @vf_dma_data_width: DMA transfer word size for VF's (optional)
>>>> * @mru_default: default MRU size for MBIM network packets
>>>> + * @autosuspend_delay: customized autosuspend_delay_ms value for specific mhi device
>>>> + * @edl_trigger: capable of triggering EDL mode in the device (if supported)
>>>> * @sideband_wake: Devices using dedicated sideband GPIO for wakeup instead
>>>> * of inband wake support (such as sdx24)
>>>> * @no_m3: M3 not supported
>>>> @@ -54,11 +57,12 @@ struct mhi_pci_dev_info {
>>>> const char *name;
>>>> const char *fw;
>>>> const char *edl;
>>>> - bool edl_trigger;
>>>> unsigned int bar_num;
>>>> unsigned int dma_data_width;
>>>> unsigned int vf_dma_data_width;
>>>> unsigned int mru_default;
>>>> + unsigned int autosuspend_delay;
>>>> + bool edl_trigger;
>>>> bool sideband_wake;
>>>> bool no_m3;
>>>> bool reset_on_remove;
>>>> @@ -1369,6 +1373,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>>>> struct mhi_pci_device *mhi_pdev;
>>>> struct mhi_controller *mhi_cntrl;
>>>> unsigned int dma_data_width;
>>>> + unsigned int autosuspend_delay;
>>>> int err;
>>>>
>>>> dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
>>>> @@ -1394,6 +1399,9 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>>>> dma_data_width = (pdev->is_virtfn && info->vf_dma_data_width) ?
>>>> info->vf_dma_data_width : info->dma_data_width;
>>>>
>>>> + autosuspend_delay = info->autosuspend_delay ? info->autosuspend_delay :
>>>> + AUTOSUSPEND_DELAY_MS;
>>>> +
>>>> mhi_cntrl->cntrl_dev = &pdev->dev;
>>>> mhi_cntrl->iova_start = 0;
>>>> mhi_cntrl->iova_stop = (dma_addr_t)DMA_BIT_MASK(dma_data_width);
>>>> @@ -1463,7 +1471,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>>>>
>>>> /* Allow runtime suspend only if both PME from D3Hot and M3 are supported */
>>>> if (pci_pme_capable(pdev, PCI_D3hot) && !(info->no_m3)) {
>>>> - pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
>>>> + pm_runtime_set_autosuspend_delay(&pdev->dev, autosuspend_delay);
>>>> pm_runtime_use_autosuspend(&pdev->dev);
>>>> pm_runtime_mark_last_busy(&pdev->dev);
>>>> pm_runtime_put_noidle(&pdev->dev);
prev parent reply other threads:[~2026-09-23 9:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 9:55 Slark Xiao
2026-09-22 4:12 ` Krishna Chaitanya Chundru
2026-09-22 11:39 ` Slark Xiao
2026-09-23 3:54 ` Krishna Chaitanya Chundru
2026-09-23 9:49 ` Slark Xiao [this message]
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=114d4e42.8e22.1a0cdab2583.Coremail.slark_xiao@163.com \
--to=slark_xiao@163.com \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
/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®