pandora-kernel.git
16 years agoMigration: find correct vma in new_vma_page()
Lee Schermerhorn [Thu, 15 Nov 2007 00:59:10 +0000 (16:59 -0800)]
Migration: find correct vma in new_vma_page()

We hit the BUG_ON() in mm/rmap.c:vma_address() when trying to migrate via
mbind(MPOL_MF_MOVE) a non-anon region that spans multiple vmas.  For
anon-regions, we just fail to migrate any pages beyond the 1st vma in the
range.

This occurs because do_mbind() collects a list of pages to migrate by
calling check_range().  check_range() walks the task's mm, spanning vmas as
necessary, to collect the migratable pages into a list.  Then, do_mbind()
calls migrate_pages() passing the list of pages, a function to allocate new
pages based on vma policy [new_vma_page()], and a pointer to the first vma
of the range.

For each page in the list, new_vma_page() calls page_address_in_vma()
passing the page and the vma [first in range] to obtain the address to get
for alloc_page_vma().  The page address is needed to get interleaving
policy correct.  If the pages in the list come from multiple vmas,
eventually, new_page_address() will pass that page to page_address_in_vma()
with the incorrect vma.  For !PageAnon pages, this will result in a bug
check in rmap.c:vma_address().  For anon pages, vma_address() will just
return EFAULT and fail the migration.

This patch modifies new_vma_page() to check the return value from
page_address_in_vma().  If the return value is EFAULT, new_vma_page()
searchs forward via vm_next for the vma that maps the page--i.e., that does
not return EFAULT.  This assumes that the pages in the list handed to
migrate_pages() is in address order.  This is currently case.  The patch
documents this assumption in a new comment block for new_vma_page().

If new_vma_page() cannot locate the vma mapping the page in a forward
search in the mm, it will pass a NULL vma to alloc_page_vma().  This will
result in the allocation using the task policy, if any, else system default
policy.  This situation is unlikely, but the patch documents this behavior
with a comment.

Note, this patch results in restarting from the first vma in a multi-vma
range each time new_vma_page() is called.  If this is not acceptable, we
can make the vma argument a pointer, both in new_vma_page() and it's caller
unmap_and_move() so that the value held by the loop in migrate_pages()
always passes down the last vma in which a page was found.  This will
require changes to all new_page_t functions passed to migrate_pages().  Is
this necessary?

For this patch to work, we can't bug check in vma_address() for pages
outside the argument vma.  This patch removes the BUG_ON().  All other
callers [besides new_vma_page()] already check the return status.

Tested on x86_64, 4 node NUMA platform.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoproc: fix proc_kill_inodes to kill dentries on all proc superblocks
Eric W. Biederman [Thu, 15 Nov 2007 00:59:08 +0000 (16:59 -0800)]
proc: fix proc_kill_inodes to kill dentries on all proc superblocks

It appears we overlooked support for removing generic proc files
when we added support for multiple proc super blocks.  Handle
that now.

[akpm@linux-foundation.org: coding-style cleanups]
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Acked-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago8250_pnp: add support for "LG C1 EXPRESS DUAL" machines
Damian Jurd [Thu, 15 Nov 2007 00:59:04 +0000 (16:59 -0800)]
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>
16 years agovideo/sis/: fix negative array index
Adrian Bunk [Thu, 15 Nov 2007 00:59:02 +0000 (16:59 -0800)]
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>
16 years agolguest_user.c: fix memory leak
Adrian Bunk [Thu, 15 Nov 2007 00:59:00 +0000 (16:59 -0800)]
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>
16 years agoLXFB: use the correct MSR number for panel support
Jordan Crouse [Thu, 15 Nov 2007 00:58:58 +0000 (16:58 -0800)]
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>
16 years agoForbid user to change file flags on quota files
Jan Kara [Thu, 15 Nov 2007 00:58:56 +0000 (16:58 -0800)]
Forbid user to change file flags on quota files

Forbid user from changing file flags on quota files.  User has no bussiness
in playing with these flags when quota is on.  Furthermore there is a
remote possibility of deadlock due to a lock inversion between quota file's
i_mutex and transaction's start (i_mutex for quota file is locked only when
trasaction is started in quota operations) in ext3 and ext4.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: LIOU Payphone <lioupayphone@gmail.com>
Cc: <linux-ext4@vger.kernel.org>
Acked-by: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/video/s1d13xxxfb.c: fix build as module with dbg
Stanislav Brabec [Thu, 15 Nov 2007 00:58:55 +0000 (16:58 -0800)]
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>
16 years agoImprove cgroup printks
Diego Calleja [Thu, 15 Nov 2007 00:58:54 +0000 (16:58 -0800)]
Improve cgroup printks

When I boot with the 'quiet' parameter, I see on the screen:

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[   39.036026] Initializing cgroup subsys cpuacct
[   39.036080] Initializing cgroup subsys debug
[   39.036118] Initializing cgroup subsys ns

This patch lowers the priority of those messages, adds a "cgroup: " prefix
to another couple of printks and kills the useless reference to the source
file.

Signed-off-by: Diego Calleja <diegocg@gmail.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: update address space affected by pud_clear
Jeff Dike [Thu, 15 Nov 2007 00:58:53 +0000 (16:58 -0800)]
uml: update address space affected by pud_clear

pud_clear wasn't setting the _PAGE_NEWPAGE bit, fooling tlb_flush into
thinking that this area of the address space was up-to-date and not unmapping
whatever was covered by the pud.

This manifested itself as ldconfig on x86_64 complaining about the first
library it looked at not being a valid ELF file.  A config file is mapped at
0x4000000, as the only thing mapped under its pud, and unmapped.  The
unmapping caused a pud_clear, which, due to this bug, didn't actually unmap
the config file data on the host.  The first library is then mapped at the
same location, but is not actually mapped on the host because accesses to it
cause no page faults.  As a result, ldconfig sees the old config file data.

[akpm@linux-foundation.org: coding-style cleanups]
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>
16 years agouml: fix recvmsg return value checking
Jeff Dike [Thu, 15 Nov 2007 00:58:51 +0000 (16:58 -0800)]
uml: fix recvmsg return value checking

Stupid bug - we need to compare the return value of recvmsg to the value of
iov_len, not its size.  This caused port_helper processes not to be killed on
shutdown on x86_64 because the pids weren't being passed out properly.

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>
16 years agooProfile: oops when profile_pc() returns ~0LU
Philippe Elie [Thu, 15 Nov 2007 00:58:48 +0000 (16:58 -0800)]
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>
16 years agouvesafb: fix warnings about unused variables on non-x86
Frank Lichtenheld [Thu, 15 Nov 2007 00:58:47 +0000 (16:58 -0800)]
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>
16 years agochipsfb: uses/depends on PCI
Randy Dunlap [Thu, 15 Nov 2007 00:58:45 +0000 (16:58 -0800)]
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>
16 years agortc: tweak driver documentation for rtc periodic
Mike Frysinger [Thu, 15 Nov 2007 00:58:43 +0000 (16:58 -0800)]
rtc: tweak driver documentation for rtc periodic

The max_user_freq member is not really meant for RTC drivers to modify, so
update the rtc documentation so drivers writers know what is expected of
them when handling periodic events.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: fix symlink loops
Jeff Dike [Thu, 15 Nov 2007 00:58:42 +0000 (16:58 -0800)]
uml: fix symlink loops

symlinks to directories in the non-O= case were lacking -n, which meant
that, when the link already existed, a new link pointing at itself was
created in the target directory.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agolib: move bitmap.o from lib-y to obj-y.
Paul Mundt [Thu, 15 Nov 2007 00:58:41 +0000 (16:58 -0800)]
lib: move bitmap.o from lib-y to obj-y.

mac80211 has a reference to __bitmap_empty() via bitmap_empty().  In
lib/bitmap.c this is flagged with an EXPORT_SYMBOL(), but this is
ultimately ineffective due to bitmap.o being linked in lib-y, resulting in:

ERROR: "__bitmap_empty" [net/mac80211/mac80211.ko] undefined!

Moving bitmap.o to obj-y fixes this up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocm40x0_cs.c: fix debug macros
Pascal Terjan [Thu, 15 Nov 2007 00:58:39 +0000 (16:58 -0800)]
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>
16 years agosysctl: check length at deprecated_sysctl_warning
Tetsuo Handa [Thu, 15 Nov 2007 00:58:38 +0000 (16:58 -0800)]
sysctl: check length at deprecated_sysctl_warning

Original patch assumed args->nlen < CTL_MAXNAME, but it can be false.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
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>
16 years agoserial: add PNP ID for Davicom ISA 33.6K modem
Bjorn Helgaas [Thu, 15 Nov 2007 00:58:36 +0000 (16:58 -0800)]
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>
16 years agoslab: fix typo in allocation failure handling
Akinobu Mita [Thu, 15 Nov 2007 00:58:35 +0000 (16:58 -0800)]
slab: fix typo in allocation failure handling

This patch fixes wrong array index in allocation failure handling.

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoW1: fix memset size error
Li Zefan [Thu, 15 Nov 2007 00:58:34 +0000 (16:58 -0800)]
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>
16 years agodrivers/video/ps3fb: fix memset size error
Li Zefan [Thu, 15 Nov 2007 00:58:33 +0000 (16:58 -0800)]
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>
16 years agortc-ds1307 exports NVRAM
David Brownell [Thu, 15 Nov 2007 00:58:32 +0000 (16:58 -0800)]
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>
16 years agoRTCs: handle NVRAM better
David Brownell [Thu, 15 Nov 2007 00:58:30 +0000 (16:58 -0800)]
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>
16 years agortc_hctosys expects RTCs in UTC (doc)
David Brownell [Thu, 15 Nov 2007 00:58:29 +0000 (16:58 -0800)]
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>
16 years agoFix Oops in toshiba_acpi error return path
Andrey Borzenkov [Thu, 15 Nov 2007 00:58:28 +0000 (16:58 -0800)]
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>
16 years agoeCryptfs: cast page->index to loff_t instead of off_t
Michael Halcrow [Thu, 15 Nov 2007 00:58:27 +0000 (16:58 -0800)]
eCryptfs: cast page->index to loff_t instead of off_t

page->index should be cast to loff_t instead of off_t.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoiwl4965: fix not correctly dealing with hotunplug
Oliver Neukum [Thu, 15 Nov 2007 01:31:10 +0000 (09:31 +0800)]
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>
16 years agort2x00: Fix chipset revision validation
Ivo van Doorn [Mon, 12 Nov 2007 14:02:22 +0000 (15:02 +0100)]
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>
16 years agoiwl3945: place CCK rates in front of OFDM for supported rates
Mohamed Abbas [Mon, 12 Nov 2007 03:37:42 +0000 (11:37 +0800)]
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>
16 years agomac80211: Fix queuing of scan containing a SSID
Helmut Schaa [Fri, 9 Nov 2007 15:25:08 +0000 (16:25 +0100)]
mac80211: Fix queuing of scan containing a SSID

This patch fixes scanning for specific ssid's which is broken due to the
scan being queued up without respecting the ssid to scan for.

Signed-off-by: Helmut Schaa <hschaa@suse.de>
Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years ago[NET]: rt_check_expire() can take a long time, add a cond_resched()
Eric Dumazet [Thu, 15 Nov 2007 00:14:05 +0000 (16:14 -0800)]
[NET]: rt_check_expire() can take a long time, add a cond_resched()

On commit 39c90ece7565f5c47110c2fa77409d7a9478bd5b:

[IPV4]: Convert rt_check_expire() from softirq processing to workqueue.

we converted rt_check_expire() from softirq to workqueue, allowing the
function to perform all work it was supposed to do.

When the IP route cache is big, rt_check_expire() can take a long time
to run.  (default settings : 20% of the hash table is scanned at each
invocation)

Adding cond_resched() helps giving cpu to higher priority tasks if
necessary.

Using a "if (need_resched())" test before calling "cond_resched();" is
necessary to avoid spending too much time doing the resched check.
(My tests gave a time reduction from 88 ms to 25 ms per
rt_check_expire() run on my i686 test machine)

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ISDN] sc: Really, really fix warning
Frank Lichtenheld [Wed, 14 Nov 2007 23:59:43 +0000 (15:59 -0800)]
[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>
16 years ago[ISDN] sc: Fix sndpkt to have the correct number of arguments
Frank Lichtenheld [Wed, 14 Nov 2007 23:57:38 +0000 (15:57 -0800)]
[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>
16 years ago[TCP] FRTO: Clear frto_highmark only after process_frto that uses it
Ilpo Järvinen [Wed, 14 Nov 2007 23:55:09 +0000 (15:55 -0800)]
[TCP] FRTO: Clear frto_highmark only after process_frto that uses it

I broke this in commit 3de96471bd7fb76406e975ef6387abe3a0698149:

[TCP]: Wrap-safed reordering detection FRTO check

tcp_process_frto should always see a valid frto_highmark. An invalid
frto_highmark (zero) is very likely what ultimately caused a seqno
compare in tcp_frto_enter_loss to do the wrong leading to the LOST-bit
leak.

Having LOST-bits integry ensured like done after commit
23aeeec365dcf8bc87fae44c533e50d0bb4f23cc:

[TCP] FRTO: Plug potential LOST-bit leak

won't hurt. It may still be useful in some other, possibly legimate,
scenario.

Reported by Chazarain Guillaume <guichaz@yahoo.fr>.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Remove notifier block from chain when register_netdevice_notifier fails
Pavel Emelyanov [Wed, 14 Nov 2007 23:53:16 +0000 (15:53 -0800)]
[NET]: Remove notifier block from chain when register_netdevice_notifier fails

Commit fcc5a03ac42564e9e255c1134dda47442289e466:

[NET]: Allow netdev REGISTER/CHANGENAME events to fail

makes the register_netdevice_notifier() handle the error from the
NETDEV_REGISTER event, sent to the registering block.

The bad news is that in this case the notifier block is
not removed from the list, but the error is returned to the
caller. In case the caller is in module init function and
handles this error this can abort the module loading. The
notifier block will be then removed from the kernel, but
will be left in the list. Oops :(

I think that the notifier block should be removed from the
chain in case of error, regardless whether this error is
handled by the caller or not. In the worst case (the error
is _not_ handled) module will not receive the events any
longer.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[FS_ENET]: Fix module build.
Jochen Friedrich [Wed, 14 Nov 2007 23:51:01 +0000 (15:51 -0800)]
[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>
16 years ago[TCP]: Make sure write_queue_from does not begin with NULL ptr
Ilpo Järvinen [Wed, 14 Nov 2007 23:47:18 +0000 (15:47 -0800)]
[TCP]: Make sure write_queue_from does not begin with NULL ptr

NULL ptr can be returned from tcp_write_queue_head to cached_skb
and then assigned to skb if packets_out was zero. Without this,
system is vulnerable to a carefully crafted ACKs which obviously
is remotely triggerable.

Besides, there's very little that needs to be done in sacktag
if there weren't any packets outstanding, just skipping the rest
doesn't hurt.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Fix size calculation in sk_stream_alloc_pskb
Herbert Xu [Wed, 14 Nov 2007 23:45:21 +0000 (15:45 -0800)]
[TCP]: Fix size calculation in sk_stream_alloc_pskb

We round up the header size in sk_stream_alloc_pskb so that
TSO packets get zero tail room.  Unfortunately this rounding
up is not coordinated with the select_size() function used by
TCP to calculate the second parameter of sk_stream_alloc_pskb.

As a result, we may allocate more than a page of data in the
non-TSO case when exactly one page is desired.

In fact, rounding up the head room is detrimental in the non-TSO
case because it makes memory that would otherwise be available to
the payload head room.  TSO doesn't need this either, all it wants
is the guarantee that there is no tail room.

So this patch fixes this by adjusting the skb_reserve call so that
exactly the requested amount (which all callers have calculated in
a precise way) is made available as tail room.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agomlx4_core: Fix thinko in QP destroy (incorrect bitmap_free)
Jack Morgenstein [Wed, 14 Nov 2007 14:33:27 +0000 (16:33 +0200)]
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>
16 years ago[S2IO]: Fixed memory leak when MSI-X vector allocation fails
Sreenivasa Honnur [Wed, 14 Nov 2007 09:41:06 +0000 (01:41 -0800)]
[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>
16 years ago[BONDING]: Fix resource use after free
Jay Vosburgh [Wed, 14 Nov 2007 05:16:29 +0000 (21:16 -0800)]
[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>
16 years ago[SYSCTL]: Fix warning for token-ring from sysctl checker
Olof Johansson [Wed, 14 Nov 2007 05:15:24 +0000 (21:15 -0800)]
[SYSCTL]: Fix warning for token-ring from sysctl checker

As seen when booting ppc64_defconfig:

sysctl table check failed: /net/token-ring .3.14 procname does not match binary path procname

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET] random : secure_tcp_sequence_number should not assume CONFIG_KTIME_SCALAR
Eric Dumazet [Wed, 14 Nov 2007 05:12:14 +0000 (21:12 -0800)]
[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>
16 years ago[IWLWIFI]: Not correctly dealing with hotunplug.
Oliver Neukum [Wed, 14 Nov 2007 05:10:32 +0000 (21:10 -0800)]
[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>
16 years ago[TCP] FRTO: Plug potential LOST-bit leak
Ilpo Järvinen [Wed, 14 Nov 2007 05:03:13 +0000 (21:03 -0800)]
[TCP] FRTO: Plug potential LOST-bit leak

It might be possible that, in some extreme scenario that
I just cannot now construct in my mind, end_seq <=
frto_highmark check does not match causing the lost_out
and LOST bits become out-of-sync due to clearing and
recounting in the loop.

This may fix LOST-bit leak reported by Chazarain Guillaume
<guichaz@yahoo.fr>.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP] FRTO: Limit snd_cwnd if TCP was application limited
Ilpo Järvinen [Wed, 14 Nov 2007 05:01:23 +0000 (21:01 -0800)]
[TCP] FRTO: Limit snd_cwnd if TCP was application limited

Otherwise TCP might violate packet ordering principles that FRTO
is based on. If conventional recovery path is chosen, this won't
be significant at all. In practice, any small enough value will
be sufficient to provide proper operation for FRTO, yet other
users of snd_cwnd might benefit from a "close enough" value.

FRTO's formula is now equal to what tcp_enter_cwr() uses.

FRTO used to check application limitedness a bit differently but
I changed that in commit 575ee7140dabe9b9c4f66f4f867039b97e548867
and as a result checking for application limitedness became
completely non-existing.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[E1000]: Fix schedule while atomic when called from mii-tool.
Jesse Brandeburg [Wed, 14 Nov 2007 05:00:09 +0000 (21:00 -0800)]
[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>
16 years ago[NETX]: Fix build failure added by 2.6.24 statistics cleanup.
David S. Miller [Wed, 14 Nov 2007 04:47:35 +0000 (20:47 -0800)]
[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>
16 years ago[EP93xx_ETH]: Build fix after 2.6.24 NAPI changes.
David S. Miller [Wed, 14 Nov 2007 04:46:09 +0000 (20:46 -0800)]
[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>
16 years ago[PKT_SCHED]: Check subqueue status before calling hard_start_xmit
Peter P Waskiewicz Jr [Wed, 14 Nov 2007 04:40:55 +0000 (20:40 -0800)]
[PKT_SCHED]: Check subqueue status before calling hard_start_xmit

The only qdiscs that check subqueue state before dequeue'ing are PRIO
and RR.  The other qdiscs, including the default pfifo_fast qdisc,
will allow traffic bound for subqueue 0 through to hard_start_xmit.
The check for netif_queue_stopped() is done above in pkt_sched.h, so
it is unnecessary for qdisc_restart().  However, if the underlying
driver is multiqueue capable, and only sets queue states on subqueues,
this will allow packets to enter the driver when it's currently unable
to process packets, resulting in expensive requeues and driver
entries.  This patch re-adds the check for the subqueue status before
calling hard_start_xmit, so we can try and avoid the driver entry when
the queues are stopped.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoRDMA/cxgb3: Set the max_qp_init_rd_atom attribute in query_device
Steve Wise [Fri, 9 Nov 2007 15:21:58 +0000 (09:21 -0600)]
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>
16 years agoIB/ehca: Fix static rate calculation
Joachim Fenkes [Fri, 2 Nov 2007 13:41:49 +0000 (15:41 +0200)]
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>
16 years agoIB/ehca: Return physical link information in query_port()
Joachim Fenkes [Fri, 2 Nov 2007 13:33:51 +0000 (15:33 +0200)]
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>
16 years agoIB/ipath: Fix race with ACK retry timeout list management
Ralph Campbell [Fri, 26 Oct 2007 15:02:39 +0000 (08:02 -0700)]
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>
16 years agoIB/ipath: Fix memory leak in ipath_resize_cq() if copy_to_user() fails
Ralph Campbell [Wed, 24 Oct 2007 22:49:39 +0000 (15:49 -0700)]
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>
16 years agomlx4_core: Fix possible bad free in mlx4_buf_free()
Ali Ayoub [Tue, 13 Nov 2007 23:26:57 +0000 (15:26 -0800)]
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>
16 years agoide: remove stale/incorrect comment from setup-pci.c
Bartlomiej Zolnierkiewicz [Tue, 13 Nov 2007 21:09:16 +0000 (22:09 +0100)]
ide: remove stale/incorrect comment from setup-pci.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoit821x/jmicron: fix return value of {it821x,jmicron}_init_one()
Bartlomiej Zolnierkiewicz [Tue, 13 Nov 2007 21:09:16 +0000 (22:09 +0100)]
it821x/jmicron: fix return value of {it821x,jmicron}_init_one()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: don't BUG() on unsupported transfer modes
Bartlomiej Zolnierkiewicz [Tue, 13 Nov 2007 21:09:15 +0000 (22:09 +0100)]
ide: don't BUG() on unsupported transfer modes

Fix ide-cris, cs5530, sc1200 and sis5513 host drivers to just return instead
of OOPS-ing for unsupported modes in ->set_dma_mode methods.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use drive->select.all for REQ_TYPE_ATA_TASK in execute_drive_cmd()
Bartlomiej Zolnierkiewicz [Tue, 13 Nov 2007 21:09:15 +0000 (22:09 +0100)]
ide: use drive->select.all for REQ_TYPE_ATA_TASK in execute_drive_cmd()

Use drive->select.all for REQ_TYPE_ATA_TASK requests in execute_drive_cmd()
(the obsolete bits 7 and 5 of the Device register need to be set).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add missing HOB bit clearing to ide_dump_ata_status()
Bartlomiej Zolnierkiewicz [Tue, 13 Nov 2007 21:09:15 +0000 (22:09 +0100)]
ide: add missing HOB bit clearing to ide_dump_ata_status()

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-pmac: skip conservative PIO "downgrade"
Bartlomiej Zolnierkiewicz [Tue, 13 Nov 2007 21:09:15 +0000 (22:09 +0100)]
ide-pmac: skip conservative PIO "downgrade"

We can skip conservative PIO "downgrade" (PIO3 becomes PIO2 etc.) on PMAC.

Problem reported by Mikael.

Cc: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: BLK_DEV_IDECD help: remove outdated note
Adrian Bunk [Tue, 13 Nov 2007 21:09:14 +0000 (22:09 +0100)]
ide: BLK_DEV_IDECD help: remove outdated note

LILO version 16 was released on 26-02-1995 (sic), so telling people to not use
older versions no longer has any value.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agocmd64x: don't clear the other channel's interrupt
Sergei Shtylyov [Tue, 13 Nov 2007 21:09:14 +0000 (22:09 +0100)]
cmd64x: don't clear the other channel's interrupt

Make sure to not clear the other IDE channel's interrupt when clearing an IDE
interrupt via the MRDMODE register.

Thanks to Bart for finding a coding mistake.

Bart:

This fixes regression from commit 66602c83dcb6a5d82772d88ae7a32cd4a1213528
("cmd64x: use interrupt status from MRDMODE register (take 2)").

Extra thanks to Martin for reporting and bisecting the issue.

From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Tested-by: Martin Rogge <marogge@onlinehome.de>
Tested-by: Milan Kocian <milon@wq.cz>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoMerge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
Linus Torvalds [Tue, 13 Nov 2007 17:09:36 +0000 (09:09 -0800)]
Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6

* 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6:
  hwmon: (i5k_amb) Convert macros to C functions
  hwmon: (w83781d) Add missing curly braces
  hwmon: (abituguru3) Identify ABit IP35 Pro as such
  hwmon: (f75375s) pwmX_mode sysfs files writable for f75375 variant
  hwmon: (f75375s) On n2100 systems, set fans to full speed on boot
  hwmon: (f75375s) Allow setting up fans with platform_data
  hwmon: (f75375s) Add new style bindings
  hwmon: (lm70) Convert semaphore to mutex
  hwmon: (applesmc) Add support for Mac Pro 2 x Quad-Core
  hwmon: (abituguru3) Add support for 2 new motherboards
  hwmon: (ibmpex) Change printk to dev_{info,err} macros
  hwmon: (i5k_amb) New memory temperature sensor driver
  hwmon: (f75375s) fix pwm mode setting
  hwmon: (ibmpex.c) fix NULL dereference
  hwmon: (sis5595) Split sis5595_attributes_opt
  hwmon: (sis5595) Add individual alarm files
  hwmon: (w83627hf) push nr+1 offset into *_REG_FAN macros and simplify
  hwmon: (w83627hf) hoist nr-1 offset out of show-store-temp-X
  hwmon: Add power meter spec to Documentation/hwmon/sysfs-interface

16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 13 Nov 2007 17:04:48 +0000 (09:04 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (45 commits)
  [NETFILTER]: xt_time should not assume CONFIG_KTIME_SCALAR
  [NET]: Move unneeded data to initdata section.
  [NET]: Cleanup pernet operation without CONFIG_NET_NS
  [TEHUTI]: Fix incorrect usage of strncat in bdx_get_drvinfo()
  [MYRI_SBUS]: Prevent that myri_do_handshake lies about ticks.
  [NETFILTER]: bridge: fix double POSTROUTING hook invocation
  [NETFILTER]: Consolidate nf_sockopt and compat_nf_sockopt
  [NETFILTER]: nf_nat: fix memset error
  [INET]: Use list_head-s in inetpeer.c
  [IPVS]: Remove unused exports.
  [NET]: Unexport sysctl_{r,w}mem_max.
  [TG3]: Update version to 3.86
  [TG3]: MII => TP
  [TG3]: Add A1 revs
  [TG3]: Increase the PCI MRRS
  [TG3]: Prescaler fix
  [TG3]: Limit 5784 / 5764 to MAC LED mode
  [TG3]: Disable GPHY autopowerdown
  [TG3]: CPMU adjustments for loopback tests
  [TG3]: Fix nvram selftest failures
  ...

16 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Linus Torvalds [Tue, 13 Nov 2007 17:04:03 +0000 (09:04 -0800)]
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Silence an annoying boot message
  [POWERPC] Fix early btext debug on PowerMac
  [POWERPC] Demote clockevent printk to KERN_DEBUG
  [POWERPC] Fix CONFIG_SMP=n build error on ppc64
  [POWERPC] Avoid unpaired stwcx. on some processors
  [POWERPC] Fix oops related to 4xx flush_tlb_page modification
  [POWERPC] cpm: Fix a couple minor issues in cpm_common.c.
  [POWERPC] Add -mno-spe for ARCH=powerpc builds

16 years agoACPI: Battery: remove cycle from battery removal.
Alexey Starikovskiy [Tue, 13 Nov 2007 09:23:06 +0000 (12:23 +0300)]
ACPI: Battery: remove cycle from battery removal.

get_property() should not call battery_update(), it also should call
get_status() only if battery is present to avoid cycle and oops.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRevert "ext2/ext3/ext4: add block bitmap validation"
Linus Torvalds [Tue, 13 Nov 2007 16:07:31 +0000 (08:07 -0800)]
Revert "ext2/ext3/ext4: add block bitmap validation"

This reverts commit 7c9e69faa28027913ee059c285a5ea8382e24b5d, fixing up
conflicts in fs/ext4/balloc.c manually.

The cost of doing the bitmap validation on each lookup - even when the
bitmap is cached - is absolutely prohibitive.  We could, and probably
should, do it only when adding the bitmap to the buffer cache.  However,
right now we are better off just reverting it.

Peter Zijlstra measured the cost of this extra validation as a 85%
decrease in cached iozone, and while I had a patch that took it down to
just 17% by not being _quite_ so stupid in the validation, it was still
a big slowdown that could have been avoided by just doing it right.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andreas Dilger <adilger@clusterfs.com>
Cc: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[NETFILTER]: xt_time should not assume CONFIG_KTIME_SCALAR
Eric Dumazet [Tue, 13 Nov 2007 11:49:53 +0000 (03:49 -0800)]
[NETFILTER]: xt_time should not assume CONFIG_KTIME_SCALAR

It is not correct to assume one can get nsec from a ktime directly by
using .tv64 field.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Move unneeded data to initdata section.
Denis V. Lunev [Tue, 13 Nov 2007 11:23:50 +0000 (03:23 -0800)]
[NET]: Move unneeded data to initdata section.

This patch reverts Eric's commit 2b008b0a8e96b726c603c5e1a5a7a509b5f61e35

It diets .text & .data section of the kernel if CONFIG_NET_NS is not set.
This is safe after list operations cleanup.

Signed-of-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Cleanup pernet operation without CONFIG_NET_NS
Denis V. Lunev [Tue, 13 Nov 2007 11:23:21 +0000 (03:23 -0800)]
[NET]: Cleanup pernet operation without CONFIG_NET_NS

If CONFIG_NET_NS is not set, the only namespace is possible.

This patch removes list of pernet_operations and cleanups code a bit.
This list is not needed if there are no namespaces. We should just call
->init method.

Additionally, the ->exit will be called on module unloading only. This
case is safe - the code is not discarded. For the in/kernel code, ->exit
should never be called.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TEHUTI]: Fix incorrect usage of strncat in bdx_get_drvinfo()
Roel Kluin [Tue, 13 Nov 2007 11:17:16 +0000 (03:17 -0800)]
[TEHUTI]: Fix incorrect usage of strncat in bdx_get_drvinfo()

Fix incorrect length for strncat by replacing it with strlcat

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[MYRI_SBUS]: Prevent that myri_do_handshake lies about ticks.
Roel Kluin [Tue, 13 Nov 2007 11:16:17 +0000 (03:16 -0800)]
[MYRI_SBUS]: Prevent that myri_do_handshake lies about ticks.

With '<=' tick can be incremented up to 26, The last loop is redundant
since even when 'softstate' becomes 'STATE_READY', 'if (tick > 25)'
will still cause the function to return -1,

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: bridge: fix double POSTROUTING hook invocation
Patrick McHardy [Tue, 13 Nov 2007 10:58:44 +0000 (02:58 -0800)]
[NETFILTER]: bridge: fix double POSTROUTING hook invocation

Packets routed between bridges have the POST_ROUTING hook invoked
twice since bridging mistakes them for bridged packets because
they have skb->nf_bridge set.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: Consolidate nf_sockopt and compat_nf_sockopt
Pavel Emelyanov [Tue, 13 Nov 2007 10:58:09 +0000 (02:58 -0800)]
[NETFILTER]: Consolidate nf_sockopt and compat_nf_sockopt

Both lookup the nf_sockopt_ops object to call the get/set callbacks
from, but they perform it in a completely similar way.

Introduce the helper for finding the ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_nat: fix memset error
Li Zefan [Tue, 13 Nov 2007 10:57:16 +0000 (02:57 -0800)]
[NETFILTER]: nf_nat: fix memset error

The size passing to memset is the size of a pointer.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[INET]: Use list_head-s in inetpeer.c
Pavel Emelyanov [Tue, 13 Nov 2007 05:27:28 +0000 (21:27 -0800)]
[INET]: Use list_head-s in inetpeer.c

The inetpeer.c tracks the LRU list of inet_perr-s, but makes
it by hands. Use the list_head-s for this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPVS]: Remove unused exports.
Adrian Bunk [Tue, 13 Nov 2007 05:25:24 +0000 (21:25 -0800)]
[IPVS]: Remove unused exports.

This patch removes the following unused EXPORT_SYMBOL's:
- ip_vs_try_bind_dest
- ip_vs_find_dest

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Unexport sysctl_{r,w}mem_max.
Adrian Bunk [Tue, 13 Nov 2007 05:24:14 +0000 (21:24 -0800)]
[NET]: Unexport sysctl_{r,w}mem_max.

sysctl_{r,w}mem_max can now be unexported.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[POWERPC] Silence an annoying boot message
Stephen Rothwell [Tue, 13 Nov 2007 04:41:49 +0000 (15:41 +1100)]
[POWERPC] Silence an annoying boot message

vmemmap_populate will printk (with KERN_WARNING) for a lot of pages
if CONFIG_SPARSEMEM_VMEMMAP is enabled (at least it does on iSeries).
Use pr_debug for it instead.

Replace the only other use of DBG in this file with pr_debug as well.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[TG3]: Update version to 3.86
Matt Carlson [Tue, 13 Nov 2007 05:23:21 +0000 (21:23 -0800)]
[TG3]: Update version to 3.86

This patch updates the version number to 3.86

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[POWERPC] Fix early btext debug on PowerMac
Benjamin Herrenschmidt [Tue, 13 Nov 2007 02:46:52 +0000 (13:46 +1100)]
[POWERPC] Fix early btext debug on PowerMac

The early btext debug wouldn't work on PowerMac when booted from BootX
due to the code looking for the wrong property name.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Demote clockevent printk to KERN_DEBUG
Tony Breeds [Mon, 12 Nov 2007 03:25:50 +0000 (14:25 +1100)]
[POWERPC] Demote clockevent printk to KERN_DEBUG

These don't need to be seen by everyone on every boot.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix CONFIG_SMP=n build error on ppc64
Olof Johansson [Sat, 10 Nov 2007 20:59:29 +0000 (07:59 +1100)]
[POWERPC] Fix CONFIG_SMP=n build error on ppc64

The patch "KVM: fix !SMP build error" change the way smp_call_function()
actually uses the passed in function names on non-SMP builds.  So
previously it was never caught that the function passed in was never
actually defined.

This causes a build error on ppc64_defconfig + CONFIG_SMP=n:

arch/powerpc/mm/tlb_64.c: In function 'pgtable_free_now':
arch/powerpc/mm/tlb_64.c:71: error: 'pte_free_smp_sync' undeclared (first use in this function)
arch/powerpc/mm/tlb_64.c:71: error: (Each undeclared identifier is reported only once
arch/powerpc/mm/tlb_64.c:71: error: for each function it appears in.)

So we need to define it even if CONFIG_SMP is off. Either that or ifdef
out the smp_call_function() call, but that's ugly.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Avoid unpaired stwcx. on some processors
Becky Bruce [Fri, 9 Nov 2007 22:17:49 +0000 (09:17 +1100)]
[POWERPC] Avoid unpaired stwcx. on some processors

The context switch code in the kernel issues a dummy stwcx. to clear the
reservation, as recommended by the architecture.  However, some processors
can have issues if this stwcx to address A occurs while the reservation
is already held to a different address B.  To avoid this problem, the dummy
stwcx. needs to be paired with a dummy lwarx to the same address.

This adds the dummy lwarx, and creates a cpu feature bit to indicate
which cpus are affected.  Tested on mpc8641_hpcn_defconfig in
arch/powerpc; build tested in arch/ppc.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[TG3]: MII => TP
Matt Carlson [Tue, 13 Nov 2007 05:22:40 +0000 (21:22 -0800)]
[TG3]: MII => TP

This patch changes the PHY type reported through ethtool for copper
devices from MII to TP.  The latter is more accurate.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Add A1 revs
Matt Carlson [Tue, 13 Nov 2007 05:22:02 +0000 (21:22 -0800)]
[TG3]: Add A1 revs

This patch adds the A1 revision of 5784, 5764, and 5761, and applies all
previous bugfixes.  In places where the list of devices gets too long,
the patch uses a new TG3_FLG3_5761_5784_AX_FIXES flag instead.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Increase the PCI MRRS
Matt Carlson [Tue, 13 Nov 2007 05:19:37 +0000 (21:19 -0800)]
[TG3]: Increase the PCI MRRS

Previous devices hardcoded the PCI Maximum Read Request Size to 4K.  To
better comply with the PCI spec, the hardware now defaults the MRRS to
512 bytes.  This will yield poor driver performance if left untouched.
This patch increases the MRRS to 4K on driver initialization.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Prescaler fix
Matt Carlson [Tue, 13 Nov 2007 05:18:04 +0000 (21:18 -0800)]
[TG3]: Prescaler fix

Internal hardware timers become inaccurate after link events.  Clock
frequency switches performed by the CPMU fail to adjust timer
prescalers.  The fix is to detect core clock frequency changes during
link events and adjust the timer prescalers accordingly.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Limit 5784 / 5764 to MAC LED mode
Matt Carlson [Tue, 13 Nov 2007 05:17:07 +0000 (21:17 -0800)]
[TG3]: Limit 5784 / 5764 to MAC LED mode

Most 5784 / 5764 LED modes do not work as expected because of a hardware
bug.  This patch forces the LED mode to be in MAC LED mode.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Disable GPHY autopowerdown
Matt Carlson [Tue, 13 Nov 2007 05:16:17 +0000 (21:16 -0800)]
[TG3]: Disable GPHY autopowerdown

New CPMU devices contend with the GPHY for power management.  The GPHY
autopowerdown feature is enabled by default in the PHY and thus needs to
be disabled after every PHY reset.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: CPMU adjustments for loopback tests
Matt Carlson [Tue, 13 Nov 2007 05:11:51 +0000 (21:11 -0800)]
[TG3]: CPMU adjustments for loopback tests

This patch adds the LINK_SPEED mode to the list of CPMU modes that can
cause the loopback tests to fail.  These bugs are planned to be fixed in
future revisions of the chip, so the patch qualifies the fixes as such.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Fix nvram selftest failures
Matt Carlson [Tue, 13 Nov 2007 05:10:58 +0000 (21:10 -0800)]
[TG3]: Fix nvram selftest failures

Newer devices contain bootcode in the chip's private ROM area.  This
bootcode is called selfboot.  Selfboot can be patched in the device's
NVRAM and the patches can have several formats.  In one particular
format, the checksum calculation needs to be slightly modified.  This
patch adjusts the NVRAM test code for that case, and add support for the
missing formats.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: 5784 / 5764 DMA engine lockup fix
Matt Carlson [Tue, 13 Nov 2007 05:10:06 +0000 (21:10 -0800)]
[TG3]: 5784 / 5764 DMA engine lockup fix

5784 and 5764 devices lock up when the link speed is 10Mbps, the CPMU
link speed mode is enabled, and the MAC clock is running at 1.5Mhz.  The
fix is to run the MAC clock at faster speeds.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: APE flag fix
Matt Carlson [Tue, 13 Nov 2007 05:08:59 +0000 (21:08 -0800)]
[TG3]: APE flag fix

This patch corrects a bug where the ENABLE_APE flag was tested against
the wrong flag variable.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: 5784 / 5764 GPHY power down fix
Matt Carlson [Tue, 13 Nov 2007 05:08:03 +0000 (21:08 -0800)]
[TG3]: 5784 / 5764 GPHY power down fix

5784 and 5764 devices fail to link / pass traffic after one load /
unload cycle.  This happens because of a hardware bug in the new CPMU.
During normal operation, the MAC depends on the PHY clock being
available.  When the PHY is powered down, the clock the MAC depends on
is disabled.  The fix is to switch the MAC clock to an alternate source
before powering down the PHY, and to restore the MAC clock to the PHY
source upon device resume.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TG3]: Fix 5761 PXEboot crash
Matt Carlson [Tue, 13 Nov 2007 05:07:01 +0000 (21:07 -0800)]
[TG3]: Fix 5761 PXEboot crash

When 5761 devices boot the machine using PXEboot, PXE leaves the device
active when it terminates.  The tg3 driver has code to detect this
condition and resets the device during initialization.  On 5761 devices,
device resets involve sending a driver state update message to the APE
on the 5761.  However, during this initialization stage, communications
to the APE registers have not yet been set up.  The driver then
dereferences a NULL pointer and crashes the machine.  The fix is to move
the APE register access setup earlier in the initialization code to
cover this condition.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>