devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Caleb Connolly <caleb.connolly@linaro.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Alex Elder <elder@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	devicetree@vger.kernel.org,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH] net: ipa: fix some resource limit max values
Date: Mon, 24 Oct 2022 14:15:46 -0500	[thread overview]
Message-ID: <bf67b30f-074b-22b5-8d23-b1531ad30d74@linaro.org> (raw)
In-Reply-To: <20221024165636.3979249-1-caleb.connolly@linaro.org>

On 10/24/22 11:56 AM, Caleb Connolly wrote:
> Some resource limits on IPA v3.1 and v3.5.1 have their max values set to
> 255, this causes a few splats in ipa_reg_encode and prevents it from booting.
> The limits are all 6 bits wide so adjust the max values to 63.

Thank you for sending this Caleb.

On IPA v3.5.1 (SDM845) I confirm that these resource limit fields are
6 bits wide, while the values we assign are in some cases 255, which
cannot be represented in 6 bits.  Your fix in this case is proper,
changing the maximum limit from 255 to be 63.  (Just in case, I've
sent a note to Qualcomm to ask them to confirm this, but I think this
is fine.)

I re-checked the definitions of the MIN_LIMIT and MAX_LIMIT fields
for IPA v3.1, and it turns out in that case the *register field*
definitions were wrong.  They should, in fact, be 8 bits wide rather
than just 6.  So in that case, 255 would be a reasonable limit value.

Did you observe these splats when doing actual testing on an msm8998
(which has IPA v3.1)?  Or did you just double-check the code?  I
looked at the other currently-supported platforms and didn't see
this sort of problem elsewhere (IPA v4.2, 4.5, 4.9, 4.11).


Could you please send a new version of your patch, which fixes the
register definition in "ipa_reg-v3.1.c" instead?

It might be best to fix the two issues in separate patches, since
they will parts pf the code with different development histories.

Thanks!

					-Alex

> Fixes: 1c418c4a929c ("net: ipa: define resource group/type IPA register fields")
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>   drivers/net/ipa/data/ipa_data-v3.1.c   | 62 +++++++++++++-------------
>   drivers/net/ipa/data/ipa_data-v3.5.1.c |  4 +-
>   2 files changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/net/ipa/data/ipa_data-v3.1.c b/drivers/net/ipa/data/ipa_data-v3.1.c
> index e0d71f609272..7ff093f982ad 100644
> --- a/drivers/net/ipa/data/ipa_data-v3.1.c
> +++ b/drivers/net/ipa/data/ipa_data-v3.1.c
> @@ -187,53 +187,53 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
>   static const struct ipa_resource ipa_resource_src[] = {
>   	[IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = {
>   		.limits[IPA_RSRC_GROUP_SRC_UL] = {
> -			.min = 3,	.max = 255,
> +			.min = 3,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DL] = {
> -			.min = 3,	.max = 255,
> +			.min = 3,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DIAG] = {
> -			.min = 1,	.max = 255,
> +			.min = 1,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DMA] = {
> -			.min = 1,	.max = 255,
> +			.min = 1,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = {
> -			.min = 2,	.max = 255,
> +			.min = 2,	.max = 63,
>   		},
>   	},
>   	[IPA_RESOURCE_TYPE_SRC_HDR_SECTORS] = {
>   		.limits[IPA_RSRC_GROUP_SRC_UL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DIAG] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DMA] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   	},
>   	[IPA_RESOURCE_TYPE_SRC_HDRI1_BUFFER] = {
>   		.limits[IPA_RSRC_GROUP_SRC_UL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DIAG] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DMA] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   	},
>   	[IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS] = {
> @@ -272,36 +272,36 @@ static const struct ipa_resource ipa_resource_src[] = {
>   	},
>   	[IPA_RESOURCE_TYPE_SRC_HDRI2_BUFFERS] = {
>   		.limits[IPA_RSRC_GROUP_SRC_UL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DIAG] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DMA] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   	},
>   	[IPA_RESOURCE_TYPE_SRC_HPS_DMARS] = {
>   		.limits[IPA_RSRC_GROUP_SRC_UL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DIAG] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_DMA] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   	},
>   	[IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES] = {
> @@ -345,22 +345,22 @@ static const struct ipa_resource ipa_resource_dst[] = {
>   	},
>   	[IPA_RESOURCE_TYPE_DST_DATA_SECTOR_LISTS] = {
>   		.limits[IPA_RSRC_GROUP_DST_UL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_DST_DL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_DST_DIAG_DPL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_DST_DMA] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_DST_Q6ZIP_GENERAL] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_DST_Q6ZIP_ENGINE] = {
> -			.min = 0,	.max = 255,
> +			.min = 0,	.max = 63,
>   		},
>   	},
>   	[IPA_RESOURCE_TYPE_DST_DPS_DMARS] = {
> diff --git a/drivers/net/ipa/data/ipa_data-v3.5.1.c b/drivers/net/ipa/data/ipa_data-v3.5.1.c
> index 383ef1890065..42f2c88a92d4 100644
> --- a/drivers/net/ipa/data/ipa_data-v3.5.1.c
> +++ b/drivers/net/ipa/data/ipa_data-v3.5.1.c
> @@ -179,10 +179,10 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
>   static const struct ipa_resource ipa_resource_src[] = {
>   	[IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = {
>   		.limits[IPA_RSRC_GROUP_SRC_LWA_DL] = {
> -			.min = 1,	.max = 255,
> +			.min = 1,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
> -			.min = 1,	.max = 255,
> +			.min = 1,	.max = 63,
>   		},
>   		.limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = {
>   			.min = 1,	.max = 63,


  reply	other threads:[~2022-10-24 21:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 16:56 [PATCH] net: ipa: fix some resource limit max values Caleb Connolly
2022-10-24 19:15 ` Alex Elder [this message]
2022-10-24 20:04   ` Caleb Connolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf67b30f-074b-22b5-8d23-b1531ad30d74@linaro.org \
    --to=elder@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=elder@kernel.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).