From patchwork Tue Nov 19 14:16:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 179754 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp697794ilf; Tue, 19 Nov 2019 06:17:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxSqCjuz+Zp+BEG/x7/L2DcON9vxdRY8q+aDTJBA+cgMuLMQlXy7acLdaSwPVLGVYNn3J4g X-Received: by 2002:a17:906:c797:: with SMTP id cw23mr34845954ejb.19.1574173065807; Tue, 19 Nov 2019 06:17:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574173065; cv=none; d=google.com; s=arc-20160816; b=ht5Xg5I6pelUIuJ6MmRPOelLASBKQHSqZ+hL9Vb1HviLMVOXgk3vgwO/DRh7oXMtt8 8T8dOlcVei/lA9CON7jJ/1N4XkywJUnhx/20de6a4rGoywMo0NJ6mOnnwr+8WMtJbq63 E31DK3U1FrAz/E1oSoWHa1CCgXFsUuUHoW5wk9WJZp5A0KaVbFwoAclp9JI7goGBKpD3 vqg+gZJc8YEjmzEDdH/FQcGrGnFWgwGpS4ZzCM+N+Tlc7xT7gpERaGltCczzxeo+7rMg NckdVxhVHnVsHHKjuIO5nIF0jwG9nRFlQ6aeIUnuN5oaNCtQrmOAhbId3envzkO/jiHT OLJQ== 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=q2AkjbhpWbUsFgOXMbxJrY5HMphD3VfMwU/ROrm6D2I=; b=vqyigp0ZB7LVuzMpMo9CqGtigFyQRnPlA4PEENfSD5g2VHK5ROTCti8Fs5ZF0udHi7 /02MXYGBuKgYrrXXTWadR8iNB/bWfo5NPO9DsJNg+msteelQPifwsphjIJxK40x8F7Zf swNSwUktdT14JyhgpfWXbZSpbQEJI24zSI2HPbc7l1muLdNGXcOxXE/WTl1QDVGWl35T FQytxcjHgaczZ8ucFaob5krnNPpfe3XQbf5Ix6ZGC+NgxrQgZF37mFSJoSrJUQH5DTql 0PWI2lznl3tyy0iD2MgVy6tipb88ot8zgeAfl81ldMKVtVk/We5jc1vgTze7qM7IQP2q 49MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=AWSL8hvC; 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 i13si13215840ejj.367.2019.11.19.06.17.45; Tue, 19 Nov 2019 06:17:45 -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=AWSL8hvC; 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 S1728324AbfKSORm (ORCPT + 26 others); Tue, 19 Nov 2019 09:17:42 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58586 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728256AbfKSOR3 (ORCPT ); Tue, 19 Nov 2019 09:17:29 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xAJEHSGB117294; Tue, 19 Nov 2019 08:17:28 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1574173048; bh=q2AkjbhpWbUsFgOXMbxJrY5HMphD3VfMwU/ROrm6D2I=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=AWSL8hvC6KXdde/QNYqmAKDDcHxzvoy3XP5RDw4tIj8zgrxEmSOeZFw+4Yz+7LhSO 6mgldBulwyDo/59P+sG+sjbp2Mhf6bNBNAwEMXjlyJP2Hnx3Xpiwas0G26UPDhzKsu AHhDGHhhKbMzGcC6QD/oFxqYKXhTc2hFVuBSaL5Y= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xAJEHS2t023025 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Nov 2019 08:17:28 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) 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.1847.3; Tue, 19 Nov 2019 08:17:28 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE103.ent.ti.com (10.64.6.24) 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; Tue, 19 Nov 2019 08:17:28 -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 xAJEGvZ7027070; Tue, 19 Nov 2019 08:17:26 -0600 From: Tero Kristo To: , , CC: , , , Tero Kristo Subject: [PATCHv2 14/15] remoteproc/omap: report device exceptions and trigger recovery Date: Tue, 19 Nov 2019 16:16:44 +0200 Message-ID: <20191119141645.19777-15-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191119141645.19777-1-t-kristo@ti.com> References: <20191119141645.19777-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 81642bf30423..e024a1cefbbf 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -364,8 +364,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);