From patchwork Tue Jan 24 01:53:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarangdhar Joshi X-Patchwork-Id: 9533859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7EE916046A for ; Tue, 24 Jan 2017 01:53:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70801279E0 for ; Tue, 24 Jan 2017 01:53:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 653E027C0C; Tue, 24 Jan 2017 01:53:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C3E20279E0 for ; Tue, 24 Jan 2017 01:53:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cVqIt-0005Z7-8y; Tue, 24 Jan 2017 01:53:47 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVqIq-0005XK-6d for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2017 01:53:46 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E9339607A7; Tue, 24 Jan 2017 01:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485222803; bh=sTFSQrcNNrI5b1AdafzCZ8e7pMaXhBBxWBH8n3u5mHw=; h=From:To:Cc:Subject:Date:From; b=nRwxrAZe4inbZ6f4rmCkWR5113y1gz+M2ahfBKn/1SU0SQDDOTWDf09U9p1lPWdGs Nph1quyS65YwRWKdiIlacd5kjPEyA8sB1uP2zVjclf7VKGrfcCiRRY0CQwjP3GnoDv ZSnvd4r725wI7SQKuNU+4F1+z8Q2Ppi4+WWtKkhU= Received: from spjoshi-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: spjoshi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8BD14607A5; Tue, 24 Jan 2017 01:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485222803; bh=sTFSQrcNNrI5b1AdafzCZ8e7pMaXhBBxWBH8n3u5mHw=; h=From:To:Cc:Subject:Date:From; b=nRwxrAZe4inbZ6f4rmCkWR5113y1gz+M2ahfBKn/1SU0SQDDOTWDf09U9p1lPWdGs Nph1quyS65YwRWKdiIlacd5kjPEyA8sB1uP2zVjclf7VKGrfcCiRRY0CQwjP3GnoDv ZSnvd4r725wI7SQKuNU+4F1+z8Q2Ppi4+WWtKkhU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8BD14607A5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=spjoshi@codeaurora.org From: Sarangdhar Joshi To: Ohad Ben-Cohen , Bjorn Andersson , Loic Pallardy , Santosh Shilimkar Subject: [PATCH v2 1/2] remoteproc: Add RPROC_DELETED state Date: Mon, 23 Jan 2017 17:53:18 -0800 Message-Id: <1485222799-20769-1-git-send-email-spjoshi@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_175344_289670_869530A2 X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Trilok Soni , Dave Gerlach , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add new state RPROC_DELETED to handle synchronization between rproc_del() and other operations on rproc. This state represents the rproc device that has been "deleted". CC: Loic Pallardy CC: Bjorn Andersson Signed-off-by: Sarangdhar Joshi --- The current patch series is a v2 version of original patch listed at https://lkml.org/lkml/2016/12/16/534 Changes from v1: * Add new RPROC_DELETED state * Use the new state RPROC_DELETED to handle race between rproc_del() and rproc_boot() drivers/remoteproc/remoteproc_sysfs.c | 1 + include/linux/remoteproc.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c index bc5b0e0..47be411 100644 --- a/drivers/remoteproc/remoteproc_sysfs.c +++ b/drivers/remoteproc/remoteproc_sysfs.c @@ -73,6 +73,7 @@ static ssize_t firmware_store(struct device *dev, [RPROC_SUSPENDED] = "suspended", [RPROC_RUNNING] = "running", [RPROC_CRASHED] = "crashed", + [RPROC_DELETED] = "deleted", [RPROC_LAST] = "invalid", }; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index e2f3a32..25a8c37 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -346,6 +346,7 @@ struct rproc_ops { * a message. * @RPROC_RUNNING: device is up and running * @RPROC_CRASHED: device has crashed; need to start recovery + * @RPROC_DELETED: device is deleted * @RPROC_LAST: just keep this one at the end * * Please note that the values of these states are used as indices @@ -359,7 +360,8 @@ enum rproc_state { RPROC_SUSPENDED = 1, RPROC_RUNNING = 2, RPROC_CRASHED = 3, - RPROC_LAST = 4, + RPROC_DELETED = 4, + RPROC_LAST = 5, }; /**