public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: <linux-kernel@vger.kernel.org>
Subject: Re: pci_alloc_consistent() and/or dma_free_coherent() bug?
Date: 05 Aug 2003 22:54:15 +0200	[thread overview]
Message-ID: <m38yq725c8.fsf@defiant.pm.waw.pl> (raw)
In-Reply-To: <m3r84010xt.fsf@defiant.pm.waw.pl>

Actually it would probably be better to do something like that:

--- arch/i386/kernel/pci-dma.c.orig	2003-05-27 03:00:25.000000000 +0200
+++ arch/i386/kernel/pci-dma.c	2003-08-05 18:55:42.000000000 +0200
@@ -20,7 +20,7 @@
 	/* ignore region specifiers */
 	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
 
-	if (dev == NULL || (*dev->dma_mask < 0xffffffff))
+	if (dev == NULL || ((*dev->consistent_dma_mask & *dev->dma_mask) < 0xffffffff))
 		gfp |= GFP_DMA;
 	ret = (void *)__get_free_pages(gfp, get_order(size));
 

So we don't need to touch pci_set*dma_mask and we don't need to call them
in specific order.
-- 
Krzysztof Halasa
Network Administrator

      reply	other threads:[~2003-08-05 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 17:14 pci_alloc_consistent() and/or dma_free_coherent() bug? Krzysztof Halasa
2003-08-05 20:54 ` Krzysztof Halasa [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=m38yq725c8.fsf@defiant.pm.waw.pl \
    --to=khc@pm.waw.pl \
    --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