lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f8b8a39d-043a-4be0-9024-c080cf864e7b@kernel.org>
Date: Wed, 5 Feb 2025 10:07:38 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Raj Kumar Bhagat <quic_rajkbhag@...cinc.com>, ath12k@...ts.infradead.org
Cc: linux-wireless@...r.kernel.org, Kalle Valo <kvalo@...nel.org>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Jeff Johnson <jjohnson@...nel.org>,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 07/13] wifi: ath12k: add support for fixed QMI firmware
 memory

On 04/02/2025 10:06, Raj Kumar Bhagat wrote:
> On 2/3/2025 3:42 PM, Krzysztof Kozlowski wrote:
>> On 03/02/2025 10:44, Raj Kumar Bhagat wrote:
>>> On 1/30/2025 1:16 PM, Krzysztof Kozlowski wrote:
>>>> On 30/01/2025 05:35, Raj Kumar Bhagat wrote:
>>>>> @@ -2646,6 +2663,136 @@ static int ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base *ab)
>>>>>  	return ret;
>>>>>  }
>>>>>  
>>>>> +static int ath12k_qmi_assign_target_mem_chunk(struct ath12k_base *ab)
>>>>> +{
>>>>> +	struct device_node *mem_node;
>>>>> +	struct resource res, m3_res;
>>>>> +	u32 bdf_start_addr;
>>>>> +	int i, idx, ret;
>>>>> +
>>>>> +	for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) {
>>>>> +		switch (ab->qmi.target_mem[i].type) {
>>>>> +		case HOST_DDR_REGION_TYPE:
>>>>> +			mem_node = ath12k_core_get_reserved_mem_by_name(ab, "q6-region");
>>>>
>>>>
>>>> Why cannot you use existing API for reserved memory -
>>>> of_reserved_mem_lookup()?
>>>>
>>>
>>> The of_reserved_mem_lookup() requires reserved memory node to read the memory and
>>> return in the structure "struct reserved_mem".
>>>
>>> The of_reserved_mem_lookup() would be used after we get the reserved memory node
>>> using the API - ath12k_core_get_reserved_mem_by_name(ab, "q6-region");
>>>
>>> In next version we would use of_reserved_mem_lookup(), Something like below:
>>>     mem_node = ath12k_core_get_reserved_mem_by_name(ab, "q6-region");
>>
>> Then why do you need ath12k_core_get_reserved_mem_by_name() in the first
>> place? Just use of_reserved_mem_lookup() directly. Why do you need to
>> parse phandle before of_reserved_mem_lookup()?
>>
> 
> Sorry, I'm having difficulty understanding this.
> We have the WiFi node at ab->dev->of_node, but we don't have a node for the reserved-memory
> 'q6-region'. The of_reserved_mem_lookup() function requires the device node for 'q6-region'.
> 
> Could you please suggest how we can use of_reserved_mem_lookup() without obtaining the
> 'q6-region' node first.


Hm, it seems you are not using it for this device, so indeed you need to
parse phandle. You can still code it simpler -
of_property_match_string() is not necessary and
of_address_to_resource()+of_node_put()  could be in the
ath12k_core_get_reserved_mem()

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ