From patchwork Fri Dec 13 12:55:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 181551 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp597696ile; Fri, 13 Dec 2019 04:56:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyHKi043URKXNavupFS7Eu2AWuopjfg/6pUqIh7fdimMVRYezU1iqfN/MDK9z/wT+fg8KFP X-Received: by 2002:a9d:48a:: with SMTP id 10mr13588917otm.95.1576241802943; Fri, 13 Dec 2019 04:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576241802; cv=none; d=google.com; s=arc-20160816; b=qJHDJNDv49iTBSOmzAuk1rDG8w5I3EVrUGQfIiEcA6d8oqtZ7qAzl9YsfLY7z1j8gs t2iUh4CWt4WqAVar9zHltBuugOiz5Nc6XmqcWA5QV9VsRVLECPcFnk4VLkONsqHCVavt GTygfqQBexkwyb41pim0uTbskUGu4cZd7i/ptBJOFus8+mwTq9OPJEOnFif/ZNnILPFl w7FQUM55tSKq1AyGHtzICY61W8hozW1ugylRuBxcnrHxapKGHULI/SzHjjsVBh2i/Vta nOP7cUrgdw/y2F8lGblTDUHcgOyxwgmfbm6L12+ntU/hWIoGVodn75eBTMOB+NIwhbAr zhdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dRlN2up8PudxZtv76blerXDBUbs7TZZ90n7iYqT2FWE=; b=QMfzh0ZMYXCgiekfozHyGsLBueUJ8NQ2eLpxm492q+ChCyse2P6sNaLcK37frwASvu YY0LJ5+3XukZ2YZ+g8IIGKJHer0pu+OkoSgiWUUCmBZ4lV5s7HiGIO5SjakZhG/Qt/+i z8rnAhoaKgswMN8sujcAFEINPSvuiqhFWs4shhqKed9HalRGEp6asKMQCaVFvY8tkaGM /bf8rhkhQm/PlfTcIk5qsCmyYMUpfViYNPxqnLixponMXV817Nzz7MW5BFzfco8xflnd GgCkD0M8Hkvf70LjdWdPMdy72HBXnQYg/KMoQNsVmdUa0SIu/sEqS++XMldau42kc6tN L32A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=n0nyD1Uj; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23si4901342oti.65.2019.12.13.04.56.42; Fri, 13 Dec 2019 04:56:42 -0800 (PST) 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=@ti.com header.s=ti-com-17Q1 header.b=n0nyD1Uj; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727541AbfLMM4l (ORCPT + 27 others); Fri, 13 Dec 2019 07:56:41 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:39762 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727490AbfLMM4c (ORCPT ); Fri, 13 Dec 2019 07:56:32 -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 xBDCuVsN056343; Fri, 13 Dec 2019 06:56:31 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576241791; bh=dRlN2up8PudxZtv76blerXDBUbs7TZZ90n7iYqT2FWE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=n0nyD1UjejQCU+pR/psLMZUJ4POwpiQvE+t9WWezG2ViRRCu/SjCKPCq0IxzH6tcn FZCp/5tot8sUhT5WksG7AyCrm+cJRtxxPJnORi80uMSRi+fyA0TlScIM8kNMhWWoeN SpLtjvMobTna4/mGclyi/Hi3W2OjjDFFmomvQTik= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBDCuVmu009247; Fri, 13 Dec 2019 06:56:31 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Fri, 13 Dec 2019 06:56:30 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE104.ent.ti.com (157.170.170.34) 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, 13 Dec 2019 06:56:30 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBDCtwVT127295; Fri, 13 Dec 2019 06:56:29 -0600 From: Tero Kristo To: , , CC: , , , Suman Anna , Tero Kristo Subject: [PATCHv3 14/15] remoteproc/omap: report device exceptions and trigger recovery Date: Fri, 13 Dec 2019 14:55:36 +0200 Message-ID: <20191213125537.11509-15-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191213125537.11509-1-t-kristo@ti.com> References: <20191213125537.11509-1-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/remoteproc/omap_remoteproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 463d6f60947a..02599278263f 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -363,8 +363,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);