aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2009-07-01intel-iommu: Use cmpxchg64_local() for setting PTEsDavid Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-07-01intel-iommu: Warn about unmatched unmap requestsDavid Woodhouse
This would have found the bug in i386 pci_unmap_addr() a long time ago. We shouldn't just silently return without doing anything. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-07-01intel-iommu: Kill superfluous mapping_lockDavid Woodhouse
Since we're using cmpxchg64() anyway (because that's the only way to do an atomic 64-bit store on i386), we might as well ditch the extra locking and just use cmpxchg64() to ensure that we don't add the page twice. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-07-01intel-iommu: Ensure that PTE writes are 64-bit atomic, even on i386David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-30intel-iommu: Performance improvement for dma_pte_free_pagetable()David Woodhouse
As with other functions, batch the CPU data cache flushes and don't keep recalculating PTE addresses. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-30intel-iommu: Don't free too much in dma_pte_free_pagetable()David Woodhouse
The loop condition was wrong -- we should free a PMD only if its _entire_ range is within the range we're intending to clear. The early-termination condition was right, but not the loop. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-30intel-iommu: dump mappings but don't die on pte already setDavid Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-30intel-iommu: Combine domain_pfn_mapping() and domain_sg_mapping()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-30intel-iommu: Introduce domain_sg_mapping() to speed up intel_map_sg()David Woodhouse
Instead of calling domain_pfn_mapping() repeatedly with single or small numbers of pages, just pass the sglist in. It can optimise the number of cache flushes like domain_pfn_mapping() does, and gives a huge speedup for large scatterlists. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Simplify __intel_alloc_iova()David Woodhouse
There's no need for the separate iommu_alloc_iova() function, and certainly not for it to be global. Remove the underscores while we're at it. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Performance improvement for domain_pfn_mapping()David Woodhouse
As with dma_pte_clear_range(), don't keep flushing a single PTE at a time. And also micro-optimise the setting of PTE values rather than using the helper functions to do all the masking. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Performance improvement for dma_pte_clear_range()David Woodhouse
It's a bit silly to repeatedly call domain_flush_cache() for each PTE individually, as we clear it. Instead, batch them up and flush a whole range at a time. We might as well refrain from recalculating the PTE address from scratch each time round the loop too. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Clean up iommu_domain_identity_map()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Remove last use of PHYSICAL_PAGE_MASK, for reserving PCI BARsDavid Woodhouse
This is fairly broken anyway -- it doesn't take hotplug into account. We should probably be checking page_is_ram() instead. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Make iommu_flush_iotlb_psi() take pfn as argumentDavid Woodhouse
Most of its callers are having to shift for themselves anyway, so we might as well do it in iommu_flush_iotlb_psi(). Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Change aligned_size() to aligned_nrpages()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Clean up intel_map_sg(), remove domain_page_mapping()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Use domain_pfn_mapping() in intel_iommu_map_range()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Use domain_pfn_mapping() in __intel_map_single()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Introduce domain_pfn_mapping()David Woodhouse
... and use it in the trivial cases; the other callers want individual (and bisectable) attention, since I screwed them up the first time... Make the BUG_ON() happen on too-large virtual address rather than physical address, too. That's the one we care about. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Clean up address handling in domain_page_mapping()David Woodhouse
No more masking and alignment; just use pfns. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Change addr_to_dma_pte() to pfn_to_dma_pte()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Clean up intel_iommu_unmap_range()David Woodhouse
Use unaligned address for domain->max_addr. That algorithm isn't ideal anyway -- we should probably just look at the last iova in the tree. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Make dma_pte_free_pagetable() take pfns as argumentDavid Woodhouse
With some cleanup of intel_unmap_page(), intel_unmap_sg() and vm_domain_exit() to no longer play with 64-bit addresses. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Make dma_pte_free_pagetable() use pfnsDavid Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Make dma_pte_clear_range() take pfns as argumentDavid Woodhouse
Noting that this is now an _inclusive_ range. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Make dma_pte_clear_range() use pfnsDavid Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Don't just mask out too-big physical addresses; BUG() insteadDavid Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Make dma_pte_clear_one() take pfn not addressDavid Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pte()David Woodhouse
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Change address_level_offset() to pfn_level_offset()David Woodhouse
We're shifting the inputs for now, but that'll change... Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Change dma_set_pte_addr() to dma_set_pte_pfn()David Woodhouse
Add some helpers for converting between VT-d and normal system pfns, since system pages can be larger than VT-d pages. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Clean up identity mapping code, remove CONFIG_DMAR_GFX_WADavid Woodhouse
There's no need for the GFX workaround now we have 'iommu=pt' for the cases where people really care about performance. There's no need to have a special case for just one type of device. This also speeds up the iommu=pt path and reduces memory usage by setting up the si_domain _once_ and then using it for all devices, rather than giving each device its own private page tables. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Create new iommu_domain_identity_map() functionDavid Woodhouse
We'll want to do this to a _domain_ (the si_domain) rather than a PCI device. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-29intel-iommu: Only avoid flushing device IOTLB for domain ID 0 in caching modeYu Zhao
In caching mode, domain ID 0 is reserved for non-present to present mapping flush. Device IOTLB doesn't need to be flushed in this case. Previously we were avoiding the flush for domain zero, even if the IOMMU wasn't in caching mode and domain zero wasn't special. Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-28Merge git://git.infradead.org/iommu-2.6Linus Torvalds
* git://git.infradead.org/iommu-2.6: intel-iommu: fix Identity Mapping to be arch independent
2009-06-28Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-ledsLinus Torvalds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds: leds: Futher document blink_set leds: Add options to have GPIO LEDs start on or keep their state leds: LED driver for National Semiconductor LP3944 Funlight Chip leds: pca9532 - Indent using tabs, not spaces. leds: Remove an orphan Kconfig entry leds: Further document parameters for blink_set() leds: alix-leds2 fixed for Award BIOS leds: leds-gpio - fix a section mismatch leds: add the sysfs interface into the leds-bd2802 driver for changing wave pattern and led current. leds: change the license information leds: fix led-bd2802 errors while resuming
2009-06-26Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bpLinus Torvalds
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: amd64_edac: misc small cleanups amd64_edac: fix ecc_enable_override handling amd64_edac: check only ECC bit in amd64_determine_edac_cap
2009-06-26Merge branch 'merge' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits) powerpc/rtas: Fix watchdog driver temperature read functionality powerpc/mm: Fix potential access to freed pages when using hugetlbfs powerpc/440: Fix warning early debug code powerpc/of: Fix usage of dev_set_name() in of_device_alloc() powerpc/pasemi: Use raw spinlock in SMP TB sync powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock powerpc/rtas: Turn rtas lock into a raw spinlock powerpc: Add irqtrace support for 32-bit powerpc powerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernel powerpc/BSR: add 4096 byte BSR size powerpc: Map more memory early on 601 processors powerpc/pmac: Fix DMA ops for MacIO devices powerpc/mm: Make k(un)map_atomic out of line powerpc: Fix mpic alloc warning powerpc: Fix output from show_regs powerpc/pmac: Fix issues with PowerMac "PowerSurge" SMP powerpc/amigaone: Limit ISA I/O range to 4k in the device tree powerpc/warp: Platform fix for i2c change powerpc: Have git ignore generated files from dtc compile powerpc/mpic: Fix mapping of "DCR" based MPIC variants ...
2009-06-26Merge branch 'release' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: ACPI: video: prevent NULL deref in acpi_get_pci_dev() eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go eeepc-laptop: get the right value for CMSG eeepc-laptop: makes get_acpi() returns -ENODEV eeepc-laptop: right parent device eeepc-laptop: rfkill refactoring eeepc-laptop.c: use pr_fmt and pr_<level> eeepc-laptop: Register as a pci-hotplug device
2009-06-26amd64_edac: misc small cleanupsBorislav Petkov
- cleanup debug calls - shorten function names - cleanup error exit paths Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2009-06-26amd64_edac: fix ecc_enable_override handlingBorislav Petkov
amd64_check_ecc_enabled() returns non-zero status when ECC checking/correcting is disabled and this fails further loading of the driver even when 'ecc_enable_override' boot param is used. Fix that by clearing return status in that case. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2009-06-26amd64_edac: check only ECC bit in amd64_determine_edac_capBorislav Petkov
Checking whether the machine is using ECC enabled DRAM is done through testing the DimmEccEn bit in the DRAM Cfg Low register (F2x[1,0]90). Do that instead of testing all bits from the DimmEccEn upwards. Also, remove mci->edac_cap assignment and use value returned from amd64_determine_edac_cap(). Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2009-06-26intel-iommu: fix Identity Mapping to be arch independentChris Wright
Drop the e820 scanning and use existing function for finding valid RAM regions to add to 1:1 mapping. Signed-off-by: Chris Wright <chrisw@redhat.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-26powerpc/rtas: Fix watchdog driver temperature read functionalityAdrian Reber
Using the RTAS watchdog driver to read out the temperature crashes on a PXCAB: Unable to handle kernel paging request for data at address 0xfe347b50 Faulting instruction address: 0xc00000000001af64 Oops: Kernel access of bad area, sig: 11 [#1] The wrong usage of "(void *)__pa(&temperature)" in rtas_call() is removed by using the function rtas_get_sensor() which does the right thing. Signed-off-by: Adrian Reber <adrian@lisas.de> Acked-by: Utz Bacher <utz.bacher@de.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-06-26powerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernelSonny Rao
On Mon, Nov 17, 2008 at 01:26:13AM -0600, Sonny Rao wrote: > On Fri, Nov 07, 2008 at 04:28:29PM +1100, Paul Mackerras wrote: > > Sonny Rao writes: > > > > > Fix the BSR driver to allow small BSR devices, which are limited to a > > > single 4k space, on a 64k page kernel. Previously the driver would > > > reject the mmap since the size was smaller than PAGESIZE (or because > > > the size was greater than the size of the device). Now, we check for > > > this case use remap_4k_pfn(). Also, take out code to set vm_flags, > > > as the remap_pfn functions will do this for us. > > > > Thanks. > > > > Do we know that the BSR size will always be 4k if it's not a multiple > > of 64k? Is it possible that we could get 8k, 16k or 32k or BSRs? > > If it is possible, what does the user need to be able to do? Do they > > just want to map 4k, or might then want to map the whole thing? > > > Hi Paul, I took a look at changing the driver to reject a request for > mapping more than a single 4k page, however the only indication we get > of the requested size in the mmap function is the vma size, and this > is always one page at minimum. So, it's not possible to determine if > the user wants one 4k page or more. As I noted in my first response, > there is only one case where this is even possible and I don't think > it is a significant concern. > > I did notice that I left out the check to see if the user is trying to > map more than the device length, so I fixed that. Here's the revised > patch. Alright, I've reworked this now so that if we get one of these cases where there's a bsr that's > 4k and < 64k on a 64k kernel we'll only advertise that it is a 4k BSR to userspace. I think this is the best solution since user programs are only supposed to look at sysfs to determine how much can be mapped, and libbsr does this as well. Please consider for 2.6.31 as a fix, thanks. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-06-26powerpc/BSR: add 4096 byte BSR sizeSonny Rao
Add a 4096 byte BSR size which will be used on new machines. Also, remove the warning when we run into an unknown size, as this can spam the kernel log excessively. Signed-off-by: Sonny Rao <sonnyrao@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-06-26powerpc/pmac: Fix DMA ops for MacIO devicesBenjamin Herrenschmidt
The macio_dev's created to map devices inside the MacIO ASICs don't have proper dma_ops. This causes crashes on some machines since the SCSI code calls dma_map_* on our behalf using the device we hang from. This fixes it by copying the parent PCI device dma_ops into the macio_dev when creating it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-06-26ACPI: video: prevent NULL deref in acpi_get_pci_dev()Troy Moure
ref: http://thread.gmane.org/gmane.linux.kernel/857228/focus=857468 When the ACPI video driver initializes, it does a namespace walk looking for for supported devices. When we find an appropriate handle, we walk up the ACPI tree looking for a PCI root bus, and then walk back down the PCI bus, assuming that every device inbetween is a P2P bridge. This assumption is not correct, and is reported broken on at least: Dell Latitude E6400 ThinkPad X61 Dell XPS M1330 Add a NULL deref check to prevent boot panics. Reported-by: Alessandro Suardi <alessandro.suardi@gmail.com> Signed-off-by: Troy Moure <twmoure@szypr.net> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2009-06-26eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 GoCorentin Chary
Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>