Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH] ath11k: allow missing memory-regions
@ 2024-09-04  9:57 Caleb Connolly
  2024-09-06  7:17 ` Raj Kumar Bhagat
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Caleb Connolly @ 2024-09-04  9:57 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo
  Cc: Caleb Connolly, linux-arm-msm, ath11k, linux-wireless

On SC7280 platforms which are running with TrustZone, it is not
necessary to manually map the memory regions used by the wifi hardware.
However, ath11k will currently fail to load unless both memory regions
are specified.

This breaks wifi on the rb3gen2 which only specifies the firmware memory
region and does not use the CE region.

Adjust the order of operations in ath11k_ahb_fw_resources_init() to
check for the wifi-firmware subnode before attempting to parse the
memory regions.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
Cc: linux-arm-msm@vger.kernel.org
---
 drivers/net/wireless/ath/ath11k/ahb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 634d385fd9ad..e24f8da565db 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -999,20 +999,20 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab)
 	 */
 	if (!ab->hw_params.fixed_fw_mem)
 		return 0;
 
-	ret = ath11k_ahb_setup_msa_resources(ab);
-	if (ret) {
-		ath11k_err(ab, "failed to setup msa resources\n");
-		return ret;
-	}
-
 	node = of_get_child_by_name(host_dev->of_node, "wifi-firmware");
 	if (!node) {
 		ab_ahb->fw.use_tz = true;
 		return 0;
 	}
 
+	ret = ath11k_ahb_setup_msa_resources(ab);
+	if (ret) {
+		ath11k_err(ab, "failed to setup msa resources\n");
+		return ret;
+	}
+
 	info.fwnode = &node->fwnode;
 	info.parent = host_dev;
 	info.name = node->name;
 	info.dma_mask = DMA_BIT_MASK(32);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath11k: allow missing memory-regions
  2024-09-04  9:57 [PATCH] ath11k: allow missing memory-regions Caleb Connolly
@ 2024-09-06  7:17 ` Raj Kumar Bhagat
  2024-09-06 10:04   ` Dmitry Baryshkov
  2024-09-06 14:48 ` Jeff Johnson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Raj Kumar Bhagat @ 2024-09-06  7:17 UTC (permalink / raw)
  To: Caleb Connolly, Jeff Johnson, Kalle Valo
  Cc: linux-arm-msm, ath11k, linux-wireless

On 9/4/2024 3:27 PM, Caleb Connolly wrote:
> On SC7280 platforms which are running with TrustZone, it is not
> necessary to manually map the memory regions used by the wifi hardware.
> However, ath11k will currently fail to load unless both memory regions
> are specified.
> 
> This breaks wifi on the rb3gen2 which only specifies the firmware memory
> region and does not use the CE region.
> 
> Adjust the order of operations in ath11k_ahb_fw_resources_init() to
> check for the wifi-firmware subnode before attempting to parse the
> memory regions.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
> Cc: linux-arm-msm@vger.kernel.org
> ---
>  drivers/net/wireless/ath/ath11k/ahb.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
> index 634d385fd9ad..e24f8da565db 100644
> --- a/drivers/net/wireless/ath/ath11k/ahb.c
> +++ b/drivers/net/wireless/ath/ath11k/ahb.c
> @@ -999,20 +999,20 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab)
>  	 */
>  	if (!ab->hw_params.fixed_fw_mem)
>  		return 0;
>  
> -	ret = ath11k_ahb_setup_msa_resources(ab);
> -	if (ret) {
> -		ath11k_err(ab, "failed to setup msa resources\n");
> -		return ret;
> -	}
> -
>  	node = of_get_child_by_name(host_dev->of_node, "wifi-firmware");
>  	if (!node) {
>  		ab_ahb->fw.use_tz = true;
>  		return 0;
>  	}
>  
> +	ret = ath11k_ahb_setup_msa_resources(ab);
> +	if (ret) {
> +		ath11k_err(ab, "failed to setup msa resources\n");
> +		return ret;
> +	}
> +
>  	info.fwnode = &node->fwnode;
>  	info.parent = host_dev;
>  	info.name = node->name;
>  	info.dma_mask = DMA_BIT_MASK(32);


ath11k_ahb_setup_msa_resources(ab), will only read the device-tree and
save the memory addresses/size form device-tree to ab_ahb->fw.
These saved address, only used if "wifi-firmware" node is defined.
This the node "wifi-firmware" is not defined it is considered to be
running with TrustZone, and saved addresses are not of use.

This changes looks fine.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath11k: allow missing memory-regions
  2024-09-06  7:17 ` Raj Kumar Bhagat
@ 2024-09-06 10:04   ` Dmitry Baryshkov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2024-09-06 10:04 UTC (permalink / raw)
  To: Raj Kumar Bhagat
  Cc: Caleb Connolly, Jeff Johnson, Kalle Valo, linux-arm-msm, ath11k,
	linux-wireless

On Fri, Sep 06, 2024 at 12:47:31PM GMT, Raj Kumar Bhagat wrote:
> On 9/4/2024 3:27 PM, Caleb Connolly wrote:
> > On SC7280 platforms which are running with TrustZone, it is not
> > necessary to manually map the memory regions used by the wifi hardware.
> > However, ath11k will currently fail to load unless both memory regions
> > are specified.
> > 
> > This breaks wifi on the rb3gen2 which only specifies the firmware memory
> > region and does not use the CE region.
> > 
> > Adjust the order of operations in ath11k_ahb_fw_resources_init() to
> > check for the wifi-firmware subnode before attempting to parse the
> > memory regions.
> > 
> > Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> > ---
> > Cc: linux-arm-msm@vger.kernel.org
> > ---
> >  drivers/net/wireless/ath/ath11k/ahb.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
> > index 634d385fd9ad..e24f8da565db 100644
> > --- a/drivers/net/wireless/ath/ath11k/ahb.c
> > +++ b/drivers/net/wireless/ath/ath11k/ahb.c
> > @@ -999,20 +999,20 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab)
> >  	 */
> >  	if (!ab->hw_params.fixed_fw_mem)
> >  		return 0;
> >  
> > -	ret = ath11k_ahb_setup_msa_resources(ab);
> > -	if (ret) {
> > -		ath11k_err(ab, "failed to setup msa resources\n");
> > -		return ret;
> > -	}
> > -
> >  	node = of_get_child_by_name(host_dev->of_node, "wifi-firmware");
> >  	if (!node) {
> >  		ab_ahb->fw.use_tz = true;
> >  		return 0;
> >  	}
> >  
> > +	ret = ath11k_ahb_setup_msa_resources(ab);
> > +	if (ret) {
> > +		ath11k_err(ab, "failed to setup msa resources\n");
> > +		return ret;
> > +	}
> > +
> >  	info.fwnode = &node->fwnode;
> >  	info.parent = host_dev;
> >  	info.name = node->name;
> >  	info.dma_mask = DMA_BIT_MASK(32);
> 
> 
> ath11k_ahb_setup_msa_resources(ab), will only read the device-tree and
> save the memory addresses/size form device-tree to ab_ahb->fw.
> These saved address, only used if "wifi-firmware" node is defined.
> This the node "wifi-firmware" is not defined it is considered to be
> running with TrustZone, and saved addresses are not of use.
> 
> This changes looks fine.

If this is a 'Reviewed-by' then please state so in your message by
adding corresponding line with the tag name, your name and email.
Maintainers and patch management systems will pick it up to reflect your
contribution to the upstream process.

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath11k: allow missing memory-regions
  2024-09-04  9:57 [PATCH] ath11k: allow missing memory-regions Caleb Connolly
  2024-09-06  7:17 ` Raj Kumar Bhagat
@ 2024-09-06 14:48 ` Jeff Johnson
  2024-09-09  3:48 ` Raj Kumar Bhagat
  2024-09-28  9:17 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Jeff Johnson @ 2024-09-06 14:48 UTC (permalink / raw)
  To: Caleb Connolly, Jeff Johnson, Kalle Valo
  Cc: linux-arm-msm, ath11k, linux-wireless

On 9/4/2024 2:57 AM, Caleb Connolly wrote:
> On SC7280 platforms which are running with TrustZone, it is not
> necessary to manually map the memory regions used by the wifi hardware.
> However, ath11k will currently fail to load unless both memory regions
> are specified.
> 
> This breaks wifi on the rb3gen2 which only specifies the firmware memory
> region and does not use the CE region.
> 
> Adjust the order of operations in ath11k_ahb_fw_resources_init() to
> check for the wifi-firmware subnode before attempting to parse the
> memory regions.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath11k: allow missing memory-regions
  2024-09-04  9:57 [PATCH] ath11k: allow missing memory-regions Caleb Connolly
  2024-09-06  7:17 ` Raj Kumar Bhagat
  2024-09-06 14:48 ` Jeff Johnson
@ 2024-09-09  3:48 ` Raj Kumar Bhagat
  2024-09-28  9:17 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Raj Kumar Bhagat @ 2024-09-09  3:48 UTC (permalink / raw)
  To: Caleb Connolly, Jeff Johnson, Kalle Valo
  Cc: linux-arm-msm, ath11k, linux-wireless

On 9/4/2024 3:27 PM, Caleb Connolly wrote:
> On SC7280 platforms which are running with TrustZone, it is not
> necessary to manually map the memory regions used by the wifi hardware.
> However, ath11k will currently fail to load unless both memory regions
> are specified.
> 
> This breaks wifi on the rb3gen2 which only specifies the firmware memory
> region and does not use the CE region.
> 
> Adjust the order of operations in ath11k_ahb_fw_resources_init() to
> check for the wifi-firmware subnode before attempting to parse the
> memory regions.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

Reviewed-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath11k: allow missing memory-regions
  2024-09-04  9:57 [PATCH] ath11k: allow missing memory-regions Caleb Connolly
                   ` (2 preceding siblings ...)
  2024-09-09  3:48 ` Raj Kumar Bhagat
@ 2024-09-28  9:17 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2024-09-28  9:17 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Jeff Johnson, Caleb Connolly, linux-arm-msm, ath11k,
	linux-wireless

Caleb Connolly <caleb.connolly@linaro.org> wrote:

> On SC7280 platforms which are running with TrustZone, it is not
> necessary to manually map the memory regions used by the wifi hardware.
> However, ath11k will currently fail to load unless both memory regions
> are specified.
> 
> This breaks wifi on the rb3gen2 which only specifies the firmware memory
> region and does not use the CE region.
> 
> Adjust the order of operations in ath11k_ahb_fw_resources_init() to
> check for the wifi-firmware subnode before attempting to parse the
> memory regions.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Reviewed-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

095cb947490c wifi: ath11k: allow missing memory-regions

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240904095815.1572186-2-caleb.connolly@linaro.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
https://docs.kernel.org/process/submitting-patches.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-28  9:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04  9:57 [PATCH] ath11k: allow missing memory-regions Caleb Connolly
2024-09-06  7:17 ` Raj Kumar Bhagat
2024-09-06 10:04   ` Dmitry Baryshkov
2024-09-06 14:48 ` Jeff Johnson
2024-09-09  3:48 ` Raj Kumar Bhagat
2024-09-28  9:17 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox