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: 9533865 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 E8CCA604A4 for ; Tue, 24 Jan 2017 01:54:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB640277D9 for ; Tue, 24 Jan 2017 01:54:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF77627CE7; Tue, 24 Jan 2017 01:54:45 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53DEE27C7A for ; Tue, 24 Jan 2017 01:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751919AbdAXByN (ORCPT ); Mon, 23 Jan 2017 20:54:13 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:60740 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdAXByL (ORCPT ); Mon, 23 Jan 2017 20:54:11 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0F74F6087C; 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=1485222804; bh=sTFSQrcNNrI5b1AdafzCZ8e7pMaXhBBxWBH8n3u5mHw=; h=From:To:Cc:Subject:Date:From; b=XQtzOmvgzcqDM0t7rIM5pWW0fcIaZffZ0rQZQotm1QR6B1mO1OfezRh40f5B5RTGo sShRjVEqkWTIMcXE+BhrCMj0f8RLST0Jg/SrvvavPVm4jTnGMqtFgdFYeg72U2p8Po UWpPiHVMSWQGwAnKVAPTVXYu8DlAfykJyGqtChl0= 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 Cc: Sarangdhar Joshi , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Dave Gerlach , Suman Anna , Stephen Boyd , Trilok Soni 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 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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, }; /**