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: <39e04750-a15d-37ec-6fa1-82591331702c@wanadoo.fr>
Date:   Fri, 27 Aug 2021 22:12:58 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     tomas.winkler@...el.com, arnd@...db.de,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] mei: switch from 'pci_' to 'dma_' API

Le 24/08/2021 à 15:43, Greg KH a écrit :
> On Sun, Aug 22, 2021 at 10:02:59PM +0200, Christophe JAILLET wrote:
>> The wrappers in include/linux/pci-dma-compat.h should go away.
>>
>> The patch has been generated with the coccinelle script below.
>>
>> It has been compile tested.
>>
>>
>> @@
>> @@
>> -    PCI_DMA_BIDIRECTIONAL
>> +    DMA_BIDIRECTIONAL
>>
>> @@
>> @@
>> -    PCI_DMA_TODEVICE
>> +    DMA_TO_DEVICE
>>
>> @@
>> @@
>> -    PCI_DMA_FROMDEVICE
>> +    DMA_FROM_DEVICE
>>
>> @@
>> @@
>> -    PCI_DMA_NONE
>> +    DMA_NONE
>>
>> @@
>> expression e1, e2, e3;
>> @@
>> -    pci_alloc_consistent(e1, e2, e3)
>> +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
>>
>> @@
>> expression e1, e2, e3;
>> @@
>> -    pci_zalloc_consistent(e1, e2, e3)
>> +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_free_consistent(e1, e2, e3, e4)
>> +    dma_free_coherent(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_map_single(e1, e2, e3, e4)
>> +    dma_map_single(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_unmap_single(e1, e2, e3, e4)
>> +    dma_unmap_single(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4, e5;
>> @@
>> -    pci_map_page(e1, e2, e3, e4, e5)
>> +    dma_map_page(&e1->dev, e2, e3, e4, e5)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_unmap_page(e1, e2, e3, e4)
>> +    dma_unmap_page(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_map_sg(e1, e2, e3, e4)
>> +    dma_map_sg(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_unmap_sg(e1, e2, e3, e4)
>> +    dma_unmap_sg(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
>> +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
>> +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
>> +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
>> +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2;
>> @@
>> -    pci_dma_mapping_error(e1, e2)
>> +    dma_mapping_error(&e1->dev, e2)
>>
>> @@
>> expression e1, e2;
>> @@
>> -    pci_set_dma_mask(e1, e2)
>> +    dma_set_mask(&e1->dev, e2)
>>
>> @@
>> expression e1, e2;
>> @@
>> -    pci_set_consistent_dma_mask(e1, e2)
>> +    dma_set_coherent_mask(&e1->dev, e2)
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> 
> That is a lot of different things in one changelog text, yet you really
> only did a replacement for pci_set_dma_mask here.  Please clean up the
> changelog to reflect what you did, and most importantly, _WHY_ you are
> doing it.
> 
> thanks,
> 
> greg k-h
> 

Hi,

thx for the feed-back.

I've continued my serie and just sent "[PATCH] niu: switch from 'pci_' 
to 'dma_' API" where you are also in copy.

I've tried to improve the log message in it, giving references of why 
these clean-ups are done (proposed by Christoph Hellwig) and some 
reasons of why it is a good idea (argumentation from Julia Lawall)

The long coccinelle script has been reduced to only relevant parts.

I hope that this new version is good enough.


Comments on the "niu" drivers will also be taken into account when I 
will send a v2 for patches you have commented on.

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ