[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4959d0d0-c5a2-43a0-8638-39abe953ba3a@intel.com>
Date: Mon, 29 Sep 2025 16:07:35 -0700
From: "Chittim, Madhu" <madhu.chittim@...el.com>
To: Jacob Keller <jacob.e.keller@...el.com>, Alok Tiwari
<alok.a.tiwari@...cle.com>, "Singh, Krishneil K"
<krishneil.k.singh@...el.com>, "alan.brady@...el.com" <alan.brady@...el.com>,
"Lobakin, Aleksander" <aleksander.lobakin@...el.com>, "andrew+netdev@...n.ch"
<andrew+netdev@...n.ch>, "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"horms@...nel.org" <horms@...nel.org>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "intel-wired-lan@...ts.osuosl.org"
<intel-wired-lan@...ts.osuosl.org>, "Tantilov, Emil S"
<emil.s.tantilov@...el.com>, "Hay, Joshua A" <joshua.a.hay@...el.com>
Subject: Re: [Intel-wired-lan] [PATCH net] idpf: fix mismatched free function
for dma_alloc_coherent
On 9/29/2025 3:53 PM, Jacob Keller wrote:
>
>
> On 9/25/2025 11:02 AM, Alok Tiwari wrote:
>> The mailbox receive path allocates coherent DMA memory with
>> dma_alloc_coherent(), but frees it with dmam_free_coherent().
>> This is incorrect since dmam_free_coherent() is only valid for
>> buffers allocated with dmam_alloc_coherent().
>>
>> Fix the mismatch by using dma_free_coherent() instead of
>> dmam_free_coherent
>>
>> Fixes: e54232da1238 ("idpf: refactor idpf_recv_mb_msg")
>> Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
>> ---
>
> This is tagged for net, not iwl-net. The fix seems obvious to me, and
> unlikely to be covered well by validation tests, due to being an error
> cleanup flow.
>
> Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
>
> I don't have an issue with this being taken directly to net, but would
> appreciate an ACK by someone from the idpf driver team first to make
> sure we're in agreement. Alternatively, if anyone has objection and
> would prefer I pick this up for IWL net dev-queue, please let me know.
>
>
>> drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
>> index 6330d4a0ae07..c1f34381333d 100644
>> --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
>> +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
>> @@ -702,9 +702,9 @@ int idpf_recv_mb_msg(struct idpf_adapter *adapter)
>> /* If post failed clear the only buffer we supplied */
>> if (post_err) {
>> if (dma_mem)
>> - dmam_free_coherent(&adapter->pdev->dev,
>> - dma_mem->size, dma_mem->va,
>> - dma_mem->pa);
>> + dma_free_coherent(&adapter->pdev->dev,
>> + dma_mem->size, dma_mem->va,
>> + dma_mem->pa);
>> break;
>> }
>>
>
Reviewed-by: Madhu Chittim <madhu.chittim@...el.com>
Powered by blists - more mailing lists