Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2442638rdb; Thu, 21 Sep 2023 20:53:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLerTy//bf/5SBMXKUXoUXGGxN4BZa2h+ObJ8uQ49Fe+26dExWTmB4FMkX12t0uSmIPL6f X-Received: by 2002:a05:6a00:22c9:b0:68e:4587:3da8 with SMTP id f9-20020a056a0022c900b0068e45873da8mr8151536pfj.21.1695354835378; Thu, 21 Sep 2023 20:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695354835; cv=none; d=google.com; s=arc-20160816; b=ALXV/9oJyTLjmKSlQhaLet8F1rDh0RibPBzPeDWW+cf8j9QvuDmASpAeDC3Y/1u4cO RQLKJNUWpzTJG2t9AHcfqnTo8xrvMDP2nzu9e3KSVIiZFF/yEbt0jLVL50s2giwtjDdn 7xnzsrUfgrVQrshxpWVLWAYvIi9X8ijhusQbErcg7g67IAFvZI5ocq2K21x/p1tMUIhd cSxJ/WHAGisAMcO+JwLQnly+D5iADncnS/GIadE00LHaFq3/9OkCndIDR4VZGLPj9C3U rtQvlch+otpSytq5b0ay5+4CfQr4FVveEou7mcFO+DDD+fLdWm+HqaRW1xIVBMonA1gl pSpg== 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=nn5MtchhUBw/9WVxrcBo+yJgs5Iopy47cAxnRR65x98=; fh=aUyuHryp/Pp4y9BMdoC/24hvQSzoZsxtHQjb3LZCCm4=; b=PQswG9gO0g/PjXWtcQWeAagTQsCiHe67iWM+Q3MgfH1PWIrMDxrN/CAhjXHf6l4h8Y QW19V/iLvqYBTKQzxVV/rhK6IZeJFF/6bQ5cFJL/lzfzs/miIvtmvMDzvRvurlBkcVDW YQkC7sCYfFwN7LJrCj5LFnGJWpO+Ms+PDn8U1fwaUD/Sep0RPeeNSQVmfUQKnbHT53bm 5EcFUu5Vr3+uPkRzTeIKEHuU5awmU4n3Slek+K1iBqk88Tpq/Q3Ig40V4cd22rSPFYBt 4FyL8Kts1oh4EkWt0/rpCNs9uCeV5NtdE9DRah3KC3ERfHYFjc/n6TfMlb0bT6Ujp/Kj PXVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T34bs/xh"; 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 n67-20020a632746000000b0057759a5b7ccsi3068144pgn.305.2023.09.21.20.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 20:53:55 -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="T34bs/xh"; 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 BF16584A6C7C; Thu, 21 Sep 2023 19:47:41 -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 S230166AbjIVCro (ORCPT + 99 others); Thu, 21 Sep 2023 22:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjIVCrn (ORCPT ); Thu, 21 Sep 2023 22:47:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD298192; Thu, 21 Sep 2023 19:47:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90F79C433C7; Fri, 22 Sep 2023 02:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695350857; bh=qyx3IGyXgOk1LNpPqO2sLQkmWUYXhJs8VFn1kQPNpRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T34bs/xhUYnwdBQ2FyGg2ipvtGMswOFWbV9gVEKgnvg2yNWxzQfyk+PJ48LZQ95oR qVHux3rPecDoJYnE0CTifK7dk1QozGnXBXhbOTXrrkbUlNsdKZvkvshRY2EpKAsp/n gEhkUsyQ+sBW5HCDEne3ihu5cK1ZWVhpaiVVOtEUqQvL5VVEGk40vOoHUdg14VWP8M oD0VmwSbi5oT7Qx8FSrqYLAAgB+38GWMqetevzohhY1m1AxdIKpaOoF75lGIfshBch GNgQBzrPF6xF6FLXt1EuxL6gpJDAC0ecvBLbXKoIn3Qw2aaanAsbRQir0/ZSvXZv+D M/cZu0gSZLm0g== Date: Thu, 21 Sep 2023 19:51:42 -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: 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]); Thu, 21 Sep 2023 19:47:41 -0700 (PDT) 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"? > Feel free to fix that up while applying. > > FWIW I don't really have an opinion if "qcom,use-guard-pages" is a good > way to describe this in the DT. For the implementation side feel free to > add my > Right, I don't think I commented on your suggestion to make the size of the guard page configurable. I am not aware of any current or upcoming reasons for adding such complexity, so I'd simply prefer to stick with a boolean. Should that need arise, I think this model would allow extension to express that. Regards, Bjorn > Reviewed-by: Stephan Gerhold > > Thanks, > Stephan > > > + rmtfs_mem->addr += SZ_4K; > > + rmtfs_mem->size -= 2 * SZ_4K; > > + } > > + > > device_initialize(&rmtfs_mem->dev); > > rmtfs_mem->dev.parent = &pdev->dev; > > rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups; > > > > -- > > 2.25.1 > >