From: Mark Einon <mark.einon@gmail.com>
To: Denis Kirjanov <kirjanov@gmail.com>
Cc: gregkh@suse.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: et131x: Match dma_alloc_ calls with dma_free_ calls
Date: Fri, 14 Oct 2011 12:24:18 +0100 [thread overview]
Message-ID: <CANK3SE1bvOwSgO2M6d==9aC9wDpAeemyam-67tLMeGHE1LjCmA@mail.gmail.com> (raw)
In-Reply-To: <CAHj3AV=vRazPzpTFFYfRKXEeWSRqFLDYSq=XyYk597870oPA=w@mail.gmail.com>
On 14 October 2011 08:49, Denis Kirjanov <kirjanov@gmail.com> wrote:
> Well, I suggest to update the whole driver in one shot rather then
> updating it partially.
>
I did look at the pci_map_* calls, and noted that they are just
wrappers for the dma_map_* equivalents, so left them.
I've since dug around a bit more on the mailing lists and found that
there is a movement towards using the dma_ versions, so I've added
converting the rest of the functions to use the dma api to my todo
list.
Thanks for the heads up.
Regards,
Mark
> On Thu, Oct 13, 2011 at 11:49 PM, Mark Einon <mark.einon@gmail.com> wrote:
>> Previous update was to replace pci_alloc with dma_alloc calls. I missed
>> replacing the corresponding pci_free_ calls with the dma versions. Now
>> done. Thanks to Denis Kirjanov <kirjanov@gmail.com> for pointing this
>> out.
>>
>> Signed-off-by: Mark Einon <mark.einon@gmail.com>
>> ---
>> drivers/staging/et131x/et131x.c | 16 ++++++++--------
>> 1 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
>> index 06ba4a9..28d54b3 100644
>> --- a/drivers/staging/et131x/et131x.c
>> +++ b/drivers/staging/et131x/et131x.c
>> @@ -2238,7 +2238,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
>> (rx_ring->fbr[0]->buffsize * FBR_CHUNKS) +
>> fbr1_align - 1;
>>
>> - pci_free_consistent(adapter->pdev,
>> + dma_free_coherent(&adapter->pdev->dev,
>> bufsize,
>> rx_ring->fbr[0]->mem_virtaddrs[index],
>> rx_ring->fbr[0]->mem_physaddrs[index]);
>> @@ -2254,7 +2254,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
>> bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[0]->num_entries)
>> + 0xfff;
>>
>> - pci_free_consistent(adapter->pdev, bufsize,
>> + dma_free_coherent(&adapter->pdev->dev, bufsize,
>> rx_ring->fbr[0]->ring_virtaddr,
>> rx_ring->fbr[0]->ring_physaddr);
>>
>> @@ -2272,7 +2272,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
>> (rx_ring->fbr[1]->buffsize *
>> (FBR_CHUNKS + 1)) - 1;
>>
>> - pci_free_consistent(adapter->pdev,
>> + dma_free_coherent(&adapter->pdev->dev,
>> bufsize,
>> rx_ring->fbr[1]->mem_virtaddrs[index],
>> rx_ring->fbr[1]->mem_physaddrs[index]);
>> @@ -2288,7 +2288,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
>> bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[1]->num_entries)
>> + 0xfff;
>>
>> - pci_free_consistent(adapter->pdev,
>> + dma_free_coherent(&adapter->pdev->dev,
>> bufsize,
>> rx_ring->fbr[1]->ring_virtaddr,
>> rx_ring->fbr[1]->ring_physaddr);
>> @@ -2303,7 +2303,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
>> sizeof(struct pkt_stat_desc) *
>> adapter->rx_ring.psr_num_entries;
>>
>> - pci_free_consistent(adapter->pdev, pktstat_ringsize,
>> + dma_free_coherent(&adapter->pdev->dev, pktstat_ringsize,
>> rx_ring->ps_ring_virtaddr,
>> rx_ring->ps_ring_physaddr);
>>
>> @@ -2312,7 +2312,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
>>
>> /* Free area of memory for the writeback of status information */
>> if (rx_ring->rx_status_block) {
>> - pci_free_consistent(adapter->pdev,
>> + dma_free_coherent(&adapter->pdev->dev,
>> sizeof(struct rx_status_block),
>> rx_ring->rx_status_block, rx_ring->rx_status_bus);
>> rx_ring->rx_status_block = NULL;
>> @@ -3038,7 +3038,7 @@ void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
>> /* Free memory relating to Tx rings here */
>> desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX)
>> + 4096 - 1;
>> - pci_free_consistent(adapter->pdev,
>> + dma_free_coherent(&adapter->pdev->dev,
>> desc_size,
>> adapter->tx_ring.tx_desc_ring,
>> adapter->tx_ring.tx_desc_ring_pa);
>> @@ -3047,7 +3047,7 @@ void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
>>
>> /* Free memory for the Tx status block */
>> if (adapter->tx_ring.tx_status) {
>> - pci_free_consistent(adapter->pdev,
>> + dma_free_coherent(&adapter->pdev->dev,
>> sizeof(u32),
>> adapter->tx_ring.tx_status,
>> adapter->tx_ring.tx_status_pa);
>> --
>> 1.7.6.4
>>
>>
>
>
>
> --
> Regards,
> Denis
>
prev parent reply other threads:[~2011-10-14 11:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 18:11 [PATCH 1/4] staging: et131x: Moving two extern inline functions to .c file Mark Einon
2011-10-13 18:11 ` [PATCH 2/4] staging: et131x: Make rx_ring.fbr{0,1} share a common structure Mark Einon
2011-10-13 18:11 ` [PATCH 3/4] staging: et131x: Fix issues when USE_FBR0 is not defined Mark Einon
2011-10-13 18:11 ` [PATCH 4/4] staging: et131x: use dma_alloc... instead of pci_alloc Mark Einon
2011-10-13 19:25 ` Denis Kirjanov
2011-10-13 19:49 ` [PATCH] staging: et131x: Match dma_alloc_ calls with dma_free_ calls Mark Einon
2011-10-14 7:49 ` Denis Kirjanov
2011-10-14 11:24 ` Mark Einon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANK3SE1bvOwSgO2M6d==9aC9wDpAeemyam-67tLMeGHE1LjCmA@mail.gmail.com' \
--to=mark.einon@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=kirjanov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®