pandora-kernel.git
16 years agoKconfig: clean up block/Kconfig help descriptions
Nick Andrew [Mon, 21 Apr 2008 07:51:04 +0000 (09:51 +0200)]
Kconfig: clean up block/Kconfig help descriptions

Modify the help descriptions of block/Kconfig for clarity, accuracy and
consistency.

Refactor the BLOCK description a bit.  The wording "This permits ...  to be
removed" isn't quite right; the block layer is removed when the option is
disabled, whereas most descriptions talk about what happens when the option is
enabled.  Reformat the list of what is affected by disabling the block layer.

Add more examples of large block devices to LBD and strive for technical
accuracy; block devices of size _exactly_ 2TB require CONFIG_LBD, not only
"bigger than 2TB".  Also try to say (perhaps not very clearly) that the config
option is only needed when you want to have individual block devices of size
>= 2TB, for example if you had 3 x 1TB disks in your computer you'd have a
total storage size of 3TB but you wouldn't need the option unless you want to
aggregate those disks into a RAID or LVM.

Improve terminology and grammar on BLK_DEV_IO_TRACE.

I also added the boilerplate "If unsure, say N" to most options.

Precisely say "2TB and larger" for LSF.

Indent the help text for BLK_DEV_BSG by 2 spaces in accordance with the
standard.

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocciss: fix warning oops on rmmod of driver
scameron@beardog.cca.cpqcorp.net [Thu, 17 Apr 2008 11:19:04 +0000 (13:19 +0200)]
cciss: fix warning oops on rmmod of driver

* Fix oops on cciss rmmod due to calling pci_free_consistent with
  irqs disabled.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocciss: Fix race between disk-adding code and interrupt handler
scameron@beardog.cca.cpqcorp.net [Thu, 17 Apr 2008 11:19:03 +0000 (13:19 +0200)]
cciss: Fix race between disk-adding code and interrupt handler

Fix race condition between cciss_init_one(), cciss_update_drive_info(),
and cciss_check_queues().

Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblock: move the padding adjustment to blk_rq_map_sg
FUJITA Tomonori [Fri, 11 Apr 2008 10:56:52 +0000 (12:56 +0200)]
block: move the padding adjustment to blk_rq_map_sg

blk_rq_map_user adjusts bi_size of the last bio. It breaks the rule
that req->data_len (the true data length) is equal to sum(bio). It
broke the scsi command completion code.

commit e97a294ef6938512b655b1abf17656cf2b26f709 was introduced to fix
the above issue. However, the partial completion code doesn't work
with it. The commit is also a layer violation (scsi mid-layer should
not know about the block layer's padding).

This patch moves the padding adjustment to blk_rq_map_sg (suggested by
James). The padding works like the drain buffer. This patch breaks the
rule that req->data_len is equal to sum(sg), however, the drain buffer
already broke it. So this patch just restores the rule that
req->data_len is equal to sub(bio) without breaking anything new.

Now when a low level driver needs padding, blk_rq_map_user and
blk_rq_map_user_iov guarantee there's enough room for padding.
blk_rq_map_sg can safely extend the last entry of a scatter list.

blk_rq_map_sg must extend the last entry of a scatter list only for a
request that got through bio_copy_user_iov. This patches introduces
new REQ_COPY_USER flag.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblock: add bio_copy_user_iov support to blk_rq_map_user_iov
FUJITA Tomonori [Fri, 11 Apr 2008 10:56:51 +0000 (12:56 +0200)]
block: add bio_copy_user_iov support to blk_rq_map_user_iov

With this patch, blk_rq_map_user_iov uses bio_copy_user_iov when a low
level driver needs padding or a buffer in sg_iovec isn't aligned. That
is, it uses temporary kernel buffers instead of mapping user pages
directly.

When a LLD needs padding, later blk_rq_map_sg needs to extend the last
entry of a scatter list. bio_copy_user_iov guarantees that there is
enough space for padding by using temporary kernel buffers instead of
user pages.

blk_rq_map_user_iov needs buffers in sg_iovec to be aligned. The
comment in blk_rq_map_user_iov indicates that drivers/scsi/sg.c also
needs buffers in sg_iovec to be aligned. Actually, drivers/scsi/sg.c
works with unaligned buffers in sg_iovec (it always uses temporary
kernel buffers).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblock: convert bio_copy_user to bio_copy_user_iov
FUJITA Tomonori [Fri, 11 Apr 2008 10:56:49 +0000 (12:56 +0200)]
block: convert bio_copy_user to bio_copy_user_iov

This patch enables bio_copy_user to take struct sg_iovec (renamed
bio_copy_user_iov). bio_copy_user uses bio_copy_user_iov internally as
bio_map_user uses bio_map_user_iov.

The major changes are:

- adds sg_iovec array to struct bio_map_data

- adds __bio_copy_iov that copy data between bio and
sg_iovec. bio_copy_user_iov and bio_uncopy_user use it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoloop: manage partitions in disk image
Laurent Vivier [Wed, 26 Mar 2008 11:11:53 +0000 (12:11 +0100)]
loop: manage partitions in disk image

This patch allows to use loop device with partitionned disk image.

Original behavior of loop is not modified.

A new parameter is introduced to define how many partition we want to be
able to manage per loop device. This parameter is "max_part".

For instance, to manage 63 partitions / loop device, we will do:
# modprobe loop max_part=63
# ls -l /dev/loop?*
brw-rw---- 1 root disk 7,   0 2008-03-05 14:55 /dev/loop0
brw-rw---- 1 root disk 7,  64 2008-03-05 14:55 /dev/loop1
brw-rw---- 1 root disk 7, 128 2008-03-05 14:55 /dev/loop2
brw-rw---- 1 root disk 7, 192 2008-03-05 14:55 /dev/loop3
brw-rw---- 1 root disk 7, 256 2008-03-05 14:55 /dev/loop4
brw-rw---- 1 root disk 7, 320 2008-03-05 14:55 /dev/loop5
brw-rw---- 1 root disk 7, 384 2008-03-05 14:55 /dev/loop6
brw-rw---- 1 root disk 7, 448 2008-03-05 14:55 /dev/loop7

And to attach a raw partitionned disk image, the original losetup is used:

# losetup -f etch.img
# ls -l /dev/loop?*
brw-rw---- 1 root disk 7,   0 2008-03-05 14:55 /dev/loop0
brw-rw---- 1 root disk 7,   1 2008-03-05 14:57 /dev/loop0p1
brw-rw---- 1 root disk 7,   2 2008-03-05 14:57 /dev/loop0p2
brw-rw---- 1 root disk 7,   5 2008-03-05 14:57 /dev/loop0p5
brw-rw---- 1 root disk 7,  64 2008-03-05 14:55 /dev/loop1
brw-rw---- 1 root disk 7, 128 2008-03-05 14:55 /dev/loop2
brw-rw---- 1 root disk 7, 192 2008-03-05 14:55 /dev/loop3
brw-rw---- 1 root disk 7, 256 2008-03-05 14:55 /dev/loop4
brw-rw---- 1 root disk 7, 320 2008-03-05 14:55 /dev/loop5
brw-rw---- 1 root disk 7, 384 2008-03-05 14:55 /dev/loop6
brw-rw---- 1 root disk 7, 448 2008-03-05 14:55 /dev/loop7
# mount /dev/loop0p1 /mnt
# ls /mnt
bench  cdrom  home        lib         mnt   root     srv  usr
bin    dev    initrd      lost+found  opt   sbin     sys  var
boot   etc    initrd.img  media       proc  selinux  tmp  vmlinuz
# umount /mnt
# losetup -d /dev/loop0

Of course, the same behavior can be done using kpartx on a loop device,
but modifying loop avoids to stack several layers of block device (loop +
device mapper), this is a very light modification (40% of modifications
are to manage the new parameter).

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocdrom: use kmalloced buffers instead of buffers on stack
Thomas Bogendoerfer [Wed, 26 Mar 2008 11:09:38 +0000 (12:09 +0100)]
cdrom: use kmalloced buffers instead of buffers on stack

If cdrom commands are issued to a scsi drive in most cases the buffer will be
filled via dma.  This leads to bad stack corruption on non coherent platforms,
because the buffers are neither cache line aligned nor is the size a multiple
of the cache line size.  Using kmalloced buffers avoids this.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocdrom: make unregister_cdrom() return void
Akinobu Mita [Wed, 26 Mar 2008 11:09:02 +0000 (12:09 +0100)]
cdrom: make unregister_cdrom() return void

Now unregister_cdrom() always returns 0.
Make it return void and update all callers that check the return value.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocdrom: use list_head for cdrom_device_info list
Akinobu Mita [Wed, 26 Mar 2008 11:09:02 +0000 (12:09 +0100)]
cdrom: use list_head for cdrom_device_info list

Use list_head for cdrom_device_info list instead of opencoded
singly list handling.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocdrom: protect cdrom_device_info list by mutex
Akinobu Mita [Wed, 26 Mar 2008 11:09:01 +0000 (12:09 +0100)]
cdrom: protect cdrom_device_info list by mutex

This patch protects the list of cdrom_device_info by cdrom_mutex
when the file in /proc/sys/dev/cdrom/ is written.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocdrom: cleanup hardcoded error-code
Akinobu Mita [Wed, 26 Mar 2008 11:09:00 +0000 (12:09 +0100)]
cdrom: cleanup hardcoded error-code

This patch eliminates hardcoded return value of register_cdrom().

It also changes the return value to -EINVAL.
It is more appropriate than -2 (-ENOENT) because it is only
happen invalid usage of register_cdrom() by broken cdrom driver.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agocdrom: remove ifdef CONFIG_SYSCTL
Akinobu Mita [Wed, 26 Mar 2008 11:08:59 +0000 (12:08 +0100)]
cdrom: remove ifdef CONFIG_SYSCTL

This patch removes #ifdef for CONFIG_SYSCTL by defining empty
cdrom_sysctl_register and cdrom_sysctl_unregister when CONFIG_SYSCTL
is not defined.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agohrtimer: optimize the softirq time optimization
Thomas Gleixner [Sat, 19 Apr 2008 19:31:26 +0000 (21:31 +0200)]
hrtimer: optimize the softirq time optimization

The previous optimization did not take the case into account where a
clock provides its own softirq_get_time() function.

Check for the availablitiy of the clock get time function first and
then check if we need to retrieve the time for both clocks via
hrtimer_softirq_gettime() to avoid a double evaluation of time in that
case as well.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agohrtimer: reduce calls to hrtimer_get_softirq_time()
Dimitri Sivanich [Fri, 18 Apr 2008 20:39:00 +0000 (13:39 -0700)]
hrtimer: reduce calls to hrtimer_get_softirq_time()

It seems that hrtimer_run_queues() is calling hrtimer_get_softirq_time() more
often than it needs to.  This can cause frequent contention on systems with
large numbers of processors/cores.

With this patch, hrtimer_run_queues only calls hrtimer_get_softirq_time() if
there is a pending timer in one of the hrtimer bases, and only once.

This also combines hrtimer_run_queues() and the inline run_hrtimer_queue()
into one function.

[ tglx@linutronix.de: coding style ]

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoclockevents: fix typo in tick-broadcast.c
Glauber Costa [Fri, 18 Apr 2008 20:38:58 +0000 (13:38 -0700)]
clockevents: fix typo in tick-broadcast.c

braodcast -> broadcast

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agojiffies: add time_is_after_jiffies and others which compare with jiffies
Dave Young [Fri, 18 Apr 2008 20:38:57 +0000 (13:38 -0700)]
jiffies: add time_is_after_jiffies and others which compare with jiffies

Most of time_after like macros usages just compare jiffies and another number,
so here add some time_is_* macros for convenience.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoPCI: Change PCI subsystem MAINTAINER
Greg Kroah-Hartman [Thu, 17 Apr 2008 17:22:27 +0000 (10:22 -0700)]
PCI: Change PCI subsystem MAINTAINER

Jesse foolishly volunteered to handle PCI patches.  Update MAINTAINERS to
reflect this.

Woho!  Time to kick back and relax...

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci-iommu-iotlb-flushing-speedup
mark gross [Fri, 18 Apr 2008 20:53:58 +0000 (13:53 -0700)]
PCI: pci-iommu-iotlb-flushing-speedup

The following patch is an update to use an array instead of a list of
IOVA's in the implementation of defered iotlb flushes.  It takes
inspiration from sba_iommu.c

I like this implementation better as it encapsulates the batch process
within intel-iommu.c, and no longer touches iova.h (which is shared)

Performance data:  Netperf 32byte UDP streaming
2.6.25-rc3-mm1:
IOMMU-strict : 58Mps @ 62% cpu
NO-IOMMU : 71Mbs @ 41% cpu
List-based IOMMU-default-batched-IOTLB flush: 66Mbps @ 57% cpu

with this patch:
IOMMU-strict : 73Mps @ 75% cpu
NO-IOMMU : 74Mbs @ 42% cpu
Array-based IOMMU-default-batched-IOTLB flush: 72Mbps @ 62% cpu

Signed-off-by: <mgross@linux.intel.com>
Cc: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_setup_bridge() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:57 +0000 (13:53 -0700)]
PCI: pci_setup_bridge() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0x28ee9): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_bus_size_cardbus() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:56 +0000 (13:53 -0700)]
PCI: pci_bus_size_cardbus() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0x28e1f): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_scan_device() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:55 +0000 (13:53 -0700)]
PCI: pci_scan_device() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0x150f): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_alloc_child_bus() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:55 +0000 (13:53 -0700)]
PCI: pci_alloc_child_bus() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0xc4c): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Tue, 4 Mar 2008 03:09:46 +0000 (19:09 -0800)]
PCI: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered
Trent Piepho [Mon, 7 Apr 2008 23:04:16 +0000 (16:04 -0700)]
PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered

The 'power' attribute of the fakephp driver originally only let one turn a
slot off.  If one tried to turn a slot on (echo 1 > .../power), it would
return ENODEV, as fakephp did not support this function.

An old (pre-git) patch changed this:
2004/11/11 16:33:31-08:00 jdittmer
[PATCH] fakephp: add pci bus rescan ability
http://article.gmane.org/gmane.linux.kernel/251183

Now writing "1" to the power attribute has the effect of triggering a bus
rescan, but it still returns ENODEV, probably an oversight in the above
patch.

Using the BusyBox echo will not produce an error message, but will
trigger *two* bus rescans (and return an exit code of 1):
~ # strace echo -n 1 > /sys/bus/pci/slots/0000:00:00.0/power
...
write(1, "1", 1)                        = -1 ENODEV (No such device)
write(1, "1", 1)                        = -1 ENODEV (No such device)
exit(1)                                 = ?

Using cp gives a write error, even though the write did happen and a rescan
was triggered:
~ # echo -n 1 > tmp ; cp tmp /sys/bus/pci/slots/0000:00:00.0/power
cp: Write Error: No such device

It seems much better to return success instead of failure.  The actual
status of the bus rescan is hard to return.  It happens asynchronously in a
work thread, so the sysfs store functions returns before any status is
ready (the whole point of the work queue).  And even if it didn't do this,
the rescan doesn't have any clear status to return.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
CC: Jan Dittmer <jdittmer@ppp0.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno()
Jesper Juhl [Fri, 21 Mar 2008 23:07:13 +0000 (00:07 +0100)]
PCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno()

In drivers/pci/hotplug/ibmphp_core.c::ibmphp_init_devno() we allocate
space dynamically for a PCI irq routing table by calling
pcibios_get_irq_routing_table(), but we never free the allocated space.

This patch frees the allocated space at the function exit points.

Spotted by the Coverity checker. Compile tested only.

Please consider applying.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: clean up resource alignment management
Ivan Kokshaysky [Sun, 30 Mar 2008 15:50:14 +0000 (19:50 +0400)]
PCI: clean up resource alignment management

Done per Linus' request and suggestions. Linus has explained that
better than I'll be able to explain:

On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
> Actually, before we go any further, there might be a less intrusive
> alternative: add just a couple of flags to the resource flags field (we
> still have something like 8 unused bits on 32-bit), and use those to
> implement a generic "resource_alignment()" routine.
>
> Two flags would do it:
>
>  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
>    resources)
>
>  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
>    during probing)
>
> and then the case of both flags zero (or both bits set) would actually be
> "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
> actually allocate the resource (so that we don't use the "start" field as
> alignment incorrectly when it no longer indicates alignment).
>
> That wouldn't be totally generic, but it would have the nice property of
> automatically at least add sanity checking for that whole "res->start has
> the odd meaning of 'alignment' during probing" and remove the need for a
> new field, and it would allow us to have a generic "resource_alignment()"
> routine that just gets a resource pointer.

Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: aerdrv_acpi.c: remove unneeded NULL check
Adrian Bunk [Sun, 30 Mar 2008 22:41:01 +0000 (01:41 +0300)]
PCI: aerdrv_acpi.c: remove unneeded NULL check

There's no reason for checking pdev->bus for being NULL here (and we'd
anyway Oops 3 lines below if it was).

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Update VIA CX700 quirk
Tim Yamin [Sun, 30 Mar 2008 19:58:59 +0000 (20:58 +0100)]
PCI: Update VIA CX700 quirk

This follows up 53a9bf4267b8b1f958dbeb7c8c1ef21c82229b71. Some newer
CX700 BIOSes from our vendor have PCI Bus Parking disabled but PCI
Master read caching enabled. This creates problems such as system
freezing when both the network controller and the USB controller are
active and one of them is pretty busy (e.g. heavy network traffic).

This patch separates the checks and both the bus parking and the read
caching are disabled independently if either is enabled by the BIOS.

Signed-off-by: Tim Yamin <tim.yamin@zonbu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Expose PCI VPD through sysfs
Ben Hutchings [Wed, 5 Mar 2008 16:52:39 +0000 (16:52 +0000)]
PCI: Expose PCI VPD through sysfs

Vital Product Data (VPD) may be exposed by PCI devices in several
ways.  It is generally unsafe to read this information through the
existing interfaces to user-land because of stateful interfaces.

This adds:
- abstract operations for VPD access (struct pci_vpd_ops)
- VPD state information in struct pci_dev (struct pci_vpd)
- an implementation of the VPD access method specified in PCI 2.2
  (in access.c)
- a 'vpd' binary file in sysfs directories for PCI devices with VPD
  operations defined

It adds a probe for PCI 2.2 VPD in pci_scan_device() and release of
VPD state in pci_release_dev().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: iommu: iotlb flushing
mark gross [Tue, 4 Mar 2008 23:22:08 +0000 (15:22 -0800)]
PCI: iommu: iotlb flushing

This patch is for batching up the flushing of the IOTLB for the DMAR
implementation found in the Intel VT-d hardware.  It works by building a list
of to be flushed IOTLB entries and a bitmap list of which DMAR engine they are
from.

After either a high water mark (250 accessible via debugfs) or 10ms the list
of iova's will be reclaimed and the DMAR engines associated are IOTLB-flushed.

This approach recovers 15 to 20% of the performance lost when using the IOMMU
for my netperf udp stream benchmark with small packets.  It can be disabled
with a kernel boot parameter "intel_iommu=strict".

Its use does weaken the IOMMU protections a bit.

Signed-off-by: Mark Gross <mgross@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: simplify quirk debug output
Bjorn Helgaas [Tue, 4 Mar 2008 23:22:07 +0000 (15:22 -0800)]
PCI: simplify quirk debug output

print_fn_descriptor_symbol() prints the address if we don't have a symbol,
so no need to print both.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: iova RB tree setup tweak
mark gross [Tue, 4 Mar 2008 23:22:04 +0000 (15:22 -0800)]
PCI: iova RB tree setup tweak

The following patch merges two functions into one allowing for a 3%
reduction in overhead in locating, allocating and inserting pages for
use in IOMMU operations.

Its a bit of a eye-crosser so I welcome any RB-tree / MM experts to take
a look.  It works by re-using some of the information gathered in the
search for the pages to use in setting up the IOTLB's in the insertion
of the iova structure into the RB tree.

Signed-off-by: <mgross@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: parisc: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:55 +0000 (11:56 -0700)]
PCI: parisc: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - checks PCI_NUM_RESOURCES (11), not DEVICE_COUNT_RESOURCE (12), resources
    - skips resources that have neither IORESOURCE_IO nor IORESOURCE_MEM set
    - skips ROM resources unless IORESOURCE_ROM_ENABLE is set
    - checks for resource collisions with "!r->parent"

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: ppc: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:57 +0000 (11:56 -0700)]
PCI: ppc: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - checks PCI_NUM_RESOURCES (11), not 6, resources
    - skips resources that have neither IORESOURCE_IO nor IORESOURCE_MEM set
    - skips ROM resources unless IORESOURCE_ROM_ENABLE is set
    - checks for resource collisions with "!r->parent", not IORESOURCE_UNSET

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: powerpc: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:56 +0000 (11:56 -0700)]
PCI: powerpc: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.
The generic version is functionally equivalent, but uses dev_printk.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: ia64: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:52 +0000 (11:56 -0700)]
PCI: ia64: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - does not check for a NULL dev pointer
    - skips resources that have neither IORESOURCE_IO nor IORESOURCE_MEM set

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: alpha: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:48 +0000 (11:56 -0700)]
PCI: alpha: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - skips resources unless requested in "mask"
    - skips ROM resources unless IORESOURCE_ROM_ENABLE is set
    - checks for resource collisions with "!r->parent"

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: x86: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:57:01 +0000 (11:57 -0700)]
PCI: x86: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - checks for resource collisions with "!r->parent"

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: add generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:47 +0000 (11:56 -0700)]
PCI: add generic pci_enable_resources()

Each architecture has its own pcibios_enable_resources() implementation.
These differ in many minor ways that have nothing to do with actual
architectural differences.  Follow-on patches will make most arches
use this generic version instead.

This version is based on powerpc, which seemed most up-to-date.  The only
functional difference from the x86 version is that this uses "!r->parent"
to check for resource collisions instead of "!r->start && r->end".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: add PCI Express ASPM support
Shaohua Li [Mon, 25 Feb 2008 01:46:41 +0000 (09:46 +0800)]
PCI: add PCI Express ASPM support

PCI Express ASPM defines a protocol for PCI Express components in the D0
state to reduce Link power by placing their Links into a low power state
and instructing the other end of the Link to do likewise. This
capability allows hardware-autonomous, dynamic Link power reduction
beyond what is achievable by software-only controlled power management.
However, The device should be configured by software appropriately.
Enabling ASPM will save power, but will introduce device latency.

This patch adds ASPM support in Linux. It introduces a global policy for
ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
it. The interface can be used as a boot option too. Currently we have
below setting:
        -default, BIOS default setting
        -powersave, highest power saving mode, enable all available ASPM
state and clock power management
        -performance, highest performance, disable ASPM and clock power
management
By default, the 'default' policy is used currently.

In my test, power difference between powersave mode and performance mode
is about 1.3w in a system with 3 PCIE links.

Note: some devices might not work well with aspm, either because chipset
issue or device issue. The patch provide API (pci_disable_link_state),
driver can disable ASPM for specific device.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove "pci=routeirq" noise from dmesg
Bjorn Helgaas [Mon, 18 Feb 2008 16:44:13 +0000 (09:44 -0700)]
PCI: remove "pci=routeirq" noise from dmesg

The "pci=routeirq" option was added in 2004, and I don't get any valid
reports anymore.  The option is still mentioned in kernel-parameters.txt.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Include PCI domain in PCI bus names on x86/x86_64
Gary Hade [Fri, 8 Feb 2008 22:00:52 +0000 (14:00 -0800)]
PCI: Include PCI domain in PCI bus names on x86/x86_64

The PCI bus names included in /proc/iomem and /proc/ioports are
of the form 'PCI Bus #XX' where XX is the bus number.  This patch
changes the naming to 'PCI Bus XXXX:YY' where XXXX is the domain
number and YY is the bus number.  For example, PCI bus 14 in
domain 0 will show as 'PCI Bus 0000:14' instead of 'PCI Bus #14'.
This change makes the naming consistent with other architectures
such as ia64 where multiple PCI domain support has been around
longer.

Signed-off-by: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: #if 0 pci_cleanup_aer_correct_error_status()
Adrian Bunk [Tue, 5 Feb 2008 07:50:11 +0000 (23:50 -0800)]
PCI: #if 0 pci_cleanup_aer_correct_error_status()

#if 0 the no longer used pci_cleanup_aer_correct_error_status().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pcie AER: don't check _OSC when acpi is disabled
Yinghai Lu [Sun, 3 Feb 2008 06:24:47 +0000 (22:24 -0800)]
PCI: pcie AER: don't check _OSC when acpi is disabled

[PATCH] pcie AER: don't check _OSC when acpi is disabled

when acpi=off or pci=noacpi, get warning

AER service couldn't init device 0000:00:0a.0:pcie01 - no _OSC support
AER service couldn't init device 0000:00:0e.0:pcie01 - no _OSC support
AER service couldn't init device 0000:00:0f.0:pcie01 - no _OSC support
AER service couldn't init device 0000:80:0b.0:pcie01 - no _OSC support
AER service couldn't init device 0000:80:0e.0:pcie01 - no _OSC support
AER service couldn't init device 0000:80:0f.0:pcie01 - no _OSC support

so don't check _OSC in aer_osc_setup

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove global list of PCI devices
Greg Kroah-Hartman [Thu, 14 Feb 2008 22:56:56 +0000 (14:56 -0800)]
PCI: remove global list of PCI devices

This patch finally removes the global list of PCI devices.  We are
relying entirely on the list held in the driver core now, and do not
need a separate "shadow" list as no one uses it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove parisc consumer of the pci global_list
James Bottomley [Wed, 20 Feb 2008 21:14:24 +0000 (15:14 -0600)]
PCI: remove parisc consumer of the pci global_list

Remove the parisc usage of the global_list, as it's not needed anymore.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pcibios_fixup_ghosts()
Greg Kroah-Hartman [Thu, 14 Feb 2008 22:56:56 +0000 (14:56 -0800)]
PCI: remove pcibios_fixup_ghosts()

This function was obviously never being used since early 2.5 days as any
device that it would try to remove would never really be removed from
the system due to the PCI device list being held in the driver core, not
the general list of PCI devices.

As we have not had a single report of a problem here in 4 years, I think
it's safe to remove now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: add is_added flag to struct pci_dev
Greg Kroah-Hartman [Thu, 14 Feb 2008 22:56:56 +0000 (14:56 -0800)]
PCI: add is_added flag to struct pci_dev

This lets us check if the device is really added to the driver core or
not, which is what we need when walking some of the bus lists.  The flag
is there in anticipation of getting rid of the other PCI device list,
which is what we used to check in this situation.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: make no_pci_devices() use the pci_bus_type list
Greg Kroah-Hartman [Thu, 14 Feb 2008 06:30:39 +0000 (22:30 -0800)]
PCI: make no_pci_devices() use the pci_bus_type list

no_pci_devices() should use the driver core list of PCI devices, not our
"separate" one.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove initial bios sort of PCI devices on x86
Greg Kroah-Hartman [Wed, 13 Feb 2008 23:06:38 +0000 (15:06 -0800)]
PCI: remove initial bios sort of PCI devices on x86

We currently keep 2 lists of PCI devices in the system, one in the
driver core, and one all on its own.  This second list is sorted at boot
time, in "BIOS" order, to try to remain compatible with older kernels
(2.2 and earlier days).  There was also a "nosort" option to turn this
sorting off, to remain compatible with even older kernel versions, but
that just ends up being what we have been doing from 2.5 days...

Unfortunately, the second list of devices is not really ever used to
determine the probing order of PCI devices or drivers[1].  That is done
using the driver core list instead.  This change happened back in the
early 2.5 days.

Relying on BIOS ording for the binding of drivers to specific device
names is problematic for many reasons, and userspace tools like udev
exist to properly name devices in a persistant manner if that is needed,
no reliance on the BIOS is needed.

Matt Domsch and others at Dell noticed this back in 2006, and added a
boot option to sort the PCI device lists (both of them) in a
breadth-first manner to help remain compatible with the 2.4 order, if
needed for any reason.  This option is not going away, as some systems
rely on them.

This patch removes the sorting of the internal PCI device list in "BIOS"
mode, as it's not needed at all anymore, and hasn't for many years.
I've also removed the PCI flags for this from some other arches that for
some reason defined them, but never used them.

This should not change the ordering of any drivers or device probing.

[1] The old-style pci_get_device and pci_find_device() still used this
sorting order, but there are very few drivers that use these functions,
as they are deprecated for use in this manner.  If for some reason, a
driver rely on the order and uses these functions, the breadth-first
boot option will resolve any problem.

Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: the ibm driver is not dependant on PCI_LEGACY
Greg Kroah-Hartman [Wed, 13 Feb 2008 21:32:24 +0000 (13:32 -0800)]
PCI Hotplug: the ibm driver is not dependant on PCI_LEGACY

This was marked incorrectly for some reason.  Allow the ibmphp driver to
be built even if PCI_LEGACY is not enabled.

Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: make cpcihp driver use modern apis
Greg Kroah-Hartman [Wed, 13 Feb 2008 21:32:24 +0000 (13:32 -0800)]
PCI Hotplug: make cpcihp driver use modern apis

This removes the depandancy of the cpcihp driver from the PCI_LEGACY
config option by removing its usage of the pci_find_bus() function.

Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: clean up search.c a lot
Greg Kroah-Hartman [Wed, 13 Feb 2008 19:03:58 +0000 (11:03 -0800)]
PCI: clean up search.c a lot

This cleans up the search.c file, now using the pci list of devices that
are created for the driver core, instead of relying on our separate list
of devices.  It's better to use the functions already created for this
kind of thing, instead of rolling our own all the time.

This work is done in anticipation of getting rid of that second list of
pci devices all together.

And it ends up saving code, always a nice benefit.

This also removes one compiler warning for when CONFIG_PCI_LEGACY is
enabled as we no longer internally use the deprecated functions anymore.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pci_get_device_reverse
Greg Kroah-Hartman [Wed, 13 Feb 2008 17:32:03 +0000 (09:32 -0800)]
PCI: remove pci_get_device_reverse

This removes the pci_get_device_reverse function as there should not be
any need to walk pci devices backwards anymore.  All users of this call
are now gone from the tree, so it is safe to remove it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pci_get_device_reverse from calgary driver
Greg Kroah-Hartman [Wed, 13 Feb 2008 17:32:03 +0000 (09:32 -0800)]
PCI: remove pci_get_device_reverse from calgary driver

This isn't needed, we can just walk the devices in bus order with no
problems at all, as we really want to remove pci_get_device_reverse from
the kernel tree.

Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pci_find_present
Greg Kroah-Hartman [Tue, 12 Feb 2008 21:36:20 +0000 (13:36 -0800)]
PCI: remove pci_find_present

No one is using this function anymore for quite some time, so remove it.
Everyone calls pci_dev_present() instead anyway...

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: #if 0 pci_assign_resource_fixed()
Adrian Bunk [Wed, 13 Feb 2008 21:30:12 +0000 (23:30 +0200)]
PCI: #if 0 pci_assign_resource_fixed()

An unused function that bloated the kernel only when CONFIG_EMBEDDED was
enabled...

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: doc/pci: create Documentation/PCI/ and move files into it
Randy Dunlap [Tue, 11 Mar 2008 00:16:32 +0000 (17:16 -0700)]
PCI: doc/pci: create Documentation/PCI/ and move files into it

Create Documentation/PCI/ and move PCI-related files to it.
Fix a few instances of trailing whitespace.
Update references to the new file locations.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years ago[HWRNG] omap: Minor updates
David Brownell [Wed, 16 Apr 2008 11:24:42 +0000 (19:24 +0800)]
[HWRNG] omap: Minor updates

Minor cleanups to the OMAP RNG:

 - Comment update re RNG status:
     * yes, it works on 16xx; "rngtest" is quite happy
     * it's fast enough that polling vs IRQ is a non-issue
 - Get rid of BUG_ON
 - Help GCC not be stupid about inlining (object code shrink)
 - Remove "sparse" warning
 - Cope with new hotplug rule requiring "platform:" modalias

And make the file header match kernel conventions.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] kconfig: Ordering cleanup
Sebastian Siewior [Sat, 5 Apr 2008 13:04:48 +0000 (21:04 +0800)]
[CRYPTO] kconfig: Ordering cleanup

Ciphers, block modes, name it, are grouped together and sorted.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] all: Clean up init()/fini()
Kamalesh Babulal [Sat, 5 Apr 2008 13:00:57 +0000 (21:00 +0800)]
[CRYPTO] all: Clean up init()/fini()

On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
> Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> wrote:
>
> > This patch cleanups the crypto code, replaces the init() and fini()
> > with the <algorithm name>_init/_fini
>
> This part ist OK.
>
> > or init/fini_<algorithm name> (if the
> > <algorithm name>_init/_fini exist)
>
> Having init_foo and foo_init won't be a good thing, will it? I'd start
> confusing them.
>
> What about foo_modinit instead?

Thanks for the suggestion, the init() is replaced with

<algorithm name>_mod_init ()

and fini () is replaced with <algorithm name>_mod_fini.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] padlock-aes: Use generic setkey function
Sebastian Siewior [Tue, 1 Apr 2008 13:24:50 +0000 (21:24 +0800)]
[CRYPTO] padlock-aes: Use generic setkey function

The Padlock AES setkey routine is the same as exported by the generic
implementation. So we could use it.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Cc: Michal Ludvig <michal@logix.cz>
Tested-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] aes: Export generic setkey
Sebastian Siewior [Tue, 1 Apr 2008 12:58:51 +0000 (20:58 +0800)]
[CRYPTO] aes: Export generic setkey

The key expansion routine could be get little more generic, become
a kernel doc entry and then get exported.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Tested-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] api: Make the crypto subsystem fully modular
Sebastian Siewior [Sun, 30 Mar 2008 08:36:09 +0000 (16:36 +0800)]
[CRYPTO] api: Make the crypto subsystem fully modular

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] cts: Add CTS mode required for Kerberos AES support
Kevin Coffman [Mon, 24 Mar 2008 13:26:16 +0000 (21:26 +0800)]
[CRYPTO] cts: Add CTS mode required for Kerberos AES support

Implement CTS wrapper for CBC mode required for support of AES
encryption support for Kerberos (rfc3962).

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] lrw: Replace all adds to big endians variables with be*_add_cpu
Marcin Slusarz [Fri, 14 Mar 2008 08:22:53 +0000 (16:22 +0800)]
[CRYPTO] lrw: Replace all adds to big endians variables with be*_add_cpu

replace all:
big_endian_variable = cpu_to_beX(beX_to_cpu(big_endian_variable) +
expression_in_cpu_byteorder);
with:
beX_add_cpu(&big_endian_variable, expression_in_cpu_byteorder);

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Change the XTEA test vectors
Sebastian Siewior [Thu, 13 Mar 2008 12:29:07 +0000 (20:29 +0800)]
[CRYPTO] tcrypt: Change the XTEA test vectors

The third test vector of ECB-XTEA-ENC fails for me all other
are fine. I could not find a RFC or something else where they
are defined. The test vector has not been modified since git
started recording histrory. The implementation is very close
(not to say equal) to what is available as Public Domain (they
recommend 64 rounds and the in kernel uses 32). Therefore I
belive that there is typo somewhere and tcrypt reported always
*fail* instead of *okey*.
This patch replaces input + result of the third test vector with
result + input from the third decryption vector. The key is the
same, the other three test vectors are also the reverse.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Shrink the tcrypt module
Sebastian Siewior [Thu, 13 Mar 2008 12:21:51 +0000 (20:21 +0800)]
[CRYPTO] tcrypt: Shrink the tcrypt module

Currently the tcrypt module is about 2 MiB on x86-32. The
main reason for the huge size is the data segment which contains
all the test vectors for each algorithm. The test vectors are
staticly allocated in an array and the size of the array has been
drastically increased by the merge of the Salsa20 test vectors.

With a hint from Benedigt Spranger I found a way how I could
convert those fixed-length arrays to strings which are flexible
in size. VIM and regex were also very helpfull :)
So, I am talking about a shrinking of ~97% on x86-32:

   text    data     bss     dec     hex filename
  18309 2039708      20 2058037  1f6735 tcrypt-b4.ko
  45628   23516      80   69224   10e68 tcrypt.ko

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Change the usage of the test vectors
Sebastian Siewior [Thu, 13 Mar 2008 12:20:28 +0000 (20:20 +0800)]
[CRYPTO] tcrypt: Change the usage of the test vectors

The test routines (test_{cipher,hash,aead}) are makeing a copy
of the test template and are processing the encryption process
in place. This patch changes the creation of the copy so it will
work even if the source address of the input data isn't an array
inside of the template but a pointer.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] api: Constify function pointer tables
Jan Engelhardt [Thu, 13 Mar 2008 11:37:45 +0000 (19:37 +0800)]
[CRYPTO] api: Constify function pointer tables

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] aes-x86-32: Remove unused return code
Sebastian Siewior [Tue, 11 Mar 2008 13:29:47 +0000 (21:29 +0800)]
[CRYPTO] aes-x86-32: Remove unused return code

The return parameter isn't used remove it.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Shrink speed templates
Sebastian Siewior [Tue, 11 Mar 2008 13:27:11 +0000 (21:27 +0800)]
[CRYPTO] tcrypt: Shrink speed templates

The speed templates as it look always the same. The key size
is repeated for each block size and we test always the same
block size. The addition of one inner loop makes it possible
to get rid of the struct and it is possible to use a tiny
u8 array :)

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Group common speed templates
Sebastian Siewior [Tue, 11 Mar 2008 13:24:26 +0000 (21:24 +0800)]
[CRYPTO] tcrypt: Group common speed templates

Some crypto ciphers which are impleneted support similar key sizes
(16,24 & 32 byte). They can be grouped together and use a common
templatte instead of their own which contains the same data.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] sha512: Rename sha512 to sha512_generic
Jan Glauber [Thu, 6 Mar 2008 11:55:38 +0000 (19:55 +0800)]
[CRYPTO] sha512: Rename sha512 to sha512_generic

Rename sha512 to sha512_generic and add a MODULE_ALIAS for sha512
so all sha512 implementations can be loaded automatically.

Keep the broken tabs so git recognizes this as a rename.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] sha384: Hardware acceleration for s390
Jan Glauber [Thu, 6 Mar 2008 11:53:50 +0000 (19:53 +0800)]
[CRYPTO] sha384: Hardware acceleration for s390

Exploit the System z10 hardware acceleration for SHA384.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] sha512: Hardware acceleration for s390
Jan Glauber [Thu, 6 Mar 2008 11:52:00 +0000 (19:52 +0800)]
[CRYPTO] sha512: Hardware acceleration for s390

Exploit the System z10 hardware acceleration for SHA512.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] s390: Generic sha_update and sha_final
Jan Glauber [Thu, 6 Mar 2008 11:50:20 +0000 (19:50 +0800)]
[CRYPTO] s390: Generic sha_update and sha_final

The sha_{update|final} functions are similar for every sha variant.
Since that is error-prone and redundant replace these functions by
a shared generic implementation for s390.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] api: Switch to proc_create()
Alexey Dobriyan [Wed, 5 Mar 2008 11:27:51 +0000 (19:27 +0800)]
[CRYPTO] api: Switch to proc_create()

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[ISDN] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:42:50 +0000 (05:42 -0400)]
[ISDN] minor irq handler cleanups

- reference irq number in CardState structure

- remove now-unused 'intno' argument from rs_interrupt_elsa()

- cs->irq_func() should be defined using standard irq_handler_t

- add KERN_DEBUG to printk() where appropriate

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agodrivers/char: minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:20:49 +0000 (05:20 -0400)]
drivers/char: minor irq handler cleanups

- remove always-false tests

- don't overload 'irq' argument, pass data properly via dev_id

- remove pointless casts from void*

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[PPC] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:15:20 +0000 (05:15 -0400)]
[PPC] minor irq handler cleanups

- whitespace cleanups

- remove pointless prototype (uses always follow func implementation)

- 'irq' argument is used here purely as a local variable.  rename
  argument to 'dummy' and define 'irq' as local to make this plain.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[BLACKFIN] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:11:45 +0000 (05:11 -0400)]
[BLACKFIN] minor irq handler cleanups

- use standard irq_handler_t to define irq handler function arguments

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[SPARC] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:08:48 +0000 (05:08 -0400)]
[SPARC] minor irq handler cleanups

- mark timer_interrupt() static

- sparc_floppy_request_irq() prototype should use irq_handler_t

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
16 years agoARM minor irq handler cleanup: avoid passing unused info to irq
Jeff Garzik [Wed, 31 Oct 2007 09:07:08 +0000 (05:07 -0400)]
ARM minor irq handler cleanup: avoid passing unused info to irq

Reduce human confusion a bit, by /not/ passing an unused value to
arm_rtc_interrupt()

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[ISDN] Hisax: eliminate many unnecessary references to CardType[]
Jeff Garzik [Wed, 31 Oct 2007 07:42:07 +0000 (03:42 -0400)]
[ISDN] Hisax: eliminate many unnecessary references to CardType[]

For the vast majority of CardType[card->typ] uses (but not all!),
the string is constant for each driver.  Therefore, we may replace
CardType[card->typ] with the actual string describing the driver, making
each printk() a bit more simple.

This also has the nice, intended side effect of greatly reducing
external references to hisax global CardType[].  This will be of value
once the ISDN drivers are converted to the ISA/PCI/PNP hotplug APIs.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[ISDN] HiSax: modularization prep
Jeff Garzik [Sat, 16 Feb 2008 04:41:15 +0000 (23:41 -0500)]
[ISDN] HiSax: modularization prep

Pass a function pointer into the core HiSax probe function checkcard(),
in order to facilitate modular drivers passing in their own setup
routines.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[POWERPC] Fix compile breakage for 64-bit UP configs
Paul Mackerras [Sun, 20 Apr 2008 07:57:10 +0000 (17:57 +1000)]
[POWERPC] Fix compile breakage for 64-bit UP configs

The rearrangements in 945feb174b14e7098cc7ecf0cf4768d35bc52f9c
("[POWERPC] irqtrace support for 64-bit powerpc") caused 64-bit
non-SMP configs to fail to compile with a message about
local_irq_save being undefined in include/linux/proportions.h.
This follows the lead of x86 in including <linux/irqflags.h> in
asm/system.h, which fixes the problem.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Define copy_siginfo_from_user32
Roland McGrath [Sat, 19 Apr 2008 22:19:24 +0000 (08:19 +1000)]
[POWERPC] Define copy_siginfo_from_user32

Define the copy_siginfo_from_user32 entry point for powerpc, so
that generic CONFIG_COMPAT code can call it.  We already had the
code rolled into compat_sys_rt_sigqueueinfo, this just moves it
out into the canonical function that other arch's define.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add compat handler for PTRACE_GETSIGINFO
Andreas Schwab [Sat, 19 Apr 2008 16:25:13 +0000 (02:25 +1000)]
[POWERPC] Add compat handler for PTRACE_GETSIGINFO

Current versions of gdb require a working implementation of
PTRACE_GETSIGINFO for proper watchpoint support.  Since struct siginfo
contains pointers it must be converted when passed to a 32-bit debugger.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] i2c: Fix build breakage introduced by OF helpers
Jochen Friedrich [Fri, 18 Apr 2008 14:23:03 +0000 (00:23 +1000)]
[POWERPC] i2c: Fix build breakage introduced by OF helpers

Fix build breakage introduced in commit "[POWERPC] i2c: OF helpers for
the i2c API".  If i2c-core is compiled as a module, the helper needs
to be compiled as a module, as well.  Rename i2c.c to of_i2c.c to
avoid name space conflict.

[paulus@samba.org: Changed dependency from OF to PPC_OF to avoid
sparc{32,64} allmodconfig breakage.]

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoSCSI: convert struct class_device to struct device
Tony Jones [Thu, 21 Feb 2008 23:13:36 +0000 (00:13 +0100)]
SCSI: convert struct class_device to struct device

It's big, but there doesn't seem to be a way to split it up smaller...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDRM: remove unused dev_class
Greg Kroah-Hartman [Tue, 11 Mar 2008 19:50:38 +0000 (12:50 -0700)]
DRM: remove unused dev_class

The struct class_device *dev_class is not used in the struct drm_head
structure at all, so remove it as class_device is being removed entirely
from the kernel.

Cc: David Airlie <airlied@linux.ie>
Cc: Tony Jones <tonyj@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoIB: rename "dev" to "srp_dev" in srp_host structure
Greg Kroah-Hartman [Wed, 5 Mar 2008 23:13:36 +0000 (00:13 +0100)]
IB: rename "dev" to "srp_dev" in srp_host structure

This sets us up to be able to convert the srp_host to use a struct
device instead of a class_device.

Based on a original patch from Tony Jones, but split up into this piece
by Greg.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Reviewed-by: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoIB: convert struct class_device to struct device
Tony Jones [Thu, 21 Feb 2008 23:13:36 +0000 (00:13 +0100)]
IB: convert struct class_device to struct device

This converts the main ib_device to use struct device instead of struct
class_device as class_device is going away.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agomemstick: convert struct class_device to struct device
Greg Kroah-Hartman [Mon, 3 Mar 2008 23:13:36 +0000 (00:13 +0100)]
memstick: convert struct class_device to struct device

struct class_device is going away, struct device should be used instead.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Wed, 5 Mar 2008 00:41:05 +0000 (16:41 -0800)]
driver core: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: refill attribute buffer when reading from offset 0
Dan Williams [Mon, 7 Apr 2008 22:35:01 +0000 (15:35 -0700)]
sysfs: refill attribute buffer when reading from offset 0

Requiring userspace to close and re-open sysfs attributes has been the
policy since before 2.6.12.  It allows userspace to get a consistent
snapshot of kernel state and consume it with incremental reads and seeks.

Now, if the file position is zero the kernel assumes userspace wants to see
the new value.  The application for this change is to allow a userspace
RAID metadata handler to check the state of an array without causing any
memory allocations.  Thus not causing writeback to a raid array that might
be blocked waiting for userspace to take action.

Cc: Neil Brown <neilb@suse.de>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove destroy_suspended_device()
Rafael J. Wysocki [Sun, 23 Mar 2008 19:28:24 +0000 (20:28 +0100)]
PM: Remove destroy_suspended_device()

After 2.6.24 there was a plan to make the PM core acquire all device
semaphores during a suspend/hibernation to protect itself from
concurrent operations involving device objects.  That proved to be
too heavy-handed and we found a better way to achieve the goal, but
before it happened, we had introduced the functions
device_pm_schedule_removal() and destroy_suspended_device() to allow
drivers to "safely" destroy a suspended device and we had adapted some
drivers to use them.  Now that these functions are no longer necessary,
it seems reasonable to remove them and modify their users to use the
normal device unregistration instead.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoFirmware: add iSCSI iBFT Support
Konrad Rzeszutek [Thu, 10 Apr 2008 02:50:41 +0000 (19:50 -0700)]
Firmware: add iSCSI iBFT Support

Add /sysfs/firmware/ibft/[initiator|targetX|ethernetX] directories along with
text properties which export the the iSCSI Boot Firmware Table (iBFT)
structure.

What is iSCSI Boot Firmware Table?  It is a mechanism for the iSCSI tools to
extract from the machine NICs the iSCSI connection information so that they
can automagically mount the iSCSI share/target.  Currently the iSCSI
information is hard-coded in the initrd.  The /sysfs entries are read-only
one-name-and-value fields.

The usual set of data exposed is:

# for a in `find /sys/firmware/ibft/ -type f -print`; do  echo -n "$a: ";  cat $a; done
/sys/firmware/ibft/target0/target-name: iqn.2007.com.intel-sbx44:storage-10gb
/sys/firmware/ibft/target0/nic-assoc: 0
/sys/firmware/ibft/target0/chap-type: 0
/sys/firmware/ibft/target0/lun: 00000000
/sys/firmware/ibft/target0/port: 3260
/sys/firmware/ibft/target0/ip-addr: 192.168.79.116
/sys/firmware/ibft/target0/flags: 3
/sys/firmware/ibft/target0/index: 0
/sys/firmware/ibft/ethernet0/mac: 00:11:25:9d:8b:01
/sys/firmware/ibft/ethernet0/vlan: 0
/sys/firmware/ibft/ethernet0/gateway: 192.168.79.254
/sys/firmware/ibft/ethernet0/origin: 0
/sys/firmware/ibft/ethernet0/subnet-mask: 255.255.252.0
/sys/firmware/ibft/ethernet0/ip-addr: 192.168.77.41
/sys/firmware/ibft/ethernet0/flags: 7
/sys/firmware/ibft/ethernet0/index: 0
/sys/firmware/ibft/initiator/initiator-name: iqn.2007-07.com:konrad.initiator
/sys/firmware/ibft/initiator/flags: 3
/sys/firmware/ibft/initiator/index: 0

For full details of the IBFT structure please take a look at:
ftp://ftp.software.ibm.com/systems/support/system_x_pdf/ibm_iscsi_boot_firmware_table_v1.02.pdf

[akpm@linux-foundation.org: fix build]
Signed-off-by: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>