From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B80AFC4332F for ; Fri, 4 Nov 2022 12:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ODzsFfrcjzwpMmr3ghdsQpC8lzPtWtO1NOTRp20ldP4=; b=aU8gITQxnJletE g3uAysCzBJMwnQz5crzVn+nxoj3w61+1m07MHHOcy1Jl+ey2FIUpO4n5xQfUl98lZ+HaUkOZEuzc3 ARjd10szVvWsw/7tlhRqH6l7cr8VkQz4YwEZMpwosPVZ2anpa+FKYtQK75GNZFIJHH1rDrgThBvR+ LaevRIwihjM3hNY8eHSVCHyLoI53Irmka12PVPlfE1Q/O+Vn3W3nnOe/eh1nU1z4WPIy0kUwb9VCp fWPiwE/LEy0JNVF3yX0dnCKHIuUaVsQbT7QVmqE9ZM1ujzqLeS0VZMaj9dJ6tcZCjX1O/LV6NjlkS mZfvK++OyB2xNGQ40e0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqwG5-003Xd1-SY; Fri, 04 Nov 2022 12:57:17 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqwG2-003XcO-LN for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 12:57:15 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A4B6162187; Fri, 4 Nov 2022 12:57:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B904C433C1; Fri, 4 Nov 2022 12:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667566633; bh=KuVTIs698EEiMtO2v0TB5wgsiCGrjXYfsEWLWFVUQGM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iOCFHVwzehKg74QV6hcvqhUwTAQe1qcPUkZoRmurL8Suu/DRTD1OD23PJK40Ue3/t jLT3vofgYUSjxnZJj1G8Zq5NJdoOOdyUDNExdyDdFvwnmYMnqtRQZd00A8xYLDb10/ vITe3avFalS0HW7W2bE/idRKGp2lcsHOQ5X7u2gHYAGz9IsPMS+J1a4jlIQWClwzRI zFCN3avf3xCocrlwKTwNgRFCE+3dwXRTRdL5Ep1XVnAOgf4Wf/CBfX8/DOtnMNMSYT iSJdg9F1BEh33Xt4mWhO1cLh7BW0WihuNi5+GJu5BbB1fKy6ovBwcfCimy+3o11Yji AbNQeHSY8SIww== Message-ID: <1f1552cd-d16b-fea0-2816-9bb3a2373ff5@kernel.org> Date: Fri, 4 Nov 2022 14:57:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v7 3/5] remoteproc: pru: Make sysfs entries read-only for PRU client driven boots Content-Language: en-US To: MD Danish Anwar , Mathieu Poirier , Krzysztof Kozlowski , Rob Herring References: <20221031073801.130541-1-danishanwar@ti.com> <20221031073801.130541-4-danishanwar@ti.com> From: Roger Quadros In-Reply-To: <20221031073801.130541-4-danishanwar@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_055714_770567_1FE30172 X-CRM114-Status: GOOD ( 18.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, srk@ti.com, vigneshr@ti.com, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrew F . Davis" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 31/10/2022 09:37, MD Danish Anwar wrote: > From: Suman Anna > > The PRU remoteproc driver is not configured for 'auto-boot' by default, > and allows to be booted either by in-kernel PRU client drivers or by > userspace using the generic remoteproc sysfs interfaces. The sysfs > interfaces should not be permitted to change the remoteproc firmwares > or states when a PRU is being managed by an in-kernel client driver. > Use the newly introduced remoteproc generic 'sysfs_read_only' flag to > provide these restrictions by setting and clearing it appropriately > during the PRU acquire and release steps. > > Signed-off-by: Suman Anna > Co-developed-by: Grzegorz Jaszczyk > Signed-off-by: Grzegorz Jaszczyk > Signed-off-by: Puranjay Mohan Reviewed-by: Roger Quadros > --- > drivers/remoteproc/pru_rproc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c > index 9ba73cfc29e2..14eb27bb5f3f 100644 > --- a/drivers/remoteproc/pru_rproc.c > +++ b/drivers/remoteproc/pru_rproc.c > @@ -230,6 +230,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index, > } > > pru->client_np = np; > + rproc->sysfs_read_only = true; > > mutex_unlock(&pru->lock); > > @@ -268,6 +269,7 @@ void pru_rproc_put(struct rproc *rproc) > } > > pru->client_np = NULL; > + rproc->sysfs_read_only = false; > mutex_unlock(&pru->lock); > > rproc_put(rproc); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel