From patchwork Tue Oct 17 13:19:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Kurapati X-Patchwork-Id: 734487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E204CDB483 for ; Tue, 17 Oct 2023 13:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbjJQNU2 (ORCPT ); Tue, 17 Oct 2023 09:20:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343926AbjJQNUJ (ORCPT ); Tue, 17 Oct 2023 09:20:09 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB9E192; Tue, 17 Oct 2023 06:20:01 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39H7jblP025029; Tue, 17 Oct 2023 13:19:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=eH9+uGhbmzhLtgVJlATCBifzu779Fbw0JaX2vCy5JFI=; b=GnOv4y2OuDgfj2NP/ctliUYxZ9HwJPuEWh0puzimsCmOeMOBz7Wkc6ei8FTYVKKC/whn ry8eQFrsGbwOhC2cet0o/dq1PQXG2rOdHLDCLuJh2NIV6jLlF3+b1Xb2xHa6C5z0eGFC KoaXprj0bpiZAONMY+xhURGaaFpkfH6+S3asmB6pb/cp2wAKqAmE8nUtW2TWULdRZxKO Ds+wH03hM+y5Z3oqG9oBaReaTWuoj7bTl9EnkNBLBpTfFuOG1xepn/6Ys3JGDyaGFsC/ Bh9uw7fiRQra4dX+0Meuk8mUwNywes9kLDG7SCBBQysggLhBbTLzlTi4z0Ki4X3GTTjq kA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ts9jnt9pk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 13:19:58 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39HDJv2g016670 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 13:19:57 GMT Received: from hu-kriskura-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Tue, 17 Oct 2023 06:19:53 -0700 From: Krishna Kurapati To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd CC: , , , , , Krishna Kurapati Subject: [RFC 4/8] clk: qcom: gcc-sm8450: Keep usb30 prim gdsc on during runtime suspend Date: Tue, 17 Oct 2023 18:49:44 +0530 Message-ID: <20231017131944.8356-1-quic_kriskura@quicinc.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: haSFvbWIW5_zdSFiQJc9enXTBRX-G3Ad X-Proofpoint-ORIG-GUID: haSFvbWIW5_zdSFiQJc9enXTBRX-G3Ad X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-17_02,2023-10-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 mlxscore=0 clxscore=1011 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=751 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310170113 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When runtime suspend happens in host mode, if cable is removed at this instant, it triggers a resume where a xhci register access is done when gdsc is not on leading to a crash. Keep usb30 prim gdsc as on during runtime suspend to avoid this crash. Signed-off-by: Krishna Kurapati --- Note: I am not sure if this is the right way or setting GDSC flags to PWRSTS_RET_ON is the right approach. So for now made this change to keep GDSC during host mode runtime suspend. drivers/clk/qcom/gcc-sm8450.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/qcom/gcc-sm8450.c b/drivers/clk/qcom/gcc-sm8450.c index 75635d40a12d..47cde2de93a2 100644 --- a/drivers/clk/qcom/gcc-sm8450.c +++ b/drivers/clk/qcom/gcc-sm8450.c @@ -2996,6 +2996,7 @@ static struct gdsc usb30_prim_gdsc = { .gdscr = 0x49004, .pd = { .name = "usb30_prim_gdsc", + .flags = GENPD_FLAG_RPM_ALWAYS_ON, }, .pwrsts = PWRSTS_OFF_ON, };