]> err.no Git - linux-2.6/log
linux-2.6
16 years agoe1000e: fix flow control when using ethtool overrides
Jesse Brandeburg [Thu, 21 Feb 2008 23:10:57 +0000 (15:10 -0800)]
e1000e: fix flow control when using ethtool overrides

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe1000e: fix link up message to show ethX:
Jesse Brandeburg [Thu, 21 Feb 2008 23:10:52 +0000 (15:10 -0800)]
e1000e: fix link up message to show ethX:

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe1000e: 82573 can use eerd method to read eeprom
Auke Kok [Thu, 21 Feb 2008 23:10:47 +0000 (15:10 -0800)]
e1000e: 82573 can use eerd method to read eeprom

This simplifies the 82571/2/3 family initialization a bit
and removes an initialization table no longer needed.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoixgb: add RNBC counter - no buffer count - to ethtool stats
Auke Kok [Thu, 21 Feb 2008 23:10:41 +0000 (15:10 -0800)]
ixgb: add RNBC counter - no buffer count - to ethtool stats

This counter is valuable to determine if the system is unable
to timely return buffers to the hardware and this counter starts
to increase well before the hardware starts to drop packets. If
users experience rx_no_buffer_count increasing, they should increase
the amount of descriptors. That will provide more buffers for the
hardware and will decrease the chance of hard drops.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agomacb: Fix speed setting
Atsushi Nemoto [Thu, 21 Feb 2008 13:50:54 +0000 (22:50 +0900)]
macb: Fix speed setting

Fix NCFGR.SPD setting on 10Mbps.  This bug was introduced by
conversion to generic PHY layer in kernel 2.6.23.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosky2: fix LED management
Stephen Hemminger [Sat, 23 Feb 2008 00:00:33 +0000 (16:00 -0800)]
sky2: fix LED management

Fix problems in LED management, so ethtool -p works correctly on Yukon-EC
and other chips. The driver was incorrectly setting the PHY LED overide bits.
Moral: read the spec sheet, not the vendor driver.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[netdrvr] via-rhine: Use register offset definition for WOLcgClr
Laura Garcia [Sat, 23 Feb 2008 17:56:35 +0000 (18:56 +0100)]
[netdrvr] via-rhine: Use register offset definition for WOLcgClr

Use register offset definition for WOLcgClr, rather than a magic
number.

This patch does not change the driver behaviour.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonet/phy/mdio_bus.c: fix a check-after-use
Adrian Bunk [Wed, 20 Feb 2008 00:13:53 +0000 (02:13 +0200)]
net/phy/mdio_bus.c: fix a check-after-use

This patch fixes a check-after-use spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoigb: Fix panic with NICs with 1000BASE-SX PHY
Bill Hayes [Tue, 19 Feb 2008 18:24:41 +0000 (10:24 -0800)]
igb: Fix panic with NICs with 1000BASE-SX PHY

This patch eliminates a kernel panic with the igb driver in 2.6.25-rc2 when
running on a Intel 82575 Ethernet controller with a 1000BASE-SX PHY.  The
panic does not happen with the 1000BASE-T PHY, only with a SX connection.

Signed-off-by: Bill Hayes <bill.hayes@hp.com>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agogianfar: don't pass NULL dev ptr to DMA ops
Becky Bruce [Mon, 18 Feb 2008 23:24:30 +0000 (17:24 -0600)]
gianfar: don't pass NULL dev ptr to DMA ops

Change all dma op invocations in gianfar.c to actually pass in the
device pointer.  Currently, the value is ignored, but it will be
used going forward as we implement archdata for 32-bit powerpc.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosis190: read the mac address from the eeprom first
Francois Romieu [Mon, 18 Feb 2008 20:20:32 +0000 (21:20 +0100)]
sis190: read the mac address from the eeprom first

Reading a serie of zero from the cmos sram area do not work
well with is_valid_ether_addr(). Let's read the mac address
from the eeprom first as it seems more reliable.

Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9831

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agotlan: add static to function definitions
Harvey Harrison [Mon, 18 Feb 2008 18:04:38 +0000 (10:04 -0800)]
tlan: add static to function definitions

The forward declarations were already marked static, make the definitions
be static as well.  Fixes the sparse warnings as well.

drivers/net/tlan.c:1403:5: warning: symbol 'TLan_HandleInvalid' was not declared. Should it be static?
drivers/net/tlan.c:1435:5: warning: symbol 'TLan_HandleTxEOF' was not declared. Should it be static?
drivers/net/tlan.c:1521:5: warning: symbol 'TLan_HandleStatOverflow' was not declared. Should it be static?
drivers/net/tlan.c:1557:5: warning: symbol 'TLan_HandleRxEOF' was not declared. Should it be static?
drivers/net/tlan.c:1692:5: warning: symbol 'TLan_HandleDummy' was not declared. Should it be static?
drivers/net/tlan.c:1722:5: warning: symbol 'TLan_HandleTxEOC' was not declared. Should it be static?
drivers/net/tlan.c:1770:5: warning: symbol 'TLan_HandleStatusCheck' was not declared. Should it be static?
drivers/net/tlan.c:1845:5: warning: symbol 'TLan_HandleRxEOC' was not declared. Should it be static?
drivers/net/tlan.c:1905:6: warning: symbol 'TLan_Timer' was not declared. Should it be static?
drivers/net/tlan.c:1986:6: warning: symbol 'TLan_ResetLists' was not declared. Should it be static?
drivers/net/tlan.c:2046:6: warning: symbol 'TLan_FreeLists' was not declared. Should it be static?
drivers/net/tlan.c:2095:6: warning: symbol 'TLan_PrintDio' was not declared. Should it be static?
drivers/net/tlan.c:2130:6: warning: symbol 'TLan_PrintList' was not declared. Should it be static?
drivers/net/tlan.c:2166:6: warning: symbol 'TLan_ReadAndClearStats' was not declared. Should it be static?
drivers/net/tlan.c:2242:1: warning: symbol 'TLan_ResetAdapter' was not declared. Should it be static?
drivers/net/tlan.c:2328:1: warning: symbol 'TLan_FinishReset' was not declared. Should it be static?
drivers/net/tlan.c:2451:6: warning: symbol 'TLan_SetMac' was not declared. Should it be static?
drivers/net/tlan.c:2493:6: warning: symbol 'TLan_PhyPrint' was not declared. Should it be static?
drivers/net/tlan.c:2542:6: warning: symbol 'TLan_PhyDetect' was not declared. Should it be static?
drivers/net/tlan.c:2589:6: warning: symbol 'TLan_PhyPowerDown' was not declared. Should it be static?
drivers/net/tlan.c:2614:6: warning: symbol 'TLan_PhyPowerUp' was not declared. Should it be static?
drivers/net/tlan.c:2635:6: warning: symbol 'TLan_PhyReset' was not declared. Should it be static?
drivers/net/tlan.c:2663:6: warning: symbol 'TLan_PhyStartLink' was not declared. Should it be static?
drivers/net/tlan.c:2750:6: warning: symbol 'TLan_PhyFinishAutoNeg' was not declared. Should it be static?
drivers/net/tlan.c:2906:5: warning: symbol 'TLan_MiiReadReg' was not declared. Should it be static?
drivers/net/tlan.c:2996:6: warning: symbol 'TLan_MiiSendData' was not declared. Should it be static?
drivers/net/tlan.c:3038:6: warning: symbol 'TLan_MiiSync' was not declared. Should it be static?
drivers/net/tlan.c:3077:6: warning: symbol 'TLan_MiiWriteReg' was not declared. Should it be static?
drivers/net/tlan.c:3147:6: warning: symbol 'TLan_EeSendStart' was not declared. Should it be static?
drivers/net/tlan.c:3187:5: warning: symbol 'TLan_EeSendByte' was not declared. Should it be static?
drivers/net/tlan.c:3248:6: warning: symbol 'TLan_EeReceiveByte' was not declared. Should it be static?
drivers/net/tlan.c:3306:5: warning: symbol 'TLan_EeReadByte' was not declared. Should it be static?

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoclaw: make use of DIV_ROUND_UP
Julia Lawall [Mon, 18 Feb 2008 13:41:55 +0000 (14:41 +0100)]
claw: make use of DIV_ROUND_UP

The kernel.h macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) / (d)) but is perhaps more readable.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopcnet_cs: if AX88190-based card, printk "use axnet_cs instead" message.
Komuro [Mon, 18 Feb 2008 13:06:19 +0000 (22:06 +0900)]
pcnet_cs: if AX88190-based card, printk "use axnet_cs instead" message.

   * If ConfigBase is 0x03c0 && manfid is (0x0149,0xc1ab),
    printk "use axnet_cs instead" message.

    Actually, most of the card with manfid(0x0149, 0xc1ab)
    use pcnet_cs driver.

   * remove entry (0x021b, 0x0202)

Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agodrivers/net/cs89x0.c: compilation warning fix
Leonardo Potenza [Sun, 17 Feb 2008 17:23:15 +0000 (18:23 +0100)]
drivers/net/cs89x0.c: compilation warning fix

Suppress the warning message about the 'netcard_portlist' defined but not used.

Signed-off-by: Leonardo Potenza <lpotenza@inwind.it>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agovirtio_net: Fix oops on early interrupts - introduced by virtio reset code
Christian Borntraeger [Mon, 18 Feb 2008 09:02:51 +0000 (10:02 +0100)]
virtio_net: Fix oops on early interrupts - introduced by virtio reset code

Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agouli526x partially recognizing interface
Grant Grundler [Sun, 17 Feb 2008 18:30:23 +0000 (11:30 -0700)]
uli526x partially recognizing interface

Patch fixes:
    http://bugzilla.kernel.org/show_bug.cgi?id=5839

Init sequence needs to poll phy until phy reset is complete. This is the
same problem that I fixed in 2002 in tulip driver.

Thanks to manty@manty.net for testing this patch.
Thanks to Pozsar Balazs <pozsy@uhulinux.hu> for posting/testing
a similar patch before:
    http://lkml.org/lkml/2006/8/21/45

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoupdate TULIP MAINTAINERS
Grant Grundler [Sun, 17 Feb 2008 18:53:49 +0000 (11:53 -0700)]
update TULIP MAINTAINERS

Kyle and I are co-maintaining tulip driver. Normally kyle will review
my patchs and submit them. I'll deal with bugzilla.kernel.org bugs and
try to resolve those bugs.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoigb: fix legacy mode irq issue
Andy Gospodarek [Fri, 15 Feb 2008 22:05:25 +0000 (14:05 -0800)]
igb: fix legacy mode irq issue

I booted an igb kernel with the option pci=nomsi and instantly noticed
that interrupts no longer worked on my igb device.  I took a look at the
interrupt initialization and quickly discovered a comment stating:

"DO NOT USE EIAME or IAME in legacy mode"

It seemed a bit odd that bits to enable IAM were being set in legacy
interrupt mode, so I dropped out the following parts and interrupts
began working fine again.

[Updated code flow and a nitpick spelling error --Auke]

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agofs_enet: Don't call phy_mii_ioctl() in atomic context.
Scott Wood [Fri, 15 Feb 2008 21:08:04 +0000 (15:08 -0600)]
fs_enet: Don't call phy_mii_ioctl() in atomic context.

The lock acquisition in fs_ioctl() does not appear to actually be necessary,
and thus is simply removed.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoehea: add kdump support
Thomas Klein [Wed, 13 Feb 2008 15:18:33 +0000 (16:18 +0100)]
ehea: add kdump support

This patch adds kdump support to the ehea driver. As the firmware doesn't free
resource handles automatically, the driver has to run an as simple as possible
free resource function in case of a crash shutdown. The function iterates over
two arrays freeing all resource handles which are stored there. The arrays are
kept up-to-date during normal runtime. The crash handler fn is triggered by the
recently introduced PPC crash shutdown reg/unreg functions.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoMerge branch 'master' of ../linux-2.6/
David S. Miller [Sun, 24 Feb 2008 04:38:20 +0000 (20:38 -0800)]
Merge branch 'master' of ../linux-2.6/

16 years agoFix u132-hcd.c compile error
Mirco Tischler [Sun, 24 Feb 2008 04:16:39 +0000 (05:16 +0100)]
Fix u132-hcd.c compile error

This fixes the following compile error caused by commit
3a2d5b700132f35401f1d9e22fe3c2cab02c2549 ("PM: Introduce
PM_EVENT_HIBERNATE callback state")

    CC [M]  drivers/usb/host/u132-hcd.o
  drivers/usb/host/u132-hcd.c: In function ‘u132_suspend’:
  drivers/usb/host/u132-hcd.c:3224: error: expected expression before ‘int’
  drivers/usb/host/u132-hcd.c:3225: error: ‘ports’ undeclared (first use in this function)
  ...

Signed-off-by: Mirco Tischler <mt-ml@gmx.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[NETFILTER]: fix ebtable targets return
Joonwoo Park [Sun, 24 Feb 2008 04:22:27 +0000 (20:22 -0800)]
[NETFILTER]: fix ebtable targets return

The function ebt_do_table doesn't take NF_DROP as a verdict from the targets.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP_TUNNEL]: Don't limit the number of tunnels with generic name explicitly.
Pavel Emelyanov [Sun, 24 Feb 2008 04:19:20 +0000 (20:19 -0800)]
[IP_TUNNEL]: Don't limit the number of tunnels with generic name explicitly.

Use the added dev_alloc_name() call to create tunnel device name,
rather than iterate in a hand-made loop with an artificial limit.

Thanks Patrick for noticing this.

[ The way this works is, when the device is actually registered,
  the generic code noticed the '%' in the name and invokes
  dev_alloc_name() to fully resolve the name.  -DaveM ]

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Restore sanity wrt. print_mac().
David S. Miller [Sun, 24 Feb 2008 04:09:11 +0000 (20:09 -0800)]
[NET]: Restore sanity wrt. print_mac().

MAC_FMT had only one user and we tried to get rid of
that, but this created more problems than it solved.

As a result, this reverts three commits:

235365f3aaaa10b7056293877c0ead50425f25c7 ("net/8021q/vlan_dev.c: Use
print_mac."), fea5fa875eb235dc186b1f5184eb36abc63e26cc ("[NET]: Remove
MAC_FMT"), and 8f789c48448aed74fe1c07af76de8f04adacec7d ("[NET]:
Elminate spurious print_mac() calls.")

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NEIGH]: Fix race between neighbor lookup and table's hash_rnd update.
Pavel Emelyanov [Sun, 24 Feb 2008 03:57:02 +0000 (19:57 -0800)]
[NEIGH]: Fix race between neighbor lookup and table's hash_rnd update.

The neigh_hash_grow() may update the tbl->hash_rnd value, which
is used in all tbl->hash callbacks to calculate the hashval.

Two lookup routines may race with this, since they call the
->hash callback without the tbl->lock held. Since the hash_rnd
is changed with this lock write-locked moving the calls to ->hash
under this lock read-locked closes this gap.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[RTNL]: Validate hardware and broadcast address attribute for RTM_NEWLINK
Thomas Graf [Sun, 24 Feb 2008 03:54:36 +0000 (19:54 -0800)]
[RTNL]: Validate hardware and broadcast address attribute for RTM_NEWLINK

RTM_NEWLINK allows for already existing links to be modified. For this
purpose do_setlink() is called which expects address attributes with a
payload length of at least dev->addr_len. This patch adds the necessary
validation for the RTM_NEWLINK case.

The address length for links to be created is not checked for now as the
actual attribute length is used when copying the address to the netdevice
structure. It might make sense to report an error if less than addr_len
bytes are provided but enforcing this might break drivers trying to be
smart with not transmitting all zero addresses.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotg3: ethtool phys_id default
Stephen Hemminger [Sun, 24 Feb 2008 03:51:59 +0000 (19:51 -0800)]
tg3: ethtool phys_id default

When asked to blink LEDs the tg3 driver behaves when using:
ethtool -p ethX
The default value for data is zero, and other drivers interpret this
as blink forever (or at least a really long time).  The tg3 driver
interprets this as blink once.  All drivers should have the same
behaviour.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[BNX2]: Update version to 1.7.4.
Michael Chan [Sun, 24 Feb 2008 03:49:48 +0000 (19:49 -0800)]
[BNX2]: Update version to 1.7.4.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agofix vmsas.c file permissions
Oliver Pinter [Sun, 24 Feb 2008 03:33:21 +0000 (04:33 +0100)]
fix vmsas.c file permissions

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[BNX2]: Disable parallel detect on an HP blade.
Michael Chan [Sun, 24 Feb 2008 03:48:57 +0000 (19:48 -0800)]
[BNX2]: Disable parallel detect on an HP blade.

Because of some board issues, we need to disable parallel detect on
an HP blade.  Without this patch, the link state can become stuck
when it goes into parallel detect mode.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[BNX2]: More 5706S link down workaround.
Michael Chan [Sun, 24 Feb 2008 03:47:44 +0000 (19:47 -0800)]
[BNX2]: More 5706S link down workaround.

The previous patches to workaround the 5706S on an HP blade were not
sufficient.  The link state still does not change properly in some
cases.  This patch adds polling to make it completely reliable.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoAdd memory barrier semantics to wake_up() & co
Linus Torvalds [Sun, 24 Feb 2008 02:05:03 +0000 (18:05 -0800)]
Add memory barrier semantics to wake_up() & co

Oleg Nesterov and others have pointed out that on some architectures,
the traditional sequence of

set_current_state(TASK_INTERRUPTIBLE);
if (CONDITION)
return;
schedule();

is racy wrt another CPU doing

CONDITION = 1;
wake_up_process(p);

because while set_current_state() has a memory barrier separating
setting of the TASK_INTERRUPTIBLE state from reading of the CONDITION
variable, there is no such memory barrier on the wakeup side.

Now, wake_up_process() does actually take a spinlock before it reads and
sets the task state on the waking side, and on x86 (and many other
architectures) that spinlock is in fact equivalent to a memory barrier,
but that is not generally guaranteed.  The write that sets CONDITION
could move into the critical region protected by the runqueue spinlock.

However, adding a smp_wmb() to before the spinlock should now order the
writing of CONDITION wrt the lock itself, which in turn is ordered wrt
the accesses within the spinlock (which includes the reading of the old
state).

This should thus close the race (which probably has never been seen in
practice, but since smp_wmb() is a no-op on x86, it's not like this will
make anything worse either on the most common architecture where the
spinlock already gave the required protection).

Acked-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomvsas: fix build warning, clean prototypes
Jeff Garzik [Sat, 23 Feb 2008 21:53:44 +0000 (16:53 -0500)]
mvsas: fix build warning, clean prototypes

- Fix build 'make randconfig' build warning spotted by Toralf Foerster:

drivers/scsi/mvsas.c: In function 'mvs_hexdump':
drivers/scsi/mvsas.c:715: error: implicit declaration of function 'isalnum'

- Remove unneeded prototypes (spotted by hch)

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodocumentation: atomic_add_unless() doesn't imply mb() on failure
Oleg Nesterov [Sat, 23 Feb 2008 21:03:29 +0000 (00:03 +0300)]
documentation: atomic_add_unless() doesn't imply mb() on failure

(sorry for being offtpoic, but while experts are here...)

A "typical" implementation of atomic_add_unless() can return 0 immediately
after the first atomic_read() (before doing cmpxchg). In that case it doesn't
provide any barrier semantics. See include/asm-ia64/atomic.h as an example.

We should either change the implementation, or fix the docs.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcgroup: return negative error code in mem_cgroup_create()
Li Zefan [Sat, 23 Feb 2008 23:24:14 +0000 (15:24 -0800)]
memcgroup: return negative error code in mem_cgroup_create()

Cgroup requires the subsystem to return negative error code on error in the
create method.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcgroup: remove a useless VM_BUG_ON()
Li Zefan [Sat, 23 Feb 2008 23:24:13 +0000 (15:24 -0800)]
memcgroup: remove a useless VM_BUG_ON()

Remove this VM_BUG_ON(), as Balbir stated:

We used to have a for loop with !list_empty() as a termination condition
and VM_BUG_ON(!pc) is a spill over.  With the new loop, VM_BUG_ON(!pc) does
not make sense.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcgroup: fix and update documentation
Li Zefan [Sat, 23 Feb 2008 23:24:12 +0000 (15:24 -0800)]
memcgroup: fix and update documentation

- remove trailing " Bytes"s in the demonstration
- remove section 4.4 (feature control_type has been removed)
- fix reference section

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: remove dead code in cgroup_get_rootdir()
Li Zefan [Sat, 23 Feb 2008 23:24:12 +0000 (15:24 -0800)]
cgroup: remove dead code in cgroup_get_rootdir()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agocgroup: remove duplicate code in find_css_set()
Li Zefan [Sat, 23 Feb 2008 23:24:11 +0000 (15:24 -0800)]
cgroup: remove duplicate code in find_css_set()

The list head res->tasks gets initialized twice in find_css_set().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agocgroup: fix subsys bitops
Li Zefan [Sat, 23 Feb 2008 23:24:11 +0000 (15:24 -0800)]
cgroup: fix subsys bitops

Cgroup uses unsigned long for subsys bitops, not unsigned long long.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agocgroup: fix memory leak in cgroup_get_sb()
Li Zefan [Sat, 23 Feb 2008 23:24:10 +0000 (15:24 -0800)]
cgroup: fix memory leak in cgroup_get_sb()

opts.release_agent is not kfree()ed in all necessary places.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agocgroup: clean up cgroup.h
Li Zefan [Sat, 23 Feb 2008 23:24:09 +0000 (15:24 -0800)]
cgroup: clean up cgroup.h

- replace old name 'cont' with 'cgrp' (Paul Menage did this cleanup for
  cgroup.c in commit bd89aabc6761de1c35b154fe6f914a445d301510)
- remove a duplicate declaration of cgroup_path()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agocgroup: fix comments
Li Zefan [Sat, 23 Feb 2008 23:24:09 +0000 (15:24 -0800)]
cgroup: fix comments

fix:
- comments about need_forkexit_callback
- comments about release agent
- typo and comment style, etc.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agocgroup: fix and update documentation
Li Zefan [Sat, 23 Feb 2008 23:24:08 +0000 (15:24 -0800)]
cgroup: fix and update documentation

Misc fixes and updates, make the doc consistent with current cgroup
implementation.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: 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 agoSolve section mismatch for free_area_init_core.
Alexander van Heukelum [Sat, 23 Feb 2008 23:24:06 +0000 (15:24 -0800)]
Solve section mismatch for free_area_init_core.

WARNING: vmlinux.o(.meminit.text+0x649):
Section mismatch in reference from the
function free_area_init_core() to the function .init.text:setup_usemap()
The function __meminit free_area_init_core() references
a function __init setup_usemap().
If free_area_init_core is only used by setup_usemap then
annotate free_area_init_core with a matching annotation.

The warning is covers this stack of functions in mm/page_alloc.c:

alloc_bootmem_node must be marked __init.
alloc_bootmem_node is used by setup_usemap, if !SPARSEMEM.
(usemap_size is only used by setup_usemap, if !SPARSEMEM.)
setup_usemap is only used by free_area_init_core.
free_area_init_core is only used by free_area_init_node.

free_area_init_node is used by:
arch/alpha/mm/numa.c: __init paging_init()
arch/arm/mm/init.c: __init bootmem_init_node()
arch/avr32/mm/init.c: __init paging_init()
arch/cris/arch-v10/mm/init.c: __init paging_init()
arch/cris/arch-v32/mm/init.c: __init paging_init()
arch/m32r/mm/discontig.c: __init zone_sizes_init()
arch/m32r/mm/init.c: __init zone_sizes_init()
arch/m68k/mm/motorola.c: __init paging_init()
arch/m68k/mm/sun3mmu.c: __init paging_init()
arch/mips/sgi-ip27/ip27-memory.c: __init paging_init()
arch/parisc/mm/init.c: __init paging_init()
arch/sparc/mm/srmmu.c: __init srmmu_paging_init()
arch/sparc/mm/sun4c.c: __init sun4c_paging_init()
arch/sparc64/mm/init.c: __init paging_init()
mm/page_alloc.c: __init free_area_init_nodes()
mm/page_alloc.c: __init free_area_init()
and
mm/memory_hotplug.c: hotadd_new_pgdat()

hotadd_new_pgdat can not be an __init function, but:

It is compiled for MEMORY_HOTPLUG configurations only
MEMORY_HOTPLUG depends on SPARSEMEM || X86_64_ACPI_NUMA
X86_64_ACPI_NUMA depends on X86_64
ARCH_FLATMEM_ENABLE depends on X86_32
ARCH_DISCONTIGMEM_ENABLE depends on X86_32
So X86_64_ACPI_NUMA implies SPARSEMEM, right?

So we can mark the stack of functions __init for !SPARSEMEM, but we must mark
them __meminit for SPARSEMEM configurations.  This is ok, because then the
calls to alloc_bootmem_node are also avoided.

Compile-tested on:
silly minimal config
defconfig x86_32
defconfig x86_64
defconfig x86_64 -HIBERNATION +MEMORY_HOTPLUG

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoSmack: update for file capabilities
Casey Schaufler [Sat, 23 Feb 2008 23:24:04 +0000 (15:24 -0800)]
Smack: update for file capabilities

Update the Smack LSM to allow the registration of the capability "module"
as a secondary LSM.  Integrate the new hooks required for file based
capabilities.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Paul Moore <paul.moore@hp.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokprobes: refuse kprobe insertion on add/sub_preempt_counter()
Srinivasa Ds [Sat, 23 Feb 2008 23:24:04 +0000 (15:24 -0800)]
kprobes: refuse kprobe insertion on add/sub_preempt_counter()

Kprobes makes use of preempt_disable(),preempt_enable_noresched() and these
functions inturn call add/sub_preempt_count().  So we need to refuse user from
inserting probe in to these functions.

This patch disallows user from probing add/sub_preempt_count().

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup memory controller: document huge memory/cache overhead in Kconfig
Andi Kleen [Sat, 23 Feb 2008 23:24:02 +0000 (15:24 -0800)]
cgroup memory controller: document huge memory/cache overhead in Kconfig

Document huge memory/cache overhead of memory controller in Kconfig

I was a little surprised that 2.6.25-rc* increased struct page for the
memory controller.  At least on many x86-64 machines it will not fit into a
single cache line now anymore and also costs considerable amounts of RAM.
At earlier review I remembered asking for a external data structure for
this.

It's also quite unobvious that a innocent looking Kconfig option with a
single line Kconfig description has such a negative effect.

This patch attempts to document these disadvantages at least so that users
configuring their kernel can make a informed decision.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Balbir Singh <balbir@in.ibm.com>
Acked-by: 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 agokernel-doc: fix function-pointer-parameter parsing
Richard Kennedy [Sat, 23 Feb 2008 23:24:01 +0000 (15:24 -0800)]
kernel-doc: fix function-pointer-parameter parsing

When running "make htmldocs" I'm seeing some non-fatal perl errors caused
by trying to parse the callback function definitions in blk-core.c.

The errors are "Use of uninitialized value in concatenation (.)..."
in combination with:
Warning(linux-2.6.25-rc2/block/blk-core.c:1877): No description found for parameter ''

The function pointers are defined without a * i.e.
int (drv_callback)(struct request *)

The compiler is happy with them, but kernel-doc isn't.

This patch teaches create_parameterlist in kernel-doc to parse this type of
function pointer definition, but is it the right way to fix the problem ?
The problem only seems to occur in blk-core.c.

However with the patch applied, kernel-doc finds the correct parameter
description for the callback in blk_end_request_callback, which is doesn't
normally.

I thought it would be a bit odd to change to code to use the more normal
form of function pointers just to get the documentation to work, so I fixed
kernel-doc instead - even though this is teaching it to understand code
that might go away (The comment for blk_end_request_callback says that it
should not be used and will removed at some point).

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: defconfig update
Yoshinori Sato [Sat, 23 Feb 2008 23:24:00 +0000 (15:24 -0800)]
h8300: defconfig update

defconfig update.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: IRQ handling update
Yoshinori Sato [Sat, 23 Feb 2008 23:23:59 +0000 (15:23 -0800)]
h8300: IRQ handling update

- add missing file and declare.
- remove unused file and macros.
- some cleanup.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: uaccess.h update
Yoshinori Sato [Sat, 23 Feb 2008 23:23:59 +0000 (15:23 -0800)]
h8300: uaccess.h update

get_user const *ptr access fix.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoh8300: signal.c typo fix
Yoshinori Sato [Sat, 23 Feb 2008 23:23:58 +0000 (15:23 -0800)]
h8300: signal.c typo fix

typo fix.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofutex: runtime enable pi and robust functionality
Thomas Gleixner [Sat, 23 Feb 2008 23:23:57 +0000 (15:23 -0800)]
futex: runtime enable pi and robust functionality

Not all architectures implement futex_atomic_cmpxchg_inatomic().  The default
implementation returns -ENOSYS, which is currently not handled inside of the
futex guts.

Futex PI calls and robust list exits with a held futex result in an endless
loop in the futex code on architectures which have no support.

Fixing up every place where futex_atomic_cmpxchg_inatomic() is called would
add a fair amount of extra if/else constructs to the already complex code.  It
is also not possible to disable the robust feature before user space tries to
register robust lists.

Compile time disabling is not a good idea either, as there are already
architectures with runtime detection of futex_atomic_cmpxchg_inatomic support.

Detect the functionality at runtime instead by calling
cmpxchg_futex_value_locked() with a NULL pointer from the futex initialization
code.  This is guaranteed to fail, but the call of
futex_atomic_cmpxchg_inatomic() happens with pagefaults disabled.

On architectures, which use the asm-generic implementation or have a runtime
CPU feature detection, a -ENOSYS return value disables the PI/robust features.

On architectures with a working implementation the call returns -EFAULT and
the PI/robust features are enabled.

The relevant syscalls return -ENOSYS and the robust list exit code is blocked,
when the detection fails.

Fixes http://lkml.org/lkml/2008/2/11/149
Originally reported by: Lennart Buytenhek

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Riku Voipio <riku.voipio@movial.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 agofutex: fix init order
Thomas Gleixner [Sat, 23 Feb 2008 23:23:55 +0000 (15:23 -0800)]
futex: fix init order

When the futex init code fails to initialize the futex pseudo file system it
returns early without initializing the hash queues.  Should the boot succeed
then a futex syscall which tries to enqueue a waiter on the hashqueue will
crash due to the unitilialized plist heads.

Initialize the hash queues before the filesystem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Riku Voipio <riku.voipio@movial.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 agodmi: prevent linked list corruption
Jean Delvare [Sat, 23 Feb 2008 23:23:55 +0000 (15:23 -0800)]
dmi: prevent linked list corruption

Adding the same item to a given linked list more than once is guaranteed
to break and corrupt the list.  This is however what we do in dmi_scan
since commit 79da4721117fcf188b4b007b775738a530f574da ("x86: fix DMI out
of memory problems").

Given that there is absolutely no interest in saving empty OEM strings
anyway, I propose the simple and efficient fix below: we discard the empty
OEM strings altogether.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Parag Warudkar <parag.warudkar@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/video/uvesafb.c: fix section mismatch warning in param_set_scroll()
Sergio Luis [Sat, 23 Feb 2008 23:23:53 +0000 (15:23 -0800)]
drivers/video/uvesafb.c: fix section mismatch warning in param_set_scroll()

Fix following warnings:
WARNING: drivers/video/built-in.o(.text+0x7c64a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c65d): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c679): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c699): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/video/built-in.o(.text+0x7c69f): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa3676): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa3689): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa36a5): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa36c5): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: drivers/built-in.o(.text+0xa36cb): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a079a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07ad): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07c9): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07e9): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan
WARNING: vmlinux.o(.text+0x4a07ef): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan

Remove __devinitdata annotation from the variable ypan.

Signed-off-by: Sergio Luis <sergio@larces.uece.br>
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 agoproc: add RLIMIT_RTTIME to /proc/<pid>/limits
Eugene Teo [Sat, 23 Feb 2008 23:23:52 +0000 (15:23 -0800)]
proc: add RLIMIT_RTTIME to /proc/<pid>/limits

RLIMIT_RTTIME was introduced to allow the user to set a runtime timeout on
real-time tasks: http://lkml.org/lkml/2007/12/18/218. This patch updates
/proc/<pid>/limits with the new rlimit.

Signed-off-by: Eugene Teo <eugeneteo@kernel.sg>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoefs: move headers out of include/linux/
Christoph Hellwig [Sat, 23 Feb 2008 23:23:51 +0000 (15:23 -0800)]
efs: move headers out of include/linux/

Merge include/linux/efs_fs{_i,_dir}.h into fs/efs/efs.h.  efs_vh.h remains
there because this is the IRIX volume header and shouldn't really be
handled by efs but by the partitioning code.  efs_sb.h remains there for
now because it's exported to userspace.  Of course this wrong and aboot
should have a copy of it's own, but I'll leave that to a separate patch to
avoid any contention.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoNBD: make nbd default to deadline I/O scheduler
Paul Clements [Sat, 23 Feb 2008 23:23:50 +0000 (15:23 -0800)]
NBD: make nbd default to deadline I/O scheduler

NBD doesn't work well with CFQ (or AS) schedulers, so let's default to
something else.

The two problems I have experienced with nbd and cfq are:

1) nbd hangs with cfq on RHEL 5 (2.6.18) -- this may well have been
   fixed

   There's a similar debian bug that has been filed as well:

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447638

   There have been posts to nbd-general mailing list about problems with
   cfq and nbd also.

2) nbd performs about 10% better (the last time I tested) with deadline
   vs.  cfq (the overhead of cfq doesn't provide much advantage to nbd [not
   being a real disk], and you end up going through the I/O scheduler on
   the nbd server anyway, so it makes sense that deadline is better with
   nbd)

Signed-off-by: Paul Clements <paul.clements@steeleye.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: fix FP register corruption
Jeff Dike [Sat, 23 Feb 2008 23:23:49 +0000 (15:23 -0800)]
uml: fix FP register corruption

Commit ee3d9bd4de1ed93d2a7ee41c331ed30a1c7b8acd ("uml: simplify SIGSEGV
handling"), while greatly simplifying the kernel SIGSEGV handler that
runs in the process address space, introduced a bug which corrupts FP
state in the process.

Previously, the SIGSEGV handler called the sigreturn system call by hand - it
couldn't return through the restorer provided to it because that could try to
call the libc restorer which likely wouldn't exist in the process address
space.  So, it blocked off some signals, including SIGUSR1, on entry to the
SIGSEGV handler, queued a SIGUSR1 to itself, and invoked sigreturn.  The
SIGUSR1 was delivered, and was visible to the UML kernel after sigreturn
finished.

The commit eliminated the signal masking and the call to sigreturn.  The
handler simply hits itself with a SIGTRAP to let the UML kernel know that it
is finished.  UML then restores the process registers, which effectively
longjmps the process out of the signal handler, skipping sigreturn's restoring
of register state and the signal mask.

The bug is that the host apparently sets used_fp to 0 when it saves the
process FP state in the sigcontext on the process signal stack.  Thus, when
the process is longjmped out of the handler, its FP state is corrupt because
it wasn't saved on the context switch to the UML kernel.

This manifested itself as sleep hanging.  For some reason, sleep uses floating
point in order to calculate the sleep interval.  When a page fault corrupts
its FP state, it is faked into essentially sleeping forever.

This patch saves the FP state before entering the SIGSEGV handler and restores
it afterwards.

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 helper_wait calls in watchdog
Johann Felix Soden [Sat, 23 Feb 2008 23:23:49 +0000 (15:23 -0800)]
uml: fix helper_wait calls in watchdog

In commit 1aa351a308d2c3ddb92b6cc45083fc54271d0010 ("uml: tidy helper
code") the arguments of helper_wait() were changed.  The adaptation of
harddog_user.c was forgotten, so this errors occur:

  /arch/um/drivers/harddog_user.c: In function 'start_watchdog':
  /arch/um/drivers/harddog_user.c:82: error: too many arguments to function 'helper_wait'
  /arch/um/drivers/harddog_user.c:89: error: too many arguments to function 'helper_wait'

Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net>
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: remove unused sigcontext accessors
Jeff Dike [Sat, 23 Feb 2008 23:23:48 +0000 (15:23 -0800)]
uml: remove unused sigcontext accessors

The macros which extract registers from a struct sigcontext are no longer
needed and can be removed.  They are starting not to build anyway, given the
removal of the 'e' and 'r' from register names during the x86 merge.

Cc: Jiri Olsa <olsajiri@gmail.com>
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 agodmi: don't save the same device twice
Jean Delvare [Sat, 23 Feb 2008 23:23:46 +0000 (15:23 -0800)]
dmi: don't save the same device twice

Now that we gather on-board devices from both DMI types 10 and 41, there is
a possibility that we list the same device twice.  In order to not confuse
drivers, and also to save memory, make sure that we do not add duplicate
devices to the dmi_devices list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc-cmos: display HPET emulation mode
David Brownell [Sat, 23 Feb 2008 23:23:44 +0000 (15:23 -0800)]
rtc-cmos: display HPET emulation mode

For the "cmos" RTC, have /proc/driver/rtc say whether HPET based IRQ
emulation is in effect.  Given the problems we've had with this particular
hardware maldesign (and the fact that most BIOS code seems not to provide
the IRQ routing needed to use the saner HPET modes), this should help
troubleshooting.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agohwrng: remove Michael as HWRNG maintainer
Michael Buesch [Sat, 23 Feb 2008 23:23:42 +0000 (15:23 -0800)]
hwrng: remove Michael as HWRNG maintainer

It turns out that I rewrote the HWRNG core once to make it pluggable, but
I'm not a crypto-expert at all.  So I'm certainly the wrong person for
being a maintainer of the HWRNG core.  Let's orphan it.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocpuset: trivial documentation fix s/N_MEMORY/N_HIGH_MEMORY/
KOSAKI Motohiro [Sat, 23 Feb 2008 23:23:41 +0000 (15:23 -0800)]
cpuset: trivial documentation fix s/N_MEMORY/N_HIGH_MEMORY/

Current implementation of cpuset track N_HIGH_MEMORY instead N_MEMORY.
(N_MEMORY doesn't exist in current implementation)

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Paul Jackson <pj@sgi.com>
Cc: Christoph Lameter <clameter@sgi.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 agospi: pxa2xx_spi clock polarity fix
Ned Forrester [Sat, 23 Feb 2008 23:23:40 +0000 (15:23 -0800)]
spi: pxa2xx_spi clock polarity fix

Fixes a sequencing bug in spi driver pxa2xx_spi.c in which the chip select
for a transfer may be asserted before the clock polarity is set on the
interface.  As a result of this bug, the clock signal may have the wrong
polarity at transfer start, so it may need to make an extra half transition
before the intended clock/data signals begin.  (This probably means all
transfers are one bit out of sequence.)

This only occurs on the first transfer following a change in clock polarity
in systems using more than one more than one such polarity.  The fix
assures that the clock mode is properly set before asserting chip select.

This bug was introduced in a patch merged on 2006/12/10, kernel 2.6.20.
The patch defines an additional bit in: include/asm-arm/arch-pxa/regs-ssp.h
for 2.6.25 and newer kernels but this addition must be made in:
include/asm-arm/arch-pxa/pxa-regs.h for kernels between 2.6.20 and 2.6.24,
inclusive

Signed-off-by: Ned Forrester <nforrester@whoi.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoatmel_spi: fix clock polarity
Atsushi Nemoto [Sat, 23 Feb 2008 23:23:39 +0000 (15:23 -0800)]
atmel_spi: fix clock polarity

The atmel_spi driver does not initialize clock polarity correctly (except for
at91rm9200 CS0 channel) in some case.

The atmel_spi driver uses gpio-controlled chipselect.  OTOH spi clock signal
is controlled by CSRn.CPOL bit, but this register controls clock signal
correctly only in 'real transfer' duration.  At the time of cs_activate()
call, CSRn.CPOL will be initialized correctly, but the controller do not know
which channel is to be used next, so clock signal will stay at the inactive
state of last transfer.  If clock polarity of new transfer and last transfer
was differ, new transfer will start with wrong clock signal state.

For example, if you started SPI MODE 2 or 3 transfer after SPI MODE 0 or 1
transfer, the clock signal state at the assertion of chipselect will be low.
Of course this will violates SPI transfer.

This patch is short term solution for this problem.  It makes all CSRn.CPOL
match for the transfer before activating chipselect.  For longer term, the
best fix might be to let NPCS0 stay selected permanently in MR and overwrite
CSR0 with to the new slave's settings before asserting CS.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
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 agolib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Hoang-Nam Nguyen [Sat, 23 Feb 2008 23:23:37 +0000 (15:23 -0800)]
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)

lib/vsprintf.c: Fix bug omitting minus sign of numbers (module_param)

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Cc: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoNOMMU: is_vmalloc_addr() won't compile if !MMU
David Howells [Sat, 23 Feb 2008 23:23:37 +0000 (15:23 -0800)]
NOMMU: is_vmalloc_addr() won't compile if !MMU

Make is_vmalloc_addr() contingent on CONFIG_MMU=y, as it won't compile
in !MMU mode.

[ Bug introduced in commit 9e2779fa281cfda13ac060753d674bbcaa23367e:
  "is_vmalloc_addr(): Check if an address is within the vmalloc
  boundaries" ].

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoatmel_serial: fix interrupt handler return value
Haavard Skinnemoen [Sat, 23 Feb 2008 23:23:36 +0000 (15:23 -0800)]
atmel_serial: fix interrupt handler return value

We should only return IRQ_HANDLED when we actually found something to
handle. This is important since the USART interrupt handler may be
shared with the timer interrupt on some chips.

Pointed-out-by: michael <trimarchi@gandalf.sssup.it>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocopyright owner and author clean up for intel iommu and related files
mark gross [Sat, 23 Feb 2008 23:23:35 +0000 (15:23 -0800)]
copyright owner and author clean up for intel iommu and related files

The following is a clean up and correction of the copyright holding
entities for the files associated with the intel iommu code.

Signed-off-by: <mgross@linux.intel.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosparc: fix build
David Rientjes [Sat, 23 Feb 2008 23:23:34 +0000 (15:23 -0800)]
sparc: fix build

Fix build failure on sparc:

In file included from include/linux/mm.h:39,
                from include/linux/memcontrol.h:24,
                from include/linux/swap.h:8,
                from include/linux/suspend.h:7,
                from init/do_mounts.c:6:
include/asm/pgtable.h:344: warning: parameter names (without
types) in function declaration
include/asm/pgtable.h:345: warning: parameter names (without
types) in function declaration
include/asm/pgtable.h:346: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '___f___swp_entry'

viro sayeth:

  I've run allmodconfig builds on a bunch of target, FWIW (essentially the
  same patch).  Note that these includes are recent addition caused by added
  inline function that had since then become a define.  So while I agree with
  your comments in general, in _this_ case it's pretty safe.

  The commit that had done it is 3062fc67dad01b1d2a15d58c709eff946389eca4
  ("memcontrol: move mm_cgroup to header file") and the switch to #define
  is in commit 60c12b1202a60eabb1c61317e5d2678fcea9893f ("memcontrol: add
  vm_match_cgroup()") (BTW, that probably warranted mentioning in the
  changelog of the latter).

Cc: Adrian Bunk <bunk@kernel.org>
Cc: Robert Reif <reif@earthlink.net>
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomarkers: fix sparse warnings in markers.c
Harvey Harrison [Sat, 23 Feb 2008 23:23:33 +0000 (15:23 -0800)]
markers: fix sparse warnings in markers.c

char can be unsigned
kernel/marker.c:64:20: error: dubious one-bit signed bitfield
kernel/marker.c:65:14: error: dubious one-bit signed bitfield

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofile capabilities: simplify signal check
Serge E. Hallyn [Sat, 23 Feb 2008 23:23:33 +0000 (15:23 -0800)]
file capabilities: simplify signal check

Simplify the uid equivalence check in cap_task_kill().  Anyone can kill a
process owned by the same uid.

Without this patch wireshark is reported to fail.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agohugetlb: ensure we do not reference a surplus page after handing it to buddy
Andy Whitcroft [Sat, 23 Feb 2008 23:23:32 +0000 (15:23 -0800)]
hugetlb: ensure we do not reference a surplus page after handing it to buddy

When we free a page via free_huge_page and we detect that we are in surplus
the page will be returned to the buddy.  After this we no longer own the page.

However at the end free_huge_page we clear out our mapping pointer from
page private.  Even where the page is not a surplus we free the page to
the hugepage pool, drop the pool locks and then clear page private.  In
either case the page may have been reallocated.  BAD.

Make sure we clear out page private before we free the page.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Adam Litke <agl@us.ibm.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 ago/proc/pid/pagemap: fix PM_SPECIAL macro
Hans Rosenfeld [Sat, 23 Feb 2008 23:23:31 +0000 (15:23 -0800)]
/proc/pid/pagemap: fix PM_SPECIAL macro

There seems to be a bug in the PM_SPECIAL macro for /proc/pid/pagemap.  I
think masking out those other bits makes more sense then setting all those
mask bits.

Signed-off-by: Hans Rosenfeld <Hans.Rosenfeld@amd.com>
Acked-by: Matt Mackall <mpm@selenic.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMAINTAINERS: linux-fbdev is moderated
Geert Uytterhoeven [Sat, 23 Feb 2008 23:23:30 +0000 (15:23 -0800)]
MAINTAINERS: linux-fbdev is moderated

While linux-fbdev is subscribers-only, non-subscribers are not plainly
rejected, but moderated, so the casual patch/comment/question comes through.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoufs: fix parenthesisation in ufs_set_fs_state()
Roel Kluin [Sat, 23 Feb 2008 23:23:29 +0000 (15:23 -0800)]
ufs: fix parenthesisation in ufs_set_fs_state()

This bug snuck in with

commit 252e211e90ce56bf005cb533ad5a297c18c19407
Author: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Date:   Tue Oct 16 23:26:31 2007 -0700

    Add in SunOS 4.1.x compatible mode for UFS

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMN10300: define SO_MARK
David Howells [Sat, 23 Feb 2008 23:23:28 +0000 (15:23 -0800)]
MN10300: define SO_MARK

Define SO_MARK for MN10300.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMN10300: define HZ as a config option
David Howells [Sat, 23 Feb 2008 23:23:28 +0000 (15:23 -0800)]
MN10300: define HZ as a config option

Define HZ as a config option.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofuse: fix permission checking
Miklos Szeredi [Sat, 23 Feb 2008 23:23:27 +0000 (15:23 -0800)]
fuse: fix permission checking

I added a nasty local variable shadowing bug to fuse in 2.6.24, with the
result, that the 'default_permissions' mount option is basically ignored.

How did this happen?

 - old err declaration in inner scope
 - new err getting declared in outer scope
 - 'return err' from inner scope getting removed
 - old declaration not being noticed

-Wshadow would have saved us, but it doesn't seem practical for
the kernel :(

More testing would have also saved us :((

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomake LKDTM depend on BLOCK
Chris Snook [Sat, 23 Feb 2008 23:23:26 +0000 (15:23 -0800)]
make LKDTM depend on BLOCK

Make LKDTM depend on BLOCK to prevent build failures with certain configs.

Signed-off-by: Chris Snook <csnook@redhat.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoarch/um/kernel/mem.c: fix a shadowed variable
WANG Cong [Sat, 23 Feb 2008 23:23:26 +0000 (15:23 -0800)]
arch/um/kernel/mem.c: fix a shadowed variable

Fix a shadowed variable in arch/um/kernel/mem.c, since there is a global
variable has the same name.

Cc: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoUML: update defconfig
Jeff Dike [Sat, 23 Feb 2008 23:23:24 +0000 (15:23 -0800)]
UML: update defconfig

Update defconfig.

Cc: Christoph Hellwig <hch@lst.de>
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 initrd printk
Johann Felix Soden [Sat, 23 Feb 2008 23:23:23 +0000 (15:23 -0800)]
uml: fix initrd printk

If the initrd file has zero-length, the error message should contain
the filepath.

Cc: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net>
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 agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Sat, 23 Feb 2008 20:29:16 +0000 (12:29 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (25 commits)
  [SCSI] qlogicpt: section fixes
  [SCSI] mvsas: convert from rough draft to working driver
  [SCSI] mvsas: Add Marvell 6440 SAS/SATA driver
  [SCSI] libsas: correctly flush the LU queue on error recovery
  [SCSI] aic94xx: fix sequencer hang on error recovery
  [SCSI] st: compile fix when DEBUG set to one
  [SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb
  [SCSI] stex: stex_direct_copy shouldn't call dma_map_sg
  [SCSI] lpfc: Balance locking
  [SCSI] qla4xxx: fix up residual handling
  [SCSI] libsas: fix error handling
  [SCSI] arcmsr: fix message allocation
  [SCSI] mptbase: fix use-after-free's
  [SCSI] iscsi transport: make 2 functions static
  [SCSI] lpfc: make lpfc_disable_node() static
  [SCSI] ips: fix data buffer accessors conversion bug
  [SCSI] gdth: don't call pci_free_consistent under spinlock
  [SCSI] qla2xxx: fix compile warning for printk format
  [SCSI] aic7xx: mitigate HOST_MSG_LOOP invalid SCB ff panic
  [SCSI] scsi_debug: disable clustering
  ...

16 years agopercpu: fix DEBUG_PREEMPT per_cpu checking
Hugh Dickins [Sat, 23 Feb 2008 19:40:17 +0000 (19:40 +0000)]
percpu: fix DEBUG_PREEMPT per_cpu checking

2.6.25-rc1 percpu changes broke CONFIG_DEBUG_PREEMPT's per_cpu checking
on several architectures.  On s390, sparc64 and x86 it's been weakened to
not checking at all; whereas on powerpc64 it's become too strict, issuing
warnings from __raw_get_cpu_var in io_schedule and init_timer for example.

Fix this by weakening powerpc's __my_cpu_offset to use the non-checking
local_paca instead of get_paca (which itself contains such a check);
and strengthening the generic my_cpu_offset to go the old slow way via
smp_processor_id when CONFIG_DEBUG_PREEMPT (debug_smp_processor_id is
where all the knowledge of what's correct when lives).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Reviewed-by: Mike Travis <travis@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoPM: Introduce PM_EVENT_HIBERNATE callback state
Rafael J. Wysocki [Sat, 23 Feb 2008 18:13:25 +0000 (19:13 +0100)]
PM: Introduce PM_EVENT_HIBERNATE callback state

During the last step of hibernation in the "platform" mode (with the
help of ACPI) we use the suspend code, including the devices'
->suspend() methods, to prepare the system for entering the ACPI S4
system sleep state.

But at least for some devices the operations performed by the
->suspend() callback in that case must be different from its operations
during regular suspend.

For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
pass it to the device drivers' ->suspend() methods during the last phase
of hibernation, so that they can distinguish this case and handle it as
appropriate.  Modify the drivers that handle PM_EVENT_SUSPEND in a
special way and need to handle PM_EVENT_HIBERNATE in the same way.

These changes are necessary to fix a hibernation regression related
to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[SCSI] qlogicpt: section fixes
Adrian Bunk [Wed, 30 Jan 2008 20:03:36 +0000 (22:03 +0200)]
[SCSI] qlogicpt: section fixes

In current mainline, __devinit qpti_sbus_probe() still is calling __init
qpti_chain_add().  Change occurrences of __init to __devinit to fix.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mvsas: convert from rough draft to working driver
Ke Wei [Sat, 23 Feb 2008 13:15:27 +0000 (21:15 +0800)]
[SCSI] mvsas: convert from rough draft to working driver

Convert rough draft Marvell 6440 driver to a working driver.
Added support for SAS and SATA devices, hotplug, wide port, and expanders.

Signed-off-by: Ke Wei <kewei@marvell.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver
Jeff Garzik [Fri, 26 Oct 2007 00:58:22 +0000 (20:58 -0400)]
[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years agoi915: fix AR register restore.
Jesse Barnes [Fri, 22 Feb 2008 01:44:35 +0000 (17:44 -0800)]
i915: fix AR register restore.

Make sure the restoration correctly restores the AR registers by
flipping the ARX register into index mode before doing anything.

Without this, some people have had the text mode restore all green.

Signed-off-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[SCSI] libsas: correctly flush the LU queue on error recovery
James Bottomley [Fri, 22 Feb 2008 23:07:52 +0000 (17:07 -0600)]
[SCSI] libsas: correctly flush the LU queue on error recovery

The current sas_scsi_clear_queue_lu() is wrongly checking for commands
which match the pointer to the one passed in.  It should be checking for
commands which are on the same logical unit as the one passed in.  Fix
this by checking target pointer and LUN for equality.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic94xx: fix sequencer hang on error recovery
James Bottomley [Fri, 22 Feb 2008 23:01:59 +0000 (17:01 -0600)]
[SCSI] aic94xx: fix sequencer hang on error recovery

The clear nexus I_T and clear nexus I_T_L functions in the aic94xx
specify the SUSPEND_TX flag which causes the sequencer to be suspended
until it receives a RESUME_TX.  Unfortunately, nothing ever sends the
resume, so the sequencer on the link is stopped forever, leading to
eventual timeouts and I/O errors.

Since clear nexus commands are only executed as part of error recovery,
it's perfectly fine to keep the sequencer running on the link ... as
soon as the recovery function is completed, we'll send it the commands
to retry.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] st: compile fix when DEBUG set to one
Kai Makisara [Fri, 22 Feb 2008 18:11:21 +0000 (20:11 +0200)]
[SCSI] st: compile fix when DEBUG set to one

Remove the now useless counting of adjacent pages from the debugging code in
to make it compile when DEBUG is set non-zero.

Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb
FUJITA Tomonori [Fri, 22 Feb 2008 14:11:04 +0000 (23:11 +0900)]
[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb

stex_internal_copy copies an in-kernel buffer to a sg list by using
scsi_kmap_atomic_sg. Some functions calls stex_internal_copy with
sg_count in struct st_ccb, which is the value that dma_map_sg
returned. However it might be shorter than the actual number of sg
entries (if the IOMMU merged the sg entries).

scsi_kmap_atomic_sg doesn't see sg->dma_length so stex_internal_copy
should be called with the actual number of sg entries
(i.e. scsi_sg_count), because if the sg entries were merged,
stex_direct_copy wrongly think that the data length in the sg list is
shorter than the actual length.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Ed Lin <ed.lin@promise.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>