Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6801339rwb; Mon, 5 Dec 2022 18:36:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7KKwGUGPpBWHGMo9uNrAo5RJu1RfTVBFzwVsB0XsIepnJoi3TDErA+PTRR7dz+DQ06K0LK X-Received: by 2002:a17:90a:d157:b0:211:710e:7d03 with SMTP id t23-20020a17090ad15700b00211710e7d03mr84827616pjw.56.1670294173914; Mon, 05 Dec 2022 18:36:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670294173; cv=none; d=google.com; s=arc-20160816; b=GC4lrE/JmcPJIfGnIKw1pNKpwlGwrOU3PorxSGW6MwbX9ug5jL9yGlGzwGkit6aQEu zKAUwceQceBcoJaHbDRgzesDz9FYErBRPuInBdLP14j63J55RO+l0R9LE4AOtbElNDPN aheJyBBhc8iQzgiYiOM7XP3UaQlUdvCZb1Ysfzk3sWnDqXMgZbsgRAQIMvN7ZT4hQLkr /JvAMFLEdwBKcAYqqtWZQdPUqiYzOIOZl1zpnbrJI/IX6Xj4RxQmWooTjPJbag8oykzp yi0f1+gxW07yN4esV79nDUYOapnxweFZwdlQjJzt559PckIaR+8iJCLrMdZzNB396F// rynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZjCqy0ftJDbg3rlALbusHYYHmUH+soAqAEw5gjrlgLQ=; b=Ogct7fQeg2zIsFHal5c3rurSYRoRFmYbdJXQuRwRfgMC96wEj1bhJvhrcK1YvQjiem AYVkIbGPeqcG08RToEfxFE/RgSZ1oy6LzwZWgnXUqFOUnz9Vh8rzKZxceW5Yjq0O6QiK cNoczAmDozkhNkCJUT4qFd4aHd7nljUONIkGnXdTuboOxBErGN/U52Sp5X/dWSLaMmJk yLUK5bclj4YyUlDWNZZSx72s/YOqPn334+lB2RdI4g5AFUQo6S7ugJ4WZm/zbPu0xzAI 9pXVliQgcqCiVIphKTCseSNI+dIPdD0KcWvERXoDmK3rcacRtneirjulNP94wh/P9t3y H/4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bQ8JXmof; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g205-20020a6252d6000000b00535d7265923si8060812pfb.377.2022.12.05.18.36.03; Mon, 05 Dec 2022 18:36:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bQ8JXmof; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233602AbiLFCA1 (ORCPT + 80 others); Mon, 5 Dec 2022 21:00:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbiLFCAZ (ORCPT ); Mon, 5 Dec 2022 21:00:25 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8535213E06; Mon, 5 Dec 2022 18:00:24 -0800 (PST) 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 2B61qDeO027449; Tue, 6 Dec 2022 02:00:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=ZjCqy0ftJDbg3rlALbusHYYHmUH+soAqAEw5gjrlgLQ=; b=bQ8JXmofmXdUIjoLVSVDe93IxEYaK7s83tGp9V9JWLbmP6AqK/FZvTpjcU49LkGguICG j9spwB7ThQTmRCZK6VRwG563cGv3rufq7tbz2MMgPAe6538anECli6vF/Hmt5ERj+WGE s5giq0LdGVbpPOd7xEX7/VnArTzpEBbVPAKJHB1cr4YGNnMx10OKJX0GCt154tv/rNT7 1zTqoS5HkIglOWHJw8NAsDcMkZyzfAH45p18yw6c3iZmfa65QxKhjN0zWnlaxNK5Fbb5 GNW9gTMfgaWCcDslQjDqGEIi1C+B1rtFCfZ5TIK2y8+oYwKYna4J7nolzsC1jLh6W13h rA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m7wdxwy0j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Dec 2022 02:00:19 +0000 Received: from nasanex01a.na.qualcomm.com ([10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B620JRA020494 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 6 Dec 2022 02:00:19 GMT Received: from aiquny2-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 5 Dec 2022 18:00:17 -0800 From: Maria Yu To: , , , CC: Maria Yu , , Subject: [PATCH v6 1/1] remoteproc: core: do pm_relax when in RPROC_OFFLINE state Date: Tue, 6 Dec 2022 09:59:57 +0800 Message-ID: <20221206015957.2616-2-quic_aiquny@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221206015957.2616-1-quic_aiquny@quicinc.com> References: <20221206015957.2616-1-quic_aiquny@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: _A-JQLjfrjqpDngPxYjnDoKQjYTfF0bF X-Proofpoint-ORIG-GUID: _A-JQLjfrjqpDngPxYjnDoKQjYTfF0bF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212060012 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure that pm_relax() happens even when the remoteproc is stopped before the crash handler work is scheduled. Signed-off-by: Maria Yu --- drivers/remoteproc/remoteproc_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 8768cb64f560..7419e1460f2a 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1862,12 +1862,18 @@ static void rproc_crash_handler_work(struct work_struct *work) mutex_lock(&rproc->lock); - if (rproc->state == RPROC_CRASHED || rproc->state == RPROC_OFFLINE) { + if (rproc->state == RPROC_CRASHED) { /* handle only the first crash detected */ mutex_unlock(&rproc->lock); return; } + if (rproc->state == RPROC_OFFLINE) { + /* Don't recover if the remote processor was stopped */ + mutex_unlock(&rproc->lock); + goto out; + } + rproc->state = RPROC_CRASHED; dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt, rproc->name); @@ -1877,6 +1883,7 @@ static void rproc_crash_handler_work(struct work_struct *work) if (!rproc->recovery_disabled) rproc_trigger_recovery(rproc); +out: pm_relax(rproc->dev.parent); } -- 2.17.1