From nobody Wed Oct 8 00:44:31 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 A44362EF9C2; Thu, 3 Jul 2025 15:09:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555397; cv=none; b=FCkB04FwTK4BySwAF3Yme0iN3tMPmEjy76LBYs4DIL3AL9FF7YsXx1dtsjQI6n7tYkdELFEyI7QE5Q8Vv4QoGrTBJ7F98Gd+pMkH1iSynEfYoueCcVlUvGKYHxYmxBOnkxTCvxeD4/P5TnGVP5jdsJkegvxosFpEvtrJC2ttlxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555397; c=relaxed/simple; bh=qc6h21sKqtrfI3mC5nB8lOxjrHzXZwfR9BvThwS9dsI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=WLlmQ8BVwL0XB+ujHc75ELKTQpzyFmOHk0X6x5s7gq+RtP4bJ2K0xHyDxjuaes5t9kMf1/Vxi2HAaKmQpv31lbCHny/f8DjaCYW6rfT7FmEv8BPJYoX6VA3jnh37SojH/LYTBJPwBNT5yobo3HtagK4sjpCU42D8hOuzsGtgim8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=YWpslB1w; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="YWpslB1w" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5638aWgK022019; Thu, 3 Jul 2025 15:09:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= YpMgQLlIsx5Qg4GfLBC3ROu71w4u6BpqxbZfnmSzJfc=; b=YWpslB1wz2nuhXbN qe70XmO3AB1m3fCdj7vBGt8qm9KG2LFGPTqJwMKSlZTI73jPg8nGH8xKWp7/Hmhb G0D47YlB7h1cWkRVc9UiLg3oBR+z3yuItWOLY9+3ETYV0M1vtc6TOHuBNmaW8u4b UG5C039AUyQJw/c09wcNqrfj5CvfIv94iJDmxAAqDjMhGl5ZNbk4nkS+yYtfMNTq iog83mLX3kb6tuVRCrMsalvDO73eBKoVfXZQTFro0NAInkc3ff8RhkfS4+zGliB3 I+ujt6dcQQ2DfiyqItsFMCt72uLT3vMwLfdtJpbg0jdfNnkunXewanS6L0MfxexH ksIHbw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47j8fxs016-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Jul 2025 15:09:51 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 563F9peB009746 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Jul 2025 15:09:51 GMT Received: from hu-vpernami-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 3 Jul 2025 08:09:49 -0700 From: Vivek.Pernamitta@quicinc.com Date: Thu, 3 Jul 2025 20:39:40 +0530 Subject: [PATCH 1/5] bus: mhi: host: pci_generic: Add SRIOV support for PCIe device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250703-sriov_vdev_next-20250630-v1-1-87071d1047e3@quicinc.com> References: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> In-Reply-To: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> To: Manivannan Sadhasivam CC: , , , Vivek Pernamitta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751555387; l=812; i=; s=20241114; h=from:subject:message-id; bh=jW7Tf+WyIKjFJb4AcgacCEBAZ5dX1ysoJaJxAcRRGGA=; b=m3V0aoZ3c+2e2XiasKNmUp9UM3j2hkVU17isgHr72uM4kI+aK0nz2o42sbKBT4HvCh/gQY96e IpxzQbiszHXBAZGtyvt0gGRLWSfH53koMCOOi022Y0xoHb7nr911fsq X-Developer-Key: i=; a=ed25519; pk=HDwn8xReb8K52LA6/CJc6S9Zik8gDCZ5LO4Cypff71Y= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzAzMDEyNyBTYWx0ZWRfXwbZF4kY+X0o7 emoHm9/80kOR1kOi+yu7mNH5nZ3qWMniYV9f7cnA28MYkt4VFPz9LjtMK35lcewTBn4SNu5aoKj Z8x7AG7IengvoeTf82Nh3iYeYofcvd/U6JBSNbHxv3nPBAv81p53vngZ9uIO7UUqs35UZAd5S4W ItzMHxungLhonqki88nAmuN5z3aVYFD2f+KNYvIEQIdPbkM94jOYHc2LSYxLSorBmB3IIHktbxo ciiaCXVBEr7cGAkncdDQHMtfPtIbA855aZplFp3SPBHaXwc6sAeCPEOrBs8maRkhhkCmKRukldN OraB6z6/p5gMM3P1l5F9a2YokTJujlcoj0W/cF+yH2r6NGTCSiFhUp+KEHRuXFahY8HuLO5xuAl q6DJ0RU/KR+FgGSMta95f/8EgB5qAmwRE/iDjT2hJMvlobFKtT4aYxH2SOI2yO9ppE0HbHxM X-Proofpoint-GUID: 2Rcs0cbTtcBlJa_EnYnFf1THS5SJDTcO X-Proofpoint-ORIG-GUID: 2Rcs0cbTtcBlJa_EnYnFf1THS5SJDTcO X-Authority-Analysis: v=2.4 cv=TqPmhCXh c=1 sm=1 tr=0 ts=68669d40 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=hzwDMOxQQ8u7MIoiZ2AA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-03_04,2025-07-02_04,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507030127 From: Vivek Pernamitta Add SRIOV support for PCIe devices. Signed-off-by: Vivek Pernamitta Reviewed-by: Krishna Chaitanya Chundru --- drivers/bus/mhi/host/pci_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_= generic.c index 5c01c23d0bcfedd23f975e99845d5fa88940ccde..3e6e2d38935927cf3352c039266= cae7cadb4c118 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -1607,7 +1607,8 @@ static struct pci_driver mhi_pci_driver =3D { .remove =3D mhi_pci_remove, .shutdown =3D mhi_pci_shutdown, .err_handler =3D &mhi_pci_err_handler, - .driver.pm =3D &mhi_pci_pm_ops + .driver.pm =3D &mhi_pci_pm_ops, + .sriov_configure =3D pci_sriov_configure_simple }; module_pci_driver(mhi_pci_driver); =20 --=20 2.34.1 From nobody Wed Oct 8 00:44:31 2025 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 30C032EFDB5; Thu, 3 Jul 2025 15:09:57 +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=1751555399; cv=none; b=PhojyPw0tRgu2mLs10suIxAa2HQZUfpyzk+3AAUz30WZ68wSsEv/NzJtDpNVXB0OCgeie8S05FBJG3xnJFrMsW31bZ2tY/YJiTX5KO2XNLGRAQgmZNSQYZTxeJdZfsADBqURhzX4EtHmu+Pyylkt7RBGnWwzVf2hSXqp9MysiJo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555399; c=relaxed/simple; bh=H8ysR/lRSq8c5+13PEkKDSmhMXEANB2ZdaqTf6BSqlk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=ZPJJ9rvs+Bnq8cMQZK9mLPrPJqUsAs9NPWb9wnDWv+KotbU2Aa5ljKzoCPbo7p/cMGW6kALmnTSCySbIcI9ew3HiZoJ4e14coAmq+nzmnzled/1hFDI7keXnehVHgGESVYyN19LWlfzfj/zI0JpoXffFkg7FGdzt6dJe0Yq4PpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=M9H2t7WN; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="M9H2t7WN" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5638gSg0032399; Thu, 3 Jul 2025 15:09:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OlpxALEan4bWtwvj8P51CoKXOXUSP3qVQibeaqMkAFg=; b=M9H2t7WNr18apk3N MS2GiP/PMmnbqKOXqlOVv3wdwmM2hPzbwh4e+1osyk/XQGOGUame04Q0Cce+jcIK 46pGnR9qUqeH0Yeez+TS0eUARnrukXYBISeSq9IMxGCfLiaT7DwW2q3OZBMb1hZx DLH3TM7LrOu6mDHCcC+8gF4jluew9pZyBZ0YaYLCqMxofBf/gjIFGseqmsd0lQIe T7Oj7+l5nzlkMLwNUp/0xwTf/0DL8h+N3bXlQyE617Gt+nfdC7ooE5AbDbBeSQbV v86hZ6TWQIw90YzyZsz/wtUFXpO6SPDOmKenja7uzh0Wlk3/m8blondTITXxYBKY x8kWDQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47j63kh5tw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Jul 2025 15:09:53 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 563F9qfc002510 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Jul 2025 15:09:53 GMT Received: from hu-vpernami-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 3 Jul 2025 08:09:51 -0700 From: Vivek.Pernamitta@quicinc.com Date: Thu, 3 Jul 2025 20:39:41 +0530 Subject: [PATCH 2/5] bus: mhi: host: Add support for separate controller configurations for VF and PF Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250703-sriov_vdev_next-20250630-v1-2-87071d1047e3@quicinc.com> References: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> In-Reply-To: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> To: Manivannan Sadhasivam CC: , , , Vivek Pernamitta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751555387; l=1932; i=; s=20241114; h=from:subject:message-id; bh=ynV4r34hLqHTRvLqx4d3dXpJqRk+MHQfLvFdVr8fsB0=; b=pDHnj4lsfpWAlgvOVvDQc7l0cMzZkqzwxwpPcsIJstyMZIi5T3DRYnQwqvN3mncHyisFSP38P OLL/EL6RzqcBtL0IjGNqGpTnL70LK+9lrpBPZwPnjKMurhb5uyCoW8E X-Developer-Key: i=; a=ed25519; pk=HDwn8xReb8K52LA6/CJc6S9Zik8gDCZ5LO4Cypff71Y= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=ZKfXmW7b c=1 sm=1 tr=0 ts=68669d41 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=v7AmYJ8y467wbwUiuX8A:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzAzMDEyNyBTYWx0ZWRfX3xR1cVlSQnjI sQqpvfScqH+LTtsyB1AKwKnZ8KvXXCLdq+DLUPPt6JU6mzGcRGd0uM9+V+GKEA3AUQXnZjfkvNE 0C3X7MnMwzTp312YyhykM0l4eb2TI+/81BY+wwhueLVWM11MSYfb1Z4lLTPvHqUNh57NpM3Hgzv dbSfGFENokl7QYZJl7qzNVa85to7U/Vc463v9kck2tuMvIt96+SvrniBb03feOW/MWvdNRJqX5q mFzZvrh/4t23BZT5HhbbHklMmvY8NWRBno6c5+IUdsEovGPGc/sryokwqsy0ndvYgqaWtBNILGg E39GXF1PGBzjq5FctN3Rlctdf9zMDGFONOjU5OiNEcfx4CuaREgNOof/NpUKBwExskYJkcEA3A9 biN/kHKq2oXG3EKgfr3fDW0KUoTNhIuFsLxMrcHCffHcB/BaMOTunrfkGcYMmvhhYk5f+Dt3 X-Proofpoint-ORIG-GUID: p9OKn6VMI6eWv0parFwEt9DuAsAKw1mO X-Proofpoint-GUID: p9OKn6VMI6eWv0parFwEt9DuAsAKw1mO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-03_04,2025-07-02_04,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 clxscore=1015 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507030127 From: Vivek Pernamitta Implement support for separate controller configurations for both Virtual Functions (VF) and Physical Functions (PF). This enhancement allows for more flexible and efficient management of resources. The PF takes on a supervisory role and will have bootup information such as SAHARA, DIAG, and NDB (for file system sync data, etc.). VFs can handle function-specific data transfers, such as data plane or hardware data. Signed-off-by: Vivek Pernamitta Reviewed-by: Krishna Chaitanya Chundru --- drivers/bus/mhi/host/pci_generic.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_= generic.c index 3e6e2d38935927cf3352c039266cae7cadb4c118..22de02c26ceb946fb618d962ac8= 882d2db1be6b4 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -34,6 +34,7 @@ /** * struct mhi_pci_dev_info - MHI PCI device specific information * @config: MHI controller configuration + * @vf_config: MHI controller configuration for Virtual function (optional) * @name: name of the PCI module * @fw: firmware path (if any) * @edl: emergency download mode firmware path (if any) @@ -47,6 +48,7 @@ */ struct mhi_pci_dev_info { const struct mhi_controller_config *config; + const struct mhi_controller_config *vf_config; const char *name; const char *fw; const char *edl; @@ -1242,9 +1244,14 @@ static int mhi_pci_probe(struct pci_dev *pdev, const= struct pci_device_id *id) return -ENOMEM; =20 INIT_WORK(&mhi_pdev->recovery_work, mhi_pci_recovery_work); + + if (pdev->is_virtfn && info->vf_config) + mhi_cntrl_config =3D info->vf_config; + else + mhi_cntrl_config =3D info->config; + timer_setup(&mhi_pdev->health_check_timer, health_check, 0); =20 - mhi_cntrl_config =3D info->config; mhi_cntrl =3D &mhi_pdev->mhi_cntrl; =20 mhi_cntrl->cntrl_dev =3D &pdev->dev; --=20 2.34.1 From nobody Wed Oct 8 00:44:31 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 205492F0029; Thu, 3 Jul 2025 15:09:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555400; cv=none; b=s8EQZUfHKHCsGf9oM9kl6HKJLZOAdLPcME8/8ZHUiTnLRZcqZX1R2XIxMzB7CW7j+rKo4cXpfvgHQPMSBsq/LLTi89Cv2e58TrYR/H81JgpLFtjc4pJO4ORwCo4dJ9LaMRViaeu+on1b4uRjuEpfxS7scPJ9hzo+BQY/+jLktAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555400; c=relaxed/simple; bh=zTku1qs4JIIGkOFtq8oa8v38TQt1vRMpsQ/2691hIGY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=qREz+79rkuV3VKxOZGXpuOKfWPwHTZ2tSNGA51NXzDSarLnTrJYFg/1Q9c61vyYuCywuBo+0nyxuOu9Sor6xboyfP8n/X53lJ0sXteUnux55iCuHpJWoTBEMBUh6FYLIFCo9YEot61OCHGdcJwtmEghT2FV30kyRxQFqD/n2D5U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=HpEUzjFl; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="HpEUzjFl" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 563F510O018851; Thu, 3 Jul 2025 15:09:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LmXiOI8vOU2lyyejBQcoBsRwaMM2OwOn2Ab/DYO8Nnc=; b=HpEUzjFlb3iciWI2 3Hmvs0xqntTFUB/SIbK7KqRIyLMRBTMhy0oKPd3Qejpj/Fea4oacIXgw/M3z6sdG 36x8KxISQBQKSxUO3+DQy+sAax2yl1w5csg0scIHW8noLB28fDXKsKjQ80Is9LN5 pj2hAWEvqfi/nsyKMRHwzPTHntzlUY54j90D0VbSXQGU7jakqpxMhEIazXS6pLRE U09+f2aPzkFJPtEiKlVZwrg62KQywBwwNj5sW4UkU3jI7ubQL0gqS/t1na/pnvPc IBJ749aQdXMGENhRTzrJIYHmLemJfqVfrfueVCxMgFGP2lwVbd2OyGcElncGnUuv TIhurA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47j8fxs01c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Jul 2025 15:09:55 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 563F9sVr006172 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Jul 2025 15:09:54 GMT Received: from hu-vpernami-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 3 Jul 2025 08:09:53 -0700 From: Vivek.Pernamitta@quicinc.com Date: Thu, 3 Jul 2025 20:39:42 +0530 Subject: [PATCH 3/5] bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250703-sriov_vdev_next-20250630-v1-3-87071d1047e3@quicinc.com> References: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> In-Reply-To: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> To: Manivannan Sadhasivam CC: , , , Vivek Pernamitta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751555387; l=1105; i=; s=20241114; h=from:subject:message-id; bh=6+0BQkQFzRYtsrXYx2NHL7wCq+lQ0TFAQYa/jS9rza4=; b=QgAkjpkWC5dEZVtLR+ch0rrpgHnU/tjp2NeaWc21XkQT0nfwTkSYJkCXlNrkjme8kwOv76kK1 vkNKheawaeIB3arCmOLx7nqZ++SlTBOrIjaY1sU8yE+HJITuOhVQ9ui X-Developer-Key: i=; a=ed25519; pk=HDwn8xReb8K52LA6/CJc6S9Zik8gDCZ5LO4Cypff71Y= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzAzMDEyNyBTYWx0ZWRfX+Ky9rTj3cUSv /syiYAzeHcRGqcUCU5+EXZZJorzSAwxaYmqRjw0jqzOvqK/8/Q0+pejhK+5PvloqK1rRPvOOEbt QK07lRbz+JQRHIP7gO1ZINFNJHE3lYUn+S3U2p04JPYcHjx62CgQ9k0+UwZ2YNMDKTFSHbEsP5V DvLVnipik4JhwfJ3ga5c/iGSqnqY5TU9uKg9RVW6AGHiGsz/gIbdCe0s1vdbrE/ZqMlPup2AxYU CFOfMaTxyJeQAHYk8wnTTJqrAbZbkvt/YnRNT8ptlAUrFR41LOAlt2oo2lfNAzkhgunbbt/yTwW Y8u2RsEespPT9YvZ/JtlDh9I8cCPDDwyTjdOQo7IbpR1d3mJh+2EZFmkLKIPPKjBPh9D7s6audX 1U3zkKDnDkaUhvwAIZBtsuB4rrf1gpq0We7ZQxfjbT2xQykanTIi382CA/u3HsNtWDUoKBFN X-Proofpoint-GUID: 8M6gvPhp7lZqT-thgp4OBcb9tULrK_Ip X-Proofpoint-ORIG-GUID: 8M6gvPhp7lZqT-thgp4OBcb9tULrK_Ip X-Authority-Analysis: v=2.4 cv=TqPmhCXh c=1 sm=1 tr=0 ts=68669d43 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=41Swp6Qei03CjfpCrlAA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-03_04,2025-07-02_04,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507030127 From: Vivek Pernamitta In SRIOV enabled devices, the VF DEVICE/VENDOR ID register returns FFFFh when read (PCIe SRIOV spec-3.4.1.1). Therefore, read the PCIe SUBSYSTEM_VENDOR_ID to check if the device is active. Signed-off-by: Vivek Pernamitta Reviewed-by: Krishna Chaitanya Chundru --- drivers/bus/mhi/host/pci_generic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_= generic.c index 22de02c26ceb946fb618d962ac8882d2db1be6b4..938f37d306a18b9a47f302df856= 97f837c225f0d 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -1025,8 +1025,10 @@ static bool mhi_pci_is_alive(struct mhi_controller *= mhi_cntrl) struct pci_dev *pdev =3D to_pci_dev(mhi_cntrl->cntrl_dev); u16 vendor =3D 0; =20 - if (pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor)) - return false; + if (pdev->is_virtfn) + pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &vendor); + else + pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor); =20 if (vendor =3D=3D (u16) ~0 || vendor =3D=3D 0) return false; --=20 2.34.1 From nobody Wed Oct 8 00:44:31 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 7BF1C2EF67A; Thu, 3 Jul 2025 15:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555407; cv=none; b=VejKGb0kvWVyRSCxiDahUG8qu9eIsIzm7yQr+58BWPZIp2aaSBO2lqXDA6XhzWA8wsUkbC/hOGL6IQ+cmevWAHKMAXBFXLNdeJ+Yf3IbGU6ecGRHnG8eTF9ZKCsYdQwfnM8cl81w5z8P/9UopwNu5FTElKs2g9+P4m9hsx44fUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555407; c=relaxed/simple; bh=v7aFdXo2qMEeUqpViYpuWuKJQcjyXEsgTf/KSXNKUh4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=k9Of1GJubZVb/Y8Uo5/WjgDPbeEb2+ZInCXJSYpAyuXgrqHxAwErSXCIXvxr7Gt2D9xke3ORqCpWalnwY5VVOm119CQWN3+VAzdf8+7XVvfQInNCknTpmQfmwMidz9baKawJusCofZ7k4ypTOnxvWIBykPOW1ydqCCWsnYDs1tg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=C/cA+99T; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="C/cA+99T" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 563CUqho020690; Thu, 3 Jul 2025 15:10:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 2CptndvT1PP45JcJ9UfrUuwh82XAjUmQeFNWYcb0hBg=; b=C/cA+99TFyhbVC1d 2AUlB0t5Sb4UC/a3SORFcf6b+PyPYaGo4c/rknPZ0h53Hk/yxS6CZRGDsASgGvHR T/A92vdjXmkYdL2s8vwKkhmohS9CzkVPgFDROnE7XQvYoF+4OujzBgFSbOSPFAel L2hVUD7hZM2un/FlZrFh50+nmRMfNpM0H/6R4SRNV7h6RiQ90oqbPVXjpTb5pjM4 6fsO0CusK6FsyiS3xqeICxLsRaaOA8m82aTnFLVJA4FnUvML6/uzYq19AfN7U/mr +ATkSQ2MbOftdhILQePDPs0F8bcoWjMLK1tYp6dXApeJl7Z3q9wo5/D3iZ7SBsAz +0YHUg== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47mhxn7jvd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Jul 2025 15:09:57 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 563F9u1b018203 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Jul 2025 15:09:56 GMT Received: from hu-vpernami-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 3 Jul 2025 08:09:55 -0700 From: Vivek.Pernamitta@quicinc.com Date: Thu, 3 Jul 2025 20:39:43 +0530 Subject: [PATCH 4/5] bus: mhi: host: pci_generic: Remove MHI driver and ensure graceful device recovery Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250703-sriov_vdev_next-20250630-v1-4-87071d1047e3@quicinc.com> References: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> In-Reply-To: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> To: Manivannan Sadhasivam CC: , , , Vivek Pernamitta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751555387; l=3942; i=; s=20241114; h=from:subject:message-id; bh=qIok+X3vKyk2p9PbkpB2Wk57AXDB+WjZx3HGCE7IHBw=; b=mjo2LVrt2qKCLgiftCV/VEJKJB7xucsjioQMEbILCb+OB2AbtWRSENcLTcxSqD26/tEDYjPk3 te4qIPNzC8jCgTzhGZ/kSdJG7hoEm7KYUV4+R/y89/p08DJQUumpYMU X-Developer-Key: i=; a=ed25519; pk=HDwn8xReb8K52LA6/CJc6S9Zik8gDCZ5LO4Cypff71Y= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzAzMDEyNyBTYWx0ZWRfX1vtSWKHJQUco hdJWkzBb4jCRRlzLcqfLn2fqORMbfb0+FEnye1CAvgb/L/r+oee20PYYktYJyBTcTrh8whyhyv4 WCCHw8SRHGa8jAZpqsA1v/3ONdIl3i97Xj+qQ8eRSzkrn//ZaIfZcTgR5ZW0lAmVI4kgwBPRRUY pjJH3vbvyk8BxIelJ0PcZfP9UNj1cfZGS+336FAl0QwgyPl5rY+ZvwrprKwOEHkShvlMvF8k8A7 r/o5W7JMvBATujWa4FJOvfFZi8FY6wjVnS22cqWL0OHjEQ6faPv9QyHE6sTPp4WgXxlZDhsRbPL FQ/QwMde8yB/l0pDZ/gOvzRoFaUdnxq1NdVj3QdYH0ppffvzhlTHD5qsdTWgfo/vWDHnZ2FG4Ut RjbWZu4wSYoZKir3SghFtNN+loJLfq88fPf/UGrn47sRA7gw6fSDfitFvcxgUTa3FYa+ZwuD X-Authority-Analysis: v=2.4 cv=EbvIQOmC c=1 sm=1 tr=0 ts=68669d46 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=f0iwCl2806sLzPXnTMgA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: L5mvjdyEbWy9sYMQXeqxbaYDETYm1ydq X-Proofpoint-GUID: L5mvjdyEbWy9sYMQXeqxbaYDETYm1ydq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-03_04,2025-07-02_04,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 adultscore=0 clxscore=1011 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507030127 From: Vivek Pernamitta When the MHI driver is removed from the host side, it is crucial to ensure graceful recovery of the device. To achieve this, the host driver will perform the following steps: 1. Disable SRIOV for any SRIOV-enabled devices on the Physical Function. 2. Perform a SOC_RESET on Physical Function (PF). Disabling SRIOV ensures that all virtual functions are properly shut down, preventing any potential issues during the reset process. Performing SOC_RESET on each physical function guarantees that the device is fully reset and ready for subsequent operations. Signed-off-by: Vivek Pernamitta --- drivers/bus/mhi/host/pci_generic.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_= generic.c index 938f37d306a18b9a47f302df85697f837c225f0d..ff9263d5dc4b54956c6ca4403e7= b0b2429d0700e 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -45,6 +45,8 @@ * @sideband_wake: Devices using dedicated sideband GPIO for wakeup instead * of inband wake support (such as sdx24) * @no_m3: M3 not supported + * @bool reset_on_driver_unbind: Set true for devices support SOC reset and + * perform it when unbinding driver */ struct mhi_pci_dev_info { const struct mhi_controller_config *config; @@ -58,6 +60,7 @@ struct mhi_pci_dev_info { unsigned int mru_default; bool sideband_wake; bool no_m3; + bool reset_on_driver_unbind; }; =20 #define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \ @@ -300,6 +303,7 @@ static const struct mhi_pci_dev_info mhi_qcom_qdu100_in= fo =3D { .dma_data_width =3D 32, .sideband_wake =3D false, .no_m3 =3D true, + .reset_on_driver_unbind =3D true, }; =20 static const struct mhi_channel_config mhi_qcom_sa8775p_channels[] =3D { @@ -970,6 +974,7 @@ struct mhi_pci_device { struct work_struct recovery_work; struct timer_list health_check_timer; unsigned long status; + bool reset_on_driver_unbind; }; =20 static int mhi_pci_read_reg(struct mhi_controller *mhi_cntrl, @@ -1270,6 +1275,11 @@ 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 + /* Assign reset functionalities only for PF */ + if (pdev->is_physfn) + mhi_pdev->reset_on_driver_unbind =3D info->reset_on_driver_unbind; + + if (info->edl_trigger) mhi_cntrl->edl_trigger =3D mhi_pci_generic_edl_trigger; =20 @@ -1336,7 +1346,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const = struct pci_device_id *id) return err; } =20 -static void mhi_pci_remove(struct pci_dev *pdev) +static void mhi_pci_resource_deinit(struct pci_dev *pdev) { struct mhi_pci_device *mhi_pdev =3D pci_get_drvdata(pdev); struct mhi_controller *mhi_cntrl =3D &mhi_pdev->mhi_cntrl; @@ -1352,13 +1362,32 @@ static void mhi_pci_remove(struct pci_dev *pdev) /* balancing probe put_noidle */ if (pci_pme_capable(pdev, PCI_D3hot)) pm_runtime_get_noresume(&pdev->dev); +} =20 +static void mhi_pci_remove(struct pci_dev *pdev) +{ + struct mhi_pci_device *mhi_pdev =3D pci_get_drvdata(pdev); + struct mhi_controller *mhi_cntrl =3D &mhi_pdev->mhi_cntrl; + + /* Disable SRIOV */ + pci_disable_sriov(pdev); + mhi_pci_resource_deinit(pdev); + if (mhi_pdev->reset_on_driver_unbind) { + dev_info(&pdev->dev, "perform SOC reset\n"); + mhi_soc_reset(mhi_cntrl); + } + + /* Perform FLR if supported*/ mhi_unregister_controller(mhi_cntrl); } =20 static void mhi_pci_shutdown(struct pci_dev *pdev) { - mhi_pci_remove(pdev); + struct mhi_pci_device *mhi_pdev =3D pci_get_drvdata(pdev); + struct mhi_controller *mhi_cntrl =3D &mhi_pdev->mhi_cntrl; + + mhi_pci_resource_deinit(pdev); + mhi_unregister_controller(mhi_cntrl); pci_set_power_state(pdev, PCI_D3hot); } =20 --=20 2.34.1 From nobody Wed Oct 8 00:44:31 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 DB74D2F0C66; Thu, 3 Jul 2025 15:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555404; cv=none; b=L6O1++U4JUF0Bt0j4GxNdSoqkq/jLcAxRK9wT4oW438jolau985Pm9GykB/0H7TdQDcxTn9IXxs44z8uwsreCrQTLHRpHBdOjikar1n0UL7R3t1EIPml94FLWNzeVuwxqmZEkgpVKnZrbRIeYnryT7ueJlFhwwbaZIHf3QNOtco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555404; c=relaxed/simple; bh=Nu8i87h6TCaRhnZcf7DE0uw7jIrV4h4OvpGTwt1RA0o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=aB2GJju1lx3VWiNTQMGiqUPWkyIq6hsdGucUN/6jm2PsWe0EmylY+TgCoOx3T9hF1vFogdQTVGUJ5SfYHs4DHbi2RGaR3YG1OwYDsPuW9bYVXhdXmoUgs6tcLpcWo50KKogw8i+ykWFM1j14DRDHpj8s6vL9+lEGuLji9iESCsw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=VSLxxtYV; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="VSLxxtYV" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 563ErnVG018568; Thu, 3 Jul 2025 15:10:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= wduHtGPtkSKEjHRVStchLaRmO1KRr1DnfiqY9YEqJU8=; b=VSLxxtYVY7jfLswS IQpEqDjTQgKcvZghnWrcHXevzfvOj6Nyc8pwdZW8/bh420SVHb/AecJuCMOwGmiq E9XARXlGx//JCrDlr8kkpcTgVSJABwq4bAJkDgpzevt9S01jIWKWJhZB4MxpCU0k jyr6mO7vv2/eyUIF/B6VQssLmCWU3XagzaPI9JRWP6JMtnTrvlbOyZecRTe4picC +7lhyGy+LCHggFcZi4E+cmhv87FNMuXqbDJggUFMV5ABrAY8vpU9PEqIbLeVg14d 6vf5JbJnG1q5hD0IbtfwdK9smIHyASDS/uG6LjIOCctoW3DWhK+DEcki4nIx+gaM velAUA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47j8fxs01m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Jul 2025 15:09:59 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 563F9wXm006223 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Jul 2025 15:09:58 GMT Received: from hu-vpernami-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 3 Jul 2025 08:09:57 -0700 From: Vivek.Pernamitta@quicinc.com Date: Thu, 3 Jul 2025 20:39:44 +0530 Subject: [PATCH 5/5] bus: host: mhi: Need to honor sys_err at power_up state Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250703-sriov_vdev_next-20250630-v1-5-87071d1047e3@quicinc.com> References: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> In-Reply-To: <20250703-sriov_vdev_next-20250630-v1-0-87071d1047e3@quicinc.com> To: Manivannan Sadhasivam CC: , , , Vivek Pernamitta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751555387; l=2008; i=; s=20241114; h=from:subject:message-id; bh=hKiSjYqoF1Z6A9EbJR7RIbDt2Fq8yqPnNUfzdUwvZsg=; b=k4VGMhntpssdu4IWaCVy8hJ2nze84LfHDmOwoziqQ/4ud7avXRWcgG2VSyzLDbY2DCsyWWLEW Fc3yoBahLY0Cz4Ss53H91aU50SKFw9wztL5B8cUM3NS78AMZPf/t97X X-Developer-Key: i=; a=ed25519; pk=HDwn8xReb8K52LA6/CJc6S9Zik8gDCZ5LO4Cypff71Y= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzAzMDEyNyBTYWx0ZWRfX9BwiUV8cSzpb gfetumcDfTZYbfZ0ZcdtrS3ky18JgZ4fms+on6BNNFANuihc1/WQCRu/xlMOYSrWIWP2WrqSqMy RH6wsGOeDmPZ3rN+E7KhbMlL8TrehNBhTeyZACMjhPgEEBNDMP6eLfx0q5BYup+nSHM+a3zjsx5 m3v3W6KFdEJcH/pPWxCn/N1MpCKCpCmESUi6/Z5SzswNK+5K4UBcJebb3+aSGTKiCeMO0U+yj0v zpG6pa2uyBTfY9qR2O/4kgWOzWoCSeqS8SFHe1zT6q+09/AMPOx+ude5x3Nril2l1mjbOoXbUwM 0ACx+XRSHoU/uhjlamyDhWFeUEasJVVRgQ4mVOVkrWUooxKuiFNCPkLO7Z5Mt+2TwXHQfasx+0r Spj/e9am9tdinMebQCpP3DFZrbitvSC+LwhqkVO8RYayY7/P6LOPG9GlOtXtFeBTrqBwEaVG X-Proofpoint-GUID: _7uzgNr14hlPh2i8wKtJ4GtsLz7CcZv1 X-Proofpoint-ORIG-GUID: _7uzgNr14hlPh2i8wKtJ4GtsLz7CcZv1 X-Authority-Analysis: v=2.4 cv=TqPmhCXh c=1 sm=1 tr=0 ts=68669d48 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=89cOwND4bmROO382wosA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-03_04,2025-07-02_04,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxlogscore=812 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507030127 From: Vivek Pernamitta In mhi_sync_power_up() host waits for device to enter in to mission mode but SYS_ERR is an valid state, If device sends an SYS_ERR host will bail out for wait_event_timeout() as MHI is in error state and calls mhi_power_down which will teardown MHI driver probe. If there is any SYS_ERR, sys_err handler needs to process SYS_ERR state and queues the next state transition for device to bring in to Mission mode, so mhi_sync_power_up() will wait for device to enter in to mission mode. Signed-off-by: Vivek Pernamitta --- drivers/bus/mhi/host/internal.h | 2 ++ drivers/bus/mhi/host/pm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/host/internal.h b/drivers/bus/mhi/host/interna= l.h index 1054e67bb450d2634771d092ed42bbdd63380472..00e46176654d8dc2f28b1535d9e= f68233266ff3b 100644 --- a/drivers/bus/mhi/host/internal.h +++ b/drivers/bus/mhi/host/internal.h @@ -170,6 +170,8 @@ enum mhi_pm_state { MHI_PM_IN_ERROR_STATE(pm_state)) #define MHI_PM_IN_SUSPEND_STATE(pm_state) (pm_state & \ (MHI_PM_M3_ENTER | MHI_PM_M3)) +#define MHI_PM_IN_BAD_STATE(pm_state) ((pm_state =3D=3D MHI_PM_FW_DL_ERR= ) || \ + (pm_state >=3D MHI_PM_SYS_ERR_FAIL)) =20 #define NR_OF_CMD_RINGS 1 #define CMD_EL_PER_RING 128 diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index 2af34980e14250cada75c981b690bc9581715212..ee50efc57cf713a7cf38a670cb4= 9ab09a83b30ee 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -1280,7 +1280,7 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntr= l) mhi_cntrl->ready_timeout_ms : mhi_cntrl->timeout_ms; wait_event_timeout(mhi_cntrl->state_event, MHI_IN_MISSION_MODE(mhi_cntrl->ee) || - MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state), + MHI_PM_IN_BAD_STATE(mhi_cntrl->pm_state), msecs_to_jiffies(timeout_ms)); =20 ret =3D (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -ETIMEDOUT; --=20 2.34.1