10 years agomfd: Add WM8351 support
Mark Brown [Thu, 18 Dec 2008 22:12:28 +0000]
mfd: Add WM8351 support

The WM8351 is a WM8350 variant. As well as register default changes the
WM8351 has fewer voltage and current regulators than the WM8350.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Support configurable numbers of DCDCs and ISINKs on WM8350
Mark Brown [Thu, 18 Dec 2008 22:12:16 +0000]
mfd: Support configurable numbers of DCDCs and ISINKs on WM8350

Some WM8350 variants have fewer DCDCs and ISINKs. Identify these at
probe and refuse to use the absent DCDCs when running on these chips.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Handle missing WM8350 platform data
Mark Brown [Thu, 18 Dec 2008 22:12:08 +0000]
mfd: Handle missing WM8350 platform data

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Add WM8352 support
Mark Brown [Thu, 18 Dec 2008 22:09:50 +0000]
mfd: Add WM8352 support

The WM8352 is a variant of the WM8350. Aside from the register defaults
there are no software visible differences to the WM8350.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Use irq_to_desc in twl4030 code
Samuel Ortiz [Thu, 18 Dec 2008 10:38:02 +0000]
mfd: Use irq_to_desc in twl4030 code

The global irq_desc array is soon going to be accessible only with
!CONFIG_SPARSE_IRQ. We should start using the generic irq_to_desc()
routines instead.

Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agopower_supply: Add Dialog DA9030 battery charger driver
Mike Rapoport [Tue, 30 Dec 2008 21:44:53 +0000]
power_supply: Add Dialog DA9030 battery charger driver

Driver for battery charger integrated into Dialog Semiconductor DA9030 PMIC

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Dialog DA9030 battery charger MFD driver
Mike Rapoport [Thu, 18 Dec 2008 09:54:27 +0000]
mfd: Dialog DA9030 battery charger MFD driver

This patch amends DA903x MFD driver with definitions and methods
needed for battery charger driver.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Register WM8400 codec device
Mark Brown [Thu, 18 Dec 2008 09:54:22 +0000]
mfd: Register WM8400 codec device

Register a child device for the codec in the WM8400.

Also switch the unregistration of the MFD devices to use the MFD core
since the current code is hand rolling the same thing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Pass driver_data onto child devices
Mark Brown [Thu, 18 Dec 2008 09:54:12 +0000]
mfd: Pass driver_data onto child devices

The MFD cell structure provides a driver_data field but doesn't pass it
on to the child devices when instantiating them - do that.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Fix twl4030-core.c build error
Samuel Ortiz [Sun, 7 Dec 2008 19:50:25 +0000]
mfd: Fix twl4030-core.c build error

This is a fix for:

twl4030-core.c:(.text+0x16a797): undefined reference to `clk_get_rate'
twl4030-core.c:(.text+0x16a797): undefined reference to `clk_put'

on x86 and x86_64, as the clock API is not defined on those platforms.

Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: twl4030 regulator bug fixes
David Brownell [Sun, 7 Dec 2008 18:10:58 +0000]
mfd: twl4030 regulator bug fixes

This contains two bugfixes to the initial twl4030 regulator
support patch related to USB:

 (a) always overwrite the old list of consumers ... else
     the regulator handles all use the same "usb1v5" name;
 (b) don't set up the "usbcp" regulator, which turns out
     to be managed through separate controls, usually ULPI
     directly from the OTG controller.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: twl4030: create some regulator devices
David Brownell [Sun, 30 Nov 2008 23:43:58 +0000]
mfd: twl4030: create some regulator devices

Initial code to create twl4030 voltage regulator devices, using
the new regulator framework.  Note that this now starts to care
what name is used to declare the TWL chip:

 - TWL4030 is the "old" chip; newer ones have a bigger variety
   of VAUX2 voltages.

 - TWL5030 is the core "new" chip; TPS65950 is its catalog version.

 - The TPS65930 and TPS65920 are cost-reduced catalog versions of
   TWL5030 parts ... fewer regulators, no battery charger, etc.

Board-specific regulator configuration should be provided, listing
which regulators are used and their constraints (e.g. 1.8V only).

Code that could ("should"?) leverage the regulator stuff includes
TWL4030 USB transceiver support and MMC glue, LCD support for the
3430SDP and Labrador boards, and S-Video output.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: twl4030: cleanup symbols and OMAP dependency
David Brownell [Sun, 30 Nov 2008 23:35:33 +0000]
mfd: twl4030: cleanup symbols and OMAP dependency

Finish removing dependency of TWL driver stack on platform-specific
IRQ definitions ... and remove the build dependency on OMAP.

This lets the TWL4030 code be included in test builds for most
platforms, and will make it easier for non-OMAP folk to update
most of this code for new APIs etc.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: twl4030: simplified child creation code
David Brownell [Sun, 30 Nov 2008 23:31:04 +0000]
mfd: twl4030: simplified child creation code

Minor cleanup to twl4030-core: define a helper function to populate
a single child node, and use it to replace six inconsistent versions
of the same logic.  Both object and source code shrink.

As part of this, some devices now have more IRQ resources:  battery
charger, keypad, ADC, and USB transceiver.  That helps to remove some
irq #defines that block the children's drivers code from compiling on
non-OMAP platforms.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agopower_supply: Add battery health reporting for WM8350
Mark Brown [Sun, 30 Nov 2008 21:45:14 +0000]
power_supply: Add battery health reporting for WM8350

Implement support for reporting battery health in the WM8350 battery
interface. Since we are now able to report this via the classs remove
the diagnostics from the interrupt handler.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agopower_supply: Add cold to the POWER_SUPPLY_HEALTH report values
Mark Brown [Sun, 30 Nov 2008 21:43:21 +0000]
power_supply: Add cold to the POWER_SUPPLY_HEALTH report values

Some systems are able to report problems with batteries being under
temperature.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Refactor WM8350 chip identification
Mark Brown [Mon, 24 Nov 2008 19:22:58 +0000]
mfd: Refactor WM8350 chip identification

Since the WM8350 driver was originally written the semantics for the
identification registers of the chip have been clarified, allowing
us to do an exact match on all the fields. This avoids mistakenly
running on unsupported hardware.

Also change to using the datasheet names more consistently for
legibility and fix a printk() that should be dev_err().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Switch WM8350 revision detection to a feature based model
Mark Brown [Mon, 24 Nov 2008 19:20:30 +0000]
mfd: Switch WM8350 revision detection to a feature based model

Rather than check for chip revisions in the WM8350 drivers have the core
code set flags for relevant differences.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agopower_supply: Add support for WM8350 PMU
Mark Brown [Sun, 16 Nov 2008 19:16:47 +0000]
power_supply: Add support for WM8350 PMU

This patch adds support for the PMU provided by the WM8350 which
implements battery, line and USB supplies including a battery charger.
The hardware functions largely autonomously, with minimal software
control required to initiate fast charging.

Support for configuration of the USB supply is not yet implemented.
This means that the hardware will remain in the mode configured at
startup, by default limiting the current drawn from USB to 100mA.

This driver was originally written by Liam Girdwood with subsequent
updates for submission by Mark Brown.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: allow reading entire register banks on twl4030
David Brownell [Sat, 8 Nov 2008 00:13:16 +0000]
mfd: allow reading entire register banks on twl4030

Minor change to the TWL4030 utility interface:  support reads
of all 256 bytes in each register bank (vs just 255).  This
can help when debugging, but is otherwise a NOP.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Add AUXADC support for WM8350
Mark Brown [Sat, 8 Nov 2008 00:10:21 +0000]
mfd: Add AUXADC support for WM8350

The auxiliary ADC in the WM8350 is shared between several subdevices
so access to it needs to be arbitrated by the core driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Add WM8350 revision H support
Mark Brown [Sat, 8 Nov 2008 00:10:16 +0000]
mfd: Add WM8350 revision H support

No other software changes are required.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Add some documentation for WM8350 register lock
Mark Brown [Fri, 7 Nov 2008 23:57:33 +0000]
mfd: Add some documentation for WM8350 register lock

Hopefully this will make the purpose of these functions a bit clearer,
it's not immediately obvious that the lock is a hardware feature.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Remove i.MX31ism from WM8350 i2c driver
Mark Brown [Fri, 7 Nov 2008 23:52:54 +0000]
mfd: Remove i.MX31ism from WM8350 i2c driver

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agomfd: Don't mark WM8350 security register as volatile
Mark Brown [Fri, 24 Oct 2008 17:25:27 +0000]
mfd: Don't mark WM8350 security register as volatile

There's no need to read this back from the chip each time.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>

10 years agoMerge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 3 Jan 2009 20:04:39 +0000]
Merge branch 'cpus4096-for-linus-3' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (77 commits)
  x86: setup_per_cpu_areas() cleanup
  cpumask: fix compile error when CONFIG_NR_CPUS is not defined
  cpumask: use alloc_cpumask_var_node where appropriate
  cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
  x86: use cpumask_var_t in acpi/boot.c
  x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
  sched: put back some stack hog changes that were undone in kernel/sched.c
  x86: enable cpus display of kernel_max and offlined cpus
  ia64: cpumask fix for is_affinity_mask_valid()
  cpumask: convert RCU implementations, fix
  xtensa: define __fls
  mn10300: define __fls
  m32r: define __fls
  h8300: define __fls
  frv: define __fls
  cris: define __fls
  cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
  cpumask: zero extra bits in alloc_cpumask_var_node
  cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/
  cpumask: convert mm/
  ...

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux...
Linus Torvalds [Sat, 3 Jan 2009 20:03:52 +0000]
Merge branch 'for-linus' of git://git./linux/kernel/git/joro/linux-2.6-iommu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu: (89 commits)
  AMD IOMMU: remove now unnecessary #ifdefs
  AMD IOMMU: prealloc_protection_domains should be static
  kvm/iommu: fix compile warning
  AMD IOMMU: add statistics about total number of map requests
  AMD IOMMU: add statistics about allocated io memory
  AMD IOMMU: add stats counter for domain tlb flushes
  AMD IOMMU: add stats counter for single iommu domain tlb flushes
  AMD IOMMU: add stats counter for cross-page request
  AMD IOMMU: add stats counter for free_coherent requests
  AMD IOMMU: add stats counter for alloc_coherent requests
  AMD IOMMU: add stats counter for unmap_sg requests
  AMD IOMMU: add stats counter for map_sg requests
  AMD IOMMU: add stats counter for unmap_single requests
  AMD IOMMU: add stats counter for map_single requests
  AMD IOMMU: add stats counter for completion wait events
  AMD IOMMU: add init code for statistic collection
  AMD IOMMU: add necessary header defines for stats counting
  AMD IOMMU: add Kconfig entry for statistic collection code
  AMD IOMMU: use dev_name in iommu_enable function
  AMD IOMMU: use calc_devid in prealloc_protection_domains
  ...

10 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Sat, 3 Jan 2009 20:02:18 +0000]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
  V4L/DVB (10173): Missing v4l2_prio_close in radio_release
  V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
  V4L/DVB (10171): Use usb_set_intfdata
  V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error
  V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2
  V4L/DVB (10167): sms1xxx: add support for inverted gpio
  V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments
  V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2
  V4L/DVB (10164): Add missing S2 caps flag to S2API
  V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev
  V4L/DVB (10162): tuner-simple: Fix tuner type set message
  V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus
  V4L/DVB (10160): em28xx: update chip id for em2710
  V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme
  V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus
  V4L/DVB (10155): Add TEA5764 radio driver
  V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board
  V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources.
  V4L/DVB (10152): Change configuration of the Beholder H6 card
  V4L/DVB (10151): Fix I2C bridge error in zl10353
  ...

10 years agosparseirq: move set/get_timer_rand_state back to .c
Yinghai Lu [Sat, 3 Jan 2009 08:06:34 +0000]
sparseirq: move set/get_timer_rand_state back to .c

those two functions only used in that C file

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Sat, 3 Jan 2009 20:00:07 +0000]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc: warn about voltage mismatches
  mmc_spi: Add support for OpenFirmware bindings
  pxamci: fix dma_unmap_sg length
  mmc_block: ensure all sectors that do not have errors are read
  drivers/mmc: Move a dereference below a NULL test
  sdhci: handle built-in sdhci with modular leds class
  mmc: balanc pci_iomap with pci_iounmap
  mmc_block: print better error messages
  mmc: Add mmc_vddrange_to_ocrmask() helper function
  ricoh_mmc: Handle newer models of Ricoh controllers
  mmc: Add 8-bit bus width support
  sdhci: activate led support also when module
  mmc: trivial annotation of 'blocks'
  pci: use pci_ioremap_bar() in drivers/mmc
  sdricoh_cs: Add support for Bay Controller devices
  mmc: at91_mci: reorder timer setup and mmc_add_host() call

10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
Linus Torvalds [Sat, 3 Jan 2009 19:59:13 +0000]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] Add support for the WM8350 watchdog
  [WATCHDOG] Add SMSC SCH311x Watchdog Timer.
  [WATCHDOG] ib700wdt - add timeout parameter

10 years agoMerge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Sat, 3 Jan 2009 19:56:24 +0000]
Merge branch 'cputime' of git://git390.osdl.marist.edu/linux-2.6

* 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
  [PATCH] improve idle cputime accounting
  [PATCH] improve precision of idle time detection.
  [PATCH] improve precision of process accounting.
  [PATCH] idle cputime accounting
  [PATCH] fix scaled & unscaled cputime accounting

10 years agoMake %p print '(null)' for NULL pointers
Linus Torvalds [Sat, 3 Jan 2009 19:46:17 +0000]
Make %p print '(null)' for NULL pointers

Before, when we only ever printed out the pointer value itself, a NULL
pointer would never cause issues and might as well be printed out as
just its numeric value.

However, with the extended %p formats, especially %pR, we might validly
want to print out resources for debugging.  And sometimes they don't
even exist, and the resource pointer is just NULL.  Print it out as
such, rather than oopsing.

This is a more generic version of a patch done by Trent Piepho (catching
all %p cases rather than just %pR, and using "(null)" instead of
"[NULL]" to match glibc).

Requested-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

10 years agoget rid of special-casing the /sbin/loader on alpha
Al Viro [Sat, 3 Jan 2009 07:16:33 +0000]
get rid of special-casing the /sbin/loader on alpha

... just make it a binfmt handler like #! one.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

10 years agosanitize ifdefs in binfmt_aout
Al Viro [Sat, 3 Jan 2009 07:16:23 +0000]
sanitize ifdefs in binfmt_aout

They are actually alpha vs.  i386/arm/m68k i.e. ecoff vs. aout.

In the only place where we actually tried to handle arm and i386/m68k in
different ways (START_DATA() in coredump handling), the arm variant
works for all of them (i386 and m68k have u.start_code set to 0).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

10 years agoremove the rudiment of a.out for sparc
Al Viro [Sat, 3 Jan 2009 07:16:13 +0000]
remove the rudiment of a.out for sparc

it's been used only in sunos compat

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

10 years agoUpdated contact info for CREDITS file
Hugh Blemings [Sat, 3 Jan 2009 05:48:44 +0000]
Updated contact info for CREDITS file

This updates some personal info in the CREDITS file.

I'm no longer actively involved in Keyspan driver work so shouldn't
really be listed as a Maintainer here.

I do however field the occasional question on them and as I'm dropping
the misc.nu domain, want to ensure people can find me should they need
to.

Signed-off-by: Hugh Blemings <hugh@blemings.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

10 years agox86: setup_per_cpu_areas() cleanup
Cyrill Gorcunov [Fri, 2 Jan 2009 18:51:32 +0000]
x86: setup_per_cpu_areas() cleanup

Impact: cleanup

__alloc_bootmem and __alloc_bootmem_node do panic
for us in case of fail so no need for additional
checks here.

Also lets use pr_*() macros for printing.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agocpumask: fix compile error when CONFIG_NR_CPUS is not defined
Mike Travis [Thu, 1 Jan 2009 02:08:48 +0000]
cpumask: fix compile error when CONFIG_NR_CPUS is not defined

CONFIG_NR_CPUS will be defined for all arch's whether SMP or not, but
it may not have made it into all arches yet.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agocpumask: use alloc_cpumask_var_node where appropriate
Mike Travis [Thu, 1 Jan 2009 02:08:47 +0000]
cpumask: use alloc_cpumask_var_node where appropriate

Impact: Reduce inter-node memory traffic.

Reduces inter-node memory traffic (offloading the global system bus)
by allocating referenced struct cpumasks on the same node as the
referring struct.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agocpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
Rusty Russell [Thu, 1 Jan 2009 02:08:47 +0000]
cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t

Impact: Reduce memory usage, use new API.

This is part of an effort to reduce structure sizes for machines
configured with large NR_CPUS.  cpumask_t gets replaced by
cpumask_var_t, which is either struct cpumask[1] (small NR_CPUS) or
struct cpumask * (large NR_CPUS).

(Changes to powernow-k* by <travis>.)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agox86: use cpumask_var_t in acpi/boot.c
Rusty Russell [Thu, 1 Jan 2009 02:08:47 +0000]
x86: use cpumask_var_t in acpi/boot.c

Impact: reduce stack size, use new API.

Replace cpumask_t with cpumask_var_t.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agox86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
Mike Travis [Thu, 1 Jan 2009 02:08:46 +0000]
x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids

Impact: Reduce future system panics due to cpumask operations using NR_CPUS

Insure that code does not look at bits >= nr_cpu_ids as when cpumasks are
allocated based on nr_cpu_ids, these extra bits will not be defined.

Also some other minor updates:

   * change in to use cpu accessor function set_cpu_present() instead of
     directly accessing cpu_present_map w/cpu_clear() [arch/x86/kernel/reboot.c]

   * use cpumask_of() instead of &cpumask_of_cpu() [arch/x86/kernel/reboot.c]

   * optimize some cpu_mask_to_apicid_and functions.

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agosched: put back some stack hog changes that were undone in kernel/sched.c
Mike Travis [Thu, 1 Jan 2009 02:08:45 +0000]
sched: put back some stack hog changes that were undone in kernel/sched.c

Impact: prevents panic from stack overflow on numa-capable machines.

Some of the "removal of stack hogs" changes in kernel/sched.c by using
node_to_cpumask_ptr were undone by the early cpumask API updates, and
causes a panic due to stack overflow.  This patch undoes those changes
by using cpumask_of_node() which returns a 'const struct cpumask *'.

In addition, cpu_coregoup_map is replaced with cpu_coregroup_mask further
reducing stack usage.  (Both of these updates removed 9 FIXME's!)

Also:
   Pick up some remaining changes from the old 'cpumask_t' functions to
   the new 'struct cpumask *' functions.

   Optimize memory traffic by allocating each percpu local_cpu_mask on the
   same node as the referring cpu.

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agox86: enable cpus display of kernel_max and offlined cpus
Mike Travis [Thu, 1 Jan 2009 02:08:45 +0000]
x86: enable cpus display of kernel_max and offlined cpus

Impact: enables /sys/devices/system/cpu/{kernel_max,offline} user interface

By setting total_cpus, the drivers/base/cpu.c will display the
values of kernel_max (NR_CPUS-1) and the offlined cpu map.

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agoia64: cpumask fix for is_affinity_mask_valid()
Ingo Molnar [Sat, 3 Jan 2009 11:50:46 +0000]
ia64: cpumask fix for is_affinity_mask_valid()

Impact: build fix on ia64

ia64's default_affinity_write() still had old cpumask_t usage:

 /home/mingo/tip/kernel/irq/proc.c: In function `default_affinity_write':
 /home/mingo/tip/kernel/irq/proc.c:114: error: incompatible type for argument 1 of `is_affinity_mask_valid'
 make[3]: *** [kernel/irq/proc.o] Error 1
 make[3]: *** Waiting for unfinished jobs....

update it to cpumask_var_t.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agocpumask: convert RCU implementations, fix
Ingo Molnar [Sat, 3 Jan 2009 12:16:09 +0000]
cpumask: convert RCU implementations, fix

Impact: cleanup

This warning:

 kernel/rcuclassic.c: In function ‘rcu_start_batch’:
 kernel/rcuclassic.c:397: warning: passing argument 1 of ‘cpumask_andnot’ from incompatible pointer type

triggers because one usage site of rcp->cpumask was not converted
to to_cpumask(rcp->cpumask). There's no ill effects of this bug.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
Ingo Molnar [Sat, 3 Jan 2009 17:54:51 +0000]
Merge branch 'master' of git://git./linux/kernel/git/rusty/linux-2.6-cpumask into cpus4096-v2

10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
Mike Travis [Thu, 1 Jan 2009 01:34:16 +0000]
Merge branch 'master' of git://git./linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask

Conflicts:
arch/x86/kernel/io_apic.c
kernel/rcuclassic.c
kernel/sched.c
kernel/time/tick-sched.c

Signed-off-by: Mike Travis <travis@sgi.com>
[ mingo@elte.hu: backmerged typo fix for io_apic.c ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>

10 years agoAMD IOMMU: remove now unnecessary #ifdefs
Joerg Roedel [Sat, 3 Jan 2009 13:16:35 +0000]
AMD IOMMU: remove now unnecessary #ifdefs

The #ifdef's are no longer necessary when the iommu-api and the amd
iommu updates are merged together.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoMerge branches 'iommu/api' and 'iommu/amd' into for-linus
Joerg Roedel [Sat, 3 Jan 2009 15:43:44 +0000]
Merge branches 'iommu/api' and 'iommu/amd' into for-linus

10 years agoAMD IOMMU: prealloc_protection_domains should be static
Jaswinder Singh Rajput [Mon, 29 Dec 2008 16:15:22 +0000]
AMD IOMMU: prealloc_protection_domains should be static

Impact: cleanup, reduce kernel size a bit, avoid sparse warning

Fixes sparse warning:
arch/x86/kernel/amd_iommu.c:1299:6: warning: symbol 'prealloc_protection_domains' was not declared. Should it be static?

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agokvm/iommu: fix compile warning
Joerg Roedel [Sat, 3 Jan 2009 15:37:53 +0000]
kvm/iommu: fix compile warning

This fixes a compile warning about a variable thats maybe used
uninitialized in the function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add statistics about total number of map requests
Joerg Roedel [Fri, 12 Dec 2008 15:13:04 +0000]
AMD IOMMU: add statistics about total number of map requests

Impact: see total number of map requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add statistics about allocated io memory
Joerg Roedel [Fri, 12 Dec 2008 14:57:30 +0000]
AMD IOMMU: add statistics about allocated io memory

Impact: see amount of allocated io memory in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for domain tlb flushes
Joerg Roedel [Fri, 12 Dec 2008 14:48:28 +0000]
AMD IOMMU: add stats counter for domain tlb flushes

Impact: see number of domain tlb flushes in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for single iommu domain tlb flushes
Joerg Roedel [Fri, 12 Dec 2008 14:46:29 +0000]
AMD IOMMU: add stats counter for single iommu domain tlb flushes

Impact: see number of single iommu domain tlb flushes in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for cross-page request
Joerg Roedel [Fri, 12 Dec 2008 14:42:39 +0000]
AMD IOMMU: add stats counter for cross-page request

Impact: see number of requests for more than one page in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for free_coherent requests
Joerg Roedel [Fri, 12 Dec 2008 14:16:38 +0000]
AMD IOMMU: add stats counter for free_coherent requests

Impact: see number of free_coherent requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for alloc_coherent requests
Joerg Roedel [Fri, 12 Dec 2008 14:14:21 +0000]
AMD IOMMU: add stats counter for alloc_coherent requests

Impact: see number of alloc_coherent requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for unmap_sg requests
Joerg Roedel [Fri, 12 Dec 2008 14:12:14 +0000]
AMD IOMMU: add stats counter for unmap_sg requests

Impact: see number of unmap_sg requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for map_sg requests
Joerg Roedel [Fri, 12 Dec 2008 14:09:48 +0000]
AMD IOMMU: add stats counter for map_sg requests

Impact: see number of map_sg requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for unmap_single requests
Joerg Roedel [Fri, 12 Dec 2008 14:07:12 +0000]
AMD IOMMU: add stats counter for unmap_single requests

Impact: see number of unmap_single requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for map_single requests
Joerg Roedel [Fri, 12 Dec 2008 14:05:16 +0000]
AMD IOMMU: add stats counter for map_single requests

Impact: see number of map_single requests in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add stats counter for completion wait events
Joerg Roedel [Fri, 12 Dec 2008 13:59:58 +0000]
AMD IOMMU: add stats counter for completion wait events

Impact: see number of completion wait events in debugfs

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add init code for statistic collection
Joerg Roedel [Fri, 12 Dec 2008 12:50:21 +0000]
AMD IOMMU: add init code for statistic collection

Impact: create a new debugfs directory

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add necessary header defines for stats counting
Joerg Roedel [Fri, 12 Dec 2008 11:33:06 +0000]
AMD IOMMU: add necessary header defines for stats counting

Impact: add defines to make iommu stats collection configurable

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add Kconfig entry for statistic collection code
Joerg Roedel [Thu, 11 Dec 2008 18:00:12 +0000]
AMD IOMMU: add Kconfig entry for statistic collection code

Impact: adds new Kconfig entry

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: use dev_name in iommu_enable function
Joerg Roedel [Wed, 10 Dec 2008 19:04:18 +0000]
AMD IOMMU: use dev_name in iommu_enable function

Impact: cleanup

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: use calc_devid in prealloc_protection_domains
Joerg Roedel [Wed, 10 Dec 2008 19:01:45 +0000]
AMD IOMMU: use calc_devid in prealloc_protection_domains

Impact: cleanup

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: convert amd_iommu_isolate to bool
Joerg Roedel [Fri, 12 Dec 2008 12:53:54 +0000]
AMD IOMMU: convert amd_iommu_isolate to bool

Impact: cleanup

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: convert iommu->need_sync to bool
Joerg Roedel [Wed, 10 Dec 2008 18:58:00 +0000]
AMD IOMMU: convert iommu->need_sync to bool

Impact: use bool instead of int for iommu->need_sync

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: use dev_name instead of self-build print_devid
Joerg Roedel [Wed, 10 Dec 2008 18:43:07 +0000]
AMD IOMMU: use dev_name instead of self-build print_devid

Impact: use generic dev_name instead of own function

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: allocate a new protection for hotplugged devices
Joerg Roedel [Wed, 10 Dec 2008 18:33:26 +0000]
AMD IOMMU: allocate a new protection for hotplugged devices

Impact: also hotplug devices benefit from device isolation

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add a domain flag for default domains
Joerg Roedel [Wed, 10 Dec 2008 17:48:59 +0000]
AMD IOMMU: add a domain flag for default domains

Impact: adds a new protection domain flag

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: register functions for the IOMMU API
Joerg Roedel [Wed, 3 Dec 2008 16:00:17 +0000]
AMD IOMMU: register functions for the IOMMU API

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain address lookup function for IOMMU API
Joerg Roedel [Tue, 2 Dec 2008 19:05:50 +0000]
AMD IOMMU: add domain address lookup function for IOMMU API

Impact: add a generic function to lockup addresses in protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain unmap function for IOMMU API
Joerg Roedel [Tue, 2 Dec 2008 18:59:10 +0000]
AMD IOMMU: add domain unmap function for IOMMU API

Impact: add a generic function to unmap pages into protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain map function for IOMMU API
Joerg Roedel [Tue, 2 Dec 2008 18:48:43 +0000]
AMD IOMMU: add domain map function for IOMMU API

Impact: add a generic function to map pages into protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add device attach function for IOMMU API
Joerg Roedel [Tue, 2 Dec 2008 18:34:11 +0000]
AMD IOMMU: add device attach function for IOMMU API

Impact: add a generic function to attach devices to protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add device detach function for IOMMU API
Joerg Roedel [Mon, 8 Dec 2008 11:07:44 +0000]
AMD IOMMU: add device detach function for IOMMU API

Impact: add a generic function to detach devices from protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain destroy function for IOMMU API
Joerg Roedel [Tue, 2 Dec 2008 17:34:12 +0000]
AMD IOMMU: add domain destroy function for IOMMU API

Impact: add a generic function for releasing protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain init function for IOMMU API
Joerg Roedel [Tue, 2 Dec 2008 17:13:27 +0000]
AMD IOMMU: add domain init function for IOMMU API

Impact: add a generic function for allocation protection domains

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain cleanup helper function
Joerg Roedel [Mon, 8 Dec 2008 11:05:55 +0000]
AMD IOMMU: add domain cleanup helper function

Impact: add a function to remove all devices from a domain

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add device notifier callback
Joerg Roedel [Wed, 10 Dec 2008 17:27:25 +0000]
AMD IOMMU: add device notifier callback

Impact: inform IOMMU about state change of a device in the driver core

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add device detach helper functions
Joerg Roedel [Mon, 8 Dec 2008 11:02:41 +0000]
AMD IOMMU: add device detach helper functions

Impact: add helper functions to detach a device from a domain

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: rename set_device_domain function
Joerg Roedel [Wed, 10 Dec 2008 13:39:51 +0000]
AMD IOMMU: rename set_device_domain function

Impact: rename set_device_domain() to attach_device()

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add device reference counting for protection domains
Joerg Roedel [Tue, 2 Dec 2008 16:56:36 +0000]
AMD IOMMU: add device reference counting for protection domains

Impact: know how many devices are assigned to a domain

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add checks for dma_ops domain to dma_ops functions
Joerg Roedel [Tue, 2 Dec 2008 16:49:42 +0000]
AMD IOMMU: add checks for dma_ops domain to dma_ops functions

Impact: detect when a driver uses a device assigned otherwise

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add protection domain flags
Joerg Roedel [Tue, 2 Dec 2008 16:46:25 +0000]
AMD IOMMU: add protection domain flags

Imapct: add a new struct member to 'struct protection_domain'

When using protection domains for dma_ops and KVM its better to know for
which subsystem it was allocated. Add a flags member to struct
protection domain for that purpose.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add iommu_flush_domain function
Joerg Roedel [Tue, 2 Dec 2008 20:01:12 +0000]
AMD IOMMU: add iommu_flush_domain function

Impact: add a function to flush a domain id on every IOMMU

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: don't remove protection domain from iommu_pd_list
Joerg Roedel [Wed, 10 Dec 2008 19:05:52 +0000]
AMD IOMMU: don't remove protection domain from iommu_pd_list

Impact: save unneeded logic to add and remove domains to the list

The removal of a protection domain from the iommu_pd_list is not
necessary. Another benefit is that we save complexity because we don't
have to readd it later when the device no longer uses the domain.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: move invalidation command building to a separate function
Joerg Roedel [Tue, 2 Dec 2008 19:54:37 +0000]
AMD IOMMU: move invalidation command building to a separate function

Impact: refactoring of iommu_queue_inv_iommu_pages

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: refactor completion wait handling into separate functions
Joerg Roedel [Tue, 2 Dec 2008 19:34:41 +0000]
AMD IOMMU: refactor completion wait handling into separate functions

Impact: split one function into three

The separate functions are required synchronize commands across all
hardware IOMMUs in the system.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: add domain id free function
Joerg Roedel [Tue, 2 Dec 2008 17:28:53 +0000]
AMD IOMMU: add domain id free function

Impact: add code to release a domain id

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: make dma_ops_free_pagetable generic
Joerg Roedel [Tue, 2 Dec 2008 17:20:21 +0000]
AMD IOMMU: make dma_ops_free_pagetable generic

Impact: change code to free pagetables from protection domains

The dma_ops_free_pagetable function can only free pagetables from
dma_ops domains. Change that to free pagetables of pure protection
domains.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoAMD IOMMU: rename iommu_map to iommu_map_page
Joerg Roedel [Tue, 2 Dec 2008 16:27:52 +0000]
AMD IOMMU: rename iommu_map to iommu_map_page

Impact: function rename

The iommu_map function maps only one page. Make this clear in the
function name.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agointel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES
Mike Day [Fri, 12 Dec 2008 16:16:30 +0000]
intel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES

Signed-off-by: Mike Day <ncmike@ncultra.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoVT-d: remove now unused intel_iommu_found function
Joerg Roedel [Wed, 3 Dec 2008 14:26:42 +0000]
VT-d: remove now unused intel_iommu_found function

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

10 years agoVT-d: register functions for the IOMMU API
Joerg Roedel [Wed, 3 Dec 2008 14:14:02 +0000]
VT-d: register functions for the IOMMU API

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>