From patchwork Fri Feb 21 10:19:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 11396087 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75D6C17F0 for ; Fri, 21 Feb 2020 10:20:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5489E24670 for ; Fri, 21 Feb 2020 10:20:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="J7hyiMSR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728955AbgBUKU1 (ORCPT ); Fri, 21 Feb 2020 05:20:27 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:60442 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728662AbgBUKU0 (ORCPT ); Fri, 21 Feb 2020 05:20:26 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 01LAKPXA015331; Fri, 21 Feb 2020 04:20:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1582280425; bh=wU0Sn6p1yeWaT25K+IJYioMb+UBf+BNiCCl361jxH5Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=J7hyiMSRLkPyy4P4iiPF813IuZku/PpT5pSLfNljWOnSIprmIRllK6N3Lm5OTXU0r s+5cky59RXCtilDbKpaQvj2XAUbH1xwL3BBq6iqKMomPkkaIvpI4v/CkakSAExQrFr edbkUTGyKw/YiEKZlcgC6KpJslglkZI2VrJGjuSg= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01LAKPxd104994; Fri, 21 Feb 2020 04:20:25 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Fri, 21 Feb 2020 04:20:24 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Fri, 21 Feb 2020 04:20:24 -0600 Received: from sokoban.bb.dnainternet.fi (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01LAJnx2034983; Fri, 21 Feb 2020 04:20:22 -0600 From: Tero Kristo To: , , , , CC: , , , Tero Kristo Subject: [PATCHv7 13/15] remoteproc/omap: Report device exceptions and trigger recovery Date: Fri, 21 Feb 2020 12:19:34 +0200 Message-ID: <20200221101936.16833-14-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200221101936.16833-1-t-kristo@ti.com> References: <20200221101936.16833-1-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Suman Anna The OMAP remote processors send a special mailbox message (RP_MBOX_CRASH) when they crash and detect an internal device exception. Add support to the mailbox handling function upon detection of this special message to report this crash to the remoteproc core. The remoteproc core can trigger a recovery using the prevailing recovery mechanism, already in use for MMU Fault recovery. Co-developed-by: Subramaniam Chanderashekarapuram Signed-off-by: Subramaniam Chanderashekarapuram Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Reviewed-by: Bjorn Andersson Acked-by: Mathieu Poirier --- drivers/remoteproc/omap_remoteproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 1ac270df4d66..7dcb5da0d940 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -383,8 +383,12 @@ static void omap_rproc_mbox_callback(struct mbox_client *client, void *data) switch (msg) { case RP_MBOX_CRASH: - /* just log this for now. later, we'll also do recovery */ + /* + * remoteproc detected an exception, notify the rproc core. + * The remoteproc core will handle the recovery. + */ dev_err(dev, "omap rproc %s crashed\n", name); + rproc_report_crash(oproc->rproc, RPROC_FATAL_ERROR); break; case RP_MBOX_ECHO_REPLY: dev_info(dev, "received echo reply from %s\n", name);