Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp808585rwl; Fri, 4 Nov 2022 06:41:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5XyY2k8QnchbBpspBN+wJruVlo+RnJY5tbIVmdgTkenhbPr0pfwCp5QnYkcIcLTS7FYVTW X-Received: by 2002:aa7:d858:0:b0:463:12ed:3f86 with SMTP id f24-20020aa7d858000000b0046312ed3f86mr32533347eds.281.1667569264229; Fri, 04 Nov 2022 06:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667569264; cv=none; d=google.com; s=arc-20160816; b=cCNRxr2YfAeLudB3iBDfK71iIIx+76le6iBh6bi99nzNfYD04JNyA2FRAXxatY8j3l CC4CHIorTFvN9BRkdgIzRES41QhG2ifxtihE0Qa8O+oTu4fYHslTOmfbugsRzu324hFM 0AC+tEjTLqLI07pQpCVeeZ4GsuJqVQOMoKJIFbR919sI14EmBF3wAu58syM9O/k+Xzue m0U6xzNOr3xrOk6oSUD51cHe7v5z9w0gEmlJLuIsobnjzNaedOTeqcAMk2wwLDKgExzj +Opef2D0qYDi0uqOPQVh+jYbCE+mYmzMIDHg9PDpbUmWfFe/Mvq+VztRWLgqaHIURyfa 9AZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KUzpKBKODAUP3nx3uDLLlmzJMKuXchDwyV8wVoQlXoY=; b=PHdErflXQhm1TNw6nRM7l3MFaFFGAU/jNmdz2Sbv2AcBqpylP3wsmetXLuMrp+R3rE lq1C1ZJerav9WLE2CBJeaT4/A2G4lynffLhpbytp9Hw5p6S/JL446X4fnywvbZ23pxWX GPJ+UplwBjI1/+e5bbiKuPDL/afzOI0FkXDGN4guVDvpP9xwe94D/7uQprQMg4ESpF4P PwmX+84EDvsQP/ZoNHV1JEt9ESbLLOLNaObNyqBUl7uYuW2+FHBb5V58E9Mb2XE0Mza/ amDaIOnxMcdmM6Sf8JBRDhAwqDHo04U2wXC5XYECi9wFmroPsLGyryDH/VfeAX6fAANO s1tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iOCFHVwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt3-20020a170907728300b007ada030c2e9si5649917ejc.944.2022.11.04.06.40.37; Fri, 04 Nov 2022 06:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iOCFHVwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230297AbiKDM5Q (ORCPT + 96 others); Fri, 4 Nov 2022 08:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiKDM5O (ORCPT ); Fri, 4 Nov 2022 08:57:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 140E826129; Fri, 4 Nov 2022 05:57:14 -0700 (PDT) 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 A70D462188; 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 Cc: Suman Anna , "Andrew F . Davis" , nm@ti.com, vigneshr@ti.com, srk@ti.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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);