Message ID | 20230531-rpm-rproc-v1-8-e0a3b6de1f14@gerhold.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2505111vqr; Mon, 5 Jun 2023 00:21:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7cLoqF/QLeqf+kZyU1OgqFV7I6yJAIMaEarV6YOfOsSIdef9LfPXaCFstLrq14w3/XsYwI X-Received: by 2002:a05:622a:a:b0:3f5:aa3:ace7 with SMTP id x10-20020a05622a000a00b003f50aa3ace7mr8605869qtw.61.1685949715659; Mon, 05 Jun 2023 00:21:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685949715; cv=pass; d=google.com; s=arc-20160816; b=EUC/gsGRiX5kIyJwCdrXN06/Sti4VHfff1YZjL0k6c6hngA/cxyBE8hET+ofTlKnh7 AWaIAGPM6y2R6wjEex+0cVSz1l6D3LWw1HETXK7u3IRXVz4qB3Wfgt8NO09xAqaygQZ3 Mx1UbFNrmmFTox9RgQ0bpdndePMiHViT5EzLEjqkqE7iXK/S/J1hcvWrfJwdXfqVvYAK oKZxW/F5oTJCA1U7MAkIGeoXEw2tCCY7AXbkMJ5RP1f4ebH7qILze5sy7VeBtjmT0AF1 RH9W1nrc2MMbqxMcDqU7s0qL/AYQSCeicaKl2rQGQDS6wPRljLCxZ2yE8FEfK71ZsJvj Kscg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=+npGgjzfjdX6BHWaITrIYD9gk4zOqfuT40I/KSZiv44=; b=v047f1xPpM1loxo6NVESO46v2M+5fOi8CvhHpVnnMwnrpG0aJRDyVnYtHKKTt91kSM 4hZXT9XrBTDksYpPdg2yjuzCoFQY0e0M5szoc4N8TVVOt3bfDMXCn9IU0eOQgJMHkE1D y+hQZRF6hvREwatUc+uxSzGeIOVF/RRSf41LNNx+zBzG5FPDB44Y+XM7VgxaKPulHyXH y0agybxLyfHYFFe8hb4ytkvVtRLyU2gR1lLCbKiXYr6YuYzIgwUnN4Pzli4Fy7rupSC5 EJ1EpvwEUB/WcMpr+arsc1KVLr2wnPkrgcqcCwCg2yQxrgATcQWGKMiKZPvNjdppWwEM v9Ww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=O6Xko2UD; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003 header.b=g8Z+6Z7M; arc=pass (i=1); 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j191-20020a638bc8000000b00535401db8d9si5166170pge.674.2023.06.05.00.21.40; Mon, 05 Jun 2023 00:21:55 -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=@gerhold.net header.s=strato-dkim-0002 header.b=O6Xko2UD; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003 header.b=g8Z+6Z7M; arc=pass (i=1); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbjFEHKp (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Mon, 5 Jun 2023 03:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231747AbjFEHKU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Jun 2023 03:10:20 -0400 Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 245F9E47; Mon, 5 Jun 2023 00:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685948955; cv=none; d=strato.com; s=strato-dkim-0002; b=D7XlZBqJodlO1/trmVZ9E0fJMP+YSpO1UHkUT5t1IQy9gi7MVHiPBN6dhB19NUy6St LbsbWO3KDW8qhjVV2jgh9ybTF4kxtKBwi2m32gmnwWKAKcYSfWUcK+uZera7oZuGPStA Ys1VXY4TS+VGm82VUI7FkKA+GQrm46Y3D7Ijyesv5Brsvsgv2Nni/vpl6jVC1oJObikp mYO2kq0E6tHWl6IPGcIRlqMQ5TOfdyu1lJL3OfCBEnC7xrMplB1de6DLYVN+WvQ8hAX2 0M0R9y2GFykcKIGYtJMbLDjv31tJuY1vFBSPBuilCh8slZyNQrqCGenAvSttb1ZXmkYa VDgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1685948955; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=+npGgjzfjdX6BHWaITrIYD9gk4zOqfuT40I/KSZiv44=; b=DknVha/VsiJFh7Pp8po0CeJ5A1xmrxy1Ahz/VS+lYPfyQ3f4SPR2X/dE9EGk8BLlyU Cc3GkM4R87UP0qQ7SR8kA+27hzjJh3zo/WBBCYfIxqD2DFievwclVBfr7MDaXWt59iPZ QOzLhpMw7J754VLKzu0+ULLzeeDuap0CHbh+inFgP5EIOLREbU9zZTKwR41Oa/5goMF+ SvKHN2VT2aRXYcBm5zxSIFnxaTTO5jhdzA/gH/QpQlNl+B/NSqU6EM8qfAef0NioKspi L2janq2WzOpmugKNlav354dWE9SPXQAI4yAG0UFMJ5VZ6q2nuZzeVGnjtXEkI2CfUWB9 xGqg== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1685948955; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=+npGgjzfjdX6BHWaITrIYD9gk4zOqfuT40I/KSZiv44=; b=O6Xko2UDLApY+us9VBR+bFjaT6Gl4a4qdBnLTZe5WdMf4naIQYdo6WJXgbNO03m8W9 cKnDavlv5i/SPg9mVsnAjFRTmUtfI2GjoBzAOic2b5VuS+TjZ2dWvpOzOTUz2vw8GdNz nSeLyQa6btqg82bsi1bigG2CUX6TZcedJRBpMhpatNGadq1CUEFSfgRcmRBdQ+2mejst W/j/LcbgTxrLCRE2eKuYGEAfkjvIKFs1pqGb5tbUuaWiJuyDaOlrGbdOFk2UES3qtaqZ fuB9zVugmC4alZFl7IYGVhzjIzH1BNOfgircLEs+xIPW0hmbAa2/Vxo0uU8o1UAIJyMV 31ww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1685948955; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=+npGgjzfjdX6BHWaITrIYD9gk4zOqfuT40I/KSZiv44=; b=g8Z+6Z7MCNOKmDPllzkNa/Z/wdZy/DYfEakkoH0VsrCUyL09TAkT8x5sYGN0f8d4Gx 4srufWDbTWRK/YG1amAw== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn9VOL5nz0=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.5.3 DYNA|AUTH) with ESMTPSA id Z82ec2z5579E8a7 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 5 Jun 2023 09:09:14 +0200 (CEST) From: Stephan Gerhold <stephan@gerhold.net> Date: Mon, 05 Jun 2023 09:08:24 +0200 Subject: [PATCH 08/14] soc: qcom: smem: Add qcom_smem_is_available() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230531-rpm-rproc-v1-8-e0a3b6de1f14@gerhold.net> References: <20230531-rpm-rproc-v1-0-e0a3b6de1f14@gerhold.net> In-Reply-To: <20230531-rpm-rproc-v1-0-e0a3b6de1f14@gerhold.net> To: Bjorn Andersson <andersson@kernel.org> Cc: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, Stephan Gerhold <stephan@gerhold.net> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767846408869328390?= X-GMAIL-MSGID: =?utf-8?q?1767846408869328390?= |
Series |
Add dedicated device tree node for RPM processor/subsystem
|
|
Commit Message
Stephan Gerhold
June 5, 2023, 7:08 a.m. UTC
Avoid having to look up a dummy item from SMEM to detect if it is
already available or if we need to defer probing.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
drivers/soc/qcom/smem.c | 9 +++++++++
include/linux/soc/qcom/smem.h | 1 +
2 files changed, 10 insertions(+)
Comments
On 5.06.2023 09:08, Stephan Gerhold wrote: > Avoid having to look up a dummy item from SMEM to detect if it is > already available or if we need to defer probing. > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > --- > drivers/soc/qcom/smem.c | 9 +++++++++ > include/linux/soc/qcom/smem.h | 1 + > 2 files changed, 10 insertions(+) > > diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c > index b0d59e815c3b..3d93a6681494 100644 > --- a/drivers/soc/qcom/smem.c > +++ b/drivers/soc/qcom/smem.c > @@ -359,6 +359,15 @@ static struct qcom_smem *__smem; > /* Timeout (ms) for the trylock of remote spinlocks */ > #define HWSPINLOCK_TIMEOUT 1000 > > +/** > + * qcom_smem_is_available() - Checks if SMEM is available > + */ Shouldn't kerneldoc explicitly say "returns x if y else z"? Modulo that: Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad > +bool qcom_smem_is_available(void) > +{ > + return !!__smem; > +} > +EXPORT_SYMBOL(qcom_smem_is_available); > + > static int qcom_smem_alloc_private(struct qcom_smem *smem, > struct smem_partition *part, > unsigned item, > diff --git a/include/linux/soc/qcom/smem.h b/include/linux/soc/qcom/smem.h > index 223db6a9c733..a36a3b9d4929 100644 > --- a/include/linux/soc/qcom/smem.h > +++ b/include/linux/soc/qcom/smem.h > @@ -4,6 +4,7 @@ > > #define QCOM_SMEM_HOST_ANY -1 > > +bool qcom_smem_is_available(void); > int qcom_smem_alloc(unsigned host, unsigned item, size_t size); > void *qcom_smem_get(unsigned host, unsigned item, size_t *size); > >
On Mon, Jun 05, 2023 at 08:53:21PM +0200, Konrad Dybcio wrote: > > > On 5.06.2023 09:08, Stephan Gerhold wrote: > > Avoid having to look up a dummy item from SMEM to detect if it is > > already available or if we need to defer probing. > > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > > --- > > drivers/soc/qcom/smem.c | 9 +++++++++ > > include/linux/soc/qcom/smem.h | 1 + > > 2 files changed, 10 insertions(+) > > > > diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c > > index b0d59e815c3b..3d93a6681494 100644 > > --- a/drivers/soc/qcom/smem.c > > +++ b/drivers/soc/qcom/smem.c > > @@ -359,6 +359,15 @@ static struct qcom_smem *__smem; > > /* Timeout (ms) for the trylock of remote spinlocks */ > > #define HWSPINLOCK_TIMEOUT 1000 > > > > +/** > > + * qcom_smem_is_available() - Checks if SMEM is available > > + */ > Shouldn't kerneldoc explicitly say "returns x if y else z"? > Seems like yes but I copy-pasted from other examples in this file and there it is always missing. I'll add something simple in v2. Thanks, Stephan
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index b0d59e815c3b..3d93a6681494 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -359,6 +359,15 @@ static struct qcom_smem *__smem; /* Timeout (ms) for the trylock of remote spinlocks */ #define HWSPINLOCK_TIMEOUT 1000 +/** + * qcom_smem_is_available() - Checks if SMEM is available + */ +bool qcom_smem_is_available(void) +{ + return !!__smem; +} +EXPORT_SYMBOL(qcom_smem_is_available); + static int qcom_smem_alloc_private(struct qcom_smem *smem, struct smem_partition *part, unsigned item, diff --git a/include/linux/soc/qcom/smem.h b/include/linux/soc/qcom/smem.h index 223db6a9c733..a36a3b9d4929 100644 --- a/include/linux/soc/qcom/smem.h +++ b/include/linux/soc/qcom/smem.h @@ -4,6 +4,7 @@ #define QCOM_SMEM_HOST_ANY -1 +bool qcom_smem_is_available(void); int qcom_smem_alloc(unsigned host, unsigned item, size_t size); void *qcom_smem_get(unsigned host, unsigned item, size_t *size);