From patchwork Mon Oct 28 12:42: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: 177922 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3339484ill; Mon, 28 Oct 2019 05:43:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyT8gSewYS2kxC9ARqv9oqqq2ifzyI8+MytVuVwkAX2zuozOLeETp2dKiM4lEQ1egWf1rMm X-Received: by 2002:a50:a9e3:: with SMTP id n90mr1667506edc.52.1572266608662; Mon, 28 Oct 2019 05:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572266608; cv=none; d=google.com; s=arc-20160816; b=C133U6cbi+nErSMw4QF5Xiwt1cMbGXQNV0pP5fPlIxdA9+UCUwgW2BrSaIyTbtIn2C VT6q+XSd9xiBuGBmzKcarkGE982sbe9kOTVQ1+mf8b/gQlmEg9FO7uLbqEFJxKfHBA5R a1mjaqPqHkn0u+BEvdfTAgEMNI/++7xcjQXsjmlgRBkevi+Vl6K2EVAE87Ouw5S6hIOd d0zYjnomPiWL0y++sPhRLIKekP3VjfO8uXSbfvMYla5ozXWe5C1U/ycR1Z44fuqy7vV8 vJ9Bu78wiRFudlXFCOJxqf0/3C6PVgxw795kwz58lEdr4ZYUqaPL879D0zwbg9Wb1Mq6 GprQ== 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=rPONEiSmD4pWcodXkaa3Ko/nwYMCIwTFmnmZ81Du1bQ=; b=zLpMdzwDR31ZRrbIXs9Xknz/1NFI93GnliIJ9WtNXmAV8xzrqUch34VHkb/8P0X9pP NPhuvWfCaw7eIn4iDqJietiKGMWau+s/nUqo9wxRWgKGhc923lQrhfJLEvpEw6DcI3jp OeycdF2PSQgCKzSNH51G3+V3dOc82yBLYx1xN4Il/yw+h3rZR2FY5bNzyC+hvvDSPyx2 xwFX+/pn3GII61HoOrbbO0vFi5dhh1d8/bVEGnHT8Ww9FbdlC39pOnqx8c7JF4i7fBGq fZ17J7QFqaRPpiwXHqD9UdKuViyzr63bIBcDSxzarW/rF9iDk4VkPXVqCzF+Nn3KtJ4F Uhsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xi1wofiD; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-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 26si7378003edz.340.2019.10.28.05.43.28; Mon, 28 Oct 2019 05:43:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=xi1wofiD; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-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 S2389418AbfJ1Mn1 (ORCPT + 5 others); Mon, 28 Oct 2019 08:43:27 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:46308 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389395AbfJ1Mn0 (ORCPT ); Mon, 28 Oct 2019 08:43:26 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9SChPX5047842; Mon, 28 Oct 2019 07:43:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572266605; bh=rPONEiSmD4pWcodXkaa3Ko/nwYMCIwTFmnmZ81Du1bQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=xi1wofiDyEyagV8/CCDO2EjZI1c92oqOCkDr1QCvVg8K7Bwr/xzEFKvZUCyeSpP1E hwD6sHID11de9EXQOcBFwLE31wCBVZ/1soJhZaJSUNGhnzkZUU/a+dkiwCffybr8/W ksgUoDb/cYz0BWiXRJyaXzzNBf5R/svCiqIzlNlY= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9SChPLs075631 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Oct 2019 07:43:25 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 28 Oct 2019 07:43:13 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 28 Oct 2019 07:43:13 -0500 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 x9SCgoh7063574; Mon, 28 Oct 2019 07:43:23 -0500 From: Tero Kristo To: , , CC: , , , Tero Kristo Subject: [PATCH 15/17] remoteproc/omap: report device exceptions and trigger recovery Date: Mon, 28 Oct 2019 14:42:36 +0200 Message-ID: <20191028124238.19224-16-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028124238.19224-1-t-kristo@ti.com> References: <20191028124238.19224-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. Signed-off-by: Subramaniam Chanderashekarapuram Signed-off-by: Suman Anna Signed-off-by: Tero Kristo --- 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 8bd415c8fc86..6f797025bb6b 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -360,8 +360,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);