Tejun Heo [Mon, 11 Jun 2007 05:04:01 +0000 (14:04 +0900)]
sysfs: fix race condition around sd->s_dentry, take#2
Allowing attribute and symlink dentries to be reclaimed means
sd->s_dentry can change dynamically. However, updates to the field
are unsynchronized leading to race conditions. This patch adds
sysfs_lock and use it to synchronize updates to sd->s_dentry.
Due to the locking around ->d_iput, the check in sysfs_drop_dentry()
is complex. sysfs_lock only protect sd->s_dentry pointer itself. The
validity of the dentry is protected by dcache_lock, so whether dentry
is alive or not can only be tested while holding both locks.
This is minimal backport of sysfs_drop_dentry() rewrite in devel
branch.
Tejun Heo [Mon, 11 Jun 2007 05:03:27 +0000 (14:03 +0900)]
sysfs: fix condition check in sysfs_drop_dentry()
The condition check doesn't make much sense as it basically always
succeeds. This causes NULL dereferencing on certain cases. It seems
that parentheses are put in the wrong place. Fix it.
Eric Sandeen [Mon, 11 Jun 2007 05:02:45 +0000 (14:02 +0900)]
sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses
Backport of
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc1/2.6.22-rc1-mm1/broken-out/gregkh-driver-sysfs-allocate-inode-number-using-ida.patch
For regular files in sysfs, sysfs_readdir wants to traverse
sysfs_dirent->s_dentry->d_inode->i_ino to get to the inode number.
But, the dentry can be reclaimed under memory pressure, and there is
no synchronization with readdir. This patch follows Tejun's scheme of
allocating and storing an inode number in the new s_ino member of a
sysfs_dirent, when dirents are created, and retrieving it from there
for readdir, so that the pointer chain doesn't have to be traversed.
Tejun's upstream patch uses a new-ish "ida" allocator which brings
along some extra complexity; this -stable patch has a brain-dead
incrementing counter which does not guarantee uniqueness, but because
sysfs doesn't hash inodes as iunique expects, uniqueness wasn't
guaranteed today anyway.
Linus Torvalds [Mon, 11 Jun 2007 22:46:08 +0000 (15:46 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IB/mlx4: Make sure RQ allocation is always valid
RDMA/cma: Fix initialization of next_port
IB/mlx4: Fix zeroing of rnr_retry value in ib_modify_qp()
mlx4_core: Don't set MTT address in dMPT entries with PA set
mlx4_core: Check firmware command interface revision
IB/mthca, mlx4_core: Fix typo in comment
mlx4_core: Free catastrophic error MSI-X interrupt with correct dev_id
mlx4_core: Initialize ctx_list and ctx_lock earlier
mlx4_core: Fix CQ context layout
Linus Torvalds [Mon, 11 Jun 2007 18:41:00 +0000 (11:41 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] Fix smp barriers in test_and_{change,clear,set}_bit
[MIPS] Fix IP27 build
[MIPS] Fix modpost warnings by making start_secondary __cpuinit
[MIPS] SMTC: Fix build error caused by nonsense code.
[MIPS] SMTC: The MT ASE requires to initialize c0_pagemask and c0_wired.
[MIPS] SMTC: Don't continue in set_vi_srs_handler on detected bad arguments.
[MIPS] SMTC: Fix warning.
[MIPS] Wire up utimensat, signalfd, timerfd, eventfd
[MIPS] Atlas: Fix build.
[MIPS] Always install the DSP exception handler.
[MIPS] SMTC: Don't set and restore irqregs ptr from self_ipi.
[MIPS] Fix KMODE for the R3000
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] CIFS should honour umask
[CIFS] Missing flag on negprot needed for some servers to force packet signing
[CIFS] whitespace cleanup part 2
[CIFS] whitespace cleanup
[CIFS] fix mempool destroy done in wrong order in cifs error path
[CIFS] typo in previous patch
[CIFS] Fix oops on failed cifs mount (in kthread_stop)
* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart:
[AGPGART] intel_agp: Add support for G33, Q33 and Q35 chipsets
[AGPGART] intel_agp: add support for 945GME
[AGPGART] intel_agp: add support for 965GME/GLE
[AGPGART] intel_agp: use table for device probe
[AGPGART] intel_agp: cleanup intel private data
Linus Torvalds [Mon, 11 Jun 2007 18:38:14 +0000 (11:38 -0700)]
Merge branch 'linus-plus-plus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'linus-plus-plus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
libata: limit post SRST nsect/lbal wait to ~100ms
libata: force PIO on IOMEGA ZIP 250 ATAPI
libata passthru: update cached device paramters
libata passthru: always enforce correct DEV bit
libata passthru: map UDMA protocols
libata passthru: support PIO multi commands
libata passthru: update protocol numbers
libata: Correct abuse of language
libata-core/sff: Fix multiple assumptions about DMA
ahci: Add MCP73/MCP77 support to AHCI driver
libata: fix hw_sata_spd_limit initialization
libata: print device model and firmware revision for ATAPI devices
libata: fix probe time irq printouts
libata: disable NCQ for HITACHI HTS541680J9SA00/SB21C7EP
remove unused variable in pata_isapnp
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6:
ide: Add the MCP73/77 support to PATA driver
Add the PATA controller device ID to pci_ids.h for MCP73/MCP77.
hpt366: disallow Ultra133 for HPT374
ide: generic IDE PCI driver, add another device exception
ide: HPA detect from resume
it821x: RAID mode fixes
serverworks: fix CSB6 tuning logic
serverworks: remove crappy code
Linus Torvalds [Mon, 11 Jun 2007 18:31:18 +0000 (11:31 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
mmc: don't call switch on old cards
mmc: fix broken if clause
au1xmmc: Replace C code with call to ARRAY_SIZE() macro.
mmc-atmel: remove linux/mmc/protocol.h dependencies
Ralf Baechle [Thu, 24 May 2007 13:56:58 +0000 (14:56 +0100)]
[MIPS] SMTC: Don't set and restore irqregs ptr from self_ipi.
This did corrupt register s0 which the caller of self_ipi expects to
be unchanged. This is a kernel bug which will only be triggered with
the compilers which compile __smtc_ipi_replay to use s0 across the
invocation of self_ipi. Gcc 4.1.2 does this, for example.
This must be the oldest bug that we have got. Leaving interrupts "as
they are" for the R3000 obviously means copying IEp to IEc. Since we have
got STATMASK now, I took this opportunity to mask the status register
"correctly" for the R3000 now too. Oh, and the R3000 hardly ever is
64-bit.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Tejun Heo [Sun, 10 Jun 2007 05:26:20 +0000 (14:26 +0900)]
libata: limit post SRST nsect/lbal wait to ~100ms
After SRST, libata used to wait for nsect/lbal to be set to 1/1 for
the slave device. However, some ATAPI devices don't set nsect/lbal
after SRST and the wait itself isn't too useful as we're gonna wait
for !BSY right after that anyway.
Before reset-seq update, nsect/lbal wait failure used to be ignored
and caused 30sec delay during detection. After reset-seq, all
timeouts are considered error conditions making libata fail to detect
such ATAPI devices.
This patch limits nsect/lbal wait to around 100ms. This should give
acceptable behavior to such ATAPI devices while not disturbing the
heavily used code path too much.
Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Albert Lee [Thu, 7 Jun 2007 08:01:17 +0000 (16:01 +0800)]
libata passthru: update cached device paramters
INIT_DEV_PARAMS and SET_MULTI_MODE change the device parameters cached
by libata. Re-read IDENTIFY DEVICE info and update the cached device
paramters when seeing these commands.
Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Alan Cox [Thu, 7 Jun 2007 15:19:15 +0000 (16:19 +0100)]
libata-core/sff: Fix multiple assumptions about DMA
The ata IRQ ack functions are only used when debugging. Unfortunately
almost every controller that calls them can cause crashes in some
configurations as there are missing checks for bmdma presence.
In addition ata_port_start insists of installing DMA buffers and pad
buffers for controllers regardless. The SFF controllers actually need to
make that decision dynamically at controller setup time and all need the
same helper - so we add ata_sff_port_start. Future patches will switch
the SFF drivers to use this.
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Tejun Heo [Wed, 6 Jun 2007 07:35:55 +0000 (16:35 +0900)]
libata: fix hw_sata_spd_limit initialization
hw_sata_spd_limit used to be incorrectly initialized to zero instead
of UINT_MAX if SPD is zero in SControl register. This breaks PHY
speed down. Fix it.
Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Olof Johansson [Sun, 3 Jun 2007 23:35:10 +0000 (18:35 -0500)]
libata: fix probe time irq printouts
Most drivers don't seem to fill out the host->irq field, resulting in the
wrong (no) irq being reported at probe time. For example, sil24 on my system:
ata1: SATA max UDMA/100 cmd 0xd00008009001f000 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 0
ata2: SATA max UDMA/100 cmd 0xd000080090021000 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 0
Since they're allocated and set up in ata_host_activate(), just save
them away there.
Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linus Torvalds [Sat, 9 Jun 2007 01:15:49 +0000 (18:15 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[CIPSO]: Fix several unaligned kernel accesses in the CIPSO engine.
[NetLabel]: consolidate the struct socket/sock handling to just struct sock
[IPV4]: Do not remove idev when addresses are cleared
Linus Torvalds [Sat, 9 Jun 2007 01:15:23 +0000 (18:15 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Handle PCI bridges without 'ranges' property.
[SPARC64]: Include <linux/rwsem.h> instead of <asm/rwsem.h>.
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
OHCI: Fix machine check in ohci_hub_status_data
USB: Fix up bogus bInterval values in endpoint descriptors
USB: cxacru: ignore error trying to start ADSL in atm_start
USB: cxacru: create sysfs attributes in atm_start instead of bind
USB: cxacru: add Documentation file
USB: UNUSUAL_DEV: Sync up some reported devices from Ubuntu
USB: usb gadgets avoid le{16,32}_to_cpup()
usblp: Don't let suspend to kill ->used
USB: set default y for CONFIG_USB_DEVICE_CLASS
Protect <linux/console_struct.h> from multiple inclusion
Prevent <linux/console_struct.h> from being included more than once,
otherwise you get a redefinition error if you happen to include
<linux/vt_kern.h> first.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Whitcroft [Fri, 8 Jun 2007 20:47:06 +0000 (13:47 -0700)]
update checkpatch.pl to version 0.04
This version brings a some new tests, and a host of changes to fix
false positives, of particular note:
- check for and report #if 0
- extend checking of line lengths and spacing for .pl, .sh etc
- extends the pointer type checks to multiple levels
- updates printk handling to track newlines
- adds a wrapped patch detector
- drops the leading component of the filenames
- extends switch indent handling to switch statmentes rooted in
the context
- adds foo * bar single pointer checks
This version of checkpatch.pl can be found at the following URL:
Andy Whitcroft (16):
allow checking line lengths and spacing on other source files
clean up that whitespace
sanitise the input line standardising the content of quotes
clean up pointer type * and space checks
fix up the sanitiser so it maintains the line length
apply the printk facility checks only to the first printk in a set
switch/case indent checks may anchor in the context
add a wrapped patch detector
put the #ifdef in C file checks on ice
asm volatile is acceptable
check for and report #if 0
drop the leading component of the filename as patches are -p1
use the original line when reporting operator errors
correct spelling of Joel's name
Version: 0.04
add support for struct foo * bar checks
Geert Uytterhoeven (1):
Fix checkpatch.pl name in usage template
Randy Dunlap (1):
checkpatch: produce fewer lines of output
Signed-off-by: Andy Whitcroft <apw@shadowen.org> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Joel Schopp <jschopp@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Fri, 8 Jun 2007 20:47:04 +0000 (13:47 -0700)]
hexdump: more output formatting
Add a prefix string parameter. Callers are responsible for any string
length/alignment that they want to see in the output. I.e., callers should
pad strings to achieve alignment if they want that.
Add rowsize parameter. This is the number of raw data bytes to be printed
per line. Must be 16 or 32.
Add a groupsize parameter. This allows callers to dump values as 1-byte,
2-byte, 4-byte, or 8-byte numbers. Default is 1-byte numbers. If the
total length is not an even multiple of groupsize, 1-byte numbers are
printed.
Add an "ascii" output parameter. This causes ASCII data output following
the hex data output.
Clean up some doc examples.
Align the ASCII output on all lines that are produced by one call.
Add a new interface, print_hex_dump_bytes(), that is a shortcut to
print_hex_dump(), using default parameter values to print 16 bytes in
byte-size chunks of hex + ASCII output, using printk level KERN_DEBUG.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bob Picco [Fri, 8 Jun 2007 20:47:00 +0000 (13:47 -0700)]
fix sysrq-m oops
We aren't sampling for holes in memory. Thus we encounter a section hole
with empty section map pointer for SPARSEMEM and OOPs for show_mem. This
issue has been seen in 2.6.21, current git and current mm. The patch below
is for mainline and mm. It was boot tested for SPARSEMEM, current VMEMMAP
of Andy's in mm ml and DISCONTIGMEM. A slightly different patch will be
posted to stable for 2.6.21.
Previous to commit f0a5a58aa812b31fd9f197c4ba48245942364eae memory_present
was called for node_start_pfn to node_end_pfn. This would cover the
hole(s) with reserved pages and valid sections. Most SPARSEMEM supported
arches do a pfn_valid check in show_mem before computing the page structure
address.
This issue was brought to my attention on IRC by Arnaldo Carvalho de Melo.
Thanks to Arnaldo for testing.
Signed-off-by: Bob Picco <bob.picco@hp.com> Cc: Chuck Ebbert <cebbert@redhat.com> Cc: Andi Kleen <ak@suse.de> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1. New entries can be added to tsk->pi_state_list after task completed
exit_pi_state_list(). The result is memory leakage and deadlocks.
2. handle_mm_fault() is called under spinlock. The result is obvious.
3. results in self-inflicted deadlock inside glibc.
Sometimes futex_lock_pi returns -ESRCH, when it is not expected
and glibc enters to for(;;) sleep() to simulate deadlock. This problem
is quite obvious and I think the patch is right. Though it looks like
each "if" in futex_lock_pi() got some stupid special case "else if". :-)
4. sometimes futex_lock_pi() returns -EDEADLK,
when nobody has the lock. The reason is also obvious (see comment
in the patch), but correct fix is far beyond my comprehension.
I guess someone already saw this, the chunk:
if (rt_mutex_trylock(&q.pi_state->pi_mutex))
ret = 0;
is obviously from the same opera. But it does not work, because the
rtmutex is really taken at this point: wake_futex_pi() of previous
owner reassigned it to us. My fix works. But it looks very stupid.
I would think about removal of shift of ownership in wake_futex_pi()
and making all the work in context of process taking lock.
From: Thomas Gleixner <tglx@linutronix.de>
Fix 1) Avoid the tasklist lock variant of the exit race fix by adding
an additional state transition to the exit code.
This fixes also the issue, when a task with recursive segfaults
is not able to release the futexes.
Fix 2) Cleanup the lookup_pi_state() failure path and solve the -ESRCH
problem finally.
Fix 3) Solve the fixup_pi_state_owner() problem which needs to do the fixup
in the lock protected section by using the in_atomic userspace access
functions.
This removes also the ugly lock drop / unqueue inside of fixup_pi_state()
Fix 4) Fix a stale lock in the error path of futex_wake_pi()
Added some error checks for verification.
The -EDEADLK problem is solved by the rtmutex fixups.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Ulrich Drepper <drepper@redhat.com> Cc: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Thomas Gleixner [Fri, 8 Jun 2007 20:46:57 +0000 (13:46 -0700)]
rt-mutex: fix stale return value
Alexey Kuznetsov found some problems in the pi-futex code.
The major problem is a stale return value in rt_mutex_slowlock():
When the pi chain walk returns -EDEADLK, but the waiter was woken up during
the phases where the locks were dropped, the rtmutex could be acquired, but
due to the stale return value -EDEADLK returned to the caller.
Reset the return value in the retry path.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: Ulrich Drepper <drepper@redhat.com> Cc: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Tejun Heo [Fri, 8 Jun 2007 20:46:55 +0000 (13:46 -0700)]
sata_promise: use TF interface for polling NODATA commands
sata_promise uses two different command modes - packet and TF. Packet mode
is intelligent low-overhead mode while TF is the same old taskfile
interface. As with other advanced interface (ahci/sil24),
ATA_TFLAG_POLLING has no effect in packet mode. However, PIO commands are
issued using TF interface in polling mode, so pdc_interrupt() considers
interrupts spurious if ATA_TFLAG_POLLING is set.
This is broken for polling NODATA commands because command is issued using
packet mode but the interrupt handler ignores it due to ATA_TFLAG_POLLING.
Fix pdc_qc_issue_prot() such that ATA/ATAPI NODATA commands are issued
using TF interface if ATA_TFLAG_POLLING is set.
This patch fixes detection failure introduced by polling SETXFERMODE.
Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Mikael Pettersson <mikpe@it.uu.se> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jeff Dike [Fri, 8 Jun 2007 20:46:54 +0000 (13:46 -0700)]
uml: get declaration of simple_strtoul
Include linux/kernel.h wherever simple_strtoul is used. This kills a
compile warning in stderr_console.c and potential ones in the other files.
This also fixes a bunch of style violations in exitcode.c.
Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jeff Dike [Fri, 8 Jun 2007 20:46:49 +0000 (13:46 -0700)]
uml: fix kernel stack size on x86_64
Force KERNEL_STACK_ORDER to be at least 1 on UML/x86_64, to avoid overflows.
Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Instead of returning the smallest available object return ZERO_SIZE_PTR.
A ZERO_SIZE_PTR can be legitimately used as an object pointer as long as it
is not deferenced. The dereference of ZERO_SIZE_PTR causes a distinctive
fault. kfree can handle a ZERO_SIZE_PTR in the same way as NULL.
This enables functions to use zero sized object. e.g. n = number of objects.
objects = kmalloc(n * sizeof(object));
for (i = 0; i < n; i++)
objects[i].x = y;
kfree(objects);
Signed-off-by: Christoph Lameter <clameter@sgi.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cache_free_alien must be called regardless if we use alien caches or not.
cache_free_alien() will do the right thing if there are no alien caches
available.
Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Paul Mundt <lethal@linux-sh.org> Acked-by: Pekka J Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hugh Dickins [Fri, 8 Jun 2007 20:46:46 +0000 (13:46 -0700)]
mount -t tmpfs -o mpol=: check nodes online
Randy Dunlap reports that a tmpfs, mounted with NUMA mpol= specifying an
offline node, crashes as soon as data is allocated upon it. Now restrict it
to online nodes, where before it restricted to MAX_NUMNODES.
Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Robin Holt <holt@sgi.com> Cc: Christoph Lameter <clameter@sgi.com> Cc: Andi Kleen <ak@suse.de> Tested-and-acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrew Morton [Fri, 8 Jun 2007 20:46:45 +0000 (13:46 -0700)]
document Acked-by:
Explain what we use Acked-by: for, and how it differs from Signed-off-by:
Acked-by: Dave Jones <davej@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ken Chen [Fri, 8 Jun 2007 20:46:44 +0000 (13:46 -0700)]
loop: preallocate eight loop devices
The kernel on-demand loop device instantiation breaks several user space
tools as the tools are not ready to cope with the "on-demand feature". Fix
it by instantiate default 8 loop devices and also reinstate max_loop module
parameter.
Signed-off-by: Ken Chen <kenchen@google.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Whitcroft [Fri, 8 Jun 2007 20:46:39 +0000 (13:46 -0700)]
update checkpatch.pl to version 0.03
This version brings a host of changes to cure false positives and
bugs detected on patches submitted to lkml and -mm. It also brings
a number of new tests in response to reviews, of particular note:
- catch use of volatile
- allow deprecated functions to be listed in feature-removal-schedule.txt
- warn about #ifdef's in c files
- check that spinlock_t and struct mutex use is commented
- report on architecture specific defines being used
- report memory barriers without an associated comment
Full changelog:
catch use of volatile
convert other quoted string checks to common routine
alloc deprecated functions to be listed in feature-removal-schedule.txt
split out the line length and indent for each line
improve switch block handling
handle GNU diff context lines with no leading space
warn about #ifdef's in c files
tidy up tests for signed-off-by using raw mode
check that spinlock_t and struct mutex use is commented
syntax checks for open brace placement may drop off the bottom of hunk
report memory barriers without an associated comment
when a sign off is present but ugly do not report it missing
do not mistake bitfield definitions for indented labels
report on architecture specific defines being used
major update to the operator checks
prevent switch/if/while etc matching foo_switch
generify assignement in condition error message
introduce an operator context marker
Version: 0.03
Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alan Stern [Fri, 4 May 2007 15:57:00 +0000 (11:57 -0400)]
OHCI: Fix machine check in ohci_hub_status_data
This patch (as901) fixes an oversight in ohci-hcd. The
hub_status_data routine must not try to access the controller's
memory-mapped registers if the controller is in a low-power state;
such attempts will cause a crash on some architectures (such as PPC).
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 8 Jun 2007 19:23:27 +0000 (15:23 -0400)]
USB: Fix up bogus bInterval values in endpoint descriptors
This patch (as904) adds code to check for endpoint descriptor bInterval
values outside the legal limits. Illegal values are set to 32 ms, which
seems like a reasonable default.
This fixes Bugzilla #8432.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Arlott [Fri, 11 May 2007 06:04:13 +0000 (23:04 -0700)]
USB: cxacru: ignore error trying to start ADSL in atm_start
The sysfs adsl_status attribute ignores (aside from returning -EIO to the
user) any error sending a START/STOP command to the device and there is at
least one firmware which never sends a response but appears to work
regardless. Therefore atm_start should also continue if an error is received
so that such firmware is usable.
The official Conexant driver doesn't expect a reply either but this is for
another device (E2 router) and a commonly used firmware does respond.
Also, there is no point in changing -ECONNRESET to -ETIMEDOUT since nothing
ever checks for either of these values.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Cc: Duncan Sands <duncan.sands@math.u-psud.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Arlott [Fri, 11 May 2007 06:04:12 +0000 (23:04 -0700)]
USB: cxacru: create sysfs attributes in atm_start instead of bind
Since usbatm doesn't set the usb_interface driver data until after calling
bind and heavy_init, it would be NULL when the sysfs attributes are read.
Reading the MAC address from atm_dev before atm_dev exists would have been
be possible too.
Calling create_device_file in atm_start will avoid this problem, and the
data is useless until the first status poll runs. However, it must be
ready before a status poll does a printk on line status change otherwise
userspace could react before the files exist.
For completeness I've moved remove_device_file to atm_stop so it's not
called in unbind when it's not needed. There's no point starting ADSL if
atm_start could still fail either.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Cc: Duncan Sands <duncan.sands@math.u-psud.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Arlott [Fri, 11 May 2007 06:04:09 +0000 (23:04 -0700)]
USB: cxacru: add Documentation file
The sysfs attributes for exposing cxacru statistics/status information with
possible values is now explained in Documentation/networking/cxacru.txt
including information on the writable adsl_state attribute's commands and a
sample of the kernel log format.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Cc: Duncan Sands <duncan.sands@math.u-psud.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Sat, 26 May 2007 03:40:14 +0000 (20:40 -0700)]
USB: usb gadgets avoid le{16,32}_to_cpup()
It turns out that le16_to_cpup() and le32_to_cpup() aren't always safe
to call with pointers into packed structures, since those are inlined
functions and GCC may lose the "packed" attribute. So those references
can become unaligned kernel accesses, which are evil on some hardware.
This patch updates uses of those routines in the gadget stack. The
references into packed structures can just use leXX_to_cpu(*x), which
in most cases is more natural. Some other uses in RNDIS, mostly in
debug code, were wrong in the first place; those use get_unaligned().
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Paul Moore [Fri, 8 Jun 2007 01:38:14 +0000 (18:38 -0700)]
[CIPSO]: Fix several unaligned kernel accesses in the CIPSO engine.
IPv4 options are not very well aligned within the packet and the
format of a CIPSO option is even worse. The result is that the CIPSO
engine in the kernel does a few unaligned accesses when parsing and
validating incoming packets with CIPSO options attached which generate
error messages on certain alignment sensitive platforms. This patch
fixes this by marking these unaligned accesses with the
get_unaliagned() macro.
Signed-off-by: Paul Moore <paul.moore@hp.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Paul Moore [Fri, 8 Jun 2007 01:37:15 +0000 (18:37 -0700)]
[NetLabel]: consolidate the struct socket/sock handling to just struct sock
The current NetLabel code has some redundant APIs which allow both
"struct socket" and "struct sock" types to be used; this may have made
sense at some point but it is wasteful now. Remove the functions that
operate on sockets and convert the callers. Not only does this make
the code smaller and more consistent but it pushes the locking burden
up to the caller which can be more intelligent about the locks. Also,
perform the same conversion (socket to sock) on the SELinux/NetLabel
glue code where it make sense.
Signed-off-by: Paul Moore <paul.moore@hp.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Manuel Estrada Sainz passed away on May 9th 2004, his email account got
deactivated. He was in charge of the firmware_class code, and still got
CC'ed in recent discussions about it.
Signed-off-by: Markus Rechberger <markus.rechberger@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kay Sievers [Tue, 1 May 2007 11:46:26 +0000 (13:46 +0200)]
Driver core: keep PHYSDEV for old struct class_device
Class-devices created by "struct class_device" are going to be replaced
by "struct device". Keep the deprecated PHYSDEV* variables for the already
"deprecated" struct class_device" devices.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Fri, 11 May 2007 05:36:14 +0000 (22:36 -0700)]
update Documentation/driver-model/platform.txt
Make note of the legacy "probe-the-hardware" drivers, and some APIs that
are mostly unused except by such drivers. We probably can't escape having
legacy drivers for a while (e.g. old ISA drivers), but we can at least
discourage this style code for new drivers, and unless it's unavoidable.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Andres Salomon <dilinger@debian.org> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Steve French [Fri, 8 Jun 2007 14:55:14 +0000 (14:55 +0000)]
[CIFS] CIFS should honour umask
This patch makes CIFS honour a process' umask like other filesystems.
Of course the server is still free to munge the permissions if it wants
to; but the client will send the "right" permissions to begin with.
A few caveats:
1) It only applies to filesystems that have CAP_UNIX (aka support unix
extensions)
2) It applies the correct mode to the follow up CIFSSMBUnixSetPerms()
after remote creation
When mode to CIFS/NTFS ACL mapping is complete we can do the
same thing for that case for servers which do not
support the Unix Extensions.
Signed-off-by: Matt Keenen <matt@opcode-solutions.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Sergei Shtylyov [Fri, 8 Jun 2007 13:14:32 +0000 (15:14 +0200)]
hpt366: disallow Ultra133 for HPT374
Eliminate UltraATA/133 support for HPT374 -- the chip isn't capable of this mode
according to the manual, and doesn't even seem to tolerate 66 MHz DPLL clock...
Jiri Slaby [Fri, 8 Jun 2007 13:14:31 +0000 (15:14 +0200)]
ide: generic IDE PCI driver, add another device exception
generic IDE PCI driver, add another device exception
This device is char device and is grabbed by generic ide driver:
00:0b.0 Class ffff: National Semiconductor Corporation 87410 IDE (rev ff) (prog-if ff)
Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Disallow generic IDE PCI driver to grab it by adding next condition. Also
consolidate exceptions to one bigger 'switch (dev->vendor)'.
Lee Trager [Fri, 8 Jun 2007 13:14:30 +0000 (15:14 +0200)]
ide: HPA detect from resume
Currently when system which have HPA require HPA to be detected and
disabled upon resume from RAM or disk. The current IDE drivers do not do
this nor does libata (obviously it since it doesn't support HPA yet).
I have implemented this into the current IDE drivers and it has been
tested by many others since 7/15/2006 in bug number 6840:
http://bugzilla.kernel.org/show_bug.cgi?id=6840
and it has been confirmed to work fine with no problems.
bart: added drv != NULL check to generic_ide_suspend()
From: Lee Trager <lt73@cs.drexel.edu> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  [PATCH] ide: if the id fields looks screwy, disable DMA
  It's the safer choice. Originally due to a bug in itx821x, but a
  generally sound thing to do.
  Signed-off-by: Jens Axboe <axboe@suse.de>
However it worked by pure luck before Jens' fixes: bogus ide_dma_enable()
usage in it821x driver combined with loosy check in ide_dma_verbose() allowed
the hardware to operate in DMA mode. When these problems were fixed the DMA
support broke...
The source root for the regression turned out to be that the it821x.c code
was clearing too much of id->field_valid. The IDE core code was using the
original value of id->field_valid to do the tuning but later DMA got disabled
in ide_dma_verbose() because of the incorrect id->field_valid fixup. Fix it.
While at it:
* Do fixup() after probing the drives but before tuning them (which is also
OK w.r.t. ide_undecoded_slave() fixup). This change fixes device IDENTIFY
data to be consistent before/after the tuning and allows us to remove extra
re-tuning of drives from it821x_fixups().
* Fake MWDMA0 enabled/supported bits in IDENTIFY data if the device has
DMA capable bit set (this is just to tell the IDE core that DMA is
supported since it821x firmware takes care of DMA mode programming).
* Don't touch timing registers and don't program transfer modes on devices
et all when in RAID mode - depend solely on firmware to do the tuning
(as suggested by Alan Cox and done in libata pata_it821x driver).
Thanks for testing the patch goes out to Thomas Kuther.
Cc: Thomas Kuther <gimpel@sonnenkinder.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Jens Axboe <axboe@suse.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
On CSB6 the driver is using BIOS settings and not programming DMA/PIO timings
itself. However the logic was completely broken and resulted in wrong timings
being silently allowed (instead of being corrected by the driver).
This bug would explain some data corruption/timeout issues with Serverworks
MegaIDE in RAID mode that Alan Cox has fixed recently with:
For 2.6.23 we may be better off with completely switching the driver to always
programming timings (libata pata_serverworks.c driver is doing things this way
and there were no problems reported so far) but for 2.6.22 lets fix the bug
in the simplest and the least intrusive way.
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>