]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bus: mhi: host: pci_generic: Disable runtime PM for QDU100
authorVivek Pernamitta <quic_vpernami@quicinc.com>
Fri, 25 Apr 2025 07:19:31 +0000 (12:49 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:40:57 +0000 (18:40 +0200)
[ Upstream commit 0494cf9793b7c250f63fdb2cb6b648473e9d4ae6 ]

The QDU100 device does not support the MHI M3 state, necessitating the
disabling of runtime PM for this device. It is essential to disable
runtime PM if the device does not support M3 state.

Signed-off-by: Vivek Pernamitta <quic_vpernami@quicinc.com>
[mani: Fixed the kdoc comment for no_m3]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Link: https://patch.msgid.link/20250425-vdev_next-20250411_pm_disable-v4-1-d4870a73ebf9@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/mhi/host/pci_generic.c

index 0d9295535bbfc0d02478affabfdf4dcda201fb94..7655a389dc5975d146ea1cf1b135f66ff7ac27de 100644 (file)
@@ -43,6 +43,7 @@
  * @mru_default: default MRU size for MBIM network packets
  * @sideband_wake: Devices using dedicated sideband GPIO for wakeup instead
  *                of inband wake support (such as sdx24)
+ * @no_m3: M3 not supported
  */
 struct mhi_pci_dev_info {
        const struct mhi_controller_config *config;
@@ -54,6 +55,7 @@ struct mhi_pci_dev_info {
        unsigned int dma_data_width;
        unsigned int mru_default;
        bool sideband_wake;
+       bool no_m3;
 };
 
 #define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \
@@ -295,6 +297,7 @@ static const struct mhi_pci_dev_info mhi_qcom_qdu100_info = {
        .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
        .dma_data_width = 32,
        .sideband_wake = false,
+       .no_m3 = true,
 };
 
 static const struct mhi_channel_config mhi_qcom_sa8775p_channels[] = {
@@ -1319,8 +1322,8 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        /* start health check */
        mod_timer(&mhi_pdev->health_check_timer, jiffies + HEALTH_CHECK_PERIOD);
 
-       /* Only allow runtime-suspend if PME capable (for wakeup) */
-       if (pci_pme_capable(pdev, PCI_D3hot)) {
+       /* 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_use_autosuspend(&pdev->dev);
                pm_runtime_mark_last_busy(&pdev->dev);