From patchwork Wed Aug 26 13:08:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 52722 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-io0-f198.google.com (mail-io0-f198.google.com [209.85.223.198]) by patches.linaro.org (Postfix) with ESMTPS id C531E22E9E for ; Wed, 26 Aug 2015 13:10:50 +0000 (UTC) Received: by iofe124 with SMTP id e124sf31179062iof.2 for ; Wed, 26 Aug 2015 06:10:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=dKmyagVcmFxYRHBVp298FVZ5ARep6WanIrG2/NtTn7c=; b=LqdBlFICYKkB0s+ty5OXe4asZOhh4C6PnKA2rvR3OM3c5ubowvofM6XryV9+Wuszoa KVMBHdlTZI+SaQSCfqBO7Vx7Ypo/zyOZUBDdnld3oMWBgfK8EmUtNxzkJPDStTJ+r8ov YMRUCi1Lzwv0NcwwswLiCwXz7QY/Gu6xLivfrk16/nKcuz0qir+Q1MVC7GjxKfT5YS4r qDed+/fa8BxFSIKh9aflV4ycs9j2hNOSls3KkHTggm6Fn7JJ6zItzOPkPQT2k9BVjawa gcT83vn0bzgzN05WUznV4wQWFAECKazfPWlSeF9fNzzkc6GaC/m/gNK4kgB1jsuBRREy FYmQ== X-Gm-Message-State: ALoCoQmFitN1KNvetRNAe3nXsHJkwDuu6ztlpcK1tFaQwecjePEELmfk1c8epe+CJ5DaCZag7AQV X-Received: by 10.107.132.148 with SMTP id o20mr2774123ioi.31.1440594650389; Wed, 26 Aug 2015 06:10:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.182.78.41 with SMTP id y9ls5130584obw.8.gmail; Wed, 26 Aug 2015 06:10:50 -0700 (PDT) X-Received: by 10.140.237.70 with SMTP id i67mr79332466qhc.48.1440594650265; Wed, 26 Aug 2015 06:10:50 -0700 (PDT) Received: from mail-qg0-f54.google.com (mail-qg0-f54.google.com. [209.85.192.54]) by mx.google.com with ESMTPS id 143si38477845qht.50.2015.08.26.06.10.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 06:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.54 as permitted sender) client-ip=209.85.192.54; Received: by qgeg42 with SMTP id g42so126233323qge.1 for ; Wed, 26 Aug 2015 06:10:50 -0700 (PDT) X-Received: by 10.140.237.135 with SMTP id i129mr81644102qhc.32.1440594650123; Wed, 26 Aug 2015 06:10:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.55.75.207 with SMTP id y198csp1419247qka; Wed, 26 Aug 2015 06:10:49 -0700 (PDT) X-Received: by 10.66.122.4 with SMTP id lo4mr69299648pab.1.1440594648990; Wed, 26 Aug 2015 06:10:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oy10si38464326pbb.20.2015.08.26.06.10.45; Wed, 26 Aug 2015 06:10:48 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756382AbbHZNKX (ORCPT + 28 others); Wed, 26 Aug 2015 09:10:23 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:38244 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393AbbHZNKU (ORCPT ); Wed, 26 Aug 2015 09:10:20 -0400 Received: by wicja10 with SMTP id ja10so14916587wic.1 for ; Wed, 26 Aug 2015 06:10:19 -0700 (PDT) X-Received: by 10.180.82.162 with SMTP id j2mr4119909wiy.10.1440594619021; Wed, 26 Aug 2015 06:10:19 -0700 (PDT) Received: from localhost.localdomain (host81-129-169-167.range81-129.btcentralplus.com. [81.129.169.167]) by smtp.gmail.com with ESMTPSA id o3sm3817050wjx.16.2015.08.26.06.10.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Aug 2015 06:10:18 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, ohad@wizery.com, devicetree@vger.kernel.org, Lee Jones Subject: [PATCH 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Date: Wed, 26 Aug 2015 14:08:03 +0100 Message-Id: <1440594483-29601-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440594483-29601-1-git-send-email-lee.jones@linaro.org> References: <1440594483-29601-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.54 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Lee Jones --- drivers/remoteproc/remoteproc_debugfs.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index 9d30809..9620962 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -88,8 +88,33 @@ static ssize_t rproc_state_read(struct file *filp, char __user *userbuf, return simple_read_from_buffer(userbuf, count, ppos, buf, i); } +static ssize_t rproc_state_write(struct file *filp, const char __user *userbuf, + size_t count, loff_t *ppos) +{ + struct rproc *rproc = filp->private_data; + char buf[2]; + int ret; + + ret = copy_from_user(buf, userbuf, 1); + if (ret) + return -EFAULT; + + switch (buf[0]) { + case '1': + ret = rproc_boot(rproc); + if (ret) + dev_warn(&rproc->dev, "Boot failed: %d\n", ret); + break; + default: + rproc_shutdown(rproc); + } + + return count; +} + static const struct file_operations rproc_state_ops = { .read = rproc_state_read, + .write = rproc_state_write, .open = simple_open, .llseek = generic_file_llseek, };