[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c2b1241-6b70-0837-3f03-f72e4bbdd165@wanadoo.fr>
Date: Sun, 13 Sep 2020 12:45:16 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Leon Romanovsky <leon@...nel.org>
Cc: davem@...emloft.net, kuba@...nel.org, snelson@...sando.io,
jeffrey.t.kirsher@...el.com, mhabets@...arflare.com,
yuehaibing@...wei.com, mchehab+huawei@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] net: dl2k: switch from 'pci_' to 'dma_' API
Le 13/09/2020 à 08:55, Leon Romanovsky a écrit :
> On Sun, Sep 13, 2020 at 08:14:17AM +0200, Christophe JAILLET wrote:
> [...]
>> @@ -504,9 +510,8 @@ static int alloc_list(struct net_device *dev)
>> sizeof(struct netdev_desc));
>> /* Rubicon now supports 40 bits of addressing space. */
>> np->rx_ring[i].fraginfo =
>> - cpu_to_le64(pci_map_single(
>> - np->pdev, skb->data, np->rx_buf_sz,
>> - PCI_DMA_FROMDEVICE));
>> + cpu_to_le64(dma_map_single(&np->pdev->dev, skb->data,
>> + np->rx_buf_sz, DMA_FROM_DEVICE));
>
> I'm aware that this was before, but both pci_map_single and
> dma_map_single return an ERROR and it is wrong to set .fraginfo without
> checking result.
>
> Thanks
>
Hi,
Nice catch.
I'll try to send patches for such patterns as some follow-ups.
It can be found in several drivers.
But anyone who want to fix it faster than me is welcome ;-)
CJ
Powered by blists - more mailing lists