pandora-kernel.git
16 years agoide: add "vlb|pci_clock=" parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:29 +0000 (15:38 +0200)]
ide: add "vlb|pci_clock=" parameter

* Add "vlb_clock=" parameter for specifying VLB clock frequency (in MHz).

* Add "pci_clock=" parameter for specifying PCI bus clock frequency (in MHz).

While at it:

* qd65xx.c: rename {active,recovery}_cycle variables to {act,rec}_cyc.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove comments markup from Documentation/ide/ide-tape.txt
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove comments markup from Documentation/ide/ide-tape.txt

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipelined mode description from Documentation/ide/ide-tape.txt
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove pipelined mode description from Documentation/ide/ide-tape.txt

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove misc references to pipelined operation in the comments
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove misc references to pipelined operation in the comments

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipelined mode parameters
Borislav Petkov [Sun, 27 Apr 2008 13:38:28 +0000 (15:38 +0200)]
ide-tape: remove pipelined mode parameters

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific members from struct ide_tape_obj
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific members from struct ide_tape_obj

Bart:
- merge "ide-tape: remove pipeline-specific code from idetape_setup" patch
- cleanup __idetape_discard_read_pipeline()
- cleanup idetape_empty_write_pipeline()
- fix 't' assignment in idetape_setup()
- fix idetape_blkdev_ioctl() w.r.t. 'nr_stages'

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipelined mode tape control flags
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove pipelined mode tape control flags

[bart: sync patch with current code and fix idetape_init_read()]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove remaining pipeline functionality
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove remaining pipeline functionality

The driver is using now solely its own request queue.

- tape->next_stage is always NULL so it is safe to remove
  all code depending on tape->next_stage != NULL

- this patch removes the last place which sets
  IDETAPE_FLAG_PIPELINE_ACTIVE in tape->flags

[bart: add above explanations]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: unwrap idetape_queue_pc_tail()
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: unwrap idetape_queue_pc_tail()

idetape_queue_pc_tail() is a wrapper for its __idetape_queue_pc_tail() counterpart
and has no other functionality. Remove it and call the "wrapped" function
directly.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code from idetape_end_request()
Borislav Petkov [Sun, 27 Apr 2008 13:38:27 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code from idetape_end_request()

As a side effect, remove unused idetape_kfree_stage() and
idetape_abort_pipeline()

[bart: resurrect taking tape->lock + clearing IDETAPE_FLAG_PIPELINE_ACTIVE]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove idetape_remove_stage_head()
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove idetape_remove_stage_head()

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove idetape_pipeline_size()
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove idetape_pipeline_size()

The computation of the block offset of the the tape position (MTIOCPOS,
MTIOCGET) is not influenced by the stages queued in the pipeline anymore but by
the size of the current buffer which is going to be sent to the drive.

[bart: resurrect deleted idetape_wait_for_pipeline() call]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code in idetape_space_over_filemarks()
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code in idetape_space_over_filemarks()

Since we don't do pipeline read-ahead anymore, we don't have to look for
filemarks we have crossed. Therefore, remove the code chunk that does that and
pass on the command to the tape. As a side effect, remove unused
idetape_wait_first_stage().

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unused parameter from idetape_copy_stage_from_user
Borislav Petkov [Sun, 27 Apr 2008 13:38:26 +0000 (15:38 +0200)]
ide-tape: remove unused parameter from idetape_copy_stage_from_user

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unused parameter from idetape_copy_stage_to_user
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove unused parameter from idetape_copy_stage_to_user

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code from idetape_add_chrdev_read_request()
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code from idetape_add_chrdev_read_request()

In order to do away with queueing read requests on the pipeline, several things
have to be done:

1. Do not allocate additional pipeline stages in idetape_init_read() until
(tape->nr_stages < max_stages) and do only read operation preparations. As a
collateral result, idetape_add_stage_tail() becomes unused so remove it.

2. Queue the read request's buffer directly thru idetape_queue_rw_tail().

3. Remove now unused idetape_kmalloc_stage() and idetape_switch_buffers().

[bart: simplify the original patch]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape remove pipeline speed/control calculations
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape remove pipeline speed/control calculations

Pipeline handling calculations in idetape_calculate_speeds() can
go since they do not have any effect on other functionality besides:

1. info is only being exported through /proc as a read-only item
(controlled_pipeline_head_speed, uncontrolled_pipeline_head_speed)

2. used in idetape_restart_speed_control() which, in turn, is unrelated to
other code

3. used only for pipeline frames number accounting (tape->pipeline_head),
also unused elsewhere.

4.some variables are:
        only written to: tape->buffer_head;
        unused: tape->tape_head, tape->last_tape_head

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove pipeline-specific code from idetape_add_chrdev_write_request
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove pipeline-specific code from idetape_add_chrdev_write_request

Refrain from adding more write requests to the pipeline and queue them
directly on the device's request queue instead.

[bart: re-do for minimal behavior changes]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove tape->cache_stage
Borislav Petkov [Sun, 27 Apr 2008 13:38:25 +0000 (15:38 +0200)]
ide-tape: remove tape->cache_stage

Prior to allocating a new pipeline stage, the code checked for the existence of
a cached pipeline stage to use. Do away with and stick to normal pipeline
stages only.

[bart: keep idetape_kmalloc_stage() for now]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "hdx=noautotune" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "hdx=noautotune" kernel parameter

Remove obsoleted "hdx=noautotune" kernel parameter
(it has been obsoleted since 1 Nov 2004).

Then make ide_hwif_t.autotune a single bit flag
and remove no longer needed IDE_TUNE_* defines.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idex=" kernel parameters
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "idex=" kernel parameters

* Remove obsoleted "idex=" kernel parameters.

* Make probe_* and cmd640_vlb variables static.

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idex=reset" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "idex=reset" kernel parameter

Remove obsoleted "idex=reset" kernel parameter
(it has been obsoleted since 1 Nov 2004).

Then remove corresponding code from ide_probe_port()
and no longer used ->reset field from ide_hwif_t.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove obsoleted "idex=serialize" kernel parameter
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:24 +0000 (15:38 +0200)]
ide: remove obsoleted "idex=serialize" kernel parameter

Remove obsoleted "idex=serialize" kernel parameter
(it has been obsoleted since 1 Nov 2004).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add "ignore_cable" parameter (take 2)
Bartlomiej Zolnierkiewicz [Sun, 27 Apr 2008 13:38:23 +0000 (15:38 +0200)]
ide: add "ignore_cable" parameter (take 2)

Add "ignore_cable" parameter:

* "ide_core.ignore_cable=[interface_number]" boot option if IDE is built-in
  (i.e. "ide_core.ignore_cable=1" to force ignoring cable for "ide1")

* "ignore_cable=[interface_number]" module parameter (for ide_core module)
  if IDE is compiled as module

v2:
* Add ide_port_apply_params() helper
  - use it in ide_device_add_all() and ide_scan_port().

* Make it possible to later disable ignoring cable detection by passing
  "[interface_number]:0" to /sys/module/ide_core/parameters/ignore_cable
  (however sysfs interface is not enabled yet since it needs some other
   IDE changes to make it work reliable).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix icside breakage
Al Viro [Sun, 27 Apr 2008 13:38:23 +0000 (15:38 +0200)]
ide: fix icside breakage

Fallout from commit ac95beedf8bc97b24f9540d4da9952f07221c023

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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>