Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp400030ybz; Tue, 21 Apr 2020 11:12:04 -0700 (PDT) X-Google-Smtp-Source: APiQypLwOCabN3aE5gJpY8Z4yxRoc3+cjF14KL9P+TSBTSk3vXLgGghj8PX08mk1eQtiiljLY2nQ X-Received: by 2002:a17:906:edb5:: with SMTP id sa21mr22911450ejb.270.1587492724344; Tue, 21 Apr 2020 11:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587492724; cv=none; d=google.com; s=arc-20160816; b=QGlWvh1EGQ1DT1tpP7MR+C5yeE0q0ndYYLyMPsN0XCYaIzSaTR94sC1gcZg26Mj1iN 5n0YlQuZR+dUMvgizSmOJGwFXV3rEpybkHX+CsBjYlMBdsUTlqOrqSzhF/iDOzQuNkYB k2pbz6rp1iTDgmdpPwtOZQ7Lm4/hDx1Vgk3e/b0jI+53f/7ADIfz0RaWpov1NEfLjC8q w04bL14yi2+O/sCjAwofXpqZCpa63Sy2ofwOFTBIvysOB4iGK5HzkEtPTLO/LLL/9QyN yAzNmVl4z9I49F+vaCnML7AC8snBbWNcmuav8kbwTBzjI64DztVJHZP5/FyzTIrPfzND 5Y+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=QTZSt3g7x8XrxZ1LJxXx1Az1VtPSffKIiAQZK87VL34=; b=cHGllkwg9uWJnBHGHIh+DnM/iW/SkgTq0+9iIMReA7TcEhe8OJCp3D7xr1P/Jkt3SH C74PWYm/8+kg7wiRNltHV+AwHz3h3QWR+QkdPYEKQAtv7KyJGucf7PjwOmC5nH5U32hP 4dgGe4aOSbyBKSuMjqH/ky7i+/cPFmOzQqQtdP1VPudHIp41g30pqjBNFCXBkhMOfyRl WSoCgZtVV1rLqSvUpxWkjRW+1mlmZZNlAgV4jD0S2Q1jiLRBMfwVZRtqIh6blA5SC241 2x5mEX4uoxKkNteruK1+DvUNQ1ttztYKdNkigwZV7ytxCNOJePaVfE+Bw3j8rfh2i09D DglQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="E/uCAeVF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk10si2159562edb.3.2020.04.21.11.11.40; Tue, 21 Apr 2020 11:12:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="E/uCAeVF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729058AbgDUSKf (ORCPT + 99 others); Tue, 21 Apr 2020 14:10:35 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:18414 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbgDUSKe (ORCPT ); Tue, 21 Apr 2020 14:10:34 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1587492634; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=QTZSt3g7x8XrxZ1LJxXx1Az1VtPSffKIiAQZK87VL34=; b=E/uCAeVFlAehIutz0dEhGOkF/Dzi2EtD6VLjC4buAe7PhiCj8RouVz574mzULjdugyAVFclM Qutb7TZ0Zzr2lypW7OxGWI2/ZQkIM7CBRYh8WS+W6taF02dIKgnfFlGBpBpwfRED47pJTyvi wF/GQrGpWvjw8P57ilvYFkIAPp0= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e9f3712.7f4b6bf29ed8-smtp-out-n02; Tue, 21 Apr 2020 18:10:26 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8E690C433BA; Tue, 21 Apr 2020 18:10:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from rishabhb-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: rishabhb) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2FF91C433CB; Tue, 21 Apr 2020 18:10:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2FF91C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=rishabhb@codeaurora.org From: Rishabh Bhatnagar To: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, ohad@wizery.com, tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org, Rishabh Bhatnagar Subject: [PATCH v3 0/2] Add character device interface to remoteproc Date: Tue, 21 Apr 2020 11:10:16 -0700 Message-Id: <1587492618-15896-1-git-send-email-rishabhb@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds a character device interface to remoteproc framework. Currently there is only a sysfs interface which the userspace clients can use. If a usersapce application crashes after booting the remote processor through the sysfs interface the remote processor does not get any indication about the crash. It might still assume that the application is running. For example modem uses remotefs service to data from disk/flash memory. If the remotefs service crashes, modem still keeps on requesting data which might lead to crash on modem. Even if the service is restarted the file handles modem requested previously would become stale. Adding a character device interface makes the remote processor tightly coupled with the user space application. A crash of the application leads to a close on the file descriptors therefore shutting down the remoteproc. Changelog: v2 -> v3: - Move booting of remoteproc from open to a write call. - Add ioctl interface for future functionality extension. - Add an ioctl call to default to rproc shutdown on release. v2 -> v1: - Fixed comments from Bjorn and Matthew. Rishabh Bhatnagar (2): remoteproc: Add remoteproc character device interface remoteproc: core: Register the character device interface Documentation/userspace-api/ioctl/ioctl-number.rst | 1 + drivers/remoteproc/Kconfig | 9 ++ drivers/remoteproc/Makefile | 1 + drivers/remoteproc/remoteproc_cdev.c | 142 +++++++++++++++++++++ drivers/remoteproc/remoteproc_core.c | 10 ++ drivers/remoteproc/remoteproc_internal.h | 21 +++ include/linux/remoteproc.h | 3 + include/uapi/linux/remoteproc_cdev.h | 21 +++ 8 files changed, 208 insertions(+) create mode 100644 drivers/remoteproc/remoteproc_cdev.c create mode 100644 include/uapi/linux/remoteproc_cdev.h -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project