public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: John Keller <jpk@sgi.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: John Keller <jpk@sgi.com>, Bernhard Walle <bwalle@suse.de>,
	"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ia64: SN specific version of dma_get_required_mask()
Date: Tue, 18 Nov 2008 15:53:04 +0000	[thread overview]
Message-ID: <200811181553.mAIFr5RT057348@fcbayern.americas.sgi.com> (raw)
In-Reply-To: <57C9024A16AD2D4C97DC78E552063EA35C454266@orsmsx505.amr.corp.intel.com> from "Luck, Tony" at Nov 18, 2008 07:35:15 AM
In-Reply-To: <20081117162454.169426.74531.sendpatchset@attica.americas.sgi.com>

> 
> > This patch addresses a problem on SN Altix systems with < 4GB, where
> > device drivers using the dma_get_required_mask() API would be told
> > to use 32 bit DMA, when 64 bit is more efficient.
> 
> Even if someone did configure an Altix with < 4GB (which seems a very
> unlikely occurance) all of that 4G would be located above 4GB (lowest
> physical address on Altix is something like 384 TB, isn't it?)
> 
> Did we really make some dma mask decisions based on the amount
> of memory rather than its location?  If we do, then perhaps we
> should fix this in a generic place, not in sn2 specific code.
> 
> -Tony
> 

This is the generic routine for all archs and platforms...

drivers/base/platform.c


#ifndef ARCH_HAS_DMA_GET_REQUIRED_MASK
u64 dma_get_required_mask(struct device *dev)
{
        u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT);
        u32 high_totalram = ((max_pfn - 1) >> (32 - PAGE_SHIFT));
        u64 mask;

        if (!high_totalram) {
                /* convert to mask just covering totalram */
                low_totalram = (1 << (fls(low_totalram) - 1));
                low_totalram += low_totalram - 1;
                mask = low_totalram;
        } else {
                high_totalram = (1 << (fls(high_totalram) - 1));
                high_totalram += high_totalram - 1;
                mask = (((u64)high_totalram) << 32) + 0xffffffff;
        }
        return mask;
}
EXPORT_SYMBOL_GPL(dma_get_required_mask);
#endif


John
----

  parent reply	other threads:[~2008-11-18 15:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 16:24 [PATCH] ia64: SN specific version of dma_get_required_mask() John Keller
2008-11-17 16:39 ` Bernhard Walle
2008-11-18 14:08 ` John Keller
2008-11-18 15:35   ` Luck, Tony
2008-11-23 13:37   ` Bernhard Walle
2008-11-18 15:53 ` John Keller [this message]
2008-11-19  4:07 ` FUJITA Tomonori
2008-11-19 16:12 ` John Keller
2008-11-20  4:49   ` FUJITA Tomonori
2008-11-20 22:57 ` John Keller
2008-11-21  5:11   ` FUJITA Tomonori
2008-11-25 20:50 ` John Keller

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=200811181553.mAIFr5RT057348@fcbayern.americas.sgi.com \
    --to=jpk@sgi.com \
    --cc=bwalle@suse.de \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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