Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2780886rdb; Fri, 22 Sep 2023 08:13:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkHNpa44q/feTdaq3Od/g32jXQp1Ujc2GG9e66oXuo67rqgRXysU4RBoSQPmZtTHviPuXm X-Received: by 2002:a17:902:d2cf:b0:1bc:69d0:a024 with SMTP id n15-20020a170902d2cf00b001bc69d0a024mr10477102plc.33.1695395596526; Fri, 22 Sep 2023 08:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695395596; cv=none; d=google.com; s=arc-20160816; b=itr2vxyM0gvFlvkEHIlxLejyFtAIUd5AU3qXx60OVljkrritOcaOSRGRoixr2Q3cY1 TkGfQUOunYtrmeHsV3Ka/Bk9DFTMPJ8o3Ty0B5hSF+TNjIYf+dcWNSHF7KA09bNKg5iK 6T6FCCTMEZiwTGuIU6bNVhYaoJ32VBs6TiFdki4AvGxCK+1IxBOQq2F/1py8qaFoCmpp 1ud6c4Li9zC661NyHJXvdM02lWjfYV4s5lNcwCtsQI5XYA6a1H/t+3B6QIZCS+zdFlbd XemTO/E9K5Bi0mZPJhd4jhAFSgsf9ehaP+1b7O78+q4eRI4ZE1gjzcOauzW0vXNNpAeo UEzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nT+58P7pg3a0ZDsxRAogXoFsnllg3fmEIw+IlM/VFLI=; fh=aUyuHryp/Pp4y9BMdoC/24hvQSzoZsxtHQjb3LZCCm4=; b=vpaFpjumhaxxEhCbGkBqQGz2BnJSykIFqpQFyl5HXYXatTVL+o34RRZE3YAnaMn6qa 2s+mzz2Nk8V6MT5bzACJx9Uz1BCzfluGD7wevRq3jAPTLj9BcQHzo36Zy2i9wrmz9Hat 8L8SDCE57EpvwXAKXWDBpHq9WC1SEqAAoHvm2+4v3LOVRokPRR1XL+A2P1SNJIxfIkEp f/B5dHQRtSMoqFKPBEtWXIiLH3Sv+neqllafOUQjeHfFYcyuzgawpQvD3xi9K04xM5Ce RSJB4PwoSRRDCYVYd2ixt/cktmN3vlRui5Okx3ojyZCnEkSap7e48x+oMR7a5q0IH3bV J9RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=umEVFJrG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ay6-20020a1709028b8600b001c465e1e219si3844297plb.30.2023.09.22.08.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=umEVFJrG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EB4768489E67; Fri, 22 Sep 2023 06:46:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234200AbjIVNqa (ORCPT + 99 others); Fri, 22 Sep 2023 09:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234188AbjIVNq0 (ORCPT ); Fri, 22 Sep 2023 09:46:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F44CC0; Fri, 22 Sep 2023 06:46:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 172F5C433C8; Fri, 22 Sep 2023 13:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695390377; bh=DM7Txi2MoiWZBA9K95f7zgHK56suYUEDbpXwcyC9bD8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=umEVFJrGGX/MrNunUQYkUy82x6LqEdrfsD8jygjAXXFDYOwO9AhUPrLzeJyAk2eKM EH2X9Hkf76IauDXpS2AtvTuNAjzbnmlRzsaELCQhfLhJN8MLsA0+b2XMButKL718IS jChUXG643/daHsdqciafR74kJ24ObxXfg7CRvi5dPA2o1UOuulsOvmPwK0mypO++WG clYbjTQxh0DvrGn0389fsg7fO0ljlnsctrDL9tFAY3aVwwL57w4Tj0Jn+SMjiibfx+ wqbLSshF7hKZDB1vhRbyg8SgKE+M+VPDn9HpJiLjCLgBoldFrEs5TsiShoToeN9o2r eLbMGg1RGIofA== Date: Fri, 22 Sep 2023 06:50:22 -0700 From: Bjorn Andersson To: Stephan Gerhold Cc: Bjorn Andersson , Andy Gross , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] soc: qcom: rmtfs: Support discarding guard pages Message-ID: <4dreta5y4rxzrfzeuomm42oszoohus5fg7hhsstx7kzo5kjive@6mosi67enick> References: <20230920-rmtfs-mem-guard-pages-v3-0-305b37219b78@quicinc.com> <20230920-rmtfs-mem-guard-pages-v3-2-305b37219b78@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 06:46:32 -0700 (PDT) On Fri, Sep 22, 2023 at 09:35:00AM +0200, Stephan Gerhold wrote: > eOn Thu, Sep 21, 2023 at 07:51:42PM -0700, Bjorn Andersson wrote: > > On Thu, Sep 21, 2023 at 08:04:06PM +0200, Stephan Gerhold wrote: > > > On Wed, Sep 20, 2023 at 07:37:31PM -0700, Bjorn Andersson wrote: > > > > In some configurations, the exact placement of the rmtfs shared memory > > > > region isn't so strict. The DeviceTree author can then choose to use the > > > > "size" property and rely on the OS for placement (in combination with > > > > "alloc-ranges", if desired). > > > > > > > > But on some platforms the rmtfs memory region may not be allocated > > > > adjacent to regions allocated by other clients. Add support for > > > > discarding the first and last 4k block in the region, if > > > > qcom,use-guard-pages is specified in DeviceTree. > > > > > > > > Signed-off-by: Bjorn Andersson > > > > --- > > > > drivers/soc/qcom/rmtfs_mem.c | 9 +++++++++ > > > > 1 file changed, 9 insertions(+) > > > > > > > > diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c > > > > index f83811f51175..83bba9321e72 100644 > > > > --- a/drivers/soc/qcom/rmtfs_mem.c > > > > +++ b/drivers/soc/qcom/rmtfs_mem.c > > > > @@ -200,6 +200,15 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev) > > > > rmtfs_mem->client_id = client_id; > > > > rmtfs_mem->size = rmem->size; > > > > > > > > + /* > > > > + * If requested, discard the first and last 4k block in order to ensure > > > > + * that the rmtfs region isn't adjacent to other protected regions. > > > > + */ > > > > + if (of_property_present(node, "qcom,use-guard-pages")) { > > > > > > I think of_property_read_bool() would be more fitting here. Right now > > > of_property_present() is just a wrapper around of_property_read_bool(). > > > Semantically reading a bool fits better here though. :-) > > > > > > > Are you saying that you would prefer this to be a bool, so hat you can > > give it a "false" value? Or you are simply saying "it walks like a > > boolean, quacks like a boolean, let's use the boolean accessor"? > > > > The latter. I would expect that of_property_present() is used for > properties which usually have a value, while of_property_read_bool() > is used for pure bool values which can be present or not but must not > have a value. I think a "bool" in terms of DT is simply a present or > not-present property without any value? > > For example consider > > regulator-min-microvolts = <4200000000>; > regulator-always-on; > > Then I would expect > > - of_property_present(..., "regulator-min-microvolts"), but > - of_property_read_bool(..., "regulator-always-on") > > Does that make sense? :D > Certainly, of_property_read_duck() it is. Thanks, Bjorn