From patchwork Mon Aug 19 20:07:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 820582 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 7678E1DD39D; Mon, 19 Aug 2024 20:08:30 +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=1724098111; cv=none; b=NfvH/RLRppb+hFOpJFPmFZu58V4fcmCx584nL0l5aT9yrXbBD7M+N3HTXPFtA536t8FlUfdJXLRFd3UOynQ3JqOIwmgj22FX86tOV4hi6P+kq5STuH5qgVOyhCPAQgU+mFGjrqKImnVL9WRrEJ7AWsVSPnDkGV1WyUW57eSfAII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724098111; c=relaxed/simple; bh=AzBRnzE5wF8BxaGA/G/dnXeF8ct7PClnoIzeb8NYXKg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=O/GeuotzDh8jw1glI+kHnKFAshRl263YaKh4yJtFNeqMb3u0GsQ4pnAGpc4jt/jyImLbzvuGguyjiwzapapP4qyhM8nD73yFa+1dBnJeA972CcGGJTBxrewKA9biqTsW7hDPCsmk4XCcSGt+gWzdZOhUPyPzU8QLCAk/Fa1Cu0s= 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=HgAvFGfG; 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="HgAvFGfG" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47JAon8L025131; Mon, 19 Aug 2024 20:08:24 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= psX4yoMM8/JkY1r0sAHQnk6Qzp2O5lOgQ4lDw0sU6iE=; b=HgAvFGfGutRGw8S4 iWbJMm7+PfO2wyxlkSi0B1YRC7Buzr0EE8sDNIYQRS28DFD8WOwfDxlEt0E6WSKd +ywJFOyPb0Zd9tciRUWYFxnjRh3ZrNVBs6FsX6MbsKV1XfBlYLNQFNeSxS4qAJZn XyIuaD77/uh87GNNRJE5wHpZvnPUI9ovb8+zXu74x6byLa9d+iWzCS+Tp83SouEi Y6bE5VXbnWTBNqDG2pFCSpml3WL6EoIGt1hUR5gyWuGkvK4jzZmsRaj5hseJDfI/ 4RvvjcBEYcxNsrkaPZJJmYEuz/AceMr49jjzG1RN3CoXanKwZ/A8JockRnT57aZR FCSEGg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 412jtrwesg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Aug 2024 20:08:24 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 47JK8NAR029674 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Aug 2024 20:08:23 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 19 Aug 2024 13:08:22 -0700 From: Bjorn Andersson Date: Mon, 19 Aug 2024 13:07:47 -0700 Subject: [PATCH v2 3/3] soc: qcom: pmic_glink: Actually communicate with remote goes down Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240819-pmic-glink-v6-11-races-v2-3-88fe3ab1f0e2@quicinc.com> References: <20240819-pmic-glink-v6-11-races-v2-0-88fe3ab1f0e2@quicinc.com> In-Reply-To: <20240819-pmic-glink-v6-11-races-v2-0-88fe3ab1f0e2@quicinc.com> To: Sebastian Reichel , Bjorn Andersson , Konrad Dybcio , "Heikki Krogerus" , Greg Kroah-Hartman , Neil Armstrong CC: Johan Hovold , Chris Lew , Dmitry Baryshkov , Stephen Boyd , Amit Pundir , , , , , Bjorn Andersson , X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1724098101; l=1515; i=quic_bjorande@quicinc.com; s=20230915; h=from:subject:message-id; bh=AzBRnzE5wF8BxaGA/G/dnXeF8ct7PClnoIzeb8NYXKg=; b=T1Kps4TJ8SRx5AQtzKZIC9kRu7K+7MInTTRHTHjNHEMxuNwEvHIzPoXhCknRbcPN7j3MUjScU bPz7Ok+SzcOByClxpcdMv5AS5MtFVbdXN7JW0aEkC7+nvcLEiO8ep+z X-Developer-Key: i=quic_bjorande@quicinc.com; a=ed25519; pk=VkhObtljigy9k0ZUIE1Mvr0Y+E1dgBEH9WoLQnUtbIM= X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: GNw6EbgvQmreIWRha_L_AjW6nYobysUn X-Proofpoint-GUID: GNw6EbgvQmreIWRha_L_AjW6nYobysUn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-19_16,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408190137 When the pmic_glink state is UP and we either receive a protection- domain (PD) notification indicating that the PD is going down, or that the whole remoteproc is going down, it's expected that the pmic_glink client instances are notified that their function has gone DOWN. This is not what the code does, which results in the client state either not updating, or being wrong in many cases. So let's fix the conditions. Fixes: 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver") Cc: stable@vger.kernel.org Reviewed-by: Heikki Krogerus Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Tested-by: Amit Pundir Signed-off-by: Bjorn Andersson Reviewed-by: Johan Hovold --- drivers/soc/qcom/pmic_glink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index e4747f1d3da5..cb202a37e8ab 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -191,7 +191,7 @@ static void pmic_glink_state_notify_clients(struct pmic_glink *pg) if (pg->pdr_state == SERVREG_SERVICE_STATE_UP && pg->ept) new_state = SERVREG_SERVICE_STATE_UP; } else { - if (pg->pdr_state == SERVREG_SERVICE_STATE_UP && pg->ept) + if (pg->pdr_state == SERVREG_SERVICE_STATE_DOWN || !pg->ept) new_state = SERVREG_SERVICE_STATE_DOWN; }