safe/jmp/linux-2.6
14 years agoMIPS: Add support for Texas Instruments AR7 System-on-a-Chip
Florian Fainelli [Wed, 24 Jun 2009 09:12:57 +0000 (11:12 +0200)]
MIPS: Add support for Texas Instruments AR7 System-on-a-Chip

This patch adds support for the Texas Instruments AR7 System-on-a-Chip.
It supports the TNETD7100, 7200 and 7300 versions of the SoC.

Signed-off-by: Matteo Croce <matteo@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Eugene Konev <ejka@openwrt.org>
Signed-off-by: Nicolas Thill <nico@openwrt.org>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14 years agoNFSD: Don't hold unrefcounted creds over call to nfsd_setuser()
David Howells [Thu, 2 Jul 2009 13:35:32 +0000 (14:35 +0100)]
NFSD: Don't hold unrefcounted creds over call to nfsd_setuser()

nfsd_open() gets an unrefcounted pointer to the current process's effective
credentials at the top of the function, then calls nfsd_setuser() via
fh_verify() - which may replace and destroy the current process's effective
credentials - and then passes the unrefcounted pointer to dentry_open() - but
the credentials may have been destroyed by this point.

Instead, the value from current_cred() should be passed directly to
dentry_open() as one of its arguments, rather than being cached in a variable.

Possibly fh_verify() should return the creds to use.

This is a regression introduced by
745ca2475a6ac596e3d8d37c2759c0fbe2586227 "CRED: Pass credentials through
dentry_open()".

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-and-Verified-By: Steve Dickson <steved@redhat.com>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
14 years agoALSA: hda - Improve ASUS eeePC 1000 mixer
Takashi Iwai [Fri, 3 Jul 2009 13:00:54 +0000 (15:00 +0200)]
ALSA: hda - Improve ASUS eeePC 1000 mixer

The mixer elements created for ASUS eeePC 1000 with ALC269 aren't
standard but strange words like "LineOut".  Rename the element names
to follow the standard one like "Headphone" and "Speaker".
Also, split the volumes to each so that the virtual master can control
them.

The alc269_fujitsu_mixer is removed because it's now identical with
the new eeepc mixer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda - Add GPIO1 control at muting with HP laptops
Takashi Iwai [Thu, 2 Jul 2009 14:10:23 +0000 (16:10 +0200)]
ALSA: hda - Add GPIO1 control at muting with HP laptops

HP laptops with AD1984A codecs (at least mobile models) need to set
GPIO1 appropriately to indicate the mute state.  The BIOS checks this
bit to judge whether the mute on or off is sent via F8 key.
Without changing this bit, the BIOS can be confused and may toggle
the mute wrongly.

Reference: Novell bnc#515266
https://bugzilla.novell.com/show_bug.cgi?id=515266

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agomfd: fix pcap adc locking
Daniel Ribeiro [Tue, 23 Jun 2009 15:30:58 +0000 (12:30 -0300)]
mfd: fix pcap adc locking

Release the lock on error.

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: sm501, fix lock imbalance
Jiri Slaby [Sun, 21 Jun 2009 22:00:02 +0000 (00:00 +0200)]
mfd: sm501, fix lock imbalance

Add omitted unlock in sm501_unit_power.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agosh-sci: update receive error handling for muxed irqs
Magnus Damm [Fri, 3 Jul 2009 08:39:34 +0000 (08:39 +0000)]
sh-sci: update receive error handling for muxed irqs

This patch updates the receive error code for muxed
interrupts in the sh-sci driver.

Receive error interrupts may be generated by the hardware
if RE or REIE bits in SCSCR are set. Update the muxed
interrupt handling code to acknowledge error interrupts
if RE or REIE is set, instead of only acknowledging if
REIE is set.

Without this patch error interrupts may be generated but
never acked resulting in a "nobody cared" crash.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: define PERF_COUNTER_INDEX_OFFSET.
Paul Mundt [Fri, 3 Jul 2009 04:08:28 +0000 (13:08 +0900)]
sh: define PERF_COUNTER_INDEX_OFFSET.

Fixes up recent build breakage.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoparisc: use generic atomic64 on 32-bit
Kyle McMartin [Thu, 2 Jul 2009 17:10:29 +0000 (13:10 -0400)]
parisc: use generic atomic64 on 32-bit

Somewhat redundant since our atomic_t uses hashed-locks on 32-bit
anyway... Maybe we can clean those up to be generic too someday.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: superio: fix build breakage
Alexander Beregalov [Thu, 16 Apr 2009 14:45:59 +0000 (14:45 +0000)]
parisc: superio: fix build breakage

Usage of parport_pc_probe_port was changed in 28783eb52
(parport: Fix various uses of parport_pc).

It introduced this build error:
drivers/parisc/superio.c: In function 'superio_parport_init':
drivers/parisc/superio.c:437: error: too few arguments to function
'parport_pc_probe_port'

Fix it.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: Fix PCI resource allocation on non-PAT SBA machines
Matthew Wilcox [Fri, 26 Jun 2009 17:44:18 +0000 (17:44 +0000)]
parisc: Fix PCI resource allocation on non-PAT SBA machines

We weren't marking the resources as memory resources, so they weren't
being found by pci_claim_resource().

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Reviewed-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: perf: wire up sys_perf_counter_open
Kyle McMartin [Wed, 24 Jun 2009 01:38:49 +0000 (21:38 -0400)]
parisc: perf: wire up sys_perf_counter_open

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: add task_pt_regs macro
Kyle McMartin [Wed, 24 Jun 2009 01:32:18 +0000 (21:32 -0400)]
parisc: add task_pt_regs macro

needed for perf_counters.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: wire sys_perf_counter_open to sys_ni_syscall
Kyle McMartin [Wed, 24 Jun 2009 00:22:06 +0000 (20:22 -0400)]
parisc: wire sys_perf_counter_open to sys_ni_syscall

Reserve a syscall slot for sys_perf_counter_open.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: inventory.c, fix bloated stack frame
Kyle McMartin [Tue, 23 Jun 2009 17:11:22 +0000 (13:11 -0400)]
parisc: inventory.c, fix bloated stack frame

The pa_pdc_cell struct can be kmalloc'd, so do that
instead.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: processor.c, fix bloated stack frame
Kyle McMartin [Tue, 23 Jun 2009 17:10:03 +0000 (13:10 -0400)]
parisc: processor.c, fix bloated stack frame

The pa_pdc_cell struct can be kmalloc'd, so do that instead.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: fix compile warning in mm/init.c
Kyle McMartin [Tue, 23 Jun 2009 15:51:43 +0000 (11:51 -0400)]
parisc: fix compile warning in mm/init.c

arch/parisc/mm/init.c: In function 'free_initmem':
381: warning: passing argument 1 of 'memset' makes pointer from integer without a cast

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: remove dead code from sys_parisc32.c
Christoph Hellwig [Tue, 23 Jun 2009 15:47:07 +0000 (11:47 -0400)]
parisc: remove dead code from sys_parisc32.c

Unless I'm totally missing something get_fd_set32/set_fd_set32 are
completely unused.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: wire up rt_tgsigqueueinfo
Kyle McMartin [Tue, 23 Jun 2009 15:40:37 +0000 (11:40 -0400)]
parisc: wire up rt_tgsigqueueinfo

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: ensure broadcast tlb purge runs single threaded
Helge Deller [Tue, 16 Jun 2009 20:51:48 +0000 (20:51 +0000)]
parisc: ensure broadcast tlb purge runs single threaded

The TLB flushing functions on hppa, which causes PxTLB broadcasts on the system
bus, needs to be protected by irq-safe spinlocks to avoid irq handlers to deadlock
the kernel. The deadlocks only happened during I/O intensive loads and triggered
pretty seldom, which is why this bug went so long unnoticed.

Signed-off-by: Helge Deller <deller@gmx.de>
[edited to use spin_lock_irqsave on UP as well since we'd been locking there
 all this time anyway, --kyle]
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: fix "delay!" timer handling
Grant Grundler [Mon, 1 Jun 2009 00:20:23 +0000 (00:20 +0000)]
parisc: fix "delay!" timer handling

Rewrote timer_interrupt() to properly handle the "delayed!" case.

If we used floating point math to compute the number of ticks that had
elapsed since the last timer interrupt, it could take up to 12K cycles
(emperical!) to handle the interrupt. Existing code assumed it would
never take more than 8k cycles. We end up programming Interval Timer
to a value less than "current" cycle counter.  Thus have to wait until
Interval Timer "wrapped" and would then get the "delayed!" printk that
I moved below.

Since we don't really know what the upper limit is, I prefer to read
CR16 again after we've programmed it to make sure we won't have to
wait for CR16 to wrap.

Further, the printk was between reading CR16 (cycle couner) and writing CR16
(the interval timer). This would cause us to continue to set the interval
timer to a value that was "behind" the cycle counter. Rinse and repeat.
So no printk's between reading CR16 and setting next interval timer.

Tested on A500 (550 Mhz PA8600).

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Tested-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
----
Kyle, Helge, and other parisc's,
Please test on 32-bit before committing.
I think I have it right but recognize I might not.

TODO: I wanted to use "do_div()" in order to get both remainder
and value back with one division op. That should help with the
latency alot but can be applied seperately from this patch.

thanks,
grant

14 years agoparisc: fix mismatched parenthesis in memcpy.c
Randolph Chung [Tue, 23 Jun 2009 14:53:26 +0000 (14:53 +0000)]
parisc: fix mismatched parenthesis in memcpy.c

>>>> I think this is what was intended? Note that this patch may affect
>>>> profiling.
>>> it really should be
>>>
>>> -    if (likely(t1 & (sizeof(unsigned int)-1)) == 0) {
>>> +    if (likely((t1 & (sizeof(unsigned int)-1)) == 0)) {
>>>
>>> randolph

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Randolph Chung <tausq@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: Fix gcc 4.4 warning in lba_pci.c
Grant Grundler [Tue, 23 Jun 2009 15:03:11 +0000 (11:03 -0400)]
parisc: Fix gcc 4.4 warning in lba_pci.c

gcc 4.4 warns about:
drivers/parisc/lba_pci.c: In function 'lba_pat_resources':
drivers/parisc/lba_pci.c:1099: warning: the frame size of 8280 bytes is larger than 4096 bytes

The problem is we declare two large structures on the stack. They don't need
to be on the stack since they are only used during LBA initialization (which
is serialized). Moving to be "static".

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: add parameter to read_cr16()
Coly Li [Thu, 30 Apr 2009 22:43:46 +0000 (22:43 +0000)]
parisc: add parameter to read_cr16()

This patch modifies parameter of au1x_counter1_read() from 'void' to 'struct
clocksource *cs', which fixes compile warning for incompatible parameter type.

Signed-off-by: Coly Li <coly.li@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: decode_exc.c should include kernel.h
Alexander Beregalov [Mon, 6 Apr 2009 09:29:58 +0000 (09:29 +0000)]
parisc: decode_exc.c should include kernel.h

Fix this build error:
arch/parisc/math-emu/decode_exc.c:351: undefined reference to `printk'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: remove obsolete hw_interrupt_type
Thomas Gleixner [Wed, 10 Jun 2009 19:56:04 +0000 (19:56 +0000)]
parisc: remove obsolete hw_interrupt_type

The defines and typedefs (hw_interrupt_type, no_irq_type, irq_desc_t) have
been kept around for migration reasons.  After more than two years it's
time to remove them finally.

This patch cleans up one of the remaining users.  When all such patches
hit mainline we can remove the defines and typedefs finally.

Impact: cleanup

Convert the last remaining users to struct irq_chip and remove the
define.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: fix irq compile bugs in arch/parisc/kernel/irq.c
Helge Deller [Sat, 6 Jun 2009 21:54:28 +0000 (21:54 +0000)]
parisc: fix irq compile bugs in arch/parisc/kernel/irq.c

Fix miscompilation in arch/parisc/kernel/irq.c:
123: warning: passing arg 1 of `cpumask_setall' from incompatible pointer type
141: warning: passing arg 1 of `cpumask_copy' from incompatible pointer type
300: warning: passing arg 1 of `cpumask_copy' from incompatible pointer type
357: warning: passing arg 2 of `cpumask_copy' from incompatible pointer type

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: advertise PCI devs after "assign_resources"
Grant Grundler [Mon, 20 Apr 2009 04:28:22 +0000 (04:28 +0000)]
parisc: advertise PCI devs after "assign_resources"

Alex Chiang asked me why PARISC was calling pci_bus_add_devices()
and pci_bus_assign_resources() in the opposite order from everyone else.
No reason and I couldn't see any data dependency.
Patch below applies cleanly to 2.6.30-rc2.

Later, I suspected the code worked only because no drivers would be
loaded/ready until much later in the system initialization sequence.

Tested "LBA" code on J6000 (32-bit) and A500 (64-bit SMP) with 2.6.30-rc2.
Not tested with any Dino controllers.
Not tested with PCI-PCI Bridge (TBD).

Reported-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: fix ldcw inline assembler
Helge Deller [Thu, 30 Apr 2009 21:39:45 +0000 (21:39 +0000)]
parisc: fix ldcw inline assembler

There are two reasons to expose the memory *a in the asm:

1) To prevent the compiler from discarding a preceeding write to *a, and
2) to prevent it from caching *a in a register over the asm.

The change has had a few days testing with a SMP build of 2.6.22.19
running on a rp3440.

This patch is about the correctness of the __ldcw() macro itself.
The use of the macro should be confined to small inline functions
to try to limit the effect of clobbering memory on GCC's optimization
of loads and stores.

Signed-off-by: Dave Anglin <dave.anglin@nrc-cnrc.gc.ca>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: kill WARN in free_initmem when DEBUG_KERNEL
Kyle McMartin [Sun, 5 Apr 2009 02:53:47 +0000 (02:53 +0000)]
parisc: kill WARN in free_initmem when DEBUG_KERNEL

Doing an IPI with local interrupts off triggers a warning. We
don't need to be quite so ridiculously paranoid. Also, clean up
a bit of the code a little.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: Remove casts from atomic macros
Bastian Blank [Sat, 4 Apr 2009 20:54:26 +0000 (20:54 +0000)]
parisc: Remove casts from atomic macros

The atomic operations on parisc are defined as macros. The macros
includes casts which disallows the use of some syntax elements and
produces error like this:

net/phonet/pep.c: In function 'pipe_rcv_status':
net/phonet/pep.c:262: error: lvalue required as left operand of assignment

The patch removes this superfluous casts.

Signed-off-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: remove CVS keywords
Alexander Beregalov [Fri, 3 Apr 2009 01:49:22 +0000 (01:49 +0000)]
parisc: remove CVS keywords

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: ccio-dma: fix build failure without procfs
Alexander Beregalov [Fri, 3 Apr 2009 12:08:54 +0000 (12:08 +0000)]
parisc: ccio-dma: fix build failure without procfs

Fix this build error when CONFIG_PROC_FS is not set:
drivers/parisc/ccio-dma.c:1574: error: 'ccio_proc_info_fops' undeclared

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: stifb: should depend on STI_CONSOLE
Alexander Beregalov [Fri, 3 Apr 2009 13:33:32 +0000 (13:33 +0000)]
parisc: stifb: should depend on STI_CONSOLE

Fix this build error when CONFIG_STI_CONSOLE is not set
drivers/video/stifb.c:1337: undefined reference to `sti_get_rom'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: wire up preadv/pwritev syscalls
Kyle McMartin [Mon, 27 Apr 2009 12:29:12 +0000 (08:29 -0400)]
parisc: wire up preadv/pwritev syscalls

Generic compat handlers look appropriate, so use those.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoMerge branch 'for-linus' of git://git.infradead.org/users/eparis/notify
Linus Torvalds [Thu, 2 Jul 2009 23:54:07 +0000 (16:54 -0700)]
Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notify

* 'for-linus' of git://git.infradead.org/users/eparis/notify:
  fs/notify/inotify: decrement user inotify count on close

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
Linus Torvalds [Thu, 2 Jul 2009 23:52:38 +0000 (16:52 -0700)]
Merge git://git./linux/kernel/git/mason/btrfs-unstable

* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: fix error message formatting
  Btrfs: fix use after free in btrfs_start_workers fail path
  Btrfs: honor nodatacow/sum mount options for new files
  Btrfs: update backrefs while dropping snapshot
  Btrfs: account for space we may use in fallocate
  Btrfs: fix the file clone ioctl for preallocated extents
  Btrfs: don't log the inode in file_write while growing the file

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Thu, 2 Jul 2009 23:52:25 +0000 (16:52 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] cxgb3i: fix connection error when vlan is enabled
  [SCSI] FC transport: Locking fix for common-code FC pass-through patch
  [SCSI] zalon: fix oops on attach failure
  [SCSI] fnic: use DMA_BIT_MASK(nn) instead of deprecated DMA_nnBIT_MASK
  [SCSI] fnic: remove redundant BUG_ONs and fix checks on unsigned
  [SCSI] ibmvscsi: Fix module load hang

14 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Thu, 2 Jul 2009 23:51:09 +0000 (16:51 -0700)]
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6: (38 commits)
  intel-iommu: Don't keep freeing page zero in dma_pte_free_pagetable()
  intel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops
  intel-iommu: Use cmpxchg64_local() for setting PTEs
  intel-iommu: Warn about unmatched unmap requests
  intel-iommu: Kill superfluous mapping_lock
  intel-iommu: Ensure that PTE writes are 64-bit atomic, even on i386
  intel-iommu: Make iommu=pt work on i386 too
  intel-iommu: Performance improvement for dma_pte_free_pagetable()
  intel-iommu: Don't free too much in dma_pte_free_pagetable()
  intel-iommu: dump mappings but don't die on pte already set
  intel-iommu: Combine domain_pfn_mapping() and domain_sg_mapping()
  intel-iommu: Introduce domain_sg_mapping() to speed up intel_map_sg()
  intel-iommu: Simplify __intel_alloc_iova()
  intel-iommu: Performance improvement for domain_pfn_mapping()
  intel-iommu: Performance improvement for dma_pte_clear_range()
  intel-iommu: Clean up iommu_domain_identity_map()
  intel-iommu: Remove last use of PHYSICAL_PAGE_MASK, for reserving PCI BARs
  intel-iommu: Make iommu_flush_iotlb_psi() take pfn as argument
  intel-iommu: Change aligned_size() to aligned_nrpages()
  intel-iommu: Clean up intel_map_sg(), remove domain_page_mapping()
  ...

14 years agoieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
Stefan Richter [Tue, 30 Jun 2009 18:28:31 +0000 (20:28 +0200)]
ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)

Increase the command ORB data structure to transport up to 16 bytes long
CDBs (instead of 12 bytes), and tell the SCSI mid layer about it.  This
is notably necessary for READ CAPACITY(16) and friends, i.e. support of
large disks.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
14 years agofirewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
Stefan Richter [Tue, 30 Jun 2009 18:27:59 +0000 (20:27 +0200)]
firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)

Increase the command ORB data structure to transport up to 16 bytes long
CDBs (instead of 12 bytes), and tell the SCSI mid layer about it.  This
is notably necessary for READ CAPACITY(16) and friends, i.e. support of
large disks.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
14 years agox86: add boundary check for 32bit res before expand e820 resource to alignment
Yinghai Lu [Wed, 1 Jul 2009 19:32:18 +0000 (12:32 -0700)]
x86: add boundary check for 32bit res before expand e820 resource to alignment

fix hang with HIGHMEM_64G and 32bit resource.  According to hpa and
Linus, use (resource_size_t)-1 to fend off big ranges.

Analyzed by hpa

Reported-and-tested-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agox86: fix power-of-2 round_up/round_down macros
Linus Torvalds [Thu, 2 Jul 2009 19:05:10 +0000 (12:05 -0700)]
x86: fix power-of-2 round_up/round_down macros

These macros had two bugs:
 - the type of the mask was not correctly expanded to the full size of
   the argument being expanded, resulting in possible loss of high bits
   when mixing types.
 - the alignment argument was evaluated twice, despite the macro looking
   like a fancy function (but it really does need to be a macro, since
   it works on arbitrary integer types)

Noticed by Peter Anvin, and with a fix that is a modification of his
suggestion (bug noticed by Yinghai Lu).

Cc: Peter Anvin <hpa@zytor.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoBtrfs: fix error message formatting
Hu Tao [Thu, 2 Jul 2009 17:55:45 +0000 (13:55 -0400)]
Btrfs: fix error message formatting

Make an error msg look nicer by inserting a space between number and word.

Signed-off-by: Hu Tao <hu.taoo@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix use after free in btrfs_start_workers fail path
Jiri Slaby [Thu, 2 Jul 2009 17:50:58 +0000 (13:50 -0400)]
Btrfs: fix use after free in btrfs_start_workers fail path

worker memory is already freed on one fail path in btrfs_start_workers,
but is still dereferenced. Switch the dereference and kfree.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: honor nodatacow/sum mount options for new files
Chris Mason [Thu, 2 Jul 2009 16:26:06 +0000 (12:26 -0400)]
Btrfs: honor nodatacow/sum mount options for new files

The btrfs attr patches unconditionally inherited the inode flags field
without honoring nodatacow and nodatasum.  This fix makes sure
we properly record the nodatacow/sum mount options in new inodes.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: update backrefs while dropping snapshot
Yan Zheng [Sun, 28 Jun 2009 01:07:35 +0000 (21:07 -0400)]
Btrfs: update backrefs while dropping snapshot

The new backref format has restriction on type of backref item.  If a tree
block isn't referenced by its owner tree, full backrefs must be used for the
pointers in it. When a tree block loses its owner tree's reference, backrefs
for the pointers in it should be updated to full backrefs. Current
btrfs_drop_snapshot misses the code that updates backrefs, so it's unsafe for
general use.

This patch adds backrefs update code to btrfs_drop_snapshot.  It isn't a
problem in the restricted form btrfs_drop_snapshot is used today, but for
general snapshot deletion this update is required.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: account for space we may use in fallocate
Josef Bacik [Sun, 28 Jun 2009 01:07:34 +0000 (21:07 -0400)]
Btrfs: account for space we may use in fallocate

Using Eric Sandeen's xfstest for fallocate, you can easily trigger a ENOSPC
panic on btrfs.  This is because we do not account for data we may use when
doing the fallocate.  This patch fixes the problem by properly reserving space,
and then just freeing it when we are done.  The reservation stuff was made with
delalloc in mind, so its a little crude for this case, but it keeps the box
from panicing.

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix the file clone ioctl for preallocated extents
Chris Mason [Sun, 28 Jun 2009 01:07:03 +0000 (21:07 -0400)]
Btrfs: fix the file clone ioctl for preallocated extents

14 years agoBtrfs: don't log the inode in file_write while growing the file
Chris Mason [Sun, 28 Jun 2009 01:06:22 +0000 (21:06 -0400)]
Btrfs: don't log the inode in file_write while growing the file

14 years agoMerge branch 'fix/oxygen' into for-linus
Takashi Iwai [Thu, 2 Jul 2009 15:48:34 +0000 (17:48 +0200)]
Merge branch 'fix/oxygen' into for-linus

* fix/oxygen:
  sound: virtuoso: fix Xonar D1/DX silence after resume

14 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Thu, 2 Jul 2009 15:48:33 +0000 (17:48 +0200)]
Merge branch 'fix/hda' into for-linus

* fix/hda:
  ALSA: hda - Add quirk for HP 6930p
  ALSA: hda - Add missing static to patch_ca0110()

14 years agoMerge branch 'fix/caiaq' into for-linus
Takashi Iwai [Thu, 2 Jul 2009 15:48:32 +0000 (17:48 +0200)]
Merge branch 'fix/caiaq' into for-linus

* fix/caiaq:
  ALSA: usx2y - reparent sound device
  ALSA: snd_usb_caiaq: reparent sound device

14 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Thu, 2 Jul 2009 15:48:31 +0000 (17:48 +0200)]
Merge branch 'fix/asoc' into for-linus

* fix/asoc:
  ASoC: Only disable pxa2xx-i2s clocks if we enabled them
  ASoC: OMAP: fix OMAP1510 broken PCM pointer callback
  ASoC: remove BROKEN from Efika and pcm030 fabric drivers
  ASoC: Fix typo in MPC5200 PSC AC97 driver Kconfig

14 years agofs/notify/inotify: decrement user inotify count on close
Keith Packard [Thu, 2 Jul 2009 04:56:38 +0000 (21:56 -0700)]
fs/notify/inotify: decrement user inotify count on close

The per-user inotify_devs value is incremented each time a new file is
allocated, but never decremented. This led to inotify_init failing after a
limited number of calls.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agointel-iommu: Don't keep freeing page zero in dma_pte_free_pagetable()
David Woodhouse [Thu, 2 Jul 2009 11:02:34 +0000 (12:02 +0100)]
intel-iommu: Don't keep freeing page zero in dma_pte_free_pagetable()

Check dma_pte_present() and only free the page if there _is_ one.
Kind of surprising that there was no warning about this.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops
David Woodhouse [Thu, 2 Jul 2009 10:21:16 +0000 (11:21 +0100)]
intel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops

On Wed, 2009-07-01 at 16:59 -0700, Linus Torvalds wrote:
> I also _really_ hate how you do
>
>         (unsigned long)pte >> VTD_PAGE_SHIFT ==
>         (unsigned long)first_pte >> VTD_PAGE_SHIFT

Kill this, in favour of just looking to see if the incremented pte
pointer has 'wrapped' onto the next page. Which means we have to check
it _after_ incrementing it, not before.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoALSA: usx2y - reparent sound device
Takashi Iwai [Thu, 2 Jul 2009 09:51:44 +0000 (11:51 +0200)]
ALSA: usx2y - reparent sound device

Fix the parent device to be the USB interface, not the USB device.
A similiar commit like 563c2bf59d392357bcc1d99642933cc88c687964.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: snd_usb_caiaq: reparent sound device
Daniel Mack [Thu, 2 Jul 2009 08:46:35 +0000 (10:46 +0200)]
ALSA: snd_usb_caiaq: reparent sound device

The sound device instance needs to be a child of the USB interface, not
the USB device. Newer udev versions pay attention to that.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agosound: virtuoso: fix Xonar D1/DX silence after resume
Clemens Ladisch [Thu, 2 Jul 2009 06:31:30 +0000 (08:31 +0200)]
sound: virtuoso: fix Xonar D1/DX silence after resume

When resuming, we better take the DACs out of the reset state before
trying to use them.

Reference: kernel bug #13599
http://bugzilla.kernel.org/show_bug.cgi?id=13599

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoFRV: Add basic performance counter support
David Howells [Wed, 1 Jul 2009 23:46:21 +0000 (00:46 +0100)]
FRV: Add basic performance counter support

Add basic performance counter support to the FRV arch.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoFRV: Implement atomic64_t
David Howells [Wed, 1 Jul 2009 23:46:16 +0000 (00:46 +0100)]
FRV: Implement atomic64_t

Implement atomic64_t and its ops for FRV.  Tested with the following patch:

diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
index 55e4fab..086d50d 100644
--- a/arch/frv/kernel/setup.c
+++ b/arch/frv/kernel/setup.c
@@ -746,6 +746,52 @@ static void __init parse_cmdline_early(char *cmdline)

 } /* end parse_cmdline_early() */

+static atomic64_t xxx;
+
+static void test_atomic64(void)
+{
+ atomic64_set(&xxx, 0x12300000023LL);
+
+ mb();
+ BUG_ON(atomic64_read(&xxx) != 0x12300000023LL);
+ mb();
+ if (atomic64_inc_return(&xxx) != 0x12300000024LL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != 0x12300000024LL);
+ mb();
+ if (atomic64_sub_return(0x36900000050LL, &xxx) != -0x2460000002cLL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != -0x2460000002cLL);
+ mb();
+ if (atomic64_dec_return(&xxx) != -0x2460000002dLL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != -0x2460000002dLL);
+ mb();
+ if (atomic64_add_return(0x36800000001LL, &xxx) != 0x121ffffffd4LL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != 0x121ffffffd4LL);
+ mb();
+ if (atomic64_cmpxchg(&xxx, 0x123456789abcdefLL, 0x121ffffffd4LL) != 0x121ffffffd4LL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != 0x121ffffffd4LL);
+ mb();
+ if (atomic64_cmpxchg(&xxx, 0x121ffffffd4LL, 0x123456789abcdefLL) != 0x121ffffffd4LL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != 0x123456789abcdefLL);
+ mb();
+ if (atomic64_xchg(&xxx, 0xabcdef123456789LL) != 0x123456789abcdefLL)
+ BUG();
+ mb();
+ BUG_ON(atomic64_read(&xxx) != 0xabcdef123456789LL);
+ mb();
+}
+
 /*****************************************************************************/
 /*
  *
@@ -845,6 +891,8 @@ void __init setup_arch(char **cmdline_p)
 // asm volatile("movgs %0,timerd" :: "r"(10000000));
 // __set_HSR(0, __get_HSR(0) | HSR0_ETMD);

+ test_atomic64();
+
 } /* end setup_arch() */

 #if 0

Note that this doesn't cover all the trivial wrappers, but does cover all the
substantial implementations.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoPCI: Fix IRQ swizzling for ARI-enabled devices
Matthew Wilcox [Wed, 1 Jul 2009 21:24:30 +0000 (14:24 -0700)]
PCI: Fix IRQ swizzling for ARI-enabled devices

For many purposes, including interrupt-swizzling, devices with ARI
enabled behave as if they have one device (number 0) and 256 functions.
This probably hasn't bitten us in practice because all ARI devices I've
seen are also IOV devices, and IOV devices are required to use MSI.
This isn't guaranteed, and there are legitimate reasons to use ARI
without IOV, and hence potentially use pin-based interrupts.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
14 years agointel-iommu: Use cmpxchg64_local() for setting PTEs
David Woodhouse [Wed, 1 Jul 2009 19:27:03 +0000 (20:27 +0100)]
intel-iommu: Use cmpxchg64_local() for setting PTEs

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Warn about unmatched unmap requests
David Woodhouse [Wed, 1 Jul 2009 18:27:53 +0000 (19:27 +0100)]
intel-iommu: Warn about unmatched unmap requests

This would have found the bug in i386 pci_unmap_addr() a long time ago.
We shouldn't just silently return without doing anything.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Wed, 1 Jul 2009 18:46:30 +0000 (11:46 -0700)]
Merge git://git./linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: LCDC dcache flush for deferred io
  sh: Fix compiler error and include the definition of IS_ERR_VALUE
  sh: re-add LCDC fbdev support to the Migo-R defconfig
  sh: fix se7724 ceu names
  sh: ms7724se: Enable sh_eth in defconfig.
  arch/sh/boards/mach-se/7206/io.c: Remove unnecessary semicolons
  sh: ms7724se: Add sh_eth support
  nommu: provide follow_pfn().
  sh: Kill off unused DEBUG_BOOTMEM symbol.
  perf_counter tools: add cpu_relax()/rmb() definitions for sh.
  sh64: Hook up page fault events for software perf counters.
  sh: Hook up page fault events for software perf counters.
  sh: make set_perf_counter_pending() static inline.
  clocksource: sh_tmu: Make undefined TCOR behaviour less undefined.

14 years agointel-iommu: Kill superfluous mapping_lock
David Woodhouse [Wed, 1 Jul 2009 18:30:28 +0000 (19:30 +0100)]
intel-iommu: Kill superfluous mapping_lock

Since we're using cmpxchg64() anyway (because that's the only way to do
an atomic 64-bit store on i386), we might as well ditch the extra
locking and just use cmpxchg64() to ensure that we don't add the page
twice.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agosh: LCDC dcache flush for deferred io
Paul Mundt [Wed, 1 Jul 2009 06:50:31 +0000 (06:50 +0000)]
sh: LCDC dcache flush for deferred io

Since writenotify on uncached vmas is unsupported in 2.6.31,
live with cached framebuffer memory in the deferred io
case for now and flush the dcache before forcing refresh.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Magnus damm <damm@igel.co.jp>
14 years agosh: Fix compiler error and include the definition of IS_ERR_VALUE
Matt Fleming [Wed, 1 Jul 2009 18:14:18 +0000 (18:14 +0000)]
sh: Fix compiler error and include the definition of IS_ERR_VALUE

When arch/sh/include/asm/syscall_32.h is included from a file that
doesn't also include linux/err.h the following error is produced,

In file included from /home/matt/src/kernels/sh-2.6/arch/sh/include/asm/syscall.h:5,
                 from kernel/trace/trace_syscalls.c:3:
/home/matt/src/kernels/sh-2.6/arch/sh/include/asm/syscall_32.h: In function 'syscall_get_error':
/home/matt/src/kernels/sh-2.6/arch/sh/include/asm/syscall_32.h:28: error: implicit declaration of function 'IS_ERR_VALUE'
make[2]: *** [kernel/trace/trace_syscalls.o] Error 1
make[1]: *** [kernel/trace] Error 2
make: *** [kernel] Error 2

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agokernel-doc: move ignoring kmemcheck
Randy Dunlap [Mon, 29 Jun 2009 21:54:11 +0000 (14:54 -0700)]
kernel-doc: move ignoring kmemcheck

Somehow I managed to generate a diff that put these 2 lines
into the wrong function:  should have been in dump_struct()
instead of in dump_enum().

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge git://git.infradead.org/mtd-2.6
Linus Torvalds [Wed, 1 Jul 2009 18:25:46 +0000 (11:25 -0700)]
Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6:
  mtd: nand: fix build failure and incorrect return from omap_wait()
  mtd: Use BLOCK_NIL consistently in NFTL/INFTL
  mtd: m25p80 timeout too short for worst-case m25p16 devices
  mtd: atmel_nand: Fix typo s/parititions/partitions/
  mtd: cmdlineparts: Use 64-bit format when printing a debug message.
  mtd: maps: Remove BUS_ID_SIZE from integrator_flash
  jffs2: fix another potential leak on error path in scan.c

14 years agointel-iommu: Ensure that PTE writes are 64-bit atomic, even on i386
David Woodhouse [Wed, 1 Jul 2009 18:21:24 +0000 (19:21 +0100)]
intel-iommu: Ensure that PTE writes are 64-bit atomic, even on i386

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
Linus Torvalds [Wed, 1 Jul 2009 18:20:46 +0000 (11:20 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mszeredi/fuse

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: invalidation reverse calls
  fuse: allow umask processing in userspace
  fuse: fix bad return value in fuse_file_poll()
  fuse: fix return value of fuse_dev_write()

14 years agoFix iommu address space allocation
David Woodhouse [Wed, 1 Jul 2009 17:49:06 +0000 (18:49 +0100)]
Fix iommu address space allocation

This fixes kernel.org bug #13584. The IOVA code attempted to optimise
the insertion of new ranges into the rbtree, with the unfortunate result
that some ranges just didn't get inserted into the tree at all. Then
those ranges would be handed out more than once, and things kind of go
downhill from there.

Introduced after 2.6.25 by ddf02886cbe665d67ca750750196ea5bf524b10b
("PCI: iova RB tree setup tweak").

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: mark gross <mgross@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoFix pci_unmap_addr() et al on i386.
David Woodhouse [Wed, 1 Jul 2009 17:34:52 +0000 (18:34 +0100)]
Fix pci_unmap_addr() et al on i386.

We can run a 32-bit kernel on boxes with an IOMMU, so we need
pci_unmap_addr() etc. to work -- without it, drivers will leak mappings.

To be honest, this whole thing looks like it's more pain than it's
worth; I'm half inclined to remove the no-op #else case altogether.

But this is the minimal fix, which just does the right thing if
CONFIG_DMAR is set.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org [ for 2.6.30 ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoelf: fix one check-after-use
Amerigo Wang [Wed, 1 Jul 2009 05:06:26 +0000 (01:06 -0400)]
elf: fix one check-after-use

Check before use it.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agointel-iommu: Make iommu=pt work on i386 too
David Woodhouse [Wed, 1 Jul 2009 17:56:16 +0000 (18:56 +0100)]
intel-iommu: Make iommu=pt work on i386 too

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Wed, 1 Jul 2009 17:41:09 +0000 (10:41 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  cfq-iosched: remove redundant check for NULL cfqq in cfq_set_request()
  blocK: Restore barrier support for md and probably other virtual devices.
  block: get rid of queue-private command filter
  block: Create bip slabs with embedded integrity vectors
  cfq-iosched: get rid of the need for __GFP_NOFAIL in cfq_find_alloc_queue()
  cfq-iosched: move cfqq initialization out of cfq_find_alloc_queue()
  Trivial typo fixes in Documentation/block/data-integrity.txt.

15 years agoASoC: Only disable pxa2xx-i2s clocks if we enabled them
Mark Brown [Wed, 1 Jul 2009 17:23:26 +0000 (18:23 +0100)]
ASoC: Only disable pxa2xx-i2s clocks if we enabled them

The clock API can't cope with unbalanced enables and disables and
we only enable in hw_params() but try to disable in shutdown.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Wed, 1 Jul 2009 17:31:26 +0000 (10:31 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: use interruptible wait when duration is controlled by userspace.
  md/raid5: suspend shouldn't affect read requests.
  md: tidy up error paths in md_alloc
  md: fix error path when duplicate name is found on md device creation.
  md: avoid dereferencing NULL pointer when accessing suspend_* sysfs attributes.
  md: Use new topology calls to indicate alignment and I/O sizes

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Wed, 1 Jul 2009 17:29:26 +0000 (10:29 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (31 commits)
  Revert "ipv4: arp announce, arp_proxy and windows ip conflict verification"
  igb: return PCI_ERS_RESULT_DISCONNECT on permanent error
  e1000e: io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT
  e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error
  e1000: fix unmap bug
  igb: fix unmap length bug
  ixgbe: fix unmap length bug
  ixgbe: Fix link capabilities during adapter resets
  ixgbe: Fix device capabilities of 82599 single speed fiber NICs.
  ixgbe: Fix SFP log messages
  usbnet: Remove private stats structure
  usbnet: Use netdev stats structure
  smsc95xx: Use netdev stats structure
  rndis_host: Use netdev stats structure
  net1080: Use netdev stats structure
  dm9601: Use netdev stats structure
  cdc_eem: Use netdev stats structure
  ipv4: Fix fib_trie rebalancing, part 3
  bnx2x: Fix the behavior of ethtool when ONBOOT=no
  sctp: xmit sctp packet always return no route error
  ...

15 years agokmemleak: Fix scheduling-while-atomic bug
Ingo Molnar [Wed, 1 Jul 2009 07:43:53 +0000 (09:43 +0200)]
kmemleak: Fix scheduling-while-atomic bug

One of the kmemleak changes caused the following
scheduling-while-holding-the-tasklist-lock regression on x86:

BUG: sleeping function called from invalid context at mm/kmemleak.c:795
in_atomic(): 1, irqs_disabled(): 0, pid: 1737, name: kmemleak
2 locks held by kmemleak/1737:
 #0:  (scan_mutex){......}, at: [<c10c4376>] kmemleak_scan_thread+0x45/0x86
 #1:  (tasklist_lock){......}, at: [<c10c3bb4>] kmemleak_scan+0x1a9/0x39c
Pid: 1737, comm: kmemleak Not tainted 2.6.31-rc1-tip #59266
Call Trace:
 [<c105ac0f>] ? __debug_show_held_locks+0x1e/0x20
 [<c102e490>] __might_sleep+0x10a/0x111
 [<c10c38d5>] scan_yield+0x17/0x3b
 [<c10c3970>] scan_block+0x39/0xd4
 [<c10c3bc6>] kmemleak_scan+0x1bb/0x39c
 [<c10c4331>] ? kmemleak_scan_thread+0x0/0x86
 [<c10c437b>] kmemleak_scan_thread+0x4a/0x86
 [<c104d73e>] kthread+0x6e/0x73
 [<c104d6d0>] ? kthread+0x0/0x73
 [<c100959f>] kernel_thread_helper+0x7/0x10
kmemleak: 834 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

The bit causing it is highly dubious:

static void scan_yield(void)
{
        might_sleep();

        if (time_is_before_eq_jiffies(next_scan_yield)) {
                schedule();
                next_scan_yield = jiffies + jiffies_scan_yield;
        }
}

It called deep inside the codepath and in a conditional way,
and that is what crapped up when one of the new scan_block()
uses grew a tasklist_lock dependency.

This minimal patch removes that yielding stuff and adds the
proper cond_resched().

The background scanning thread could probably also be reniced
to +10.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoALSA: hda - Add quirk for HP 6930p
Takashi Iwai [Wed, 1 Jul 2009 16:08:01 +0000 (18:08 +0200)]
ALSA: hda - Add quirk for HP 6930p

Added a quirk model=laptop for HP 6930p (103c:30dc) with AD1984A codec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agocfq-iosched: remove redundant check for NULL cfqq in cfq_set_request()
Shan Wei [Wed, 1 Jul 2009 10:41:14 +0000 (12:41 +0200)]
cfq-iosched: remove redundant check for NULL cfqq in cfq_set_request()

With the changes for falling back to an oom_cfqq, we never fail
to find/allocate a queue in cfq_get_queue(). So remove the check.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblocK: Restore barrier support for md and probably other virtual devices.
NeilBrown [Tue, 30 Jun 2009 07:35:44 +0000 (09:35 +0200)]
blocK: Restore barrier support for md and probably other virtual devices.

The next_ordered flag is only meaningful for devices that use __make_request.
So move the test against next_ordered out of generic code and in to
__make_request

Since this test was added, barriers have not worked on md or any
devices that don't use __make_request and so don't bother to set
next_ordered.  (dm explicitly sets something other than
QUEUE_ORDERED_NONE since
  commit 99360b4c18f7675b50d283301d46d755affe75fd
but notes in the comments that it is otherwise meaningless).

Cc: Ken Milmore <ken.milmore@googlemail.com>
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblock: get rid of queue-private command filter
Jens Axboe [Fri, 26 Jun 2009 14:27:10 +0000 (16:27 +0200)]
block: get rid of queue-private command filter

The initial patches to support this through sysfs export were broken
and have been if 0'ed out in any release. So lets just kill the code
and reclaim some space in struct request_queue, if anyone would later
like to fixup the sysfs bits, the git history can easily restore
the removed bits.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoblock: Create bip slabs with embedded integrity vectors
Martin K. Petersen [Fri, 26 Jun 2009 13:37:49 +0000 (15:37 +0200)]
block: Create bip slabs with embedded integrity vectors

This patch restores stacking ability to the block layer integrity
infrastructure by creating a set of dedicated bip slabs.  Each bip slab
has an embedded bio_vec array at the end.  This cuts down on memory
allocations and also simplifies the code compared to the original bvec
version.  Only the largest bip slab is backed by a mempool.  The pool is
contained in the bio_set so stacking drivers can ensure forward
progress.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@carl.(none)>
15 years agocfq-iosched: get rid of the need for __GFP_NOFAIL in cfq_find_alloc_queue()
Jens Axboe [Tue, 30 Jun 2009 07:34:12 +0000 (09:34 +0200)]
cfq-iosched: get rid of the need for __GFP_NOFAIL in cfq_find_alloc_queue()

Setup an emergency fallback cfqq that we allocate at IO scheduler init
time. If the slab allocation fails in cfq_find_alloc_queue(), we'll just
punt IO to that cfqq instead. This ensures that cfq_find_alloc_queue()
never fails without having to ensure free memory.

On cfqq lookup, always try to allocate a new cfqq if the given cfq io
context has the oom_cfqq assigned. This ensures that we only temporarily
punt to this shared queue.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agocfq-iosched: move cfqq initialization out of cfq_find_alloc_queue()
Jens Axboe [Fri, 26 Jun 2009 08:44:34 +0000 (10:44 +0200)]
cfq-iosched: move cfqq initialization out of cfq_find_alloc_queue()

We're going to be needing that init code outside of that function
to get rid of the __GFP_NOFAIL in cfqq allocation.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoTrivial typo fixes in Documentation/block/data-integrity.txt.
Andre Noll [Thu, 25 Jun 2009 11:03:04 +0000 (13:03 +0200)]
Trivial typo fixes in Documentation/block/data-integrity.txt.

Signed-off-by: Andre Noll <maan@systemlinux.org>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoALSA: hda - Add missing static to patch_ca0110()
Takashi Iwai [Wed, 1 Jul 2009 06:34:32 +0000 (08:34 +0200)]
ALSA: hda - Add missing static to patch_ca0110()

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agosh: re-add LCDC fbdev support to the Migo-R defconfig
Magnus Damm [Wed, 1 Jul 2009 05:16:31 +0000 (05:16 +0000)]
sh: re-add LCDC fbdev support to the Migo-R defconfig

Re-add LCDC fbdev support to the Migo-R defconfig.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: fix se7724 ceu names
Magnus Damm [Wed, 1 Jul 2009 04:55:35 +0000 (04:55 +0000)]
sh: fix se7724 ceu names

Use "ceu0" and "ceu1" as CEU names instead of "ceu".
This fixes "memchunk" kernel command line selection
on the solution engine 7724 board.

With this patch applied use "memchunk.ceu0=1m" or
"memchunk.ceu1=1m" on kernel command line to override
physically memory size to one meg for CEU0 or CEU1.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agomd: use interruptible wait when duration is controlled by userspace.
NeilBrown [Wed, 1 Jul 2009 03:15:35 +0000 (13:15 +1000)]
md: use interruptible wait when duration is controlled by userspace.

User space can set various limits on an md array so that resync waits
when it gets to a certain point, or so that I/O is blocked for a short
while.
When md is waiting against one of these limit, it should use an
interruptible wait so as not to add to the load average, and so are
not to trigger a warning if the wait goes on for too long.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd/raid5: suspend shouldn't affect read requests.
NeilBrown [Wed, 1 Jul 2009 03:15:35 +0000 (13:15 +1000)]
md/raid5: suspend shouldn't affect read requests.

md allows write to regions on an array to be suspended temporarily.
This allows user-space to participate is aspects of reshape.
In particular, data can be copied with not risk of a race.
We should not be blocking read requests though, so don't.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoRevert "ipv4: arp announce, arp_proxy and windows ip conflict verification"
Eric W. Biederman [Tue, 30 Jun 2009 16:27:17 +0000 (16:27 +0000)]
Revert "ipv4: arp announce, arp_proxy and windows ip conflict verification"

This reverts commit 73ce7b01b4496a5fbf9caf63033c874be692333f.

After discovering that we don't listen to gratuitious arps in 2.6.30
I tracked the failure down to this commit.

The patch makes absolutely no sense.  RFC2131 RFC3927 and RFC5227.
are all in agreement that an arp request with sip == 0 should be used
for the probe (to prevent learning) and an arp request with sip == tip
should be used for the gratitous announcement that people can learn
from.

It appears the author of the broken patch got those two cases confused
and modified the code to drop all gratuitous arp traffic.  Ouch!

Cc: stable@kernel.org
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: return PCI_ERS_RESULT_DISCONNECT on permanent error
Alexander Duyck [Tue, 30 Jun 2009 12:46:34 +0000 (12:46 +0000)]
igb: return PCI_ERS_RESULT_DISCONNECT on permanent error

PCI drivers that implement the io_error_detected callback should return
PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure.  This patch fixes the issue for igb.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT
Mike Mason [Tue, 30 Jun 2009 12:45:53 +0000 (12:45 +0000)]
e1000e: io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT

on permanent failure

PCI drivers that implement the io_error_detected callback
should return PCI_ERS_RESULT_DISCONNECT if the state
passed in is pci_channel_io_perm_failure.  This state is not
checked in many of the network drivers.

This patch fixes the omission in the e1000e driver.

Signed-off-by: Mike Mason <mmlnx@us.ibm.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000: return PCI_ERS_RESULT_DISCONNECT on permanent error
Andre Detsch [Tue, 30 Jun 2009 12:46:13 +0000 (12:46 +0000)]
e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error

PCI drivers that implement the io_error_detected callback
should return PCI_ERS_RESULT_DISCONNECT if the state
passed in is pci_channel_io_perm_failure.  This state is
not checked in many of the network drivers.

The patch fixes the omission in the e1000 driver.

Based on Mike Mason's similar patch for e1000e.

Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
CC: Mike Mason <mmlnx@us.ibm.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000: fix unmap bug
Jesse Brandeburg [Tue, 30 Jun 2009 12:45:34 +0000 (12:45 +0000)]
e1000: fix unmap bug

as reported by kerneloops.org

[  121.781161] ------------[ cut here ]------------
[  121.781171] WARNING: at lib/dma-debug.c:793 check_unmap+0x14e/0x577()
[  121.781173] Hardware name: S5520HC
[  121.781177] e1000 0000:0a:00.0: DMA-API: device driver tries to free DMA
memory it has not allocated [device address=0x00000001d688b0fa] [size=1522
bytes]
[  121.781180] Modules linked in: e1000 mdio  dca [last unloaded: ixgbe]
[  121.781187] Pid: 4793, comm: bash Tainted: P 2.6.30-master-06161113 #3
[  121.781190] Call Trace:
[  121.781195]  [<ffffffff8123056f>] ? check_unmap+0x14e/0x577
[  121.781201]  [<ffffffff81057a19>] warn_slowpath_common+0x77/0x8f
[  121.781205]  [<ffffffff81057ae1>] warn_slowpath_fmt+0x9f/0xa1
[  121.781212]  [<ffffffff81477ce2>] ? _spin_lock_irqsave+0x3f/0x49
[  121.781216]  [<ffffffff8122fa97>] ? get_hash_bucket+0x28/0x33
[  121.781220]  [<ffffffff8123056f>] check_unmap+0x14e/0x577
[  121.781225]  [<ffffffff810e4f48>] ? check_bytes_and_report+0x38/0xcb
[  121.781230]  [<ffffffff81230bbf>] debug_dma_unmap_page+0x80/0x92
[  121.781234]  [<ffffffff8122e549>] ? unmap_single+0x1a/0x4e
[  121.781239]  [<ffffffff813901e1>] ? __kfree_skb+0x74/0x78
[  121.781250]  [<ffffffffa00662ef>] pci_unmap_single+0x64/0x6d [e1000]
[  121.781259]  [<ffffffffa0066344>] e1000_clean_rx_ring+0x4c/0xbf [e1000]
[  121.781268]  [<ffffffffa00663df>] e1000_clean_all_rx_rings+0x28/0x36 [e1000]
[  121.781277]  [<ffffffffa0067464>] e1000_down+0x138/0x141 [e1000]
[  121.781286]  [<ffffffffa00681c2>] __e1000_shutdown+0x6b/0x198 [e1000]
[  121.781296]  [<ffffffffa0068405>] e1000_suspend+0x17/0x50 [e1000]
[  121.781301]  [<ffffffff81237665>] pci_legacy_suspend+0x3b/0xbe
[  121.781305]  [<ffffffff81237bc6>] pci_pm_suspend+0x3e/0xf1
[  121.781310]  [<ffffffff812eaf1c>] pm_op+0x57/0xde
[  121.781314]  [<ffffffff812eb444>] dpm_suspend_start+0x31e/0x470
[  121.781319]  [<ffffffff810877da>] suspend_devices_and_enter+0x3e/0x1a2
[  121.781323]  [<ffffffff81087a0f>] enter_state+0xd1/0x127
[  121.781327]  [<ffffffff8108717a>] state_store+0xa7/0xc9
[  121.781332]  [<ffffffff81221843>] kobj_attr_store+0x17/0x19
[  121.781336]  [<ffffffff8113c01e>] sysfs_write_file+0xe5/0x121
[  121.781341]  [<ffffffff810ed165>] vfs_write+0xab/0x105
[  121.781344]  [<ffffffff810ed279>] sys_write+0x47/0x6d
[  121.781349]  [<ffffffff81027aab>] system_call_fastpath+0x16/0x1b
[  121.781352] ---[ end trace 97bacaaac2ed7786 ]---

Fix is to correctly zero out internal ->dma value when unmapping
and make sure never to unmap unless there specifically was a mapping done.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>