From patchwork Fri Mar 24 19:22:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaying Liang X-Patchwork-Id: 9643925 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 E156060328 for ; Fri, 24 Mar 2017 19:31:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEBA127D16 for ; Fri, 24 Mar 2017 19:31:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C39B827E5A; Fri, 24 Mar 2017 19:31: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=ham 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 5A8DD27D45 for ; Fri, 24 Mar 2017 19:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967043AbdCXTbi (ORCPT ); Fri, 24 Mar 2017 15:31:38 -0400 Received: from mail-by2nam01on0055.outbound.protection.outlook.com ([104.47.34.55]:58720 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S967062AbdCXTaG (ORCPT ); Fri, 24 Mar 2017 15:30:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YUPflGjldwf1f5VrH9+Ql/iWqTqMz5rrsoZdFjvHaHM=; b=5bbokxiO2Lfzwwc7KRgXUvMP+hkxxBBpqDPR9d9rOu17kKzEMrNeoBhLLRDTb+snOwJedpng0uCGHaD2THEGxiGVauK0w69eGH1q3dDFhkOFDSr2xeUhClsm6Wj4OsugaGNFhvXttLMsPjyvp3LeX5z0kbgOZck1Q0ouf4oxtpM= Received: from MWHPR02CA0048.namprd02.prod.outlook.com (10.164.133.37) by BY2PR0201MB0712.namprd02.prod.outlook.com (10.160.124.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Fri, 24 Mar 2017 19:29:48 +0000 Received: from CY1NAM02FT028.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::202) by MWHPR02CA0048.outlook.office365.com (2603:10b6:301:60::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Fri, 24 Mar 2017 19:29:47 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT028.mail.protection.outlook.com (10.152.75.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 24 Mar 2017 19:29:47 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1crUuA-0006IR-W4; Fri, 24 Mar 2017 12:29:46 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1crUuA-0002kt-SY; Fri, 24 Mar 2017 12:29:46 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v2OJThCM010398; Fri, 24 Mar 2017 12:29:43 -0700 Received: from [172.19.2.167] (helo=xsjjliang50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1crUu6-0002jg-5f; Fri, 24 Mar 2017 12:29:42 -0700 From: Wendy Liang To: CC: , , "Wendy Liang" , Wendy Liang , Michal Simek Subject: [RFC LINUX PATCH 04/19] remoteproc: sysfs: Add running independent state Date: Fri, 24 Mar 2017 12:22:20 -0700 Message-ID: <1490383355-23176-5-git-send-email-jliang@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490383355-23176-1-git-send-email-jliang@xilinx.com> References: <1490383355-23176-1-git-send-email-jliang@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-22962.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39860400002)(39410400002)(39850400002)(39840400002)(2980300002)(438002)(199003)(189002)(9170700003)(356003)(305945005)(50986999)(5003940100001)(110136004)(4326008)(2906002)(38730400002)(76176999)(47776003)(9786002)(50226002)(48376002)(8936002)(50466002)(107886003)(6916009)(2950100002)(81166006)(33646002)(2351001)(189998001)(106466001)(36386004)(36756003)(54906002)(8676002)(5660300001)(77096006)(6666003)(107986001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB0712; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT028; 1:38Y/JBW4glT+cOmXdp+m66KWAPKhrItYnqvLCcRNRiHa0EEuhoS4QTFwtirCHjIOPsKIiDmOWywJlp+vYDFYSdXqV2qM6CpiDui1E5sBT9g73saHWqGZFUt/7RSf+EILJ6/zrDjTBlAnmQNnmw5uVB/Xl+FN75I3F3jnT0ipYYcZ5RW8orNnO9aOGE3KG7v1GN4EroajPgbtDgAbLfPToN4TvW4CwziQg3kp+skVMj6KY0Pfp/AXuUsOq3JP6soSN5bn7jY/oGGPSFn709BrDKXEOOpJ8UbU80YOAh915rYh1BwkSL+nhG82g0DGe/Y4Inxbuwg4+hh/ZOM86vjFN1hml4n3DgC1VqRBXCUFllSn5tWfNJY8GAEFAvn8IXhZN4PV6WcPcRZ8n3YekaXF8LTnqyR+CHuC63qBcw8w1UVSFqzeRfq7SFSgbxdubrlF4lZL5ASCh0rZhY51OjFk8XeNNP4HSAoRM+JHX5T6bTESbzbzMGuXwyD4v0IOPEdDyhJIgUXdLqY41NP23lXgY6PDhGxSzinRR4+uaXvctjblYszfWpZ2NLdq1WtSNZRpxEyx2vexrpmeAajC+vxxLA== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 454f1030-0def-480c-a494-08d472ec2248 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075); SRVR:BY2PR0201MB0712; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0712; 3:hQYtd6fgP1C5gshPj4N2RVciZKvE+QpyU87EI5FJ7DU0clpgWcJB10c/o/HzgZz0PIOJVwRtrggubvkJ7xUfbpPe3QGpdSa2iO+K1X0vg8Sqs7dvo0NQrRE7skNmNMXYczhrwhjmeGCTLEEDZrp5KsBQwG1/fCsyL3aAFhiaXuZ3QjrHrzuK5Gjh7/VmptiYryLunBZBRf4k5ljJRgwEnfwS5qRLZX8thn1eMPIMulLg8Grpth8ZxNdGgxMsLzhcFgvlFCqyy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AhT8zmMWQl+pLmB4QSUgw6SGmZAT1tq1B6U2I9w1IvJUJlpYG20NEhZDo/5rv61NEMrbKw+0Pq7SYEV/6oFQlUynyH0kAz+3Gpix5j1h7yB60HXJ6P+Rim+dq7wTWKr44aYLCjHJ2AzsM9rRfNP8EfdnqsfnXwDP5uj2CEwnmrdAJy/Xb/dm/YhgOI9IS5mRDnmeSYpj4FFbdqYF3dByWbSTHquXqZdipE1RhlhmK2ZoDHdAny91WuhZIfESFjCKhJ+vipbEWkOprCVeQQfWMMoDr66XKNx9wCHHMIAKyzzOAzRbAlgqTLy4PkvFFgMa/NoSF/OF1zyH7BPdBCLlL+utgBDbUU1a6iO27cvzvlh7PdLNXnLducWOS97K7R3vgDeC3ndcf9Kzlg8rQ8psMwT14tTILC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13017025)(8121501046)(13023025)(13024025)(5005006)(13015025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:BY2PR0201MB0712; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB0712; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0712; 4:08GDj4bOrFxVY/6MfrUs81SJBDe+N6WKx2CkDEDIHbU1vbvJKfuB7FslcF1kzHBGt8lTRUPnPkYpDvq+2nfIbHNOvmYPlct+WV1ya9Qrd5Q0nUP41lcRVrzBDrigTYcYXsyz693ddnHDjZNg137fg7f+RNfbnbIBa1bAjD+BZxK7OqlnA0Zdss2pPncIQSoZLf9idoDqMqGJIAgIRsvZx9E07YXRCw8Tmc/hqrPbaodzoIB/+3rlFvA6QOePTlLt5W1oaABJGlQPChSx6wPrUv1jBpm1SCQCd4K0+70Z4SwwNYW2JLuWMlVdpyWJiSVYjvo6rFqAbpqRLdqLrPke5X8JUkjCfl9TAJM6zsNbnADFYjNBLvdJsjSk5qLoSrUBGaVE2g0ZWEYOgch0BpbfjvGOKEbUOCvklAFV6wo4I1DGcoxR4ZwagqjVSfuJNYlipjvDPcuwmWGxrJ3ASqz5fEaKNtSEWkwNzXBjRNAFcsfTvLUiBypjh4vgF5w7mlKGxeA8b6dMTqY5Lh79g7/TxVQwOhp015X95ziY0jIqRLJWigYxAAeOwiytWiK+071NAi8KbpicVosu5e+U3PTC2oWoirCzPC2D7xtBiO75YS24v8+IVmmKmi/OX8HHa4CDUGUGriiJAdhDyCt7JpOdWxaoLYt/OerTPOD4KV8UZGTdx5G0LAlC6ZGRvjk9QR95R3h5U0JNU284XI3IwNN4MATGBYF3yprlVG9RYttksVf+0gGexRnV7VBWGJThjE1iXFc+So7dvKlgopbTcLe3+A== X-Forefront-PRVS: 0256C18696 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0201MB0712; 23:EgdKec1vKVYdn0P64akK3Rdlnq72NsZxeTAaSPb?= =?us-ascii?Q?2Wnwvkcryno6C25OoFdcfwb16maj2rs3z9dvC7PydKfXcwf+tZ5HkEQWOdlF?= =?us-ascii?Q?2tdd1AM9peI5JmCMw2AnFuNmd9uvNnxP2p+mTen22Va03AX/8+EGEusIjzoS?= =?us-ascii?Q?G1uIp5XHqGuHf3EmpnHweCrW6Ij+5HCW5dcb76Xb+YACeUmNyzZiwSHs+SAC?= =?us-ascii?Q?ROxFjVNiQSK8GlS4G2SSwuWtCoUDHhizQI3XGkmoJg8yjA3on8PmPWVpVPNs?= =?us-ascii?Q?KTe+8+Z4FYb7Ne138VtY1yNQuFRjumGYlRrUQv/zF3rEfkv101dM5KDK/4/N?= =?us-ascii?Q?6ZcCqTLQ9WVKSB3Z8RcezVzY9URFBRfqBXwOMYE+RPx7Xf+g3XoXru4PFYzt?= =?us-ascii?Q?xzxn3HILCVDlQKNBPs1wUXz+qiCrg3fR4LZE4/ktXONBTFQFQ2SkKAOQwKtr?= =?us-ascii?Q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XU4nqCmvhAVdyiSFOIWu4XaDTndPIMGOHyH0gm6z+T9SHgY8hz/tOdd2+PHcp5gz80nfaLZw0bkqJCSEuZ7ZKMEowqCAwkFffKEPWnRVCu4P1ECiQ5r5I+HDvepcm1BwHP2uBsBrGMmzwnzxT+kLLi1schfaW5Q=; 5:nUaAiAUhy6AAwPIdLewwhNzbakfnFOxTakr1dQmK5RDSj62Pqn6BaV8RbfUoBHPrz+sEW+XT4UiTtucHvBr2qy2p9JoudLj/imhWqkoh8tOTl9DImsbRDBXHBVeSmf2UkJfary12R1FPDKho7gIAnQ==; 24:5g872w7uPG/DWLHyYcL2L8EdTN2acxFOZsBERvkzFGi6wAhrNaIcFW6ifwd7VBUTDRRvQverknZ2IDmplkmvXRU4RfCU5uSJ6uriqM//Jwc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0712; 7:8AfHAQG2LzliVCCSBGjJ3L3S0d0zVGnumZVWae1QPC745OPMNr+h6jM47OxGITNHO5QQbRavq3qtll1VyOYydAFowo9WnDY2Y28AMTX0Vc6k4w1tvi7sXMrD4pb0De/Hlitw/47LtP14qHnVOJnan51u6yijR86CW/qzby5TdRtTK6FS6H//w2/79njf5mpPaCnuh/VD/un6fqFyUBQbzDFDhmbuf1Q4TF6w/hbtjKhvbWORcJl2/tq+V5Va/Y9OFfZScX7VyEM3BYgdhMRuPTU3GMBYpr/vPt4uu/5V2dMd/SIY/+qQUtqHV4ngRiqUkLLvad1IKsxVZjROUUspGQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 19:29:47.6616 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB0712 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 From: Wendy Liang Show running independent state to indicate the remote runs and it is not started by the remoteproc driver. Signed-off-by: Wendy Liang Signed-off-by: Michal Simek --- drivers/remoteproc/remoteproc_sysfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c index 47be411..616057d 100644 --- a/drivers/remoteproc/remoteproc_sysfs.c +++ b/drivers/remoteproc/remoteproc_sysfs.c @@ -74,6 +74,7 @@ static ssize_t firmware_store(struct device *dev, [RPROC_RUNNING] = "running", [RPROC_CRASHED] = "crashed", [RPROC_DELETED] = "deleted", + [RPROC_RUNNING_INDEPENDENT] = "running_independent", [RPROC_LAST] = "invalid", }; @@ -97,14 +98,16 @@ static ssize_t state_store(struct device *dev, int ret = 0; if (sysfs_streq(buf, "start")) { - if (rproc->state == RPROC_RUNNING) + if (rproc->state == RPROC_RUNNING || + rproc->state == RPROC_RUNNING_INDEPENDENT) return -EBUSY; ret = rproc_boot(rproc); if (ret) dev_err(&rproc->dev, "Boot failed: %d\n", ret); } else if (sysfs_streq(buf, "stop")) { - if (rproc->state != RPROC_RUNNING) + if (rproc->state != RPROC_RUNNING && + rproc->state != RPROC_RUNNING_INDEPENDENT) return -EINVAL; rproc_shutdown(rproc);