login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
8
Re: [RFC][PATCH] x86 calgary: add fallback dma_ops]]
view
thread
Score:
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Alexis Bruemmer <alexisb@...>
To: FUJITA Tomonori <fujita.tomonori@...>
Cc: <linux-kernel@...>, <muli@...>
Subject:
Re: [RFC][PATCH] x86 calgary: add fallback dma_ops]]
Date: Thursday, May 8, 2008 - 7:41 pm
On Fri, 2008-05-09 at 08:13 +0900, FUJITA Tomonori wrote:
quoted text
> On Thu, 08 May 2008 14:40:20 -0700 > Alexis Bruemmer <alexisb@us.ibm.com> wrote: > > > Currently the calgary code can give drivers addresses above 4GB which is > > very bad for hardware that is only 32bit DMA addressable. This patch > > "teaches" calgary to fallback to the appropriate dma_ops when it > > encounters a device/bus which is not behind the Calgary/CalIOC2. I > > believe there is a better way to do this and am open for ideas, but for > > now this certainly fixes the badness. > > I'm not sure that I correctly understand what you want. You mean that > the Calgary IOMMU code ignores device's dma_mask and gives addresses > above 4GB or the Calgary IOMMU code wrongly handles devices that are > not behind the Calgary?
The real issue is the latter-- the Calgary IOMMU code does not properly handle devices that are not behind the Calgary/CalIO2.
quoted text
> > If you refers to the former problem, other IOMMU implementations do > something like this. > > > diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c > index e28ec49..2a977bc 100644 > --- a/arch/x86/kernel/pci-calgary_64.c > +++ b/arch/x86/kernel/pci-calgary_64.c > @@ -268,21 +268,37 @@ static unsigned long iommu_range_alloc(struct device *dev, > { > unsigned long flags; > unsigned long offset; > + unsigned long limit; > unsigned long boundary_size; > + unsigned long start; > + unsigned long mask; > > boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1, > PAGE_SIZE) >> PAGE_SHIFT; > > BUG_ON(npages == 0); > > + if (dev->dma_mask) > + mask = *dev->dma_mask >> PAGE_SHIFT; > + else > + mask = 0xfffffffful >> PAGE_SHIFT; > + > + limit = tbl->it_size; > + start = tbl->it_hint; > + > + if (limit > mask) { > + limit = mask + 1; > + start = tbl->it_hint & mask; > + } > + > spin_lock_irqsave(&tbl->it_lock, flags); > > - offset = iommu_area_alloc(tbl->it_map, tbl->it_size, tbl->it_hint, > + offset = iommu_area_alloc(tbl->it_map, limit, start, > npages, 0, boundary_size, 0); > if (offset == ~0UL) { > tbl->chip_ops->tce_cache_blast(tbl); > > - offset = iommu_area_alloc(tbl->it_map, tbl->it_size, 0, > + offset = iommu_area_alloc(tbl->it_map, limit, 0, > npages, 0, boundary_size, 0); > if (offset == ~0UL) { > printk(KERN_WARNING "Calgary: IOMMU full.\n");
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC][PATCH] x86 calgary: add fallback dma_ops]]
, Alexis Bruemmer
, (Thu May 8, 5:40 pm)
Re: [RFC][PATCH] x86 calgary: add fallback dma_ops]]
, FUJITA Tomonori
, (Thu May 8, 7:13 pm)
Re: [RFC][PATCH] x86 calgary: add fallback dma_ops]]
, Alexis Bruemmer
, (Thu May 8, 7:41 pm)
Re: [RFC][PATCH] x86 calgary: add fallback dma_ops]]
, FUJITA Tomonori
, (Thu May 8, 8:23 pm)
Re: [RFC][PATCH] x86 calgary: add fallback dma_ops]]
, Muli Ben-Yehuda
, (Sun May 11, 6:08 am)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-btrfs
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-ia64
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-kvm
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
reiserfs-devel
tux3
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Nigel Cunningham
Re: [Suspend2-devel] Re: CFS and suspend2: hang in atomic copy
Bart Van Assche
Integration of SCST in the mainstream Linux kernel
Greg Kroah-Hartman
[PATCH 005/196] Chinese: add translation of SubmittingDrivers
Rafael J. Wysocki
[Bug #10821] rt25xx: lock dependency warning, association failure, and kmalloc cor...
git
:
Martin Langhoff
Re: Change set based shallow clone
Karl
[StGIT PATCH] Don't use patches/<branch>/current
Andrew Morton
Untracked working tree files
Jon Smirl
! [rejected] master -> master (non-fast forward)
openbsd-misc
:
Richard Stallman
Real men don't attack straw men
askthelist
Packets Per Second Limit?
GVG GVG
ssh_exchange_identification: Connection closed by remote host
Renaud Allard
Spamd default behaviour of accepting everything
linux-netdev
:
Simon Horman
Re: [PATCHv2 RFC 05/25] IPVS: Add internal versions of sockopt interface structs
Lennert Buytenhek
[PATCH 08/39] mv643xx_eth: nuke port status register bit defines
Jiri Bohac
PATCH: fix bridged 802.3ad bonding
Natalie Protasevich
[BUG] New Kernel Bugs
Latest forum posts
make bzImage
8 hours ago
Linux kernel
make bzImage
9 hours ago
Linux kernel
collectl: the one performance monitoring tool for all your needs
10 hours ago
Linux general
Replacing Windows XP bootloader with GRUB bootloader
14 hours ago
Linux general
Anybody know where I can find an embedded sw engineer with good experience in digital video products???
16 hours ago
Windows
Problem in Inserting a module
19 hours ago
Linux kernel
stop process from getting scheduled out
1 day ago
Linux kernel
register_security LSM
1 day ago
Linux kernel
Process activity notification
1 day ago
Linux kernel
How to make my PCIE ATA storage device running in Linux
1 day ago
Linux general
Show all forums...
Recent Tags
more tags
Colocation donated by:
Who's online
There are currently
5 users
and
883 guests
online.
Online users
strcmp
catfeeder
Jeremy
Mr_Z
kingneutron
Syndicate
speck-geostationary