Commit Graph

32646 Commits (32df81cbd5b41d281cc3d7e7ff6a98ac6201e197)

Author SHA1 Message Date
Sergei Shtylyov dd05c199cd pata_sil680: kill bogus reset code (take 2)
Since writing to two reserved bits ain't much of a housekeeping, I think it's
time we get rid of the custom error handler in this driver. ;-)

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 19:23:55 -05:00
Herbert Valerio Riedel 6a2e391190 Input: gpio-keys - request and configure GPIOs
Currently, gpio_keys.c assumes the GPIOs to be already properly configured;
this patch changes gpio-keys to perform explicit calls to gpio_request() and
gpio_configure_input().

This matches the behaviour of leds-gpio.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-11-21 14:42:33 -05:00
Jiri Kosina 8bf4215e8a Input: i8042 - add i8042.noloop quirk for MS Virtual Machine
When booting under Microsoft Virtual Machine, the noloop quirk is
needed, otherwise PS/2 mouse is not properly detected.

Reported-by: Lawrence Steeger <vendor@russte.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-11-21 14:17:38 -05:00
Dmitry Torokhov 3cb93db6e8 Sonypi: use synchronize_irq instead of sycnronize_sched
We know exactly what IRQ we are using, so synchronize_irq()
suits much better. Plus synchronize_sched() will not work
for us in -rt kernels.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mattia Dongili <malattia@linux.it>
2007-11-21 14:16:38 -05:00
Dmitry Torokhov dcf65cd41c sonypi: fit input devices into sysfs tree
Properly set up parent on input devices registered by sonypi.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mattia Dongili <malattia@linux.it>
2007-11-21 14:16:16 -05:00
Dmitry Torokhov 2e4d242ce7 sony-laptop: fit input devices into sysfs tree
Properly set up parent on input devices registered by sony-laptop.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mattia Dongili <malattia@linux.it>
2007-11-21 14:15:53 -05:00
David Woodhouse 1dff314451 mmc: Avoid re-using minor numbers before the original device is closed.
Move the code which marks the minor number as free to mmc_blk_put() so
that it happens on the final close() (or removal), instead of doing it
at removal even when the device is still logically open.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-21 18:45:38 +01:00
Alex Dubov b37a05069b tifm_sd: handle non-power-of-2 block sizes
It is possible to handle arbitrary block sizes with tifm card reader by
conditionally switching to PIO in case such block has to be delivered. At
the beginning of each request, DMA is either disabled (non-power-of-2 block
size) or set to load time user preference.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-21 18:42:45 +01:00
Pierre Ossman d198f10198 mmc_block: check card state after write
Some cards have been reported to signal that they're ready prematurely.
Checking both the busy bit and card state solves the issue.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-21 18:40:53 +01:00
Len Brown a3f095ade0 Pull bugzilla-9327 into release branch
Conflicts:

	drivers/acpi/ec.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20 20:07:49 -05:00
Alexey Starikovskiy e790cc8bbb ACPI: EC: Workaround for optimized controllers (version 3)
Some controllers fail to send confirmation GPE after address or data write.
Detect this and don't expect such confirmation in future.
This is a generalization of previous workaround
(66c5f4e736), which did only read address.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9327

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Romano Giannetti <romano.giannetti@gmail.com>
Tested-by: Mats Johannesson
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20 20:06:15 -05:00
Márton Németh 3ebe08a749 ACPI: EC: use printk_ratelimit(), add some DEBUG mode messages
Sometimes it is usefull to see raw protocol dump.
Uncomment '#define DEBUG' at the beginning of file to make EC
really verbose.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20 20:04:39 -05:00
Len Brown 0af2f653c5 Revert "ACPI: EC: Workaround for optimized controllers"
This reverts commit f2d68935ba.
2007-11-20 19:59:08 -05:00
Jack Morgenstein 9ed87fd34c mlx4_core: Fix state check in mlx4_qp_modify()
When checking the states passed in, mlx4_qp_modify() accidentally checks
cur_state twice rather than checking cur_state and new_state.  Fix this
to make sure that both values are in-bounds.

Since these values may be passed in from userspace, this bug results in
userspace being able to trigger an oops.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Cc: stable <stable@kernel.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-20 13:01:28 -08:00
Ralph Campbell 4187b915a0 IB/ipath: Normalize error return codes for posting work requests
The error codes for ib_post_send(), ib_post_recv(), and ib_post_srq_recv()
were inconsistent. Use EINVAL for too many SGEs and ENOMEM for too many
WRs.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-20 11:05:42 -08:00
Ralph Campbell 14de986a0b IB/ipath: Fix offset returned to ibv_modify_srq()
The wrong offset was being returned to libipathverbs so that when
ibv_modify_srq() calls mmap(), it always fails.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-20 11:04:41 -08:00
Ralph Campbell 8a278e6d57 IB/ipath: Fix error path in QP creation
This patch fixes the code which frees the partially allocated QP
resources if there was an error while creating the QP. In particular,
the QPN wasn't deallocated and the QP wasn't removed from the hash
table.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-20 11:04:10 -08:00
Ralph Campbell fb74dacb0f IB/ipath: Fix offset returned to ibv_resize_cq()
The wrong offset was being returned to libipathverbs so that when
ibv_resize_cq() calls mmap(), it always fails.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-20 11:03:26 -08:00
Cornelia Huck c5d4a9997b [S390] cio: Register/unregister subchannels only from kslowcrw.
Make sure all subchannel handling is done on the slow path workqueue
so that we don't have races between an old subchannel unregistering
and a new subchannel with the same name registering.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-11-20 11:13:49 +01:00
Peter Oberparleiter 3b8c88993e [S390] cio: change device sense procedure to work with pav aliases
Modify the sense id channel program to allow device sensing of pav
alias devices which belong to a base device with ungrouped paths.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-11-20 11:13:44 +01:00
Len Brown e6532b8883 Pull fluff into release branch
Conflicts:

	drivers/acpi/ec.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20 01:21:47 -05:00
Len Brown d89a9bda14 Pull video-2.6.24 into release branch 2007-11-20 01:20:57 -05:00
Len Brown d12dbbfe94 Pull thinkpad-2.6.24 into release branch 2007-11-20 01:20:42 -05:00
Len Brown 614a6bbecc Pull thermal into release branch 2007-11-20 01:20:31 -05:00
Len Brown c2e46d2e2a Pull procfs-default into release branch
Conflicts:

	drivers/acpi/sbs.c

Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20 01:20:00 -05:00
Len Brown 95b00786f3 Pull cpuidle into release branch 2007-11-20 01:18:37 -05:00
Len Brown 22201f7402 Pull bugzilla-9327 into release branch 2007-11-20 01:18:19 -05:00
Len Brown 5824b45126 Pull bugzilla-9262 into release branch 2007-11-20 01:18:07 -05:00
Len Brown 7833b4ae46 Pull bugzilla-9153 into release branch 2007-11-20 01:17:54 -05:00
Len Brown 86533e80e0 Pull battery into release branch 2007-11-20 01:17:42 -05:00
Shaohua Li 61fd47e0c8 ACPI: fix two IRQ8 issues in IOAPIC mode
Use mp_irqs[] to get PNP device's interrupt polarity and trigger.
There are two reasons to do this:
1. BIOS bug for PNP interrupt
2. BIOS explictly does override
mp_irqs[] should cover all the cases.

http://bugzilla.kernel.org/show_bug.cgi?id=5243
http://bugzilla.kernel.org/show_bug.cgi?id=7679
http://bugzilla.kernel.org/show_bug.cgi?id=9153

[lenb: fixed !IOAPIC and 64-bit !SMP builds]

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20 01:16:29 -05:00
Joe Perches 4fdb2a05ef ACPI: Add missing spaces to printk format
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 21:53:32 -05:00
Venkatesh Pallipadi ddc081a195 cpuidle: fix HP nx6125 regression
Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9355

cpuidle always used to fallback to C2 if there is some bm activity while
entering C3. But, presence of C2 is not always guaranteed. Change cpuidle
algorithm to detect a safe_state to fallback in case of bm_activity and
use that state instead of C2.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 21:43:22 -05:00
Venkatesh Pallipadi 5062911830 cpuidle: add sched_clock_idle_[sleep|wakeup]_event() hooks
Port 2aa44d0567
(sched: sched_clock_idle_[sleep|wakeup]_event()) to cpuidle.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 21:32:02 -05:00
Venkatesh Pallipadi c9c860e534 cpuidle: fix C3 for no bus-master control case
Port 18eab85503
(Enable C3 even when PM2_control is zero) to cpuidle.

Without this patch, some systems will notice a regression
when enabling CPU_IDLE -- C3 would no longer be available.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 21:25:23 -05:00
Henrique de Moraes Holschuh 59f91ff11e ACPI: thinkpad-acpi: fix oops when a module parameter has no value
set_ibm_param() could OOPS with a NULL pointer derreference if one did not give
any values for a module parameter it handles.  This would, of course, cause all
sort of trouble for future modprobing and require a reboot to clean up
properly.

Fix it by returning -EINVAL if no values are given for the parameter, and also
avoid any nastyness from BUG_ON while at it.

How to reproduce: modprobe thinkpad-acpi brightness

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Tested-by: Mike Kershaw <dragorn@kismetwireless.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 16:10:04 -05:00
Len Brown f0714d2023 Revert "Fix very high interrupt rate for IRQ8 (rtc) unless pnpacpi=off"
This reverts commit 9cd8047b46.
2007-11-19 12:23:59 -05:00
Alexey Starikovskiy 5870a8cd23 ACPI: EC: Don't init EC early if it has no _INI
Option to init EC early inserted to handle #8598 ASUS problem,
introduced several others.

EC driver in this particular case has fake _INI method, not present on
other machines, which don't need or break from this workaround, so lets use
its presence as a flag for early init.

http://bugzilla.kernel.org/show_bug.cgi?id=9262
http://bugzilla.kernel.org/show_bug.cgi?id=8598
https://bugzilla.novell.com/show_bug.cgi?id=334806

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 12:20:48 -05:00
Len Brown 65ea652037 Revert "acpi: make ACPI_PROCFS default to y"
This reverts commit cbff2fbf55.
2007-11-19 11:22:44 -05:00
Len Brown 3539a901d6 Revert "ACPI: add documentation for deprecated /proc/acpi/battery in ACPI_PROCFS"
This reverts commit 6e800af233.
2007-11-19 11:22:35 -05:00
Alexey Starikovskiy fdcedbba2f ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.
Introduce new ACPI_PROCFS_POWER (default Yes) config option and move
procfs code in battery, ac, and sbs drivers under it.
This is done to allow ACPI_PROCFS to be default No.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 11:21:50 -05:00
Danny Baumann c88c5786d3 ACPI: Video: Increase buffer size for writes to brightness proc file.
In order to be able to write the value "100"
to /proc/acpi/video/.../brightness, we have to allocate 5 bytes:
4 characters will be written (1, 0, 0 plus null byte),
and 1 byte should be buffer for a terminating NULL character.

http://bugzilla.kernel.org/show_bug.cgi?id=9278

Signed-off-by: Danny Baumann <dannybaumann@web.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 01:55:13 -05:00
Alexey Starikovskiy f2d68935ba ACPI: EC: Workaround for optimized controllers
Some controllers fail to send confirmation GPE after address write.
Detect this and don't expect such confirmation in future.
This is a generalization of previous workaround
(66c5f4e736), which did only read address.

http://bugzilla.kernel.org/show_bug.cgi?id=9327

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Romano Giannetti <romano.giannetti@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19 01:05:01 -05:00
Tejun Heo a0ce9aca97 ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3
ICH8 and 9 use two SFF controllers to show 6 SATA ports.  The first
controllre hosts the first 4 ports while the second one hosts the last
2.  The PCS register of the first controller encompasses the first
four ports or all six ports depending on configuration while PCS of
the second controller controls the last two ports.  Using 0xf for the
first controller and 0x3 for the second controller always result in
the correct configuration.

Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 13:10:04 +09:00
Thomas Rohwer 8d8ef2fb93 ata_piix: only enable the first port on apple macbook pro
ICH8M on apple macbook pro occasionally locks up completely during PCS
initialization if ports other than the first one are enabled.  Add a
separate controller ID and only enable the first port.

tj: commit description added and patch updated to fit with the
    previous controller ID update.

Signed-off-by: Thomas Rohwer <tr@tng.de>
Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:11 +09:00
Tejun Heo 00242ec876 ata_piix: reorganize controller IDs
Move piix_pata_mwdma to top, rename ich9_2port_sata to ich8_2port_sata
for consistency and use automatically incremented values instead of
assigning fixed values to ease adding new controller IDs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:11 +09:00
Gabriel C 1f71d0672a pata_sis.c: Add Packard Bell EasyNote K5305 to laptops
With newer kernels HDD in my old laptop is limited to UDMA 33.
With this patch I get UDMA 100 again.

Signed-off-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:11 +09:00
Mark Lord 607126c2a2 libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs
Sebastian Kemper reported that issuing CD/DVD commands under libata is
not fully compatible with ide-scsi.  In particular, the
GPCMD_SET_STREAMING was being rejected at the host level in some
instances.

The reason is that libata-scsi insists upon the cmd_len field exactly
matching the SCSI opcode being issued, whereas ide-scsi tolerates
12-byte commands contained within a 16-byte (cmd_len) CDB.

There doesn't seem to be a good reason for us to not be compatible
there, so here is a patch to fix libata-scsi to permit SCSI opcodes so
long as they fit within whatever size CDB is provided.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:11 +09:00
Albert Lee f442cd86c1 libata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives
Per Mark's comments, maybe all ATAPI tape drives need ATA_HORKAGE_STUCK_ERR.
This patch applys ATA_HORKAGE_STUCK_ERR for all ATAPI tape drives.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:11 +09:00
Albert Lee 2d3b8eea7f libata: workaround DRQ=1 ERR=1 for ATAPI tape drives
After an error condition, some ATAPI tape drives set DRQ=1 together
with ERR=1 when asking the host to transfer the CDB of the next packet
command (i.e. request sense).  This patch, a revised version of
Alan/Mark's previous patch, adds ATA_HORKAGE_STUCK_ERR to workaround
the problem by ignoring the ERR bit and proceed sending the CDB.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:11 +09:00
Adrian Bunk 21bef6dd2b libata: remove unused functions
This patch removes the following obsolete functions:
- libata-core.c: __sata_phy_reset()
- libata-core.c: sata_phy_reset()
- libata-eh.c: ata_qc_timeout()
- libata-eh.c: ata_eng_timeout()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Tejun Heo <htejun@gmail.com>
2007-11-19 12:28:09 +09:00
Tejun Heo de753e5e86 ata_piix: add SATELLITE U205 to broken suspend list
Satellite U205 has alternate product name where the satellite part is
all capatalized.  Add it to the blacklist.

This is reported by Ross Patterson in kernel bugzilla bug #7780.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Ross Patterson <me@rpatterson.net>
2007-11-19 12:28:09 +09:00
Ivo van Doorn b242e891c2 rt2x00: Request usb_maxpacket() once
The usb max packet size won't change during the
device's presence. We should store it in a
variable inside rt2x00dev and use that.
This should also fix a division error when the
device is being hot-unplugged while a frame is
being send out.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-18 18:47:37 -08:00
Rusty Russell 8329d98e48 virtio: fix net driver loop case where we fail to restart
skb is only NULL the first time around: it's more correct to test for
being under-budget.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2007-11-19 11:20:44 +11:00
Rusty Russell 74b2553f1d virtio: fix module/device unloading
The virtio code never hooked through the ->remove callback.  Although
noone supports device removal at the moment, this code is already
needed for module unloading.

This of course also revealed bugs in virtio_blk, virtio_net and lguest
unloading paths.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2007-11-19 11:20:42 +11:00
Jeff Garzik 037cbc63fd ACPI: SBS: Fix retval warning
drivers/acpi/sbs.c: In function acpi_battery_add:
drivers/acpi/sbs.c:811: warning: ignoring return value of device_create_file,
declared with attribute warn_unused_result

Additional cleanups:
* use struct acpi_battery in acpi_battery_remove() to clean up function
calls, just like acpi_battery_add() already does.

* put braces around unregister call, as it depends on dev being not NULL.

* remove unneeded braces

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-18 17:24:01 -05:00
Zhao Yakui f79f06ab9f ACPI: Enable MSR (FixedHW) support for T-States
Add throttling control via MSR when T-states uses
the FixHW Control Status registers.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:46:25 -05:00
Zhao Yakui 0ac3c57131 ACPI: Get throttling info from BIOS only after evaluating _PDC
Previously _PDC was evaluated later, and thus we'd not get
the chance to tell the BIOS that we can suport FixedHW registers (MSRs)
and the BIOS would always ask us to use System I/O access
for throttling.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:45:39 -05:00
Zhao Yakui 9bcb272173 ACPI: Use _TSS for throttling control, when present. Add error checks.
_TSS was erroneously ignored, in favor of the FADT.

When TSS is used, the access width is included in the PTC control/status
register.  So it is unnecessary that the access bit width is multiplied by 8.
At the same time the bit_offset should be considered for system I/O Access.

It should be checked the bit_width and bit_offset of PTC regsiter in order to
avoid the failure of system I/O access. It means that bit_width plus
bit_offset can't be greater than 32.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:43:21 -05:00
Zhao Yakui 0753f6e0a3 ACPI: throttle: Change internal APIs better handle _PTC
Change the function interface for throttling control via PTC.
The following functions are concerned:

acpi_read_throttling_status()
acpi_write_throttling_state()
acpi_get_throttling_value()
acpi_get_throttling_state()

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:40:40 -05:00
Zhao Yakui 22cc50199d ACPI: If _TSS exists, do not access FADT.duty_width
Factor out legacy FADT.duty_width code
and run it only in the non _TSS case.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:39:21 -05:00
Zhao Yakui 49fbabf56d ACPI: Handle I/O access width requestst that are not a multiple of 8 bits.
We've run into BIOS that hand us 4-bit access width requests
for T-state control when the code expected only multipls of 8-bits.
Round up.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:37:14 -05:00
Zhao Yakui ef54d5ad2f ACPI: Enforce T-state limit changes immediately
When a T-state limit change notification is received,
Linux must evaluate _TPC and change its current
T-state immediately to comply with the new limit.

Previously, Linux would notice the new limit
only upon the next throttling change.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16 21:34:49 -05:00
Linus Torvalds 4c5cdb1e1f Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Fix up whitespace in conservative governor.
  [CPUFREQ] Make cpufreq_conservative handle out-of-sync events properly
  [CPUFREQ] architectural pstate driver for powernow-k8
2007-11-16 18:30:26 -08:00
Linus Torvalds adea27f4ba 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:
  [NETFILTER]: Fix NULL pointer dereference in nf_nat_move_storage()
  [SUNHME]: VLAN support for sunhme
  [CHELSIO]: Fix skb->dev setting.
  [NETFILTER]: fix compat_nf_sockopt typo
  [INET]: Fix potential kfree on vmalloc-ed area of request_sock_queue
  [VIA_VELOCITY]: Don't oops on MTU change.
  iwl4965: fix not correctly dealing with hotunplug
  rt2x00: Fix chipset revision validation
  iwl3945: place CCK rates in front of OFDM for supported rates
  mac80211: Fix queuing of scan containing a SSID
2007-11-15 16:34:00 -08:00
Chris Poon a5a97263a9 [SUNHME]: VLAN support for sunhme
This patch enables VLAN support on sunhme by increasing BMAC_TXMAX/BMAC_RXMAX
and allocating extra space via skb_put for the VLAN header.
 
Signed-off-by: Chris Poon <dev-null@telus.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-15 15:38:45 -08:00
Divy Le Ray 7de6af0f23 [CHELSIO]: Fix skb->dev setting.
eth_type_trans() now sets skb->dev.  Access skb->def after it gets
set.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-15 15:06:32 -08:00
Linus Torvalds ecefe4a1c3 Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefix
  i2c/eeprom: Hide Sony Vaio serial numbers
  i2c-pasemi: Fix NACK detection
  i2c-pasemi: Replace obsolete "driverfs" reference with "sysfs"
  i2c: Make i2c_check_addr static
  i2c-dev: Unbound new-style i2c clients aren't busy
  i2c-dev: "how does it work" comments
2007-11-15 11:01:07 -08:00
Jean Delvare 8b925a3dd8 i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefix
Recent (i.e. 2005 and later) Sony Vaio laptops have names beginning
with VGN rather than PCG. Update the eeprom driver so that it
recognizes these.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-11-15 19:24:03 +01:00
Jean Delvare 0f2cbd38aa i2c/eeprom: Hide Sony Vaio serial numbers
The sysfs interface to DMI data takes care to not make the system
serial number and UUID world-readable, presumably due to privacy
concerns. For consistency, we should not let the eeprom driver
export these same strings to the world on Sony Vaio laptops.
Instead, only make them readable by root, as we already do for BIOS
passwords.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-11-15 19:24:03 +01:00
Olof Johansson be8a1f7cd4 i2c-pasemi: Fix NACK detection
Turns out we don't actually check the status to see if there was a
device out there to talk to, just if we had a timeout when doing so.

Add the proper check, so we don't falsly think there are devices
on the bus that are not there, etc.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-11-15 19:24:02 +01:00
Robert P. J. Day ff23f3eabb i2c-pasemi: Replace obsolete "driverfs" reference with "sysfs"
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-11-15 19:24:02 +01:00
Jean Delvare 5e31c2bd3c i2c: Make i2c_check_addr static
i2c_check_addr is only used inside i2c-core now, so we can make it
static and stop exporting it. Thanks to David Brownell for noticing.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-11-15 19:24:02 +01:00
Jean Delvare bd4217d8c6 i2c-dev: Unbound new-style i2c clients aren't busy
Let i2c-dev deal properly with new-style i2c clients. Instead of
considering them always busy, it needs to check wether a driver is
bound to them or not.

This is still not completely correct, as the client could become
busy later, but the same problem already existed before new-style
clients were introduced. We'll want to fix it someday.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2007-11-15 19:24:01 +01:00
David Brownell 907135aaa0 i2c-dev: "how does it work" comments
This adds some "how does this work" comments to the i2c-dev driver,
plus separators between the three main components:

  - The parallel list of i2c_adapters ("i2c_dev_list"), each of which
    gets a "struct i2c_dev" and a /dev/i2c-X character special file.

  - An i2cdev_driver gets adapter add/remove notifications, which are
    used to maintain that list of adapters.

  - Special file operations, which let userspace talk either directly to
    the adapter (for i2c_msg operations) or through cached addressing info
    using an anonymous i2c_client (never registered anywhere).

Plus there's the usual module load/unload record keeping.

After making sense of this code, I think that the anonymous i2c_client
is pretty shady.  But since it's never registered, using this code with
a system set up for "new style" I2C drivers is no more complicated than
always using the I2C_SLAVE_FORCE ioctl (instead of I2C_SLAVE).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-11-15 19:24:01 +01:00
Linus Torvalds 279e1dab94 Revert "skge: fix ram buffer size calculation"
This reverts commit 7fb7ac2411.

Heikki Orsila reports that it causes a regression:

  "Doing

	nc host port < /dev/zero

   on a sending machine (not skge) to an skge machine that is receiving:

	nc -l -p port >/dev/null

   with ~60 MiB/s speed, causes the interface go malfunct. A slow
   transfer doesn't cause a problem."

See

	http://bugzilla.kernel.org/show_bug.cgi?id=9321

for some more information.

There is a workaround (also reported by Heikki):

  "After some fiddling, I noticed that not changing the register write
   order on patch:

   +       skge_write32(hw, RB_ADDR(q, RB_END), end);
           skge_write32(hw, RB_ADDR(q, RB_WP), start);
           skge_write32(hw, RB_ADDR(q, RB_RP), start);
   -       skge_write32(hw, RB_ADDR(q, RB_END), end);

   fixes the visible effect..  Possibly not the root cause of the
   problem, but changing the order back fixes networking here."

but that has yet to be ack'ed or tested more widely, so the whole
problem-causing commit gets reverted until this is resolved properly.

Bisected-and-requested-by: Heikki Orsila <shdl@zakalwe.fi>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-15 08:44:36 -08:00
Mike Frysinger 9862cc5278 Blackfin arch: change get_bf537_ether_addr() to bfin_get_ether_addr() since this is not BF537 specific and to better match other Blackfin-specific conventions
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-15 21:21:20 +08:00
Mike Frysinger 529a73fbae Blackfin arch: punt CONFIG_BFIN -- we already have CONFIG_BLACKFIN
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-23 14:28:44 +08:00
Stephen Hemminger bd7b3f3419 [VIA_VELOCITY]: Don't oops on MTU change.
Simple mtu change when device is down.
Fix http://bugzilla.kernel.org/show_bug.cgi?id=9382.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14 19:47:27 -08:00
David S. Miller d06fc1d9b5 Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2007-11-14 19:44:02 -08:00
Linus Torvalds 99fee6d7e5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  [CRYPTO] geode: Fix not inplace encryption
2007-11-14 19:17:07 -08:00
Linus Torvalds 4e396db803 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:
  mlx4_core: Fix thinko in QP destroy (incorrect bitmap_free)
  RDMA/cxgb3: Set the max_qp_init_rd_atom attribute in query_device
  IB/ehca: Fix static rate calculation
  IB/ehca: Return physical link information in query_port()
  IB/ipath: Fix race with ACK retry timeout list management
  IB/ipath: Fix memory leak in ipath_resize_cq() if copy_to_user() fails
  mlx4_core: Fix possible bad free in mlx4_buf_free()
2007-11-14 18:53:49 -08:00
Linus Torvalds 6f37ac793d 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:
  [NET]: rt_check_expire() can take a long time, add a cond_resched()
  [ISDN] sc: Really, really fix warning
  [ISDN] sc: Fix sndpkt to have the correct number of arguments
  [TCP] FRTO: Clear frto_highmark only after process_frto that uses it
  [NET]: Remove notifier block from chain when register_netdevice_notifier fails
  [FS_ENET]: Fix module build.
  [TCP]: Make sure write_queue_from does not begin with NULL ptr
  [TCP]: Fix size calculation in sk_stream_alloc_pskb
  [S2IO]: Fixed memory leak when MSI-X vector allocation fails
  [BONDING]: Fix resource use after free
  [SYSCTL]: Fix warning for token-ring from sysctl checker
  [NET] random : secure_tcp_sequence_number should not assume CONFIG_KTIME_SCALAR
  [IWLWIFI]: Not correctly dealing with hotunplug.
  [TCP] FRTO: Plug potential LOST-bit leak
  [TCP] FRTO: Limit snd_cwnd if TCP was application limited
  [E1000]: Fix schedule while atomic when called from mii-tool.
  [NETX]: Fix build failure added by 2.6.24 statistics cleanup.
  [EP93xx_ETH]: Build fix after 2.6.24 NAPI changes.
  [PKT_SCHED]: Check subqueue status before calling hard_start_xmit
2007-11-14 18:51:48 -08:00
Jesper Nilsson 3eed639364 CRISv10 Ethernet declare mac fix
Declare mac using DECLARE_MAC_BUF for use when calling print_mac().

This fixes compile error where mac was undeclared.
Also, remove unused variable i.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:47 -08:00
Jesper Nilsson 77accbf505 CRISv10 serial driver rewrite
New and improved serial driver for CRISv10, take three, with improvements
suggested by Jiri Slaby.

- Call wait_event_interruptible with a _correct_ and sensible condition.
- Removed superfluous test of info->flags & ASYNC_CLOSING, since that is done
  by wait_event_interruptible.
- Moved common code for deregistering DMA and IRQ to deinit_port function.
- Use setup_timer when initializing flush_timer.
- Convert bit-field for uses_dma_in and uses_dma_out to regular bytes.
- Removed CVS tags.
- Removed defines and comments for CRIS_BUF_SIZE and TTY_THRESHOLD_THROTTLE
  (no longer used).
- Cleaned up code to pass checkpatch.
- Add crisv10.h header file.
- Merge of CRISv10 from Axis internal CVS.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Reviewed-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:46 -08:00
Andrew Morton 633edf5a4f cris-build-fixes-update-eth_v10c-ethernet-driver-fix
Fix locking bug noted by  Roel Kluin <12o3l@tiscali.nl>.

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:45 -08:00
Jesper Nilsson bafef0ae9d cris build fixes: update eth_v10.c ethernet driver
New (updated) version of ethernet driver for cris v10.

- First steps to simplify and make the MII code more similar
  between the etrax100 and etraxfs ports.

- Start the transmit queue before enabling tx interrupts
  to avoid race with the first frame.

- Flip the comparition statement to stick to physical addresses
  to avoid phys_to_virt mapping a potential null pointer.
  This was not an error but the change simplifies debugging
  of address-space mappings.

- Made myPrevRxDesc local to e100_rx since it was only used there.
  Fixed out of memory handling in e100_rx.  If dev_alloc_skb() fails
  persistently the system is hosed anyway but at least it won't
  loop in an interrupt handler.

- Correct some code formatting issues.

- Add defines SET_ETH_ENABLE_LEDS, SET_ETH_DISABLE_LEDS
  and SET_ETH_AUTONEG used in new cris v10 ethernet driver.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Mikael Starvik <starvik@axis.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:45 -08:00
Andrew Morton d297a5d576 aic94xx_sds: rename FLASH_SIZE
arm:

drivers/scsi/aic94xx/aic94xx_sds.c:381:1: warning: "FLASH_SIZE" redefined
In file included from include/asm/arch/irqs.h:22,
                 from include/asm/irq.h:4,
                 from include/asm/hardirq.h:6,
                 from include/linux/hardirq.h:7,
                 from include/asm-generic/local.h:5,
                 from include/asm/local.h:1,
                 from include/linux/module.h:19,
                 from include/linux/device.h:21,
                 from include/linux/pci.h:52,
                 from drivers/scsi/aic94xx/aic94xx_sds.c:28:
include/asm/arch/platform.h:444:1: warning: this is the location of the previous definition

Cc: Gilbert Wu <gilbert_wu@adaptec.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:44 -08:00
Borislav Petkov 7eea436433 keyspan: init termios properly
Remove redundant code leading to NULL ptr deref and let terminal config
settings take place in the proper initialization path in
usb_console_setup().

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Cc: <lucy@keyspan.com>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:44 -08:00
Alexey Starikovskiy 5bfeca3138 ACPI: AC: Update AC state on resume
Check if AC state has changed across resume and notify userspace if so.

Fixes "[2.6.24-rc1 regression] AC adapter state does not change after resume"

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:44 -08:00
Andrey Borzenkov 8a246ee43f make /proc/acpi/ac_adapter dependent on ACPI_PROCFS
Do not provide /proc/acpi/ac_adapter if ACPI_PROCFS is not defined.  This
eliminates duplicated power adapters in HAL and makes it consistent with
battery module

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:44 -08:00
Randy Dunlap 579d6d93ca gbefb: fix section mismatch warnings
Make 'default_mode' and 'default_var' be __initdata.
Fixes these section warnings:

WARNING: vmlinux.o(.data+0x128e0): Section mismatch: reference to .init.data:default_mode_CRT (between 'default_mode' and 'default_var')
WARNING: vmlinux.o(.data+0x128e4): Section mismatch: reference to .init.data:default_var_CRT (between 'default_var' and 'dev_attr_size')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:42 -08:00
Christian Borntraeger 5d0360ee96 rd: fix data corruption on memory pressure
We have seen ramdisk based install systems, where some pages of mapped
libraries and programs were suddendly zeroed under memory pressure.  This
should not happen, as the ramdisk avoids freeing its pages by keeping them
dirty all the time.

It turns out that there is a case, where the VM makes a ramdisk page clean,
without telling the ramdisk driver.  On memory pressure shrink_zone runs
and it starts to run shrink_active_list.  There is a check for
buffer_heads_over_limit, and if true, pagevec_strip is called.
pagevec_strip calls try_to_release_page.  If the mapping has no releasepage
callback, try_to_free_buffers is called.  try_to_free_buffers has now a
special logic for some file systems to make a dirty page clean, if all
buffers are clean.  Thats what happened in our test case.

The simplest solution is to provide a noop-releasepage callback for the
ramdisk driver.  This avoids try_to_free_buffers for ramdisk pages.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Nick Piggin <npiggin@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:42 -08:00
David Brownell 822bd5aa2b tle62x0 driver stops ignoring read errors
The tle62x0 driver was ignoring all read errors.  This patch makes it
pass such errors up the stack, instead of returning bogus data.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:42 -08:00
Bjorn Helgaas e02f5f52ca serial: only use PNP IRQ if it's valid
"Luming Yu" <luming.yu@gmail.com> says:

  There is a "ttyS1 irq is -1" problem observed on tiger4 which cause the
  serial port broken.

  It is because that there is __no__ ACPI IRQ resource assigned for the
  serial port.  So the value of the IRQ for the port is never changed since it
  got initialized to -1.

If PNP supplies a valid IRQ, use it.  Otherwise, leave port.irq == 0, which
means "no IRQ" to the serial core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yu Luming <luming.yu@intel.com>
Acked-by: Matthew Wilcox <matthew@wil.cx>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:41 -08:00
Darrick J. Wong 57510c2f93 i5000_edac: no need to __stringify() KBUILD_BASENAME
The i5000_edac driver's PCI registration structure has the name
""i5000_edac"" (with extra set of double-quotes) which is probably not
intentional.  Get rid of __stringify.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:41 -08:00
Bjorn Helgaas 9626f1f117 rtc: fall back to requesting only the ports we actually use
Firmware like PNPBIOS or ACPI can report the address space consumed by the
RTC.  The actual space consumed may be less than the size (RTC_IO_EXTENT)
assumed by the RTC driver.

The PNP core doesn't request resources yet, but I'd like to make it do so.
If/when it does, the RTC_IO_EXTENT request may fail, which prevents the RTC
driver from loading.

Since we only use the RTC index and data registers at RTC_PORT(0) and
RTC_PORT(1), we can fall back to requesting just enough space for those.

If the PNP core requests resources, this results in typical I/O port usage
like this:

    0070-0073 : 00:06		<-- PNP device 00:06 responds to 70-73
      0070-0071 : rtc		<-- RTC driver uses only 70-71

instead of the current:

    0070-0077 : rtc		<-- RTC_IO_EXTENT == 8

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:41 -08:00
Bjorn Helgaas 4c06be10c7 rtc: release correct region in error path
The misc_register() error path always released an I/O port region,
even if the region was memory-mapped (only mips uses memory-mapped RTC,
as far as I can see).

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:41 -08:00
Shannon Nelson 7bb67c14fd I/OAT: Add support for version 2 of ioatdma device
Add support for version 2 of the ioatdma device.  This device handles
the descriptor chain and DCA services slightly differently:
 - Instead of moving the dma descriptors between a busy and an idle chain,
   this new version uses a single circular chain so that we don't have
   rewrite the next_descriptor pointers as we add new requests, and the
   device doesn't need to re-read the last descriptor.
 - The new device has the DCA tags defined internally instead of needing
   them defined statically.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:41 -08:00
Dan Williams 6c55be8b96 raid5: fix unending write sequence
<debug output from Joel's system>
handling stripe 7629696, state=0x14 cnt=1, pd_idx=2 ops=0:0:0
check 5: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800ffcffcc0 written 0000000000000000
check 4: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800fdd4e360 written 0000000000000000
check 3: state 0x1 toread 0000000000000000 read 0000000000000000 write 0000000000000000 written 0000000000000000
check 2: state 0x1 toread 0000000000000000 read 0000000000000000 write 0000000000000000 written 0000000000000000
check 1: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800ff517e40 written 0000000000000000
check 0: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800fd4cae60 written 0000000000000000
locked=4 uptodate=2 to_read=0 to_write=4 failed=0 failed_num=0
for sector 7629696, rmw=0 rcw=0
</debug>

These blocks were prepared to be written out, but were never handled in
ops_run_biodrain(), so they remain locked forever.  The operations flags
are all clear which means handle_stripe() thinks nothing else needs to be
done.

This state suggests that the STRIPE_OP_PREXOR bit was sampled 'set' when it
should not have been.  This patch cleans up cases where the code looks at
sh->ops.pending when it should be looking at the consistent stack-based
snapshot of the operations flags.

Report from Joel:
	Resync done. Patch fix this bug.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Joel Bertrand <joel.bertrand@systella.fr>
Cc: <stable@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
David Brownell 19cd7537bd atmel_serial build warnings begone
Remove annoying build warnings about unused variables in atmel_serial,
which afflict both AT91 and AVR32 builds.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Haavard Skinnemoen 348badf1e8 dmaengine: fix broken device refcounting
When a DMA device is unregistered, its reference count is decremented twice
for each channel: Once dma_class_dev_release() and once in
dma_chan_cleanup().  This may result in the DMA device driver's remove()
function completing before all channels have been cleaned up, causing lots
of use-after-free fun.

Fix it by incrementing the device's reference count twice for each
channel during registration.

[dan.j.williams@intel.com: kill unnecessary client refcounting]
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Julia Lawall 90d8dabf74 drivers/misc: Move misplaced pci_dev_put's
Move pci_dev_put outside the loops in which it occurs.  Within the loop,
pci_dev_put is done implicitly by pci_get_device.

The problem was detected using the following semantic patch, and corrected
by hand.

@@
expression dev;
expression E;
@@

- pci_dev_put(dev)
   ... when != dev = E
- pci_get_device(...,dev)

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Ondrej Zary e62aa046e1 paride: pf driver fixes
The pf driver for parallel port floppy drives seems to be broken.  At least
with Imation SuperDisk with EPAT chip, the driver calls pi_connect() and
pi_disconnect after each transferred sector.  At least with EPAT, this
operation is very expensive - causes drive recalibration.  Thus, transferring
even a single byte (dd if=/dev/pf0 of=/dev/null bs=1 count=1) takes 20
seconds, making the driver useless.

The pf_next_buf() function seems to be broken as it returns 1 always (except
when pf_run is non-zero), causing the loop in do_pf_read_drq (and
do_pf_write_drq) to be executed only once.

The following patch fixes this problem.  It also fixes swapped descriptions in
pf_lock() function and removes DBMSG macro, which seems useless.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Atsushi Nemoto ba0a7f39ce spi: fix error paths on txx9spi_probe
Some error paths in txx9spi_probe wrongly return 0.  This patch fixes them by
using the devres interfaces.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Atsushi Nemoto 350d0076c5 spi: fix double-free on spi_unregister_master
After 49dce689ad, device_for_each_child
iteration hits the master device itself.  Do not call spi_unregister_device()
for the master device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: David Brownell <david-b@pacbell.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Andrew Morton cbff2fbf55 acpi: make ACPI_PROCFS default to y
Zillions of people are getting my-battery-monitor-doesnt-work problems
(including me).

Lessen the damage by making ACPI_PROCFS default to on.

Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
Damian Jurd 7105458563 8250_pnp: add support for "LG C1 EXPRESS DUAL" machines
The following is an extra entry to enable the touch screen on the new LG
C1 EXPRESS DUAL machine.

Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:38 -08:00
Adrian Bunk a9e60e5c3c video/sis/: fix negative array index
This patch fixes the possible usage of a negative value as an array
index spotted by the Coverity checker.

sisfb_validate_mode() could return a negative error code and we must check for
that prior to using its return value as an array index.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:38 -08:00
Adrian Bunk 43054412db lguest_user.c: fix memory leak
This patch fixes a memory leak spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:38 -08:00
Jordan Crouse 62ec56524f LXFB: use the correct MSR number for panel support
A relatively recent version of the Geode LX datasheet listed the wrong
address for one of the MSRs that controls TFT panels, resulting in
breakage.  This patch corrects the MSR address.

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:38 -08:00
Stanislav Brabec 28822f22e1 drivers/video/s1d13xxxfb.c: fix build as module with dbg
Attached patch fixes two compilation problems of s1d13xxxfb.c:

- Fixes outdated dbg() message to fix compilation error with debugging enabled.

- Do not read kernel command line options when compiled as module.

Signed-off-by: Stanislav Brabec <utx@penguin.cz>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:38 -08:00
Philippe Elie df9d177aa2 oProfile: oops when profile_pc() returns ~0LU
Instruction pointer returned by profile_pc() can be a random value.  This
break the assumption than we can safely set struct op_sample.eip field to a
magic value to signal to the per-cpu buffer reader side special event like
task switch ending up in a segfault in get_task_mm() when profile_pc()
return ~0UL.  Fixed by sanitizing the sampled eip and reject/log invalid
eip.

Problem reported by Sami Farin, patch tested by him.

Signed-off-by: Philippe Elie <phil.el@wanadoo.fr>
Tested-by: Sami Farin <safari-kernel@safari.iki.fi>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:37 -08:00
Frank Lichtenheld 03ad369ac9 uvesafb: fix warnings about unused variables on non-x86
Variables that are only used in #ifdef CONFIG_X86 should also only be
declared there.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Cc: Michal Januszewski <spock@gentoo.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:37 -08:00
Randy Dunlap 0f8c0234f2 chipsfb: uses/depends on PCI
chipsfb uses PCI interfaces and should depend on PCI.

  CC      drivers/video/chipsfb.o
drivers/video/chipsfb.c: In function 'chipsfb_pci_init':
drivers/video/chipsfb.c:378: error: implicit declaration of function 'pci_request_region'
drivers/video/chipsfb.c:435: error: implicit declaration of function 'pci_release_region'
make[2]: *** [drivers/video/chipsfb.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2

!CONFIG_PCI causes the build to fail.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:37 -08:00
Pascal Terjan ddd73611b7 cm40x0_cs.c: fix debug macros
When PCMCIA_DEBUG is set, cm40x0_cs.c and cm4000_cs.c don't build because the
definition of reader_to_dev uses a non-existent handle field of the struct
pcmcia_device in the call to handle_to_dev.  As handle_to_dev works on struct
pcmcia_device, the fix is quite trivial.

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:37 -08:00
Bjorn Helgaas dbd0cf4884 serial: add PNP ID for Davicom ISA 33.6K modem
This should resolve these bug reports of the modem not working:
    http://bugzilla.kernel.org/show_bug.cgi?id=4355
    http://www.linuxquestions.org/questions/linux-newbie-8/connect-script-failed-on-ppp-go-123975/

I don't have hardware to test this, but the initial report in the kernel
bugzilla indicates that this change fixed the problem.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Dmitry Vavilov <vavilov@ihep.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
Li Zefan e9b5a495dc W1: fix memset size error
The size argument passed to memset is wrong.

Signed-off-by Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
Li Zefan 3cc2c17700 drivers/video/ps3fb: fix memset size error
The size passed to memset is wrong.

Signed-off-by Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
David Brownell 682d73f685 rtc-ds1307 exports NVRAM
Export the NVRAM on DS1307 and DS1338 chips, like several of the
other drivers do for such combination RTC-and-NVRAM chips.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
David Brownell a4b1d50e61 RTCs: handle NVRAM better
Several of the RTC drivers are exporting binary "nvram" files in sysfs.  Such
NVRAM (or on many systems, EEPROM) data is often initialized during system
manufacture to hold data about identity (serial numbers, Ethernet addresses,
etc), configuration, calibration, and so forth.

This patch improves integrity and security of those files:

  - Correctly initializes the size in one of the two cases where
    that was not yet being done.

  - Improves system security/integrity by making this state not
    be world-writable by default.

Letting arbitrary userspace code mangle such state by default is at least Not
A Good Thing; and it could sometimes be worse, depending on the particular
data that might be corrupted.  (I disregard the paranoiac "don't let anyone
read it either" approach.  Anyone storing passwords in such memory doesn't
really care about security.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Torsten Ertbjerg Rasmussen <tr@newtec.dk>
Cc: Mark Zhan <rongkai.zhan@windriver.com>
Cc: Thomas Hommel <thomas.hommel@gefanuc.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
David Brownell 779d20892f rtc_hctosys expects RTCs in UTC (doc)
The RTC "hctosys" mechanism expects that RTC clock will use UTC, not local
time (e.g.  PST).  Say so in Kconfig and in the kernel message.

(Strictly speaking, the RTC clock should be tracking the POSIX epoch.  That's
not worth going into here.  Goofing timezones means clocks are wrong by many
hours; the POSIX-v-UTC differences just cost seconds.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
Andrey Borzenkov 1299342bac Fix Oops in toshiba_acpi error return path
When backlight_device_register() fails, return after undo initialization, do
not try to use pointer that just was reset to NULL

This fixes this oops:

[ 1595.177672]  [<c010480a>] show_trace_log_lvl+0x1a/0x30
[ 1595.177706]  [<c01052a2>] show_trace+0x12/0x20
[ 1595.177718]  [<c0105305>] dump_stack+0x15/0x20
[ 1595.177728]  [<c01c9375>] kobject_shadow_add+0x125/0x1c0
[ 1595.177754]  [<c01c941a>] kobject_add+0xa/0x10
[ 1595.177764]  [<c0239a37>] device_add+0x97/0x5d0
[ 1595.177776]  [<c0239f82>] device_register+0x12/0x20
[ 1595.177786]  [<dfd912df>] backlight_device_register+0x9f/0x110 [backlight]
[ 1595.177814]  [<df861117>] toshiba_acpi_init+0x117/0x15e [toshiba_acpi]
[ 1595.177834]  [<c013e28d>] sys_init_module+0xfd/0x14e0
[ 1595.177871]  [<c0104112>] sysenter_past_esp+0x5f/0x99
[ 1595.177883]  =======================
[ 1595.177890] Could not register toshiba backlight device
[ 1595.177985] BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004
...
[ 1595.394097] EIP:    0060:[<df861143>]    Not tainted VLI
[ 1595.394101] EFLAGS: 00010282   (2.6.23-rc9-1avb #24)
[ 1595.480081] EIP is at toshiba_acpi_init+0x143/0x15e [toshiba_acpi]

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: John Belmonte <toshiba_acpi@memebeam.org>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
Oliver Neukum 66fbb541a5 iwl4965: fix not correctly dealing with hotunplug
The interrupt handler returns IRQ_NONE if it detects that the device
is gone. That's incorrect because the device may have raised the interrupt.
Not acknowledging it may trigger the spurious interrupt detection and kill
drivers sharing the interrupt line.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-14 21:31:56 -05:00
Ivo van Doorn 755a957d40 rt2x00: Fix chipset revision validation
The validation of the chipset revision was broken
since for rt2500usb and rt73usb different registers
should be read. When rt2500usb was loaded for a rt73
device it would false think the chipset was correct
because the wrong register was read and validated.

This has been fixed by expanding the check to also
see if the first 4 bits of the revision is not-0
(When reading the wrong register offset the returned
value is usually 0 which can be interpreted as invalid)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-14 21:21:15 -05:00
Mohamed Abbas 14577f239f iwl3945: place CCK rates in front of OFDM for supported rates
The patch fixes association failure (reason = 18) bug by arranging CCK
rates before OFDM rates. This patch will register with mac80211 the
modified rate arrangement with CCK rate first. Change rate scale algorithm
also to deal with rate change. Fix Txpower and rate Table commands to be
constructed correctly after rearrangement.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-14 21:16:46 -05:00
Frank Lichtenheld 66ba886254 [ISDN] sc: Really, really fix warning
CC [M]  drivers/isdn/sc/shmem.o
drivers/isdn/sc/shmem.c: In function ‘memcpy_toshmem’:
drivers/isdn/sc/shmem.c:53: warning: passing argument 1 of ‘memcpy_toio’ makes pointer from integer without a cast

Commit 9317d4313e0cd51b2256ea9a9316f2d8561e37a8:

	ISDN/sc: fix longstanding warning

claimed to fix it, but it didn't.

[ Changed the "void *" to be "void __iomem *" -DaveM ]

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Acked-by:Karsten Keil <kkeilæsuse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14 15:59:43 -08:00
Frank Lichtenheld 186fd777a8 [ISDN] sc: Fix sndpkt to have the correct number of arguments
isdn_if.writebuf_skb has an additional ack flag argument which
was missing from sndpkt leading to the following warning:
  CC [M]  drivers/isdn/sc/init.o
drivers/isdn/sc/init.c: In function ‘sc_init’:
drivers/isdn/sc/init.c:281: warning: assignment from incompatible pointer type

Note that this doesn't actually do anything with the flag, it
just fixes the warning (and probably accessing the last argument).

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14 15:57:38 -08:00
Jochen Friedrich 8a856397f1 [FS_ENET]: Fix module build.
If fs_enet is build as module, on PPC_CPM_NEW_BINDING platforms
mii-fec/mii-bitbang should be build as module, as well. On other
platforms, mii-fec/mii-bitbang must be included into the main module.
Otherwise some symbols remain undefined. Additionally, fs_enet uses
libphy, so add a select PHYLIB.

  Building modules, stage 2.
  MODPOST 5 modules
ERROR: "fs_scc_ops" [drivers/net/fs_enet/fs_enet.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14 15:51:01 -08:00
Len Brown a4f0c2767e ACPI: video - delete stray run-time printk
printk("video bus notify\n");

Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14 12:49:13 -05:00
Dmitry Torokhov bbac81f548 ACPI: video - convert semaphore to a mutex
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14 12:17:41 -05:00
Dmitry Torokhov ff102ea990 ACPI: video - remove unsafe uses of list_for_each_safe()
list_for_each_safe() only protects list from list alterations
performed by the same thread. One still needs to implement
proper locking when list is being accessed from several threads.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14 12:14:28 -05:00
Dmitry Torokhov f51e83916a ACPI: video - add missing input_free_device()
If input_register_device() fails input_free_device() must
be called to release memory allocated for the device.
Also consolidate error handling in acpi_bus_video_add()
and handle input_allocate_device() failures.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14 11:53:35 -05:00
Dmitry Torokhov 91c05c667b ACPI: video - fit input device into sysfs tree
Properly set up parent on input device registered by the video driver.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14 11:48:51 -05:00
Jack Morgenstein e383d19e90 mlx4_core: Fix thinko in QP destroy (incorrect bitmap_free)
Fix thinko in commit eaf559bf ("mlx4_core: Don't free special QPs in
QP number bitmap").  The old commit had the logic exactly backwards
and ended up freeing *only* special QPs, which not only left the
original bug in place but also introduced the problem that the QP
number bitmap would get full after a while.

Found by Dotan Barak of Mellanox.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-14 08:20:03 -08:00
Sreenivasa Honnur 18b2b7bd09 [S2IO]: Fixed memory leak when MSI-X vector allocation fails
- Fixed memory leak by freeing MSI-X local entry memories when vector allocation
fails in s2io_add_isr.
- Added two utility functions remove_msix_isr and remove_inta_isr to eliminate
code duplication.
- Incorporated following review comments from Jeff
        - Removed redundant stats->mem_freed and synchronize_irq call
        - do_rem_msix_isr is renamed as remove_msix_isr
        - do_rem_inta_isr is renamed as remove_inta_isr

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14 01:41:06 -08:00
Jay Vosburgh 8cbdeec637 [BONDING]: Fix resource use after free
Fix bond_destroy and bond_free_all to not reference the struct
net_device after calling unregister_netdevice.

Bug and offending change reported by Moni Shoua <monis@voltaire.com>

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 21:16:29 -08:00
Eric Dumazet 6dd10a6235 [NET] random : secure_tcp_sequence_number should not assume CONFIG_KTIME_SCALAR
All 32 bits machines but i386 dont have CONFIG_KTIME_SCALAR. On these
machines, ktime.tv64 is more than 4 times the (correct) result given
by ktime_to_ns()

Again on these machines, using ktime_get_real().tv64 >> 6 give a
32bits rollover every 64 seconds, which is not wanted (less than the
120 s MSL)

Using ktime_to_ns() is the portable way to get nsecs from a ktime, and
have correct code.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 21:12:14 -08:00
Oliver Neukum cb4da1a34d [IWLWIFI]: Not correctly dealing with hotunplug.
It makes no sense to enable interrupts if a device has been unplugged.
In addition if in doubt IRQ_HANDLED should be returned.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 21:10:32 -08:00
Jesse Brandeburg f0163ac45b [E1000]: Fix schedule while atomic when called from mii-tool.
mii-tool can cause the driver to call msleep during nway reset,
bugzilla.kernel.org bug 8430.  Fix by simply calling reinit_locked
outside of the spinlock, which is safe from ethtool, so it should be
safe from here.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 21:00:09 -08:00
David S. Miller e2ac455a18 [NETX]: Fix build failure added by 2.6.24 statistics cleanup.
Reported by rmk from kautobuild output:

drivers/net/netx-eth.c: In function 'netx_eth_hard_start_xmit':
drivers/net/netx-eth.c:131: error: 'dev' undeclared (first use in this function)
drivers/net/netx-eth.c:131: error: (Each undeclared identifier is reported only once
drivers/net/netx-eth.c:131: error: for each function it appears in.)
drivers/net/netx-eth.c: In function 'netx_eth_receive':
drivers/net/netx-eth.c:158: error: 'dev' undeclared (first use in this function)

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 20:47:35 -08:00
David S. Miller 4e04b84ea5 [EP93xx_ETH]: Build fix after 2.6.24 NAPI changes.
Reported by rmk from kautobuild output:

drivers/net/arm/ep93xx_eth.c:420: error: implicit declaration of function '__netif_rx_schedule_prep'

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 20:46:09 -08:00
Steve Wise 9a7666494b RDMA/cxgb3: Set the max_qp_init_rd_atom attribute in query_device
The device attribute max_qp_init_rd_atom is not getting set in cxgb3's
query_device method.  Version 1.0.4 of librdmacm now validates the
user's requested initiator and responder resources against the max
supported by the device.  Since iw_cxgb3 wasn't setting this attribute
(and it defaulted to 0), all rdma_connect()s fail if there are
initiator resources requested by the app.  Fix this by setting the
correct value in iwch_query_device().

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-13 15:27:00 -08:00
Joachim Fenkes 51aaa54eb9 IB/ehca: Fix static rate calculation
The IPD (inter-packet delay) formula was a little off and assumed a
fixed physical link rate; fix the formula and query the actual
physical link rate, now that we can get it.  Also, refactor the
calculation into a common function ehca_calc_ipd() and use that
instead of duplicating code.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-13 15:27:00 -08:00
Joachim Fenkes 40ebb5615e IB/ehca: Return physical link information in query_port()
Newer firmware versions return physical port information to the
partition, so hand that information to the consumer if it's present.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-13 15:26:59 -08:00
Ralph Campbell f4ad1bcc44 IB/ipath: Fix race with ACK retry timeout list management
When an ACK is received, the QP is removed from the timeout list and
then if there are still pending send WQEs, the QP is put back on the
timeout list. It is possible that another post send has put the QP on
the timeout list thus, a check needs to be made before trying to do it
again or the list is corrupted.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-13 15:26:58 -08:00
Ralph Campbell a6e7550d8f IB/ipath: Fix memory leak in ipath_resize_cq() if copy_to_user() fails
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Patrick Marchand Latifi <patrick.latifi@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-13 15:26:57 -08:00
Ali Ayoub 3bba11e5c4 mlx4_core: Fix possible bad free in mlx4_buf_free()
When mlx4_buf_free() is called from the error path of
mlx4_buf_alloc(), it may be passed a buffer structure that does not
have all pages filled in.  Add a check for NULL to mlx4_buf_free() so
we avoid passing NULL to dma_free_coherent() (which will crash).

Signed-off-by: Ali Ayoub <ali@mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-13 15:26:57 -08:00
Bartlomiej Zolnierkiewicz 0fd4980fa7 ide: remove stale/incorrect comment from setup-pci.c
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-13 22:09:16 +01:00
Bartlomiej Zolnierkiewicz 24ffbd6258 it821x/jmicron: fix return value of {it821x,jmicron}_init_one()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-13 22:09:16 +01:00