pandora-kernel.git
16 years agox86: multi pci root bus with different io resource range, on 64-bit
Yinghai Lu [Tue, 19 Feb 2008 11:21:20 +0000 (03:21 -0800)]
x86: multi pci root bus with different io resource range, on 64-bit

scan AMD opteron io/mmio routing to make sure every pci root bus get correct
resource range. Thus later pci scan could assign correct resource to device
with unassigned resource.

this can fix a system without _CRS for multi pci root bus.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: use bus conf in NB conf fun1 to get bus range on, on 64-bit
Yinghai Lu [Tue, 19 Feb 2008 11:15:08 +0000 (03:15 -0800)]
x86: use bus conf in NB conf fun1 to get bus range on, on 64-bit

... so we use the same code with Quad core cpu as old opteron.

This patch is useful when acpi=off or _PXM is not there in DSDT.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: get mp_bus_to_node early
Yinghai Lu [Tue, 19 Feb 2008 11:20:09 +0000 (03:20 -0800)]
x86: get mp_bus_to_node early

Currently, on an amd k8 system with multi ht chains, the numa_node of
pci devices under /sys/devices/pci0000:80/* is always 0, even if that
chain is on node 1 or 2 or 3.

Workaround: pcibus_to_node(bus) is used when we want to get the node that
pci_device is on.

In struct device, we already have numa_node member, and we could use
dev_to_node()/set_dev_node() to get and set numa_node in the device.
set_dev_node is called in pci_device_add() with pcibus_to_node(bus),
and pcibus_to_node uses bus->sysdata for nodeid.

The problem is when pci_add_device is called, bus->sysdata is not assigned
correct nodeid yet. The result is that numa_node will always be 0.

pcibios_scan_root and pci_scan_root could take sysdata. So we need to get
mp_bus_to_node mapping before these two are called, and thus
get_mp_bus_to_node could get correct node for sysdata in root bus.

In scanning of the root bus, all child busses will take parent bus sysdata.
So all pci_device->dev.numa_node will be assigned correctly and automatically.

Later we could use dev_to_node(&pci_dev->dev) to get numa_node, and we
could also could make other bus specific device get the correct numa_node
too.

This is an updated version of pci_sysdata and Jeff's pci_domain patch.

[ mingo@elte.hu: build fix ]

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86 pci: remove checking type for mmconfig probe
Yinghai Lu [Fri, 29 Feb 2008 07:56:50 +0000 (23:56 -0800)]
x86 pci: remove checking type for mmconfig probe

doesn't need to check if it is type1 or type2, we can use raw_pci_ops
directly.

also make pci_direct_conf1 static again.

anyway is there system with type 2 and mmconf support?

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove unneeded check in mmconf reject
Yinghai Lu [Thu, 21 Feb 2008 06:21:57 +0000 (22:21 -0800)]
x86: remove unneeded check in mmconf reject

mmconfig is only used to access extended configuration space.

so don't need to reject MFG that only have one entry and only handle bus0.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agodriver core: try parent numa_node at first before using default
Yinghai Lu [Tue, 19 Feb 2008 11:20:41 +0000 (03:20 -0800)]
driver core: try parent numa_node at first before using default

in the device_add, we try to use use parent numa_node.
need to make sure pci root bus's bridge device numa_node is set.
then we could use device->numa_node direclty for all device.
and don't need to call pcibus_to_node().

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: seperate mmconf for fam10h out from setup_64.c
Yinghai Lu [Tue, 26 Feb 2008 19:04:17 +0000 (11:04 -0800)]
x86: seperate mmconf for fam10h out from setup_64.c

Separate mmconf for fam10h out from setup_64.c

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: if acpi=off, force setting the mmconf for fam10h
Yinghai Lu [Tue, 26 Feb 2008 02:41:35 +0000 (18:41 -0800)]
x86: if acpi=off, force setting the mmconf for fam10h

some BIOS only let AMD fam 10h handle bus0, and nvidia mcp55/ck804
to handle other buses. at that case MCFG will cover all over them.

but with acpi=off, we can not use MCFG. this patch will double check
the busnbits, and if it is less handling 256 bues, and acpi=off
will forcely reset the mmconf in msr, so we still use mmconf in above case.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86_64: check MSR to get MMCONFIG for AMD Family 10h
Yinghai Lu [Tue, 19 Feb 2008 11:13:02 +0000 (03:13 -0800)]
x86_64: check MSR to get MMCONFIG for AMD Family 10h

so even booting kernel with acpi=off or even MCFG is not there, we still can
use MMCONFIG.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Greg KH <greg@kroah.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86_64: check and enable MMCONFIG for AMD Family 10h
Yinghai Lu [Tue, 19 Feb 2008 11:13:43 +0000 (03:13 -0800)]
x86_64: check and enable MMCONFIG for AMD Family 10h

So we can use MMCONF when MMCONF is not set by BIOS

using TOP_MEM2 msr to get memory top, and try to scan fam10h mmio routing to
make sure the range is not conflicted with some prefetch MMIO that is above 4G.
(current only LinuxBIOS assign 64 bit mmio above 4G for some co-processor)

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86_64: set cfg_size for AMD Family 10h in case MMCONFIG
Yinghai Lu [Fri, 15 Feb 2008 09:32:50 +0000 (01:32 -0800)]
x86_64: set cfg_size for AMD Family 10h in case MMCONFIG

reuse pci_cfg_space_size but skip check pci express and pci-x CAP ID.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: mmconf enable mcfg early
Yinghai Lu [Fri, 15 Feb 2008 09:30:14 +0000 (01:30 -0800)]
x86: mmconf enable mcfg early

Patch
"x86: validate against ACPI motherboard resources"

changed the mmconf init sequence, and init MMCONF late in acpi_init.

here change it back to old sequence:

 1. check hostbridge in early
 2. check MCFG with e820 in early
 3. if all fail, will check MCFg with acpi _CRS in acpi_init

So we can make MCONF working again when acpi=off is set if hostbridge
support that.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <greg@kroah.com>
Cc: Greg KH <greg@kroah.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: clear pci_mmcfg_virt when mmcfg get rejected
Yinghai Lu [Fri, 15 Feb 2008 09:28:41 +0000 (01:28 -0800)]
x86: clear pci_mmcfg_virt when mmcfg get rejected

For x86_64, need to free pci_mmcfg_virt, and iounmap some pointers
when MMCONF is not reserved in E820 or acpi _CRS and get rejected.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <greg@kroah.com>
Cc: Greg KH <greg@kroah.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: validate against acpi motherboard resources
Robert Hancock [Fri, 15 Feb 2008 09:27:20 +0000 (01:27 -0800)]
x86: validate against acpi motherboard resources

This path adds validation of the MMCONFIG table against the ACPI reserved
motherboard resources.  If the MMCONFIG table is found to be reserved in
ACPI, we don't bother checking the E820 table.  The PCI Express firmware
spec apparently tells BIOS developers that reservation in ACPI is required
and E820 reservation is optional, so checking against ACPI first makes
sense.  Many BIOSes don't reserve the MMCONFIG region in E820 even though
it is perfectly functional, the existing check needlessly disables MMCONFIG
in these cases.

In order to do this, MMCONFIG setup has been split into two phases.  If PCI
configuration type 1 is not available then MMCONFIG is enabled early as
before.  Otherwise, it is enabled later after the ACPI interpreter is
enabled, since we need to be able to execute control methods in order to
check the ACPI reserved resources.  Presently this is just triggered off
the end of ACPI interpreter initialization.

There are a few other behavioral changes here:

- Validate all MMCONFIG configurations provided, not just the first one.

- Validate the entire required length of each configuration according to
  the provided ending bus number is reserved, not just the minimum required
  allocation.

- Validate that the area is reserved even if we read it from the chipset
  directly and not from the MCFG table.  This catches the case where the
  BIOS didn't set the location properly in the chipset and has mapped it
  over other things it shouldn't have.

This also cleans up the MMCONFIG initialization functions so that they
simply do nothing if MMCONFIG is not compiled in.

Based on an original patch by Rajesh Shah from Intel.

[akpm@linux-foundation.org: many fixes and cleanups]
Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Andi Kleen <ak@suse.de>
Cc: Rajesh Shah <rajesh.shah@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <ak@suse.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 26 Apr 2008 21:04:32 +0000 (14:04 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-x86-bigbox-bootmem-v3

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-bigbox-bootmem-v3:
  x86_64/mm: check and print vmemmap allocation continuous
  x86_64: fix setup_node_bootmem to support big mem excluding with memmap
  x86_64: make reserve_bootmem_generic() use new reserve_bootmem()
  mm: allow reserve_bootmem() cross nodes
  mm: offset align in alloc_bootmem()
  mm: fix alloc_bootmem_core to use fast searching for all nodes
  mm: make mem_map allocation continuous

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Linus Torvalds [Sat, 26 Apr 2008 21:03:54 +0000 (14:03 -0700)]
Merge git://git./linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: scripts/Makefile.modpost typo fix
  kbuild: soften MODULE_LICENSE check

16 years agox86_64/mm: check and print vmemmap allocation continuous
Yinghai Lu [Sat, 12 Apr 2008 08:19:24 +0000 (01:19 -0700)]
x86_64/mm: check and print vmemmap allocation continuous

On big systems with lots of memory, don't print out too much during
bootup, and make it easy to find if it is continuous.

on 256G 8 sockets system will get
 [ffffe20000000000-ffffe20002bfffff] PMD -> [ffff810001400000-ffff810003ffffff] on node 0
[ffffe2001c700000-ffffe2001c7fffff] potential offnode page_structs
 [ffffe20002c00000-ffffe2001c7fffff] PMD -> [ffff81000c000000-ffff8100255fffff] on node 0
[ffffe20038700000-ffffe200387fffff] potential offnode page_structs
 [ffffe2001c800000-ffffe200387fffff] PMD -> [ffff810820200000-ffff81083c1fffff] on node 1
 [ffffe20040000000-ffffe2007fffffff] PUD ->ffff811027a00000 on node 2
 [ffffe20038800000-ffffe2003fffffff] PMD -> [ffff811020200000-ffff8110279fffff] on node 2
[ffffe20054700000-ffffe200547fffff] potential offnode page_structs
 [ffffe20040000000-ffffe200547fffff] PMD -> [ffff811027c00000-ffff81103c3fffff] on node 2
[ffffe20070700000-ffffe200707fffff] potential offnode page_structs
 [ffffe20054800000-ffffe200707fffff] PMD -> [ffff811820200000-ffff81183c1fffff] on node 3
 [ffffe20080000000-ffffe200bfffffff] PUD ->ffff81202fa00000 on node 4
 [ffffe20070800000-ffffe2007fffffff] PMD -> [ffff812020200000-ffff81202f9fffff] on node 4
[ffffe2008c700000-ffffe2008c7fffff] potential offnode page_structs
 [ffffe20080000000-ffffe2008c7fffff] PMD -> [ffff81202fc00000-ffff81203c3fffff] on node 4
[ffffe200a8700000-ffffe200a87fffff] potential offnode page_structs
 [ffffe2008c800000-ffffe200a87fffff] PMD -> [ffff812820200000-ffff81283c1fffff] on node 5
 [ffffe200c0000000-ffffe200ffffffff] PUD ->ffff813037a00000 on node 6
 [ffffe200a8800000-ffffe200bfffffff] PMD -> [ffff813020200000-ffff8130379fffff] on node 6
[ffffe200c4700000-ffffe200c47fffff] potential offnode page_structs
 [ffffe200c0000000-ffffe200c47fffff] PMD -> [ffff813037c00000-ffff81303c3fffff] on node 6
 [ffffe200c4800000-ffffe200e07fffff] PMD -> [ffff813820200000-ffff81383c1fffff] on node 7

instead of a very long print out...

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86_64: fix setup_node_bootmem to support big mem excluding with memmap
Yinghai Lu [Tue, 18 Mar 2008 19:52:37 +0000 (12:52 -0700)]
x86_64: fix setup_node_bootmem to support big mem excluding with memmap

typical case: four sockets system, every node has 4g ram, and we are using:

memmap=10g$4g

to mask out memory on node1 and node2

when numa is enabled, early_node_mem is used to get node_data and node_bootmap.

if it can not get memory from the same node with find_e820_area(), it will
use alloc_bootmem to get buff from previous nodes.

so check it and print out some info about it.

need to move early_res_to_bootmem into every setup_node_bootmem.
and it takes range that node has. otherwise alloc_bootmem could return addr
that reserved early.

depends on "mm: make reserve_bootmem can crossed the nodes".

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86_64: make reserve_bootmem_generic() use new reserve_bootmem()
Yinghai Lu [Tue, 18 Mar 2008 19:50:21 +0000 (12:50 -0700)]
x86_64: make reserve_bootmem_generic() use new reserve_bootmem()

"mm: make reserve_bootmem can crossed the nodes" provides new
reserve_bootmem(), let reserve_bootmem_generic() use that.

reserve_bootmem_generic() is used to reserve initramdisk, so this way
we can make sure even when bootloader or kexec load ranges cross the
node memory boundaries, reserve_bootmem still works.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agomm: allow reserve_bootmem() cross nodes
Yinghai Lu [Tue, 18 Mar 2008 19:49:12 +0000 (12:49 -0700)]
mm: allow reserve_bootmem() cross nodes

split reserve_bootmem_core() into two functions, one which checks
conflicts, and one which sets the bits.

and make reserve_bootmem to loop bdata_list to cross the nodes.

user could be crashkernel and ramdisk..., in case the range provided
by those externalities crosses the nodes.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agomm: offset align in alloc_bootmem()
Yinghai Lu [Tue, 18 Mar 2008 19:44:48 +0000 (12:44 -0700)]
mm: offset align in alloc_bootmem()

need offset alignment when node_boot_start's alignment is less than
the alignment required.

use local node_boot_start to match alignment - so don't add extra operation
in search loop.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agomm: fix alloc_bootmem_core to use fast searching for all nodes
Yinghai Lu [Tue, 11 Mar 2008 06:23:42 +0000 (23:23 -0700)]
mm: fix alloc_bootmem_core to use fast searching for all nodes

Make the nodes other than node 0 use bdata->last_success for fast
search too.

We need to use __alloc_bootmem_core() for vmemmap allocation for other
nodes when numa and sparsemem/vmemmap are enabled.

Also, make fail_block path increase i with incr only after ALIGN
to avoid extra increase when size is larger than align.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agomm: make mem_map allocation continuous
Yinghai Lu [Sun, 13 Apr 2008 18:51:06 +0000 (11:51 -0700)]
mm: make mem_map allocation continuous

vmemmap allocation currently has this layout:

 [ffffe20000000000-ffffe200001fffff] PMD ->ffff810001400000 on node 0
 [ffffe20000200000-ffffe200003fffff] PMD ->ffff810001800000 on node 0
 [ffffe20000400000-ffffe200005fffff] PMD ->ffff810001c00000 on node 0
 [ffffe20000600000-ffffe200007fffff] PMD ->ffff810002000000 on node 0
 [ffffe20000800000-ffffe200009fffff] PMD ->ffff810002400000 on node 0
...

note that there is a 2M hole between them - not optimal.

the root cause is that usemap (24 bytes) will be allocated after every 2M
mem_map, and it will push next vmemmap (2M) to the next (2M) alignment.

solution: try to allocate the mem_map continously.

after the patch, we get:

 [ffffe20000000000-ffffe200001fffff] PMD ->ffff810001400000 on node 0
 [ffffe20000200000-ffffe200003fffff] PMD ->ffff810001600000 on node 0
 [ffffe20000400000-ffffe200005fffff] PMD ->ffff810001800000 on node 0
 [ffffe20000600000-ffffe200007fffff] PMD ->ffff810001a00000 on node 0
 [ffffe20000800000-ffffe200009fffff] PMD ->ffff810001c00000 on node 0
...

which is the ideal layout.

and usemap will share a page because of they are allocated continuously too:

sparse_early_usemap_alloc: usemap = ffff810024e00000 size = 24
sparse_early_usemap_alloc: usemap = ffff810024e00080 size = 24
sparse_early_usemap_alloc: usemap = ffff810024e00100 size = 24
sparse_early_usemap_alloc: usemap = ffff810024e00180 size = 24
...

so we make the bootmem allocation more compact and use less memory
for usemap => mission accomplished ;-)

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 26 Apr 2008 20:46:11 +0000 (13:46 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-generic-bitops-v3

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-generic-bitops-v3:
  x86, bitops: select the generic bitmap search functions
  x86: include/asm-x86/pgalloc.h/bitops.h: checkpatch cleanups - formatting only
  x86: finalize bitops unification
  x86, UML: remove x86-specific implementations of find_first_bit
  x86: optimize find_first_bit for small bitmaps
  x86: switch 64-bit to generic find_first_bit
  x86: generic versions of find_first_(zero_)bit, convert i386
  bitops: use __fls for fls64 on 64-bit archs
  generic: implement __fls on all 64-bit archs
  generic: introduce a generic __fls implementation
  x86: merge the simple bitops and move them to bitops.h
  x86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps
  x86, uml: fix uml with generic find_next_bit for x86
  x86: change x86 to use generic find_next_bit
  uml: Kconfig cleanup
  uml: fix build error

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Sat, 26 Apr 2008 20:44:19 +0000 (13:44 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (46 commits)
  ide: constify struct ide_dma_ops
  ide: add struct ide_dma_ops (take 3)
  ide: add IDE_HFLAG_SERIALIZE_DMA host flag
  sl82c105: check bridge revision in sl82c105_init_one()
  au1xxx-ide: use ->init_dma method
  palm_bk3710: use ->init_dma method
  sgiioc4: use ->init_dma method
  icside: use ->init_dma method
  ide-pmac: use ->init_dma method
  ide: do complete DMA setup in ->init_dma method (take 2)
  au1xxx-ide: fix MWDMA support
  ide: cleanup ide_setup_dma()
  ide: factor out setting PCI bus-mastering from ide_hwif_setup_dma()
  ide: export ide_allocate_dma_engine()
  ide: move ide_setup_dma() call out from ->init_dma method
  alim15x3: skip DMA initialization completely on revs < 0x20
  pdc202xx_old: remove init_dma_pdc202xx()
  ide: don't display "BIOS" settings in ide_setup_dma()
  ide: remove ->cds field from ide_hwif_t (take 2)
  ide: remove ide_dma_iobase()
  ...

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 26 Apr 2008 20:29:41 +0000 (13:29 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-x86-bigbox-bootparam

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-bigbox-bootparam:
  x86, boot: Document for linked list of struct setup_data
  x86, boot: export linked list of struct setup_data via debugfs
  x86, boot: add linked list of struct setup_data
  x86, boot: add free_early to early reservation machanism

16 years agoide: constify struct ide_dma_ops
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:24 +0000 (22:25 +0200)]
ide: constify struct ide_dma_ops

* Export ide_dma_exec_cmd() and __ide_dma_test_irq().

* Constify struct ide_dma_ops.

* Always set hwif->dma_ops to &sff_dma_ops in ide_setup_dma()
  (it is later overriden by ide_init_port() if needed) and drop
  'const struct ide_port_info *d' argument.

While at it:

* Rename __ide_dma_test_irq() to ide_dma_test_irq().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add struct ide_dma_ops (take 3)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:24 +0000 (22:25 +0200)]
ide: add struct ide_dma_ops (take 3)

Add struct ide_dma_ops and convert core code + drivers to use it.

While at it:

* Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods.

* Drop "ide_" "infixes" from DMA methods.

* au1xxx-ide.c:
  - use auide_dma_{test_irq,end}() directly in auide_dma_timeout()

* pdc202xx_old.c:
  - drop "old_" "infixes" from DMA methods

* siimage.c:
  - add siimage_dma_test_irq() helper
  - print SATA warning in siimage_init_one()

* Remove no longer needed ->init_hwif implementations.

v2:
* Changes based on review from Sergei:
  - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/
  - s/drive->hwif/hwif/ in idefloppy_pc_intr().
  - fix patch description w.r.t. au1xxx-ide changes
  - fix au1xxx-ide build
  - fix naming for cmd64*_dma_ops
  - drop "ide_" and "old_" infixes
  - s/hpt3xxx_dma_ops/hpt37x_dma_ops/
  - s/hpt370x_dma_ops/hpt370_dma_ops/
  - use correct DMA ops for HPT302/N, HPT371/N and HPT374
  - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/

v3:
* Two bugs slipped in v2 (noticed by Sergei):
  - use correct DMA ops for HPT374 (for real this time)
  - handle HPT370/HPT370A properly

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add IDE_HFLAG_SERIALIZE_DMA host flag
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:24 +0000 (22:25 +0200)]
ide: add IDE_HFLAG_SERIALIZE_DMA host flag

* Add IDE_HFLAG_SERIALIZE_DMA host flag to serialize ports
  if DMA is available and handle it in ide_init_port().

* Convert sl82c105 host driver to use this new flag.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agosl82c105: check bridge revision in sl82c105_init_one()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:23 +0000 (22:25 +0200)]
sl82c105: check bridge revision in sl82c105_init_one()

* Make sl82c105_bridge_revision() return 'u8' instead of 'unsigned long'.

* Check bridge revision in sl82c105_init_one().

While at:

* Use proper KERN_ level for printk().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoau1xxx-ide: use ->init_dma method
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:23 +0000 (22:25 +0200)]
au1xxx-ide: use ->init_dma method

* Pass 'ide_hwif_t *hwif' instead of '_auide_hwif *auide' to
  auide_ddma_init().

* Add 'const struct ide_port_info *d' argument to auide_ddma_init().

* Convert the driver to use ->init_dma method.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: use ->init_dma method
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:23 +0000 (22:25 +0200)]
palm_bk3710: use ->init_dma method

* Move DMA setup to palm_bk3710_init_dma().

* Convert the driver to use ->init_dma method.

Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agosgiioc4: use ->init_dma method
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:23 +0000 (22:25 +0200)]
sgiioc4: use ->init_dma method

* Move dma_base check from sgiioc4_ide_setup_pci_device()
  to ide_dma_sgiioc4().

* Replace ide_dma_sgiioc4() 'unsigned long dma_base' argument
  by 'const struct ide_port_info *d'.

* Move hwif->INB setup from ide_init_sgiioc4() to
  sgiioc4_ide_setup_pci_device().

* Move ide_init_sgiioc4() call from sgiioc4_ide_setup_pci_device()
  to ide_dma_sgiioc4().

* Convert the driver to use ->init_dma method.

Cc: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoicside: use ->init_dma method
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:23 +0000 (22:25 +0200)]
icside: use ->init_dma method

* Add 'const struct ide_port_info *d' argument to icside_dma_init().

* Make icside_dma_init() return an error value and add icside_dma_off_init()
  (->init_dma implementation for case when DMA cannot be enabled).

* Convert the driver to use ->init_dma method.

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-pmac: use ->init_dma method
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:22 +0000 (22:25 +0200)]
ide-pmac: use ->init_dma method

* Move pmif->dma_regs check from pmac_ide_setup_device() to
  pmac_ide_init_dma().

* Get 'pmif' from 'hwif->hwif_data' in pmac_ide_init_dma() and replace
  'pmac_ide_hwif_t *pmif' argument by 'const struct ide_port_info *d'.

* Add pmac_ide_init_dma() implementation for CONFIG_BLK_DEV_IDEDMA_PMAC=n
  case and convert the driver to use ->init_dma method.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: do complete DMA setup in ->init_dma method (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:22 +0000 (22:25 +0200)]
ide: do complete DMA setup in ->init_dma method (take 2)

* Make ide_hwif_setup_dma() return an error value.

* Pass 'const struct ide_port_info *d' instead of 'unsigned long dmabase'
  to ->init_dma method and make it return an error value.

* Rename ide_get_or_set_dma_base() to ide_pci_dma_base(),
  change ordering of its arguments and then export it.

* Export ide_pci_set_master().

* Do complete DMA setup inside ->init_dma method and update ->init_dma
  users accordingly.

* Sanitize code for DMA setup in ide_init_port().

v2:
* Fix for CONFIG_BLK_DEV_IDEDMA_PCI=n configs
  (from Jiri Slaby <jirislaby@gmail.com>):

  Fix following compiler warning by returning EINVAL:

  In file included from ANYTHING-INCLUDING-IDE.H:45:
  include/linux/ide.h: In function â€˜ide_hwif_setup_dma’:
  include/linux/ide.h:1022: warning: no return statement in function returning non-void

Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoau1xxx-ide: fix MWDMA support
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:22 +0000 (22:25 +0200)]
au1xxx-ide: fix MWDMA support

Always use "fast" MWDMA support and remove dma_{black,white}_list
(they were based on completely bogus ->ide_dma_check implementation
which didn't set neither the host controller timings nor the device
for the desired transfer mode).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: cleanup ide_setup_dma()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)]
ide: cleanup ide_setup_dma()

* There is no need to call ide_release_dma_engine().

* Move the code up to (and including) ide_allocate_dma_engine()
  call to the callers of ide_setup_dma().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: factor out setting PCI bus-mastering from ide_hwif_setup_dma()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)]
ide: factor out setting PCI bus-mastering from ide_hwif_setup_dma()

Factor out setting PCI bus-mastering from ide_hwif_setup_dma()
to ide_pci_set_master() helper.

While at it:

* don't read PCI Command register if not necessary

* use PCI device name instead of hwif->name

* cleanup ide_hwif_setup_dma() a bit

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: export ide_allocate_dma_engine()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)]
ide: export ide_allocate_dma_engine()

Export ide_allocate_dma_engine() and use it in trm290 host driver.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: move ide_setup_dma() call out from ->init_dma method
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)]
ide: move ide_setup_dma() call out from ->init_dma method

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoalim15x3: skip DMA initialization completely on revs < 0x20
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)]
alim15x3: skip DMA initialization completely on revs < 0x20

Skip DMA initialization completely on revs < 0x20 by setting IDE_HFLAG_NO_DMA
host flag and resetting DMA host masks in alim15x3_init_one() (currently
ide_hwif_setup_dma() will try to obtain DMA base and setup PCI bus-mastering
but init_dma_ali15x3() will fail).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopdc202xx_old: remove init_dma_pdc202xx()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:21 +0000 (22:25 +0200)]
pdc202xx_old: remove init_dma_pdc202xx()

Do PDC202xx specific DMA initialization in init_chipset_pdc202xx()
and remove no longer needed init_dma_pdc202xx().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: don't display "BIOS" settings in ide_setup_dma()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:20 +0000 (22:25 +0200)]
ide: don't display "BIOS" settings in ide_setup_dma()

Nowadays BIOS info is not very useful and only confuses users since:

- IDE always tries to use DMA

- BIOS info may not be accurate with modular IDE/libata

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->cds field from ide_hwif_t (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:20 +0000 (22:25 +0200)]
ide: remove ->cds field from ide_hwif_t (take 2)

* Use hwif->name instead of cds->name in ide_allocate_dma_engine().

* Use pci_name(dev) instead of cds->name in init_dma_pdc202xx().

* Remove no longer needed ->cds field from ide_hwif_t.

v2:

* scc_pata.c also needs to be updated now (noticed by Stephen Rothwell).

There should be no functional changes caused by this patch.

Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Cc: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide_dma_iobase()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:20 +0000 (22:25 +0200)]
ide: remove ide_dma_iobase()

* ide_mapped_mmio_dma() and ide_iomio_dma() are called only by
  ide_dma_iobase() so inline them there.

* ide_dma_iobase() is called only by ide_setup_dma() so inline
  it there.

* Setup hwif->extra_base also if hwif->mmio flag is set.

There should be no functional changes casued by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->extra field from struct ide_port_info
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:20 +0000 (22:25 +0200)]
ide: remove ->extra field from struct ide_port_info

Always setup hwif->extra_base in ide_iomio_dma() and remove
no longer needed ->extra field from struct ide_port_info.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Sat, 26 Apr 2008 20:25:20 +0000 (22:25 +0200)]
ide: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

[bart: fix checkpatch.pl errors in ide-lib.c and ppc/mpc8xx.c while at it]

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove idetape_pipeline_active()
Borislav Petkov [Sat, 26 Apr 2008 20:25:20 +0000 (22:25 +0200)]
ide-tape: remove idetape_pipeline_active()

This function was simply a wrapper for a test_bit() macro so remove it and
use the macro instead.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: cleanup setting hwif->mmio flag
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:19 +0000 (22:25 +0200)]
ide: cleanup setting hwif->mmio flag

It is no longer needed to set hwif->mmio flag to tell IDE layer to not
manage resources so cleanup host drivers that used hwif->mmio flag only
for this purpose.

Ditto for ide_legacy_init_one().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide_hwif_request_regions()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:19 +0000 (22:25 +0200)]
ide: remove ide_hwif_request_regions()

Remove no longer used ide_hwif_request_regions() and hwif_request_region().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: manage resources for PCI devices in ide_pci_enable() (take 3)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:19 +0000 (22:25 +0200)]
ide: manage resources for PCI devices in ide_pci_enable() (take 3)

* Reserve PCI BARs 0-3 (0-1 for single port controllers) in
  ide_pci_enable() and remove ide_hwif_request_regions() call
  from ide_device_add_all() (also cleanup resource management
  in scc_pata host driver).

* Fix handling of PCI BAR 4 in ide_pci_enable(), then cleanup
  ide_iomio_dma() (+ init_hwif_trm290() in trm290 host driver)
  and remove ide_release[_iomio]_dma().

v2:
* Fixup trm290 host driver.

v3:
* Because of scc_pata host driver changes we need to call
  pci_request_selected_regions() also in setup_mmio_scc().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agocmd640: manage I/O resources in driver
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:19 +0000 (22:25 +0200)]
cmd640: manage I/O resources in driver

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: manage I/O resources in ide_legacy_init_one()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:18 +0000 (22:25 +0200)]
ide: manage I/O resources in ide_legacy_init_one()

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Set ->name field of 'struct ide_port_info' instances in legacy VLB
  host drivers and use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_legacy_init_one() helper
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:18 +0000 (22:25 +0200)]
ide: add ide_legacy_init_one() helper

Move the common code for primary/seconary port setup from
ide_legacy_device_add() to ide_legacy_init_one().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide_arm: manage I/O resources in driver
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:18 +0000 (22:25 +0200)]
ide_arm: manage I/O resources in driver

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-4drives: manage I/O resources in driver
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:18 +0000 (22:25 +0200)]
ide-4drives: manage I/O resources in driver

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

* Remove no longer needed 'hwif->chipset == ide_4drives' handling
  from ide_device_add_all().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: manage I/O resources in driver
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:17 +0000 (22:25 +0200)]
ide-generic: manage I/O resources in driver

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide_hwif_release_regions()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:17 +0000 (22:25 +0200)]
ide: remove ide_hwif_release_regions()

All host drivers using ide_unregister()/module_exit() have been fixed
to manage resources themselves so this function can be removed now.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: register ports with non-present devices (for warm-plug)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:17 +0000 (22:25 +0200)]
ide: register ports with non-present devices (for warm-plug)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cs: manage I/O resources in driver
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:17 +0000 (22:25 +0200)]
ide-cs: manage I/O resources in driver

* Make idecs_register() return pointer to hwif structure instead of
  hwif's index.

* Store pointer to hwif structure instead of hwif's index in ide_info_t
  (fixes ide-cs for IDE[6-9]_MAJOR major numbers).

* Remove no longer needed ide_major[].

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-pnp: manage I/O resources in driver
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:16 +0000 (22:25 +0200)]
ide-pnp: manage I/O resources in driver

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoqd65xx: cleanup qd_probe()
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:16 +0000 (22:25 +0200)]
qd65xx: cleanup qd_probe()

* Replace 'if ()'-s by 'switch ()' block.

* Merge common code for QD6500/QD6580A/QD6580B.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use ide_legacy_device_add() for qd65xx (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:16 +0000 (22:25 +0200)]
ide: use ide_legacy_device_add() for qd65xx (take 2)

* Add 'unsigned long config' argument to ide_legacy_device_add()
  for setting hwif->config_data.

* Use ide_find_port_slot() instead of ide_find_port() in
  ide_legacy_device_add().

* Handle IDE_HFLAG_QD_2ND_PORT and IDE_HFLAG_SINGLE host flags in
  ide_legacy_device_add().

* Convert qd65xx host driver to use ide_legacy_device_add().

v2:
* Update ali14xx, dtc2278, ht6560b and umc8672 host drivers.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_legacy_device_add() helper
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:16 +0000 (22:25 +0200)]
ide: add ide_legacy_device_add() helper

Add ide_legacy_device_add() helper for use by legacy VLB host drivers
(+ convert them to use it).

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->noprobe field from ide_hwif_t
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:16 +0000 (22:25 +0200)]
ide: remove ->noprobe field from ide_hwif_t

Update IDE PMAC host driver to use drive->noprobe instead of hwif->noprobe
and remove hwif->noprobe completely (it is always set to zero now).

There should be no functional changes caused by this patch.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix remaining checkpatch.pl issues
Borislav Petkov [Sat, 26 Apr 2008 20:25:15 +0000 (22:25 +0200)]
ide-cd: fix remaining checkpatch.pl issues

Some of them are:
WARNING: braces {} are not necessary for single statement blocks
CHECK: multiple assignments should be avoided
WARNING: printk() should include KERN_ facility level
WARNING: no space between function name and open parenthesis '('

[bart: minor fixups]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: shorten lines longer than 80 columns
Borislav Petkov [Sat, 26 Apr 2008 20:25:15 +0000 (22:25 +0200)]
ide-cd: shorten lines longer than 80 columns

[bart: minor fixups]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fixup comments
Borislav Petkov [Sat, 26 Apr 2008 20:25:15 +0000 (22:25 +0200)]
ide-cd: fixup comments

[bart: minor fixups, md5sum checked]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: put all proc-related code at one place
Borislav Petkov [Sat, 26 Apr 2008 20:25:15 +0000 (22:25 +0200)]
ide-cd: put all proc-related code at one place

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: include proper headers
Borislav Petkov [Sat, 26 Apr 2008 20:25:15 +0000 (22:25 +0200)]
ide-cd: include proper headers

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add struct ide_port_ops (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Apr 2008 20:25:14 +0000 (22:25 +0200)]
ide: add struct ide_port_ops (take 2)

* Move hooks for port/host specific methods from ide_hwif_t to
  'struct ide_port_ops'.

* Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info'
  and ide_hwif_t.

* Update host drivers and core code accordingly.

While at it:

* Rename ata66_*() cable detect functions to *_cable_detect() to match
  the standard naming. (Suggested by Sergei Shtylyov)

v2:
* Fix build for bast-ide. (Noticed by Andrew Morton)

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agox86, boot: Document for linked list of struct setup_data
Huang, Ying [Fri, 28 Mar 2008 02:49:50 +0000 (10:49 +0800)]
x86, boot: Document for linked list of struct setup_data

Documentation for linked list of struct setup_data.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86, boot: export linked list of struct setup_data via debugfs
Huang, Ying [Fri, 28 Mar 2008 02:49:48 +0000 (10:49 +0800)]
x86, boot: export linked list of struct setup_data via debugfs

Export linked list of struct setup_data via debugfs.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86, boot: add linked list of struct setup_data
Huang, Ying [Fri, 28 Mar 2008 02:49:44 +0000 (10:49 +0800)]
x86, boot: add linked list of struct setup_data

This patch adds a field of 64-bit physical pointer to NULL terminated
single linked list of struct setup_data to real-mode kernel
header. This is used as a more extensible boot parameters passing
mechanism.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86, boot: add free_early to early reservation machanism
Huang, Ying [Fri, 28 Mar 2008 02:49:42 +0000 (10:49 +0800)]
x86, boot: add free_early to early reservation machanism

Add free_early to early reservation mechanism - this way early bootup
failure paths can stop wasting memory.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86, PAT: disable /dev/mem mmap RAM with PAT
Venki Pallipadi [Sat, 26 Apr 2008 18:32:12 +0000 (11:32 -0700)]
x86, PAT: disable /dev/mem mmap RAM with PAT

disable /dev/mem mmap of RAM with PAT. It makes things safer and
eliminates aliasing. A future improvement would be to avoid the
range_is_allowed duplication.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokbuild: scripts/Makefile.modpost typo fix
Adrian Bunk [Fri, 25 Apr 2008 20:40:16 +0000 (23:40 +0300)]
kbuild: scripts/Makefile.modpost typo fix

-EVIUSER  ;-)

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
16 years agokbuild: soften MODULE_LICENSE check
Sam Ravnborg [Sat, 26 Apr 2008 19:07:26 +0000 (21:07 +0200)]
kbuild: soften MODULE_LICENSE check

Only modules that has other MODULE_* content
shall have the MODULE_LICENSE() tag.

This fixes allmodconfig build on my box.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
16 years agox86, bitops: select the generic bitmap search functions
Alexander van Heukelum [Fri, 25 Apr 2008 11:12:53 +0000 (13:12 +0200)]
x86, bitops: select the generic bitmap search functions

Introduce GENERIC_FIND_FIRST_BIT and GENERIC_FIND_NEXT_BIT in
lib/Kconfig, defaulting to off. An arch that wants to use the
generic implementation now only has to use a select statement
to include them.

I added an always-y option (X86_CPU) to arch/x86/Kconfig.cpu
and used that to select the generic search functions. This
way ARCH=um SUBARCH=i386 automatically picks up the change
too, and arch/um/Kconfig.i386 can therefore be simplified a
bit. ARCH=um SUBARCH=x86_64 does things differently, but
still compiles fine. It seems that a "def_bool y" always
wins over a "def_bool n"?

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: include/asm-x86/pgalloc.h/bitops.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:07 +0000 (01:03 -0700)]
x86: include/asm-x86/pgalloc.h/bitops.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: finalize bitops unification
Alexander van Heukelum [Fri, 4 Apr 2008 18:49:30 +0000 (20:49 +0200)]
x86: finalize bitops unification

include/asm-x86/bitops_32.h and include/asm-x86/bitops_64.h are now
almost identical. The 64-bit version sets ARCH_HAS_FAST_MULTIPLIER
and has an extra inline function set_bit_string. The define currently
has no influence on the generated code, but it can be argued that
setting it on i386 is the right thing to do anyhow. The addition
of the extra inline function on i386 does not hurt either.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, UML: remove x86-specific implementations of find_first_bit
Alexander van Heukelum [Tue, 1 Apr 2008 15:47:57 +0000 (17:47 +0200)]
x86, UML: remove x86-specific implementations of find_first_bit

x86 has been switched to the generic versions of find_first_bit
and find_first_zero_bit, but the original versions were retained.
This patch just removes the now unused x86-specific versions.

also update UML.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: optimize find_first_bit for small bitmaps
Alexander van Heukelum [Tue, 1 Apr 2008 15:42:21 +0000 (17:42 +0200)]
x86: optimize find_first_bit for small bitmaps

Avoid a call to find_first_bit if the bitmap size is know at
compile time and small enough to fit in a single long integer.
Modeled after an optimization in the original x86_64-specific
code.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: switch 64-bit to generic find_first_bit
Alexander van Heukelum [Tue, 1 Apr 2008 15:41:26 +0000 (17:41 +0200)]
x86: switch 64-bit to generic find_first_bit

Switch x86_64 to generic find_first_bit. The x86_64-specific
implementation is not removed.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: generic versions of find_first_(zero_)bit, convert i386
Alexander van Heukelum [Tue, 1 Apr 2008 09:46:19 +0000 (11:46 +0200)]
x86: generic versions of find_first_(zero_)bit, convert i386

Generic versions of __find_first_bit and __find_first_zero_bit
are introduced as simplified versions of __find_next_bit and
__find_next_zero_bit. Their compilation and use are guarded by
a new config variable GENERIC_FIND_FIRST_BIT.

The generic versions of find_first_bit and find_first_zero_bit
are implemented in terms of the newly introduced __find_first_bit
and __find_first_zero_bit.

This patch does not remove the i386-specific implementation,
but it does switch i386 to use the generic functions by setting
GENERIC_FIND_FIRST_BIT=y for X86_32.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agobitops: use __fls for fls64 on 64-bit archs
Alexander van Heukelum [Sat, 15 Mar 2008 17:32:36 +0000 (18:32 +0100)]
bitops: use __fls for fls64 on 64-bit archs

Use __fls for fls64 on 64-bit archs. The implementation for
64-bit archs is moved from x86_64 to asm-generic.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agogeneric: implement __fls on all 64-bit archs
Alexander van Heukelum [Sat, 15 Mar 2008 17:31:49 +0000 (18:31 +0100)]
generic: implement __fls on all 64-bit archs

Implement __fls on all 64-bit archs:

alpha has an implementation of fls64.
Added __fls(x) = fls64(x) - 1.

ia64 has fls, but not __fls.
Added __fls based on code of fls.

mips and powerpc have __ilog2, which is the same as __fls.
Added __fls = __ilog2.

parisc, s390, sh and sparc64:
Include generic __fls.

x86_64 already has __fls.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agogeneric: introduce a generic __fls implementation
Alexander van Heukelum [Sat, 15 Mar 2008 17:30:57 +0000 (18:30 +0100)]
generic: introduce a generic __fls implementation

Add a generic __fls implementation in the same spirit as
the generic __ffs one. It finds the last (most significant)
set bit in the given long value.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge the simple bitops and move them to bitops.h
Alexander van Heukelum [Sat, 15 Mar 2008 12:04:42 +0000 (13:04 +0100)]
x86: merge the simple bitops and move them to bitops.h

Some of those can be written in such a way that the same
inline assembly can be used to generate both 32 bit and
64 bit code.

For ffs and fls, x86_64 unconditionally used the cmov
instruction and i386 unconditionally used a conditional
branch over a mov instruction. In the current patch I
chose to select the version based on the availability
of the cmov instruction instead. A small detail here is
that x86_64 did not previously set CONFIG_X86_CMOV=y.

Improved comments for ffs, ffz, fls and variations.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps
Alexander van Heukelum [Tue, 11 Mar 2008 15:17:19 +0000 (16:17 +0100)]
x86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps

This moves an optimization for searching constant-sized small
bitmaps form x86_64-specific to generic code.

On an i386 defconfig (the x86#testing one), the size of vmlinux hardly
changes with this applied. I have observed only four places where this
optimization avoids a call into find_next_bit:

In the functions return_unused_surplus_pages, alloc_fresh_huge_page,
and adjust_pool_surplus, this patch avoids a call for a 1-bit bitmap.
In __next_cpu a call is avoided for a 32-bit bitmap. That's it.

On x86_64, 52 locations are optimized with a minimal increase in
code size:

Current #testing defconfig:
146 x bsf, 27 x find_next_*bit
   text    data     bss     dec     hex filename
   5392637  846592  724424 6963653  6a41c5 vmlinux

After removing the x86_64 specific optimization for find_next_*bit:
94 x bsf, 79 x find_next_*bit
   text    data     bss     dec     hex filename
   5392358  846592  724424 6963374  6a40ae vmlinux

After this patch (making the optimization generic):
146 x bsf, 27 x find_next_*bit
   text    data     bss     dec     hex filename
   5392396  846592  724424 6963412  6a40d4 vmlinux

[ tglx@linutronix.de: build fixes ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, uml: fix uml with generic find_next_bit for x86
Alexander van Heukelum [Thu, 13 Mar 2008 17:53:52 +0000 (18:53 +0100)]
x86, uml: fix uml with generic find_next_bit for x86

Update UML to use the generic bits too.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change x86 to use generic find_next_bit
Alexander van Heukelum [Sun, 9 Mar 2008 20:01:04 +0000 (21:01 +0100)]
x86: change x86 to use generic find_next_bit

The versions with inline assembly are in fact slower on the machines I
tested them on (in userspace) (Athlon XP 2800+, p4-like Xeon 2.8GHz, AMD
Opteron 270). The i386-version needed a fix similar to 06024f21 to avoid
crashing the benchmark.

Benchmark using: gcc -fomit-frame-pointer -Os. For each bitmap size
1...512, for each possible bitmap with one bit set, for each possible
offset: find the position of the first bit starting at offset. If you
follow ;). Times include setup of the bitmap and checking of the
results.

Athlon Xeon Opteron 32/64bit
x86-specific: 0m3.692s 0m2.820s 0m3.196s / 0m2.480s
generic: 0m2.622s 0m1.662s 0m2.100s / 0m1.572s

If the bitmap size is not a multiple of BITS_PER_LONG, and no set
(cleared) bit is found, find_next_bit (find_next_zero_bit) returns a
value outside of the range [0, size]. The generic version always returns
exactly size. The generic version also uses unsigned long everywhere,
while the x86 versions use a mishmash of int, unsigned (int), long and
unsigned long.

Using the generic version does give a slightly bigger kernel, though.

defconfig:    text    data     bss     dec     hex filename
x86-specific: 4738555  481232  626688 5846475  5935cb vmlinux (32 bit)
generic: 4738621  481232  626688 5846541  59360d vmlinux (32 bit)
x86-specific: 5392395  846568  724424 6963387  6a40bb vmlinux (64 bit)
generic: 5392458  846568  724424 6963450  6a40fa vmlinux (64 bit)

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agouml: Kconfig cleanup
Ingo Molnar [Sat, 26 Apr 2008 17:10:17 +0000 (19:10 +0200)]
uml: Kconfig cleanup

pointed out by Linus: arch/um/Kconfig.x86_64 should
include arch/x86/Kconfig.cpu instead of defining those
symbols itself.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agouml: fix build error
Ingo Molnar [Sat, 26 Apr 2008 16:59:42 +0000 (18:59 +0200)]
uml: fix build error

fix:

 arch/um/os-Linux/helper.c: In function 'run_helper':
 arch/um/os-Linux/helper.c:73: error: 'PATH_MAX' undeclared (first use in this function)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 26 Apr 2008 16:50:58 +0000 (09:50 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-x86-fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-fixes:
  x86 PAT: decouple from nonpromisc devmem
  x86 PAT: tone down debugging messages

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
Linus Torvalds [Sat, 26 Apr 2008 16:49:51 +0000 (09:49 -0700)]
Merge git://git./linux/kernel/git/mchehab/v4l-dvb

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (7751): ir-kbd-i2c: Save a temporary memory allocation in ir_probe
  V4L/DVB (7750): au0828/ cleanups and fixes
  V4L/DVB (7748): tuner-core: some adjustments at tuner logs, if debug enabled
  V4L/DVB (7746): pvrusb2: make signed one-bit bitfields unsigned
  V4L/DVB (7744): pvrusb2-dvb: add atsc/qam support for Hauppauge pvrusb2 model 751xx
  V4L/DVB (7742): cx88: Add support for the DViCO FusionHDTV_7_GOLD digital modes
  V4L/DVB (7741): s5h1411: Adding support for this ATSC/QAM demodulator
  V4L/DVB (7740): tuner-xc2028.c dubious !x & y
  V4L/DVB (7739): mt312.h: dubious one-bit signed bitfield
  V4L/DVB (7735): Fix compilation for au0828
  V4L/DVB (7734): em28xx: copy and paste error in em28xx_init_isoc
  V4L/DVB (7733): blackbird_find_mailbox negative return ignored in blackbird_initialize_codec()
  V4L/DVB (7732): vivi: fix a warning

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 26 Apr 2008 16:48:52 +0000 (09:48 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-x86-optimized-inlining

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-optimized-inlining:
  generic: make optimized inlining arch-opt-in
  x86: add optimized inlining

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Sat, 26 Apr 2008 16:48:00 +0000 (09:48 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (61 commits)
  ide: sanitize handling of IDE_HFLAG_NO_SET_MODE host flag
  sis5513: fail early for unsupported chipsets
  it821x: fix kzalloc() failure handling
  qd65xx: use IDE_HFLAG_SINGLE host flag
  qd65xx: always use ->selectproc method
  ide-cd: put proc-related functions together under single ifdef
  ide-cd: Replace __FUNCTION__ with __func__
  IDE: Coding Style fixes to drivers/ide/ide-cd.c
  IDE: Coding Style fixes to drivers/ide/pci/cy82c693.c
  IDE: Coding Style fixes to drivers/ide/pci/it8213.c
  IDE: Coding Style fixes to drivers/ide/ide-floppy.c
  IDE: Coding Style fixes to drivers/ide/legacy/ali14xx.c
  IDE: Coding Style fixes to drivers/ide/legacy/hd.c
  IDE: Coding Style fixes to drivers/ide/pci/cmd640.c
  IDE: Coding Style fixes to drivers/ide/pci/opti621.c
  IDE: Coding Style fixes to drivers/ide/ide-pnp.c
  IDE: Coding Style fixes to drivers/ide/ide-proc.c
  IDE: Coding Style fixes to drivers/ide/legacy/ide-4drives.c
  IDE: Coding Style fixes to drivers/ide/legacy/umc8672.c
  IDE: Coding Style fixes to drivers/ide/pci/generic.c
  ...

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 26 Apr 2008 16:44:32 +0000 (09:44 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-x86-misc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-misc: (28 commits)
  x86: section mismatch fixes, #3
  x86: section mismatch fixes, #2
  x86: pgtable_32.h - prototype and section mismatch fixes
  x86: unlock_ExtINT_logic() - fix section mismatch warnings
  x86: uniq_ioapic_id - fix section mismatch warning
  x86: trampoline_32.S - switch to .cpuinit.data
  x86: use get_bios_ebda()
  x86: remove duplicate get_bios_ebda() from rio.h
  x86: get_bios_ebda() requires asm/io.h
  x86: use cpumask function for present, possible, and online cpus
  x86: cleanup div_sc() usage
  x86: cleanup clocksource_hz2mult usage
  x86: remove unnecessary memset and NULL check after alloc_bootmem()
  x86: use bitmap library for pin_programmed
  x86: use MP_intsrc_info()
  x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating
  x86_64 ia32 ptrace: convert to compat_arch_ptrace
  x86_64 ia32 ptrace: use compat_ptrace_request for siginfo
  x86 signals: lift set_fs
  x86 signals: lift flags diddling code
  ...