[PATCH] I2C: patch quirks.c - SMBus hidden on hp laptop
This patch unhides the SMBus on the hp nc8000 and nc6000 laptops. The
patch has been co-written by Jean Delvare and Rudolf Marek. I've only
tested this on nc8000, but it should work for the nc6000 too.
Unfortunatley, we had to little information to fix the problem described
in the reported bug below, as is probably the same problem. But if we're
very lucky it might solve it too.
http://bugzilla.kernel.org/show_bug.cgi?id=2976
Anton Blanchard [Wed, 14 Jul 2004 11:00:50 +0000 (07:00 -0400)]
[PATCH] tg3 bug
During receive processing, the tg3 card updates rx_producer (the
hardware position in the receive ring) and the opaque cookie. Due to PCI
rules the stores happen in order. However the cpu may reorder the reads.
In these sort of cases there is usually a data dependency between
reading the index and looking up the data (since we use the index to
load the data). I think all cpus except alpha guarantee the reads
happen in order in this case.
However in this particular case we load hw_idx, compare it to sw_idx and
then use sw_idx to locate the opaque cookie. There is no data dependency
in this case. We need a read memory barrier between the read of
rx_producer and the opaque cookie to enforce ordering.
Thanks to Olof Johansson, Michael Chan and Broadcom for their assistance
in finding this bug.
Andrew Morton [Wed, 14 Jul 2004 10:42:35 +0000 (06:42 -0400)]
[PATCH] fix airo oops-on-removal
From: Bill Nottingham <notting@redhat.com>
airo creates /proc/driver/aironet/<device name> on device activation.
However, the device can be renamed - then on teardown it tries to remove
the wrong directory. The removal of /proc/driver/aironet then runs afoul
of the BUG_ON() in remove_proc_entry.
This fixes it by keeping a copy of the name of the directory it created.
(It doesn't actually solve the problem of the stats directory still being
/proc/driver/aironet/eth0 when you rename the device to, say, 'joe'. But
that patch would be a little less trivial.)
2004-07-12 Margit Schubert-While <margitsw@t-online.de>
* The OID type for BSSID was incorrectly set to type SSID.
It should be type RAW. This lead to interesting reporting
by "iwpriv ethX g_bssid".
(Which caused garbage output and possibly an out of bound)
* Be ultra-cautious in reporting SSID by changing the "%s"
to "%.*s" and passing the length. (Prompted by the false
type above, whereby length = 0 and a %s on a garbage field)
Pavel Roskin [Wed, 14 Jul 2004 10:25:46 +0000 (06:25 -0400)]
[netdrvr pci-skeleton] refresh
Here it is. The patch fixes all compile errors and warnings in
pci-skeleton.c. The "debug" parameter lacks corresponding variable,
so I removed it to avoid a warning on module load. Obsolete
pci_power_on() and pci_power_off() have been replaced with the new
code using pci_set_power_state(), pci_save_state() and
pci_restore_state(). The driver has been tested by compiling it as
module and as part of the kernel.
Jean Delvare [Wed, 14 Jul 2004 04:51:29 +0000 (21:51 -0700)]
[PATCH] I2C: Refine detection of LM75 chips
The LM75 detection method was a bit loose so far and would accept
non-LM75-compatible chips from times to times. It should be better now.
Additionally, the help for the lm75 driver was reworked because we now
know that the LM75 and the LM77 are not compatible.
Signed-off-by: Jean Delvare <khali at linux-fr dot org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
[PATCH] mconf.c: Honor $LINES and $COLUMNS if TIOCGWINSZ failed
While reading code, I found this buglet. If the TIOCGWINSZ fails,
mconf.c assumes 24/80 as screen size, without honoring the LINES and
COLUMNS environment variables. This is the shorter and IMHO more
correct version.
Alexander Viro [Wed, 14 Jul 2004 02:40:17 +0000 (19:40 -0700)]
[PATCH] mcdx irq handling cleanup
mcdx has different IRQ numbers for all drives; irq handler needs a
pointer to structure describing the drive in question. However, instead
of passing such pointer at request_irq() time and having it passed to
mcdx_intr() for free, mcdx.c sticks the pointer in question into an
array indexed by IRQ number and has mcdx_intr() go look it up there.
Alexander Viro [Wed, 14 Jul 2004 02:38:57 +0000 (19:38 -0700)]
[PATCH] sparse: sound compat ioctls annotations
Trivial annotations + typo fix in _snd_ioctl32_hwdep_dsp_image()
(we want to copy 32bit structure from userland, convert it to native one
and do normal ioctl on it; see the first changed line below for what's
really happening...)
Alexander Viro [Wed, 14 Jul 2004 02:37:38 +0000 (19:37 -0700)]
[PATCH] sparse: __forced added to casts in arch-specific code
Casts from __user to address-space-agnostic in amd64 and i386
made explicit (__force added; in these places we pass userland pointer
to arch-specific code that handles kernel and userland pointers the
same way).
csum_partial_copy_*() annotated properly
Alexander Viro [Wed, 14 Jul 2004 02:37:04 +0000 (19:37 -0700)]
[PATCH] sparse: read_descriptor_t annotation
We have a fun situation with read_descriptor_t - all its instances end
up passed to some actor; these actors use desc->buf as their private
data; there are 5 of them and they expect resp:
IOW, there is no type safety whatsoever; the field is essentially untyped,
we rely on the fact that actor is chosen by the same code that sets ->buf
and expect it to put something of the right type there.
Right now desc->buf is declared as char __user *. Moreover, the last
argument of ->sendfile() (what should be stored in ->buf) is void __user *,
even though it's actually _never_ a userland pointer.
If nothing else, ->sendfile() should take void * instead; that alone removes
a bunch of bogus warnings. I went further and replaced desc->buf with a
union of void * and char __user *.
Rename PCDP_TABLE_GUID back to HCDP_TABLE_GUID to get the file to compile
again. This change is against current 2.6 BK and is under
CONFIG_IA64_EARLY_PRINTK_UART.
Michael Hunold [Wed, 14 Jul 2004 02:27:27 +0000 (19:27 -0700)]
[PATCH] fix saa7146 compilation
From: Colin Leroy <colin@colino.net>
This patch fixes a compilation error on 2.6.8-rc1. Here's the error:
drivers/media/common/saa7146_video.c:3: conflicting types for `memory'
include/asm-m68k/setup.h:365: previous declaration of `memory' make[3]: ***
[drivers/media/common/saa7146_video.o] Error 1
Signed-off-by: Colin Leroy <colin@colino.net> Signed-off-by: Michael Hunold <hunold@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix 3c59x.c uses of plain integer as NULL pointer
This patch will fix 3Com "Vortex" and "Boomerang" ethernet driver sparse
warnings about using plain integer as NULL pointer.
Signed-off-by: Petri T. Koistinen <petri.koistinen@iki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Tue, 13 Jul 2004 04:30:17 +0000 (21:30 -0700)]
[PATCH] compat_fillonedir() warning fix
access_ok() expects a pointer, not unsigned long. It's not a
problem on platforms that have this guy done as a macro (or ones that
do not use fs/compat.c at all), but that's still wrong and on some
platforms that care we actually have access_ok() as inlined function.
Bogus cast removed.
Alexander Viro [Tue, 13 Jul 2004 04:16:58 +0000 (21:16 -0700)]
[PATCH] __vfs_follow_link() made inline again
__vfs_follow_link() really should be inline; that's a special case since
we are in the middle of recursion and really want to conserve stack
space. Moved before the first use, made inline again.
Alexander Viro [Tue, 13 Jul 2004 04:03:08 +0000 (21:03 -0700)]
[PATCH] sparse: gemtek ioctl fix
Dumb Typo(tm) - the first bug caught by 0/NULL checks (arg is
really a kernel pointer there, so memset() is actually OK - results
will be copied to userland by caller. Or would be, if we would not
oops ;-)
Alexander Viro [Tue, 13 Jul 2004 04:02:33 +0000 (21:02 -0700)]
[PATCH] sparse: signal annotation
ss_sp in struct sigaltstack made __user
->si_addr and ->sival_ptr made __user
your ->sa_restorer and ->sa_handler changes propagated
users of these guys annotated on i386/amd64/alpha/sparc/sparc64
Alexander Viro [Tue, 13 Jul 2004 04:02:10 +0000 (21:02 -0700)]
[PATCH] sparse: alpha sparse infrastructure
* added usual CHECK assignment in Makefile
* switched uaccess.h to __check_uptr()
* added L on long constants (ones missed earlier)
* added __user in osf_sys.c (duh - I've added __user to cast in
the initializer, but forgot to add it in declaration)
Alexander Viro [Tue, 13 Jul 2004 04:01:35 +0000 (21:01 -0700)]
[PATCH] sparse: drivers/sbus fixes
a) vfc is not 64bit-clean, marked as such in Kconfig
b) aurora is simply broken - still uses tqueues. Marked as broken.
c) vfc does dereferencing of userland pointer, right after having
carefully copied the data to kernel space ;-) Fixed.
d) vfc ->mmap() had missed prototype change. Fixed.
e) BPP ioctls are misdeclared - they should've been _IO(...) instead
of _IOR(..., void). Too late to fix, but we can at least make them
_IOR(..., char) - same value, but doesn't try to find sizeof(void).
Alexander Viro [Tue, 13 Jul 2004 04:01:12 +0000 (21:01 -0700)]
[PATCH] sparse: tms380tr.c fix
tms380tr is used both by ISA and PCI drivers. Enabling/disabling
DMA is done only for ISA ones (it's protected by if (dev->dma > 0) and
PCI ones leave it 0), but it's compiled unconditionally. Which breaks
on platforms that don't have that ISA crap at all, but support PCI just
fine. Code in question placed under ifdef CONFIG_ISA.
Alexander Viro [Tue, 13 Jul 2004 04:00:39 +0000 (21:00 -0700)]
[PATCH] sparse: isdn compile fix for platforms with HZ > 1000
Division by zero is an ugly thing... We are safe wrt overflows,
since the maximal value we ever pass is 10000 - not enough to overflow
unless you've got a platform with HZ > 200000.
Alexander Viro [Tue, 13 Jul 2004 04:00:16 +0000 (21:00 -0700)]
[PATCH] sparse: VIDIOCSWIN compat_ioctl fixes
In handling of VIDIOCSWIN for 32bit on 64bit platforms:
* switched to compat_alloc_user_space()
* fixed memory corruption in copying arguments from userland
* fixed arithmetic overflows
* added missing checks for get_user() results
and corresponding returns with -EFAULT.
Fixes calculation of how many bytes in the RX/TX FIFOs.
Previous code failed to check wether the full flags
where set before returning the byte counter. This
should ensure that the serial driver behaves correctly
when the FIFO fills, and not just ignore the input
data
Dave Kleikamp [Mon, 12 Jul 2004 08:31:38 +0000 (03:31 -0500)]
JFS: Add d_hash and d_compare operations for case-insensitive names
JFS supports OS/2-compatibility with case-insensitive file names.
To avoid multiple dentries for these names, jfs needs to provide
the d_hash and d_compare dentry_operations. The operations are
only used when the volume was created in OS/2 or with the -O flag.
Jack Steiner [Mon, 12 Jul 2004 07:27:49 +0000 (00:27 -0700)]
[PATCH] ia64: Reduce TLB flushing during process migration
This patch adds an architecture-specific callout after explicit
processor migrations. The callout allows architectures (or platforms)
to update TLB specific information (ex., cpu_vm_mask).
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: David Mosberger <davidm@hpl.hp.com>
copy_from_user() moved from dvb_ringbuffer_{write,pkt_write}() to callers;
these functions are always getting kernel pointer now. "usermem" argument
killed, code annotated.