From patchwork Mon Oct 28 12:42:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 177923 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3339650ill; Mon, 28 Oct 2019 05:43:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzi5KLy5GoqxXFVxe2fbIU0ZofX1keOVSUq8CzcjnxMk+GwYv/49q2uu1O8UmXcBJmOkzpi X-Received: by 2002:a17:906:d794:: with SMTP id pj20mr9441908ejb.184.1572266618121; Mon, 28 Oct 2019 05:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572266618; cv=none; d=google.com; s=arc-20160816; b=f5bA+TIzXuWLaFJOa81Gqsv3DU0OJMYQ3bX3MDZvWQofnkynZct5hmVzc6oMZrcoFe KVOWKvqcYscOIuYO/QAkM/EtUOa4wlTTm+8CekFzpDacRQCfSfJb4VDK1+C3IIFifA3v hiozWslIP2chOhKLlSlJmtD1m0bepB2D3G8M088zbQncgr4vpI6wF2TUT9FeQxfZ70tp xat8bdLLjfTftd8BIUWdLPCRnzmotxQvf5WPHw2WlnKZa73WtkR0s3peDNO5WKY1VZMz hoso0okEeUzeBeUopPa5d3V8nX6HKO6zH2PH3M4G6gBEw5aKBlOn5bByF770xiZscksY gFpw== 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=RjOxaFJF9928MExwXsThcLzcc0mTulOCLUMie9VmrpA=; b=VunS6YJULgyP70j4rL9Qn8IbInhuUP+Z3JQQ6vhhcQiQnSrw2bMAPMkgk5CG/PFxY1 jON/SnD4hnQ7lYMQnw4/+ueDoKDpPCTPGwnfoRvHxEOKHLWzZ+qIluyTbuvbSrQ/p2DB jZeRI8Mm2NH77pXtVx1BqlGFW9DGjGg0nI5WjGcSXlJCZKOFiBT/iLLrmeUhN6TrgImf 3U9wjQDV+zH0luhvZEY4kneQ6Ouu0qNHXMoorVRHpdkDuy7oEG79Ep1CeFeCwocH8o1g 5tpc2IQudAi5avhCbHL9V3IrrL7+4EugVGmEGn/6rxbfAvL3nMc9pZKFd/88oLCNaEzB DuwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MSpMeR3C; 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 g3si6168162ejw.13.2019.10.28.05.43.37; Mon, 28 Oct 2019 05:43:38 -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=@ti.com header.s=ti-com-17Q1 header.b=MSpMeR3C; 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 S2389485AbfJ1Mnf (ORCPT + 26 others); Mon, 28 Oct 2019 08:43:35 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:37336 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389444AbfJ1Mnb (ORCPT ); Mon, 28 Oct 2019 08:43:31 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9SChUE9034373; Mon, 28 Oct 2019 07:43:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572266610; bh=RjOxaFJF9928MExwXsThcLzcc0mTulOCLUMie9VmrpA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=MSpMeR3C94Knhds1rQEhThX7xPi6ZtSwvVbqGp02NXI4Fkqcig9lrELGkDc6BgrFt YszypclGnQOdKrcPhm05WLNYVy+qC9SmYK7CI+NnkhAB3h+gyxtX6Yr83kjP1WjV1T eJwus7NTNAK391rb2ssBP+ud89SGvalyxKLEjxes= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9SChUEr075731 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Oct 2019 07:43:30 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE111.ent.ti.com (157.170.170.22) 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:17 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE115.ent.ti.com (157.170.170.26) 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:29 -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 x9SCgoh9063574; Mon, 28 Oct 2019 07:43:27 -0500 From: Tero Kristo To: , , CC: , , , Tero Kristo Subject: [PATCH 17/17] remoteproc/omap: fix auto-suspend failure warning during crashed state Date: Mon, 28 Oct 2019 14:42:38 +0200 Message-ID: <20191028124238.19224-18-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suman Anna The runtime autosuspend on a OMAP remoteproc device is attempted when the suspend timer expires (autosuspend delay elapsed since the last time the device is busy). This is the normal autosuspend scenario for a device functioning normally. This timer can also expire during the debugging of a remoteproc crash when the remoteproc recovery is disabled. This is an invalid pre-condition though, so check for the RPROC_CRASHED state and bail out before the actual check for the RPROC_RUNNING state. The auto-suspend is also not re-attempted until the remoteproc is recovered and restored to normal functional state. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo --- drivers/remoteproc/omap_remoteproc.c | 5 +++++ 1 file changed, 5 insertions(+) -- 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 2eb05d7a4dec..1dfac82224f7 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -945,6 +945,11 @@ static int omap_rproc_runtime_suspend(struct device *dev) struct omap_rproc *oproc = rproc->priv; int ret; + if (rproc->state == RPROC_CRASHED) { + dev_dbg(dev, "rproc cannot be runtime suspended when crashed!\n"); + return -EBUSY; + } + if (WARN_ON(rproc->state != RPROC_RUNNING)) { dev_err(dev, "rproc cannot be runtime suspended when not running!\n"); return -EBUSY;