Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4322519ybl; Mon, 26 Aug 2019 08:44:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDZxtsEdDOOtTxazJJ6A8ni7R5zB03Wl+HA0+saxbHi+gjz66kz/ZeBpOuCCrWZJ9HkUoP X-Received: by 2002:a17:902:bb95:: with SMTP id m21mr19366901pls.26.1566834281760; Mon, 26 Aug 2019 08:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566834281; cv=none; d=google.com; s=arc-20160816; b=g5o9r0AE7VTDxSUFOSjLsW3obsPkfqFSTRInMMEWOyc1G4U6r64EcF2RFac+kW93rH 6vbCy3viS8SDQsQrGXWT4CvOM0K7PLkuzM5fp2IgnZAaLQwbGPLOon1rGeXEw18LdGyk m1/GttbCzc3Wfu/HdsuVm2Mym/SPZN8FY3desLudstptJCeohd3ttH1QLEHAup7WfUlc 2odyMtyXj4M6qhNtXPIGgZITJjSp1q/SqhVUP6MHVAnJOCPgJOM69Kp2Eo07xpPkV8v2 VMLG386UincAmvt224nFH0M2IZysD9rU2BokRS2Fpxz5uke/s55Qpt5HlfUoB56i7Xyk hYzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=C0FjddlLz1tmGjWDBbox9NlNRBYo5AeX1gKNZtaLU5g=; b=ydwsr/ZFHlVxqjy8YACg5XUu22JuZY5mRIL7njCf3Zz/guDYPpJJPK/MkqvoxXhTH1 u5B1POE2L8ZVsXCoRtZlxJ4dbvVCJgufBJRqY6DwRbTPoYR6dNYTRfCoUxVOPZaayB1N ps6An9pMDpOd9tFkgbIn/VQni4R+Dxi2l5gaDiYkE9Yk7/a3h9JNxCpvELgHaUxACQSw flfBngfwBsq4gcccZKUjvZLOs7pO5uvgbcaSF46PHz1zhEbp+AO5aiWVqjM2yR8Iaetd m0xymyxCojnbpAGi/sP9JCisOdPUNy+OQnXlyKyOCo7IHax/hPGGimJ7MjijfIH91QB8 mzeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Uy9YJ97H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si9237002pgd.203.2019.08.26.08.44.26; Mon, 26 Aug 2019 08:44:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Uy9YJ97H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733237AbfHZPjk (ORCPT + 99 others); Mon, 26 Aug 2019 11:39:40 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:1355 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733084AbfHZPjV (ORCPT ); Mon, 26 Aug 2019 11:39:21 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7QFPrA8018373; Mon, 26 Aug 2019 17:39:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=C0FjddlLz1tmGjWDBbox9NlNRBYo5AeX1gKNZtaLU5g=; b=Uy9YJ97HWifGqiNE2bZDoI7Goq6JnRM7BYzJuFG+KghxPxQpMXRocx54nTa7JjhnaXH9 pPWn55lKtkr86gbQ0Q9xTfq9ue4Wjj5DBRFvLb27ZNa0aCBE5vLQSpdGoU60SWHC7SyC gs/+4Co71mrbqGPctuDkriAajhGNNVpk9F4B/x4ANnsPksHO8u/LErIQhrgi1ivgQF2r XUKzG4wyUm7W+TJra1/zVOWlAG4wmBJlFNv5hr8ScymlZn083D4mrfcRXizwk5EOwODd zxciaIIANo/FGysi1csooiGWhF0x27CYRUjUZgz4fXC6xHuItnr3v7GXNnUEfyz1+wJr KA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2uju0vmgf6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 26 Aug 2019 17:39:14 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 274E01D1; Mon, 26 Aug 2019 15:38:42 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A29F52D3762; Mon, 26 Aug 2019 17:38:25 +0200 (CEST) Received: from SAFEX1HUBCAS21.st.com (10.75.90.45) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 26 Aug 2019 17:38:25 +0200 Received: from localhost (10.201.23.25) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 26 Aug 2019 17:38:21 +0200 From: Fabien Dessenne To: Maxime Coquelin , Alexandre Torgue , Ohad Ben-Cohen , Bjorn Andersson , , , , CC: Fabien Dessenne , Loic Pallardy , Arnaud Pouliquen Subject: [PATCH] remoteproc: stm32: clear MCU PDDS at firmware start Date: Mon, 26 Aug 2019 17:38:06 +0200 Message-ID: <1566833886-16571-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-26_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When remoteproc stops a firmware, it sets the MCU PDDS flag, allowing the platform to reach the Standby power mode if needed. Symmetrically, clear this flag before running a firmware. This fixes the issue where the system goes to Standby mode when the MCU crashes while MPU is in CSTOP mode. Signed-off-by: Fabien Dessenne --- drivers/remoteproc/stm32_rproc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index e2da719..1c95913 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -383,10 +383,21 @@ static void stm32_rproc_add_coredump_trace(struct rproc *rproc) static int stm32_rproc_start(struct rproc *rproc) { + struct stm32_rproc *ddata = rproc->priv; int err; stm32_rproc_add_coredump_trace(rproc); + /* clear remote proc Deep Sleep */ + if (ddata->pdds.map) { + err = regmap_update_bits(ddata->pdds.map, ddata->pdds.reg, + ddata->pdds.mask, 0); + if (err) { + dev_err(&rproc->dev, "failed to clear pdds\n"); + return err; + } + } + err = stm32_rproc_set_hold_boot(rproc, false); if (err) return err; -- 2.7.4