From nobody Mon Jun 8 18:58:48 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C8DF3E3144 for ; Wed, 27 May 2026 08:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779871950; cv=none; b=GhRdnOy0g/DqvKhbehNn6XZuDb+FYcXxVICajqlMlKFFqmjBH3vw3gnCA44g9p99TeTFSQtBXuXazR/uf9yL4sZ6kB4HQBbLgEN40ywlZprfT0q5iHNXx1CtH1XIRIX0vPLLPl/A02XMT/Ws+XYBSRgT0NvrAQ5iNkHAMCF8ThI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779871950; c=relaxed/simple; bh=ydp3iiH3t45YwufOFs9xQs9qEz4U89SME+5Zvi/mahQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pCwlyCXLCnuOjj0vKPeaQzUKFjcNhUDJMzBLOBLE2+h4ejNux8yBifb1s0wF3/3h2k+/jy7aa9RSECvBCLf/tx71R9oeYBgExo2tjH5NsxKuM6OUhQA3EFBrOQa7/J+TFwxY2T5NCHOUwaqLmwOo2tYXeR+umsh1dRNzs80xYps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=RnBxcLQl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=JtgPt8n0; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="RnBxcLQl"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="JtgPt8n0" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64R8mR1w4108420 for ; Wed, 27 May 2026 08:52:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=T/chsqjTnFdkud9/UATRE73Ia/WpFMOscnZ 9VfaUcDU=; b=RnBxcLQl9ZT8ZlB8FzkL7qCzH1WwZHdUKv9nDPX4iD45gPPTuHy xIDLe5fKg3JTdb2o/2kPdhlPdiwH0IfF7zi1q3T4VbLLU4XUCP1HB/Ql8RdGHpdE wDpwXCIW0wjmiMT+VljDh69SqBV+ZVQX0WrixfjpErXMgXQvID0Cng02xaOlkYc3 lcjPZ0zDXu7qJZMMUc+qxkyYRYz+1QgUU9CibfvqOCGJM/MB4vBklRemNnvBnoGM ySJCLBq7WVoCQscvThl6+YsgzFepzutFT+F3sVhLBjL1bKAtkfbjOM2qTt8es0+p vbcq71TZOCDVGv8WO+DzyE8RrWG9b5tz3wg== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4edefukc7f-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 27 May 2026 08:52:27 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-516d51ffb59so24499811cf.3 for ; Wed, 27 May 2026 01:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779871947; x=1780476747; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=T/chsqjTnFdkud9/UATRE73Ia/WpFMOscnZ9VfaUcDU=; b=JtgPt8n0JB1JeD61eqmEOogyWR5nCsidRK8UPgoLe85TuSX2DHA3oXnovQhTXXFAru ZpooZF5CXXYi7eG40p9u7b7Qad794jw0rfxBaDDsXbFZIOZ54mq0Jam2YhkdBUcKEAEI 0QZFWt3VhD4S4WZWbJTTTj0IZ9+RTxgrrBx7x8N5d41OqMgi8VRh8xRG0heJI6bovFx6 OF1BejvMFQfT9mCT+L7A7IJx69AFPbUxMJmwS1A3X/JpoWIFHnNykr6pK6xc213igQjh g9VDShD5GU/5l1q/jtVxCPnORMGByIKCsRjR2hzSZ+mARhAE0NS2oRUvcElyrDTCK/Vt INJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779871947; x=1780476747; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=T/chsqjTnFdkud9/UATRE73Ia/WpFMOscnZ9VfaUcDU=; b=mUzBxhvpBQJkbPvi8Vk14MEvIn9ODCCPMM3mZy/idr7vhrhK6JUvysPf9aUb/s/utA sHDljwcPwrPDy6uHFCOu2NNDEAmDXc1qvoX1zOlMulgJrTPzMTzNdESxGI3wXieA7Xoe k4onu5ujiMWxGpwAvavD6/zBsrH1oKntpBdn2b/Os29UCAxGHuLCZ2lA76L05Ywb9qUh ZaHOTcPSoIhBAuuqEQyxfL51YfiiDXKPVSMg0bu7oZItw9jY2ffdjgTP12LFF6W7VrZE sfivtZ8lS6bz17ukbXGoDwBBfSV+025aSGAMEpjDZ5rMIbpq2IqMsnx43WJyRcVrsxYH 0E1w== X-Forwarded-Encrypted: i=1; AFNElJ8ZZ7gtIY/XORKuNZ2i1jFPQnf7fnCQtydb1LaBdAPe18oV8Zl0P1suYA7Tu3eIhPvUNITOXvv2e+cehJQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxX/6tDxkHfo/tOTJ45TwQD/XSUn037FsohJYWgSu9HEHduOa7v 4uK8kAjgC3thQZs4yurQu/WBQN98CqA44lvJMBs8QNtFb6eJWeWaB/eIK+r+CMKp2ep9bLEcLt7 l1kiFORjmFan1aXIBPPok8WR4RseXK3h3bCYYB6wd2Cs/+QpMXAxrTnHZ7cwELxPGP0o= X-Gm-Gg: Acq92OEU/uhvQIJ5ca5MNZLvOi5w5YsX1HrYgHw0UmtuI5WfV9STN/tWsdqaW3yW9RE yXO/EcDPbgi43Cm8Kg5031Osb8YK7UrVGStkZHUfmBQEMxEyLgWfyihCiBQE/lvgHh5Los6kZxL MUuyYwYSKrxooqgRi9MlbrYzvBBM9drRTJZIpZU8l0abkO7Beb5BfPc7X+ZEtv/412X0YDEtuq9 BgEzOabrJXrugh6axmDIdhZekpo5t0peNJHZgpJizI8ZDJrdOf3LvJcLKuRjpXeQjYjDFZezx0Z BYEUkMBOmgC/A7KTAj0locIRv6icE+gSVmv5S+B6vaosLgvqbQ40D9yLzEciLpC8sE8jxD4XynL RrmPNW6dRkXcwrEZYcxVwOJi7wvXGYcN4ALXhXyVYCat9Nddj3Xdmnxnm46TW/WiFEtVme38hBP j2i3qqfI4DtdwjNeiwpZgIpA== X-Received: by 2002:ac8:5a45:0:b0:517:146c:c869 with SMTP id d75a77b69052e-517146cebebmr13526681cf.31.1779871946504; Wed, 27 May 2026 01:52:26 -0700 (PDT) X-Received: by 2002:ac8:5a45:0:b0:517:146c:c869 with SMTP id d75a77b69052e-517146cebebmr13526431cf.31.1779871945964; Wed, 27 May 2026 01:52:25 -0700 (PDT) Received: from work.wifi.ville-nice.fr (62-193-63-110.as16211.net. [62.193.63.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45edb5c27e7sm4601127f8f.35.2026.05.27.01.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 01:52:25 -0700 (PDT) From: Manivannan Sadhasivam To: mani@kernel.org, mhi@lists.linux.dev Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Slark Xiao Subject: [PATCH] bus: mhi: host: pci_generic: Fix the physical function check Date: Wed, 27 May 2026 10:52:20 +0200 Message-ID: <20260527085220.14139-1-manivannan.sadhasivam@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTI3MDA4NSBTYWx0ZWRfXxbLoMyV2s9dQ YKlseYnNYc1I7j2ApH4yoWqjnnxsMVWKmYviPd6gkz/79b8ZEoFjURTKwzuw/S7FVz9VN+p1D0l Af7NyWPfMF3XnJEO9u/pXfU82yTRn9xDgmPYjWdO1HKz+C4/F51GHf/t/8r7BVH2vSpicdbAwRX Sma9JgkSJnAQyJcc/9c+WeCP+uqOyhHE1j4gwKTE2qjwo/vgpqO5jbVl7IvFkZH86cZOlK+85o8 iIO3PyOfL69iK4fFBYPUACyDrKYpoGHnHQ9ZftXjUnm36Qg19TF04Giz265JQdhVQra14PmEHii CGDXp5+dU/QXj81JQS1lecgeMMSvJIMD1xW6MV00xzGUAOG6ObP179TIryxnD1acYkAXuHjaoOa etMiDVUF7Q0XTBMb71COO/5L++YTtIpLHcB3uUxTfSx5YZkVOJy6shvtaDtiN81V43ZHV13hqMn j4lPo3XGcWg4KKOWA8A== X-Proofpoint-GUID: ARdWcUjqs8HhVIG9T6l65W0kGJD1w-4y X-Proofpoint-ORIG-GUID: ARdWcUjqs8HhVIG9T6l65W0kGJD1w-4y X-Authority-Analysis: v=2.4 cv=cPnQdFeN c=1 sm=1 tr=0 ts=6a16b0cb cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xizqlaZpAqmNt8UN1ov9oQ==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=Byx-y9mGAAAA:8 a=EUspDBNiAAAA:8 a=_ArHcOP2DiPeV0EhLvoA:9 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-05-27_01,2026-05-26_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605270085 Content-Type: text/plain; charset="utf-8" Commit b4d01c5b9a9d ("bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status") added the check for physical function by checking for 'pdev->is_physfn. But 'pdev->is_physfn' is only set for the physical function of a SR-IOV capable device. But for the non-SR-IOV device this variable will be 0. So this check ended up breaking the health check functionality for all non-SR-IOV devices. Fix it by checking for '!pdev->is_virtfn' to make sure that the check is only skipped for virtual functions. Reported-by: Slark Xiao Fixes: b4d01c5b9a9d ("bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID= for VF's to check status") Signed-off-by: Manivannan Sadhasivam Tested-by: Slark Xiao --- drivers/bus/mhi/host/pci_generic.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_= generic.c index 5836ecb0ea32..0d0d9c7ffa4b 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -1261,7 +1261,7 @@ static void mhi_pci_recovery_work(struct work_struct = *work) =20 dev_warn(&pdev->dev, "device recovery started\n"); =20 - if (pdev->is_physfn) + if (!pdev->is_virtfn) timer_delete(&mhi_pdev->health_check_timer); =20 pm_runtime_forbid(&pdev->dev); @@ -1291,7 +1291,7 @@ static void mhi_pci_recovery_work(struct work_struct = *work) =20 set_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status); =20 - if (pdev->is_physfn) + if (!pdev->is_virtfn) mod_timer(&mhi_pdev->health_check_timer, jiffies + HEALTH_CHECK_PERIOD); =20 return; @@ -1382,7 +1382,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const = struct pci_device_id *id) mhi_cntrl_config =3D info->config; =20 /* Initialize health check monitor only for Physical functions */ - if (pdev->is_physfn) + if (!pdev->is_virtfn) timer_setup(&mhi_pdev->health_check_timer, health_check, 0); =20 mhi_cntrl =3D &mhi_pdev->mhi_cntrl; @@ -1404,7 +1404,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const = struct pci_device_id *id) mhi_cntrl->mru =3D info->mru_default; mhi_cntrl->name =3D info->name; =20 - if (pdev->is_physfn) + if (!pdev->is_virtfn) mhi_pdev->reset_on_remove =3D info->reset_on_remove; =20 if (info->edl_trigger) @@ -1453,7 +1453,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const = struct pci_device_id *id) set_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status); =20 /* start health check */ - if (pdev->is_physfn) + if (!pdev->is_virtfn) mod_timer(&mhi_pdev->health_check_timer, jiffies + HEALTH_CHECK_PERIOD); =20 /* Allow runtime suspend only if both PME from D3Hot and M3 are supported= */ @@ -1482,7 +1482,7 @@ static void mhi_pci_remove(struct pci_dev *pdev) pm_runtime_forbid(&pdev->dev); pci_disable_sriov(pdev); =20 - if (pdev->is_physfn) + if (!pdev->is_virtfn) timer_delete_sync(&mhi_pdev->health_check_timer); cancel_work_sync(&mhi_pdev->recovery_work); =20 @@ -1514,7 +1514,7 @@ static void mhi_pci_reset_prepare(struct pci_dev *pde= v) =20 dev_info(&pdev->dev, "reset\n"); =20 - if (pdev->is_physfn) + if (!pdev->is_virtfn) timer_delete(&mhi_pdev->health_check_timer); =20 /* Clean up MHI state */ @@ -1560,7 +1560,7 @@ static void mhi_pci_reset_done(struct pci_dev *pdev) } =20 set_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status); - if (pdev->is_physfn) + if (!pdev->is_virtfn) mod_timer(&mhi_pdev->health_check_timer, jiffies + HEALTH_CHECK_PERIOD); } =20 @@ -1626,7 +1626,7 @@ static int __maybe_unused mhi_pci_runtime_suspend(st= ruct device *dev) if (test_and_set_bit(MHI_PCI_DEV_SUSPENDED, &mhi_pdev->status)) return 0; =20 - if (pdev->is_physfn) + if (!pdev->is_virtfn) timer_delete(&mhi_pdev->health_check_timer); =20 cancel_work_sync(&mhi_pdev->recovery_work); @@ -1679,7 +1679,7 @@ static int __maybe_unused mhi_pci_runtime_resume(stru= ct device *dev) } =20 /* Resume health check */ - if (pdev->is_physfn) + if (!pdev->is_virtfn) mod_timer(&mhi_pdev->health_check_timer, jiffies + HEALTH_CHECK_PERIOD); =20 /* It can be a remote wakeup (no mhi runtime_get), update access time */ --=20 2.51.0