]> err.no Git - linux-2.6/log
linux-2.6
15 years ago[PATCH] configfs: Convenience macros for attribute definition.
Joel Becker [Thu, 19 Jun 2008 02:29:05 +0000 (19:29 -0700)]
[PATCH] configfs: Convenience macros for attribute definition.

Sysfs has the _ATTR() and _ATTR_RO() macros to make defining extended
form attributes easier.  configfs should have something similiar.

- _CONFIGFS_ATTR() and _CONFIGFS_ATTR_RO() are the counterparts to the
  sysfs macros.
- CONFIGFS_ATTR_STRUCT() creates the extended form attribute structure.
- CONFIGFS_ATTR_OPS() defines the show_attribute()/store_attribute()
  operations that call the show()/store() operations of the extended
  form configfs_attributes.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Pin configfs subsystems separately from new config_items.
Joel Becker [Tue, 17 Jun 2008 22:34:32 +0000 (15:34 -0700)]
[PATCH] configfs: Pin configfs subsystems separately from new config_items.

configfs_mkdir() creates a new item by calling its parent's
->make_item/group() functions.  Once that object is created,
configfs_mkdir() calls try_module_get() on the new item's module.  If it
succeeds, the module owning the new item cannot be unloaded, and
configfs is safe to reference the item.

If the item and the subsystem it belongs to are part of the same module,
the subsystem is also pinned.  This is the common case.

However, if the subsystem is made up of multiple modules, this may not
pin the subsystem.  Thus, it would be possible to unload the toplevel
subsystem module while there is still a child item.  Thus, we now
try_module_get() the subsystem's module.  This only really affects
children of the toplevel subsystem group.  Deeper children already have
their parents pinned.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Fix open directory making rmdir() fail
Louis Rilling [Fri, 27 Jun 2008 11:10:25 +0000 (13:10 +0200)]
[PATCH] configfs: Fix open directory making rmdir() fail

When checking for user-created elements under an item to be removed by rmdir(),
configfs_detach_prep() counts fake configfs_dirents created by dir_open() as
user-created and fails when finding one. It is however perfectly valid to remove
a directory that is open.

Simply make configfs_detach_prep() skip fake configfs_dirent, like it already
does for attributes, and like detach_groups() does.

Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Lock new directory inodes before removing on cleanup after failure
Louis Rilling [Fri, 4 Jul 2008 14:56:06 +0000 (16:56 +0200)]
[PATCH] configfs: Lock new directory inodes before removing on cleanup after failure

Once a new configfs directory is created by configfs_attach_item() or
configfs_attach_group(), a failure in the remaining initialization steps leads
to removing a directory which inode the VFS may have already accessed.

This commit adds the necessary inode locking to safely remove configfs
directories while cleaning up after a failure. As an advantage, the locking
rules of populate_groups() and detach_groups() become the same: the caller must
have the group's inode mutex locked.

Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Prevent userspace from creating new entries under attaching directories
Louis Rilling [Fri, 4 Jul 2008 14:56:05 +0000 (16:56 +0200)]
[PATCH] configfs: Prevent userspace from creating new entries under attaching directories

process 1:  process 2:
configfs_mkdir("A")
  attach_group("A")
    attach_item("A")
      d_instantiate("A")
    populate_groups("A")
      mutex_lock("A")
      attach_group("A/B")
        attach_item("A")
          d_instantiate("A/B")
mkdir("A/B/C")
  do_path_lookup("A/B/C", LOOKUP_PARENT)
    ok
  lookup_create("A/B/C")
    mutex_lock("A/B")
    ok
  configfs_mkdir("A/B/C")
    ok
      attach_group("A/C")
        attach_item("A/C")
          d_instantiate("A/C")
        populate_groups("A/C")
          mutex_lock("A/C")
          attach_group("A/C/D")
            attach_item("A/C/D")
              failure
          mutex_unlock("A/C")
          detach_groups("A/C")
            nothing to do
mkdir("A/C/E")
  do_path_lookup("A/C/E", LOOKUP_PARENT)
    ok
  lookup_create("A/C/E")
    mutex_lock("A/C")
    ok
  configfs_mkdir("A/C/E")
    ok
        detach_item("A/C")
        d_delete("A/C")
      mutex_unlock("A")
      detach_groups("A")
        mutex_lock("A/B")
        detach_group("A/B")
  detach_groups("A/B")
    nothing since no _default_ group
          detach_item("A/B")
        mutex_unlock("A/B")
        d_delete("A/B")
    detach_item("A")
    d_delete("A")

Two bugs:

1/ "A/B/C" and "A/C/E" are created, but never removed while their parent are
removed in the end. The same could happen with symlink() instead of mkdir().

2/ "A" and "A/C" inodes are not locked while detach_item() is called on them,
   which may probably confuse VFS.

This commit fixes 1/, tagging new directories with CONFIGFS_USET_CREATING before
building the inode and instantiating the dentry, and validating the whole
group+default groups hierarchy in a second pass by clearing
CONFIGFS_USET_CREATING.
mkdir(), symlink(), lookup(), and dir_open() simply return -ENOENT if
called in (or linking to) a directory tagged with CONFIGFS_USET_CREATING. This
does not prevent userspace from calling stat() successfuly on such directories,
but this prevents userspace from adding (children to | symlinking from/to |
read/write attributes of | listing the contents of) not validated items. In
other words, userspace will not interact with the subsystem on a new item until
the new item creation completes correctly.
It was first proposed to re-use CONFIGFS_USET_IN_MKDIR instead of a new
flag CONFIGFS_USET_CREATING, but this generated conflicts when checking the
target of a new symlink: a valid target directory in the middle of attaching
a new user-created child item could be wrongly detected as being attached.

2/ is fixed by next commit.

Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Fix failing symlink() making rmdir() fail
Louis Rilling [Fri, 20 Jun 2008 12:09:22 +0000 (14:09 +0200)]
[PATCH] configfs: Fix failing symlink() making rmdir() fail

On a similar pattern as mkdir() vs rmdir(), a failing symlink() may make rmdir()
fail for the symlink's parent and the symlink's target as well.

failing symlink() making target's rmdir() fail:

process 1: process 2:
symlink("A/S" -> "B")
  allow_link()
  create_link()
    attach to "B" links list
rmdir("B")
  detach_prep("B")
    error because of new link
    configfs_create_link("A", "S")
      error (eg -ENOMEM)

failing symlink() making parent's rmdir() fail:

process 1: process 2:
symlink("A/D/S" -> "B")
  allow_link()
  create_link()
    attach to "B" links list
    configfs_create_link("A/D", "S")
      make_dirent("A/D", "S")
rmdir("A")
  detach_prep("A")
    detach_prep("A/D")
      error because of "S"
      create("S")
        error (eg -ENOMEM)

We cannot use the same solution as for mkdir() vs rmdir(), since rmdir() on the
target cannot wait on the i_mutex of the new symlink's parent without risking a
deadlock (with other symlink() or sys_rename()). Instead we define a global
mutex protecting all configfs symlinks attachment, so that rmdir() can avoid the
races above.

Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Fix symlink() to a removing item
Louis Rilling [Mon, 23 Jun 2008 12:16:17 +0000 (14:16 +0200)]
[PATCH] configfs: Fix symlink() to a removing item

The rule for configfs symlinks is that symlinks always point to valid
config_items, and prevent the target from being removed. However,
configfs_symlink() only checks that it can grab a reference on the target item,
without ensuring that it remains alive until the symlink is correctly attached.

This patch makes configfs_symlink() fail whenever the target is being removed,
using the CONFIGFS_USET_DROPPING flag set by configfs_detach_prep() and
protected by configfs_dirent_lock.

This patch introduces a similar (weird?) behavior as with mkdir failures making
rmdir fail: if symlink() races with rmdir() of the parent directory (or its
youngest user-created ancestor if parent is a default group) or rmdir() of the
target directory, and then fails in configfs_create(), this can make the racing
rmdir() fail despite the concerned directory having no user-created entry (resp.
no symlink pointing to it or one of its default groups) in the end.
This behavior is fixed in later patches.

Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years ago[PATCH] configfs: Include linux/err.h in linux/configfs.h
Joel Becker [Thu, 17 Jul 2008 23:54:19 +0000 (16:54 -0700)]
[PATCH] configfs: Include linux/err.h in linux/configfs.h

We now use PTR_ERR() in the ->make_item() and ->make_group() operations.
Folks including configfs.h need err.h.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 years agokbuild: scripts/ver_linux: don't set PATH
Adrian Bunk [Wed, 23 Jul 2008 19:50:45 +0000 (22:50 +0300)]
kbuild: scripts/ver_linux: don't set PATH

It would have saved both a bug submitter and me a few hours if
scripts/ver_linux had picked the same gcc as the build.

Since I can't see any reason why it fiddles with PATH at all this patch
therefore removes the PATH setting.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agoKconfig/init: change help text to match default value
jkacur [Tue, 15 Jul 2008 22:31:16 +0000 (00:31 +0200)]
Kconfig/init: change help text to match default value

Change the "If unsure" message to match the default value.

Signed-off-by: John Kacur <jkacur at gmail dot com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: genksyms: Include extern information in dumps
Andreas Gruenbacher [Mon, 21 Jul 2008 02:28:25 +0000 (04:28 +0200)]
kbuild: genksyms: Include extern information in dumps

The extern flag currently is not included in type dump files
(genksyms --dump-types). Include that flag there for completeness.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: genksyms parser: fix the __attribute__ rule
Andreas Gruenbacher [Wed, 30 Jul 2008 22:03:49 +0000 (00:03 +0200)]
kbuild: genksyms parser: fix the __attribute__ rule

We are having two kinds of problems with genksyms today: fake checksum
changes without actual ABI changes, and changes which we would rather like
to ignore (such as an additional field at the end of a structure that
modules are not supposed to touch, for example).

I have thought about ways to improve genksyms and compute checksums
differently to avoid those problems, but in the end I don't see a
fundamentally better way.  So here are some genksyms patches for at least
making the checksums more easily manageable, if we cannot fully fix them.

In addition to the bugfixes (the first two patches), this allows genksyms
to track checksum changes and report why a checksum changed (third patch),
and to selectively ignore changes (fourth patch).

This patch:

Gcc __attribute__ definitions may occur repeatedly, e.g.,

static int foo __attribute__((__used__))
       __attribute__((aligned (16)));

The genksyms parser does not understand this, and generates a syntax error.
Fix this case.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agonetfilter: xt_hashlimit: fix race between htable_destroy and htable_gc
Pavel Emelyanov [Thu, 31 Jul 2008 07:38:52 +0000 (00:38 -0700)]
netfilter: xt_hashlimit: fix race between htable_destroy and htable_gc

Deleting a timer with del_timer doesn't guarantee, that the
timer function is not running at the moment of deletion. Thus
in the xt_hashlimit case we can get into a ticklish situation
when the htable_gc rearms the timer back and we'll actually
delete an entry with a pending timer.

Fix it with using del_timer_sync().

AFAIK del_timer_sync checks for the timer to be pending by
itself, so I remove the check.

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>
15 years agonetfilter: ipt_recent: fix race between recent_mt_destroy and proc manipulations
Pavel Emelyanov [Thu, 31 Jul 2008 07:38:31 +0000 (00:38 -0700)]
netfilter: ipt_recent: fix race between recent_mt_destroy and proc manipulations

The thing is that recent_mt_destroy first flushes the entries
from table with the recent_table_flush and only *after* this
removes the proc file, corresponding to that table.

Thus, if we manage to write to this file the '+XXX' command we
will leak some entries. If we manage to write there a 'clean'
command we'll race in two recent_table_flush flows, since the
recent_mt_destroy calls this outside the recent_lock.

The proper solution as I see it is to remove the proc file first
and then go on with flushing the table. This flushing becomes
safe w/o the lock, since the table is already inaccessible from
the outside.

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>
15 years agonetfilter: nf_conntrack_tcp: decrease timeouts while data in unacknowledged
Patrick McHardy [Thu, 31 Jul 2008 07:38:01 +0000 (00:38 -0700)]
netfilter: nf_conntrack_tcp: decrease timeouts while data in unacknowledged

In order to time out dead connections quicker, keep track of outstanding data
and cap the timeout.

Suggested by Herbert Xu.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago[MTD] [NOR] drivers/mtd/chips/jedec_probe.c: fix Am29DL800BB device ID
Jerry Hicks [Wed, 30 Jul 2008 19:49:59 +0000 (12:49 -0700)]
[MTD] [NOR] drivers/mtd/chips/jedec_probe.c: fix Am29DL800BB device ID

The device id for Am29DL800BB in jedec_probe.c is wrong.

Reference: http://www.spansion.com/datasheets/21519c4.pdf

I discovered this while working with u-boot.

The u-boot folks mentioned Linux as an upstream reference, thought I'd
post a heads-up here too.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoirda: replace __FUNCTION__ with __func__
Harvey Harrison [Thu, 31 Jul 2008 00:20:18 +0000 (17:20 -0700)]
irda: replace __FUNCTION__ with __func__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonsc-ircc: default to dongle type 9 on IBM hardware
Matthew Garrett [Thu, 31 Jul 2008 00:00:38 +0000 (17:00 -0700)]
nsc-ircc: default to dongle type 9 on IBM hardware

This is necessary to set the dongle type on the nsc driver in order to get
it to work correctly.  Thinkpads all appear to use dongle type 9.  This
patch defaults nsc devices with an IBM PnP descriptor to use type 9.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Ben Collins <ben.collins@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15 years agobluetooth: add quirks for a few hci_usb devices
Michael Frey [Wed, 30 Jul 2008 23:59:15 +0000 (16:59 -0700)]
bluetooth: add quirks for a few hci_usb devices

Preface: The "Broadcom" device is on unreleased hardware, so I can't
disclose the actual model.

When the Dell 370 and 410 BT adapters are put into BT radio mode, they
need to be prepared like many other Broadcom adapters.

Also, add quirk Broadcom 2046 devices with HCI_RESET.  Reference for this
bug: https://launchpad.net/bugs/249448

Signed-off-by: Michael Frey <michael.frey@canonical.com>
Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Ben Collins <ben.collins@canonical.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agohysdn: remove the packed attribute from PofTimStamp_tag
David Howells [Wed, 30 Jul 2008 23:48:05 +0000 (16:48 -0700)]
hysdn: remove the packed attribute from PofTimStamp_tag

Remove the packed attribute from PofTimStamp_tag in the hysdn driver as the
thing being packed is just an array of chars and so is unpackable.

This deals with a compiler warning:

In file included from drivers/isdn/hysdn/hysdn_boot.c:19:
drivers/isdn/hysdn/hysdn_pof.h:63: warning: 'packed' attribute ignored for field of type 'unsigned char[40]'

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisdn: use the common ascii hex helpers
Harvey Harrison [Wed, 30 Jul 2008 23:40:22 +0000 (16:40 -0700)]
isdn: use the common ascii hex helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotg3: adapt tg3 to use reworked PCI PM code
Rafael J. Wysocki [Wed, 30 Jul 2008 23:37:33 +0000 (16:37 -0700)]
tg3: adapt tg3 to use reworked PCI PM code

Adapt the tg3 driver to use the reworked PCI PM and make it use the
exported PCI PM core functions instead of accessing the PCI PM registers
directly by itself.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatm: fix direct casts of pointers to u32 in the InterPhase driver
David Howells [Wed, 30 Jul 2008 23:33:05 +0000 (16:33 -0700)]
atm: fix direct casts of pointers to u32 in the InterPhase driver

Fix direct casts of pointers to u32 in the InterPhase ATM driver.  These are
all arguments being passed to printk() calls.  So drop the cast and change the
%x to a %p.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatm: fix const assignment/discard warnings in the ATM networking driver
David Howells [Wed, 30 Jul 2008 23:31:46 +0000 (16:31 -0700)]
atm: fix const assignment/discard warnings in the ATM networking driver

Fix const assignment/discard warnings in the ATM networking driver.

The lane2_assoc_ind() function needed its arguments changing to match changes
in the lane2_ops struct (patch 61c33e012964ce358b42d2a1e9cd309af5dab02b
"atm: use const where reasonable").

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: use the common ascii hex helpers
Harvey Harrison [Wed, 30 Jul 2008 23:30:15 +0000 (16:30 -0700)]
net: use the common ascii hex helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agorandom32: seeding improvement
Stephen Hemminger [Wed, 30 Jul 2008 23:29:19 +0000 (16:29 -0700)]
random32: seeding improvement

The rationale is:
   * use u32 consistently
   * no need to do LCG on values from (better) get_random_bytes
   * use more data from get_random_bytes for secondary seeding
   * don't reduce state space on srandom32()
   * enforce state variable initialization restrictions

Note: the second paper has a version of random32() with even longer period
and a version of random64() if needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15 years agobridge: send correct MTU value in PMTU (revised)
Simon Wunderlich [Wed, 30 Jul 2008 23:27:55 +0000 (16:27 -0700)]
bridge: send correct MTU value in PMTU (revised)

When bridging interfaces with different MTUs, the bridge correctly chooses
the minimum of the MTUs of the physical devices as the bridges MTU.  But
when a frame is passed which fits through the incoming, but not through
the outgoing interface, a "Fragmentation Needed" packet is generated.

However, the propagated MTU is hardcoded to 1500, which is wrong in this
situation.  The sender will repeat the packet again with the same frame
size, and the same problem will occur again.

Instead of sending 1500, the (correct) MTU value of the bridge is now sent
via PMTU.  To achieve this, the corresponding rtable structure is stored
in its net_bridge structure.

Modified to get rid of fake_net_device as well.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
David S. Miller [Wed, 30 Jul 2008 22:44:30 +0000 (15:44 -0700)]
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

15 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Wed, 30 Jul 2008 22:14:56 +0000 (15:14 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Cobalt: update defconfig
  [MIPS] kgdb: add arch support for the kernel's kgdb core
  [MIPS] kgdb: Remove existing implementation
  [MIPS] TXx9: Kconfig cleanup
  [MIPS] TXx9: Kill unused txx927.h
  [MIPS] TXx9: Support early_printk
  [MIPS] TXx9: Unify serial_txx9 setup
  [MIPS] TXx9: Random cleanup
  [MIPS] TXx9: Make tx4938-specific code more independent
  [MIPS] TXx9: Make tx3927-specific code more independent
  [MIPS] TXx9: Cleanup watchdog
  [MIPS] TXx9: Cleanup restart/halt/power_off
  [MIPS] TXx9: PCI error handling
  [MIPS] TXx9: Add some pci options
  [MIPS] Introduce pcibios_plat_setup
  [MIPS] TXx9: PCI fixes for tx3927/tx4927
  [MIPS] TXx9: Fix JMR3927 irq numbers
  [MIPS] RB532: Flags are unsigned long
  [MIPS] Initialization of Alchemy boards
  [MIPS] tlb-r4k: Nuke broken paranoia error test.

15 years agoFix off-by-one error in iov_iter_advance()
Linus Torvalds [Wed, 30 Jul 2008 21:45:12 +0000 (14:45 -0700)]
Fix off-by-one error in iov_iter_advance()

The iov_iter_advance() function would look at the iov->iov_len entry
even though it might have iterated over the whole array, and iov was
pointing past the end.  This would cause DEBUG_PAGEALLOC to trigger a
kernel page fault if the allocation was at the end of a page, and the
next page was unallocated.

The quick fix is to just change the order of the tests: check that there
is any iovec data left before we check the iov entry itself.

Thanks to Alexey Dobriyan for finding this case, and testing the fix.

Reported-and-tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@kernel.org> [2.6.25.x, 2.6.26.x]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoromfs_readpage: don't report errors for pages beyond i_size
Linus Torvalds [Wed, 30 Jul 2008 21:26:25 +0000 (14:26 -0700)]
romfs_readpage: don't report errors for pages beyond i_size

We zero-fill them like we are supposed to, and that's all fine.  It's
only an error if the 'romfs_copyfrom()' routine isn't able to fill the
data that is supposed to be there.

Most of the patch is really just re-organizing the code a bit, and using
separate variables for the error value and for how much of the page we
actually filled from the filesystem.

Reported-and-tested-by: Chris Fester <cfester@wms.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Matt Waddel <matt.waddel@freescale.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Signed-of-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodrivers/net/ehea/ehea_main.c: Release mutex in error handling code
Julia Lawall [Mon, 21 Jul 2008 07:57:26 +0000 (09:57 +0200)]
drivers/net/ehea/ehea_main.c: Release mutex in error handling code

The mutex is released on a successful return, so it would seem that it
should be released on an error return as well.

The semantic patch finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression l;
@@

mutex_lock(l);
... when != mutex_unlock(l)
    when any
    when strict
(
if (...) { ... when != mutex_unlock(l)
+   mutex_unlock(l);
    return ...;
}
|
mutex_unlock(l);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosh_eth: Add support of SH7763 to sh_eth
Nobuhiro Iwamatsu [Mon, 30 Jun 2008 02:08:17 +0000 (11:08 +0900)]
sh_eth: Add support of SH7763 to sh_eth

SH7763 has Ethernet core same as SH7710/SH7712.
Positions of some registry are different, but the basic part is the same.
I add support of ethernet of sh7763 to sh_eth.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agofix NE2000 linkage error
Mikael Pettersson [Wed, 30 Jul 2008 11:44:55 +0000 (13:44 +0200)]
fix NE2000 linkage error

Trying to build with CONFIG_NE2000=m fails with:

  scripts/mod/modpost   -o /tmp/tmp/linux-2.6.27-rc1/Module.symvers    -S     -s
ERROR: "NS8390_init" [drivers/net/ne.ko] undefined!

This is because the split of 8390 into pausing and non-pausing
versions was incompletely propagated to ne.c. This fixes it.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[MIPS] Cobalt: update defconfig
Yoichi Yuasa [Fri, 25 Jul 2008 16:34:52 +0000 (01:34 +0900)]
[MIPS] Cobalt: update defconfig

Select new LCD framebuffer driver.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] kgdb: add arch support for the kernel's kgdb core
Jason Wessel [Tue, 29 Jul 2008 20:58:53 +0000 (15:58 -0500)]
[MIPS] kgdb: add arch support for the kernel's kgdb core

The new kgdb architecture specific handler registers and unregisters
dynamically for exceptions depending on when you configure a kgdb I/O
driver.

Aside from initializing the exceptions earlier in the boot process,
kgdb should have no impact on a device when it is compiled in so long
as an I/O module is not configured for use.

There have been quite a number of contributors during the existence of
this patch (see arch/mips/kernel/kgdb.c).  Most recently Jason
re-wrote the mips kgdb logic to use the die notification handlers.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] kgdb: Remove existing implementation
Jason Wessel [Tue, 29 Jul 2008 20:58:52 +0000 (15:58 -0500)]
[MIPS] kgdb: Remove existing implementation

This patch explicitly removes the kgdb implementation, for mips which
is intended to be followed by a patch that adds a kgdb implementation
for MIPS that makes use of the kgdb core in the kernel.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Kconfig cleanup
Atsushi Nemoto [Tue, 29 Jul 2008 13:11:33 +0000 (22:11 +0900)]
[MIPS] TXx9: Kconfig cleanup

Unify some entries in txx9/Kconfig.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Kill unused txx927.h
Atsushi Nemoto [Tue, 29 Jul 2008 13:10:47 +0000 (22:10 +0900)]
[MIPS] TXx9: Kill unused txx927.h

include/asm-mips/txx9/txx927.h is no longer used.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Support early_printk
Atsushi Nemoto [Tue, 29 Jul 2008 13:10:08 +0000 (22:10 +0900)]
[MIPS] TXx9: Support early_printk

Kill jmr3927-specific prom_putchar and add txx9-generic prom_putchar
to support early_printk.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Unify serial_txx9 setup
Atsushi Nemoto [Fri, 25 Jul 2008 14:08:06 +0000 (23:08 +0900)]
[MIPS] TXx9: Unify serial_txx9 setup

* Unify calling of early_serial_txx9_setup.
* Use dedicated serial clock on RBTX4938.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Random cleanup
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:21 +0000 (00:25 +0900)]
[MIPS] TXx9: Random cleanup

* Random cleanups spotted by checkpatch script.
* Do not initialize panic_timeout.  "panic=" kernel parameter can be used.
* Do not add "ip=any" or "ip=bootp".  This options is not board specific.
* Do not add "root=/dev/nfs".  This is default on CONFIG_ROOT_NFS.
* Kill unused error checking.
* Fix IRQ comment to match current code.
* Kill some unneeded includes
* ST0_ERL is already cleared in generic code.
* conswitchp is initialized generic code.
* __init is not needed in prototype.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Make tx4938-specific code more independent
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:20 +0000 (00:25 +0900)]
[MIPS] TXx9: Make tx4938-specific code more independent

Make some TX4938 SoC specific code independent from board specific code.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Make tx3927-specific code more independent
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:19 +0000 (00:25 +0900)]
[MIPS] TXx9: Make tx3927-specific code more independent

Make some TX3927 SoC specific code independent from board specific code.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Cleanup watchdog
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:18 +0000 (00:25 +0900)]
[MIPS] TXx9: Cleanup watchdog

Unify registration of txx9wdt platform device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Cleanup restart/halt/power_off
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:17 +0000 (00:25 +0900)]
[MIPS] TXx9: Cleanup restart/halt/power_off

Unify machine_restart/machine_halt/pm_power_off and add fallback
machine_halt routine.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: PCI error handling
Atsushi Nemoto [Fri, 25 Jul 2008 14:01:35 +0000 (23:01 +0900)]
[MIPS] TXx9: PCI error handling

From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 24 Jul 2008 00:25:16 +0900
Subject: [PATCH] txx9: PCI error handling

Add more control and detailed report on PCI error interrupt.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Add some pci options
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:15 +0000 (00:25 +0900)]
[MIPS] TXx9: Add some pci options

Add pci options for backplane type, clock selection, error handling,
timeout values.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] Introduce pcibios_plat_setup
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:14 +0000 (00:25 +0900)]
[MIPS] Introduce pcibios_plat_setup

Introduce pcibios_plat_setup for platform-specific pcibios_setup.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: PCI fixes for tx3927/tx4927
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:13 +0000 (00:25 +0900)]
[MIPS] TXx9: PCI fixes for tx3927/tx4927

* Fix tx3927 pci ops for Type-1 configuration
* Fix abort checking of tx3927 pci ops
* Flush write buffer to avoid spurious PCI error interrupt
* Add a quirk for FPCIB backplane

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] TXx9: Fix JMR3927 irq numbers
Atsushi Nemoto [Wed, 23 Jul 2008 15:25:12 +0000 (00:25 +0900)]
[MIPS] TXx9: Fix JMR3927 irq numbers

* Fix wrong txx9_clockevent interrupt number
* Fix TXX9_IRQ_BASE for JMR3927+FPCIB case

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] RB532: Flags are unsigned long
Adrian Bunk [Tue, 29 Jul 2008 06:46:34 +0000 (09:46 +0300)]
[MIPS] RB532: Flags are unsigned long

A recent generic change now catches such bugs:

<--  snip  -->

...
  CC      arch/mips/rb532/time.o
cc1: warnings being treated as errors
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/rb532/time.c: In function 'plat_time_init':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/rb532/time.c:55: error: comparison of distinct pointer types lacks a cast
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/rb532/time.c:66: error: comparison of distinct pointer types lacks a cast
make[2]: *** [arch/mips/rb532/time.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] Initialization of Alchemy boards
Kevin Hickey [Mon, 28 Jul 2008 18:09:26 +0000 (13:09 -0500)]
[MIPS] Initialization of Alchemy boards

An earlier update changed some calls from simple_strotl to strict_strtol but
did not account for the differences in the syntax between the calls.
simple_strotl returns the integer; strict_strtol returns an error code and
takes a pointer to the result.  As it was, NULL was being passed in place of
the result, which led to failures during kernel initialization when using
YAMON.

Signed-off-by: Kevin Hickey <khickey@rmicorp.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] tlb-r4k: Nuke broken paranoia error test.
Ralf Baechle [Tue, 22 Jul 2008 17:04:38 +0000 (18:04 +0100)]
[MIPS] tlb-r4k: Nuke broken paranoia error test.

Bug originally found and reported by Julia Lawall <julia@diku.dk>.  I
decieded that the whole error check was mostly useless paranoia and should
be discarded.  It would only ever trigger if r3k_have_wired_reg has a wrong
value.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agokbuild: scripts/genksyms/lex.l: add %option noinput
Adrian Bunk [Wed, 16 Jul 2008 23:08:12 +0000 (02:08 +0300)]
kbuild: scripts/genksyms/lex.l: add %option noinput

gcc 4.3 correctly determines that input() is unused and gives the
following warning:

<--  snip  -->

...
  HOSTCC  scripts/genksyms/lex.o
scripts/genksyms/lex.c:1487: warning: â€˜input’ defined but not used
...

<--  snip  -->

Fix it by adding %option noinput to scripts/genksyms/lex.l and
regeneration of scripts/genksyms/lex.c_shipped.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokconfig: scripts/kconfig/zconf.l: add %option noinput
Adrian Bunk [Wed, 16 Jul 2008 23:07:59 +0000 (02:07 +0300)]
kconfig: scripts/kconfig/zconf.l: add %option noinput

gcc 4.3 correctly determines that input() is unused and gives the
following warning:

<--  snip  -->

...
  HOSTCC  scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1628: warning: â€˜input’ defined but not used
...

<--  snip  -->

Fix it by adding %option noinput to scripts/kconfig/zconf.l and
regeneration of scripts/kconfig/lex.zconf.c_shipped.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: fix O=... build of um
Sam Ravnborg [Wed, 30 Jul 2008 20:21:20 +0000 (22:21 +0200)]
kbuild: fix O=... build of um

We used include/asm-$ARCH/system.h to check if
we should create a symlink in include2 directory with
make O=... builds.
But um does not have such a file thus build filed.

Let's try anohter filename:
$ ls -d include/asm-* | wc -l
21
$ ls -d include/asm-*/errno.h | wc -l
21

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Jeff Dike <jdike@addtoit.com>
15 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Wed, 30 Jul 2008 17:43:56 +0000 (10:43 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/mm: Lockless get_user_pages_fast() for 64-bit (v3)
  powerpc: Don't use the wrong thread_struct for ptrace get/set VSX regs
  powerpc: Fix ptrace buffer size for VSX
  powerpc: Correctly hookup PTRACE_GET/SETVSRREGS for 32 bit processes
  ide/powermac: Fix use of uninitialized pointer on media-bay
  powerpc: Allow non-hcall return values for lparcfg writes
  ipmi/powerpc: Use linux/of_{device,platform}.h instead of asm
  powerpc/fsl: proliferate simple-bus compatibility to soc nodes
  Documentation: remove old sbc8260 board specific information
  cpm2: Rework baud rate generators configuration to support external clocks.
  powerpc: rtc_cmos_setup: assign interrupts only if there is i8259 PIC
  cpm_uart: Add generic clock API support to set baudrates
  cpm_uart: Modem control lines support
  powerpc: implement GPIO LIB API on CPM1 Freescale SoC.
  cpm2: Implement GPIO LIB API on CPM2 Freescale SoC.
  powerpc: Fix 8xx build failure
  powerpc: clean up the Book-E HW watchpoint support

15 years agocpumask: statement expressions confuse some versions of gcc
Stephen Rothwell [Tue, 29 Jul 2008 06:07:37 +0000 (16:07 +1000)]
cpumask: statement expressions confuse some versions of gcc

when you take the address of the result.  Noticed on a sparc64 compile
using a version 3.4.5 cross compiler.

 kernel/time/tick-common.c: In function `tick_check_new_device':
 kernel/time/tick-common.c:210: error: invalid lvalue in unary `&'
 ...

Just make it a regular expression.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Wed, 30 Jul 2008 17:13:37 +0000 (10:13 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
  net: Make "networking" one-click deselectable.
  ipv6: Fix useless proc net sockstat6 removal
  tcp: MD5: Use MIB counter instead of warning for MD5 mismatch.
  pkt_sched: Fix OOPS on ingress qdisc add.
  niu: Fix error checking in niu_ethflow_to_class.
  IPv6: datagram_send_ctl() should exit immediately when an error occured
  mac80211: fix mesh beaconing
  PS3: gelic: use unsigned long for irqflags
  mac80211: fix cfg80211 hooks for master interface
  nl80211: fix dump callbacks
  mac80211: partially fix skb->cb use
  rtl8187: Improve wireless statistics for RTL8187B
  rtl8187: Fix for TX sequence number problem
  mac80211: append CONFIG_ to MAC80211_VERBOSE_PS_DEBUG in net/mac80211/tx.c.
  mac80211: fix sparse integer as NULL pointer warning
  drivers/net/wireless/iwlwifi/iwl-led.c: printk fix
  mac80211: return correct error return from ieee80211_wep_init
  mac80211: tx, use dev_kfree_skb_any for beacon_get
  rt2x00: Clear queue entry flags during initialization
  rt2x00: Force full register config after start()
  ...

15 years agox86: wrong register was used in align macro
Vitaly Mayatskikh [Wed, 30 Jul 2008 11:30:14 +0000 (13:30 +0200)]
x86: wrong register was used in align macro

New ALIGN_DESTINATION macro has sad typo: r8d register was used instead
of ecx in fixup section. This can be considered as a regression.

Register ecx was also wrongly loaded with value in r8d in
copy_user_nocache routine.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: setup the notify GRU message queue
Dean Nelson [Wed, 30 Jul 2008 05:34:19 +0000 (22:34 -0700)]
sgi-xp: setup the notify GRU message queue

Setup the notify GRU message queue that is used for sending user messages
on UV systems.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: setup the activate GRU message queue
Dean Nelson [Wed, 30 Jul 2008 05:34:18 +0000 (22:34 -0700)]
sgi-xp: setup the activate GRU message queue

Setup the activate GRU message queue that is used for partition activation
and channel connection on UV systems.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: cleanup naming of partition defines
Dean Nelson [Wed, 30 Jul 2008 05:34:18 +0000 (22:34 -0700)]
sgi-xp: cleanup naming of partition defines

Cleanup naming of partition defines.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: move xpc_check_remote_hb() to support both SN2 and UV
Dean Nelson [Wed, 30 Jul 2008 05:34:17 +0000 (22:34 -0700)]
sgi-xp: move xpc_check_remote_hb() to support both SN2 and UV

Move xpc_check_remote_hb() so it can support both SN2 and UV.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: add usage of GRU driver by xpc_remote_memcpy()
Dean Nelson [Wed, 30 Jul 2008 05:34:16 +0000 (22:34 -0700)]
sgi-xp: add usage of GRU driver by xpc_remote_memcpy()

Add UV support to xpc_remote_memcpy(), which involves interfacing to the
GRU driver.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: enable building of XPC/XPNET on x86_64
Dean Nelson [Wed, 30 Jul 2008 05:34:16 +0000 (22:34 -0700)]
sgi-xp: enable building of XPC/XPNET on x86_64

Get XPC/XPNET to build on x86_64.  Trying to modprobe them up on a non-UV
or sn2 system will result in a -ENODEV.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: add 'jiffies' to reserved page's timestamp name
Dean Nelson [Wed, 30 Jul 2008 05:34:15 +0000 (22:34 -0700)]
sgi-xp: add 'jiffies' to reserved page's timestamp name

Rename XPC's reserved page's timestamp member to reflect the units of time
involved.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: use standard bitops macros and functions
Dean Nelson [Wed, 30 Jul 2008 05:34:14 +0000 (22:34 -0700)]
sgi-xp: use standard bitops macros and functions

Change sgi-xp to use the standard bitops macros and functions instead of
trying to invent its own mechanism.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: eliminate '>>>' in comments
Dean Nelson [Wed, 30 Jul 2008 05:34:14 +0000 (22:34 -0700)]
sgi-xp: eliminate '>>>' in comments

Comments in /drivers/misc/sgi-xp has been using '>>>' as a means to draw
attention to something that needs to be done or considered.  To avoid
colliding with git rejects, '>>>' will now be replaced by '!!!' to
indicate something to do, and by '???' to indicate something to be
considered.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: add _sn2 suffix to a few variables
Dean Nelson [Wed, 30 Jul 2008 05:34:13 +0000 (22:34 -0700)]
sgi-xp: add _sn2 suffix to a few variables

Add an '_sn2' suffix to some variables found in xpc_sn2.c.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: isolate remote copy buffer to sn2 only
Dean Nelson [Wed, 30 Jul 2008 05:34:13 +0000 (22:34 -0700)]
sgi-xp: isolate remote copy buffer to sn2 only

Make the remote copy buffer an sn2 only item.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: enable XPNET to handle more than 64 partitions
Dean Nelson [Wed, 30 Jul 2008 05:34:12 +0000 (22:34 -0700)]
sgi-xp: enable XPNET to handle more than 64 partitions

Enable XPNET to support more than 64 partitions.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: isolate allocation of XPC's msgqueues to sn2 only
Dean Nelson [Wed, 30 Jul 2008 05:34:11 +0000 (22:34 -0700)]
sgi-xp: isolate allocation of XPC's msgqueues to sn2 only

Move the allocation of XPC's msgqueues to xpc_sn2.c.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: replace AMO_t typedef by struct amo
Dean Nelson [Wed, 30 Jul 2008 05:34:11 +0000 (22:34 -0700)]
sgi-xp: replace AMO_t typedef by struct amo

Replace the AMO_t typedef by a direct reference to 'struct amo'.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: separate chctl_flags from XPC's notify IRQ
Dean Nelson [Wed, 30 Jul 2008 05:34:10 +0000 (22:34 -0700)]
sgi-xp: separate chctl_flags from XPC's notify IRQ

Tie current IPI references to either XPC's notify IRQ or channel control
flags.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: isolate additional sn2 specific code
Dean Nelson [Wed, 30 Jul 2008 05:34:09 +0000 (22:34 -0700)]
sgi-xp: isolate additional sn2 specific code

Move additional sn2 specific code into xpc_sn2.c.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: isolate activate IRQ's hardware specific components
Dean Nelson [Wed, 30 Jul 2008 05:34:09 +0000 (22:34 -0700)]
sgi-xp: isolate activate IRQ's hardware specific components

Isolate architecture specific code related to XPC's activate IRQ.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: move xpc_allocate() into xpc_send()/xpc_send_notify()
Dean Nelson [Wed, 30 Jul 2008 05:34:08 +0000 (22:34 -0700)]
sgi-xp: move xpc_allocate() into xpc_send()/xpc_send_notify()

Move xpc_allocate() functionality into xpc_send()/xpc_send_notify() so
xpc_allocate() no longer needs to be called by XPNET.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: base xpc_rsvd_page's timestamp on jiffies
Dean Nelson [Wed, 30 Jul 2008 05:34:07 +0000 (22:34 -0700)]
sgi-xp: base xpc_rsvd_page's timestamp on jiffies

Change XPC's reserved page timestamp to be based on jiffies.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: isolate xpc_vars structure to sn2 only
Dean Nelson [Wed, 30 Jul 2008 05:34:07 +0000 (22:34 -0700)]
sgi-xp: isolate xpc_vars structure to sn2 only

Isolate the xpc_vars structure of XPC's reserved page to sn2 only.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: isolate xpc_vars_part structure to sn2 only
Dean Nelson [Wed, 30 Jul 2008 05:34:06 +0000 (22:34 -0700)]
sgi-xp: isolate xpc_vars_part structure to sn2 only

Isolate the xpc_vars_part structure of XPC's reserved page to sn2 only.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: prepare xpc_rsvd_page to work on either sn2 or uv hardware
Dean Nelson [Wed, 30 Jul 2008 05:34:05 +0000 (22:34 -0700)]
sgi-xp: prepare xpc_rsvd_page to work on either sn2 or uv hardware

Prepare XPC's reserved page header to work for either sn2 or uv.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: create a common xp_remote_memcpy() function
Dean Nelson [Wed, 30 Jul 2008 05:34:05 +0000 (22:34 -0700)]
sgi-xp: create a common xp_remote_memcpy() function

Create a common remote memcpy function that maps to what the hardware
booted supports.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: support runtime selection of xp_max_npartitions
Dean Nelson [Wed, 30 Jul 2008 05:34:04 +0000 (22:34 -0700)]
sgi-xp: support runtime selection of xp_max_npartitions

Support runtime selection of the max number of partitions based on the
hardware being run on.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: define BYTES_PER_WORD
Dean Nelson [Wed, 30 Jul 2008 05:34:03 +0000 (22:34 -0700)]
sgi-xp: define BYTES_PER_WORD

Add a BYTES_PER_WORD #define.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: define xpSalError reason code
Dean Nelson [Wed, 30 Jul 2008 05:34:03 +0000 (22:34 -0700)]
sgi-xp: define xpSalError reason code

Define xpSalError reason code.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-xp: define is_shub() and is_uv() macros
Dean Nelson [Wed, 30 Jul 2008 05:34:02 +0000 (22:34 -0700)]
sgi-xp: define is_shub() and is_uv() macros

Define the is_shub()/is_uv() macros if they've not already been defined.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver V3: fixes to resolve code review comments
Jack Steiner [Wed, 30 Jul 2008 05:34:02 +0000 (22:34 -0700)]
GRU Driver V3: fixes to resolve code review comments

Fixes problems identified in a code review:
- add comment with high level dscription of the GRU
- prepend "gru_" to all global names
- delete unused function
- couple of trivial bug fixes

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: driver/misc Makefile & Kconfig changes
Jack Steiner [Wed, 30 Jul 2008 05:34:01 +0000 (22:34 -0700)]
GRU Driver: driver/misc Makefile & Kconfig changes

Driver/misc changes for the GRU driver

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: export is_uv_system(), zap_page_range() & follow_page()
Jack Steiner [Wed, 30 Jul 2008 05:34:01 +0000 (22:34 -0700)]
GRU Driver: export is_uv_system(), zap_page_range() & follow_page()

Exports needed by the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: driver makefile
Jack Steiner [Wed, 30 Jul 2008 05:34:00 +0000 (22:34 -0700)]
GRU Driver: driver makefile

This patch adds the GRU driver makefile

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: TLB flushing, MMUOPS callouts
Jack Steiner [Wed, 30 Jul 2008 05:33:59 +0000 (22:33 -0700)]
GRU Driver: TLB flushing, MMUOPS callouts

This file contains the functions for handlinf GRU TLB flushing, This
includes functions to handle the MMUOPS callouts.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: /proc interfaces
Jack Steiner [Wed, 30 Jul 2008 05:33:59 +0000 (22:33 -0700)]
GRU Driver: /proc interfaces

This file externalizes some GRU state & statistics to the user using the
/proc file system.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: resource management
Jack Steiner [Wed, 30 Jul 2008 05:33:58 +0000 (22:33 -0700)]
GRU Driver: resource management

This file contains functions realted to managing GRU resources provided to
the user.  Examples include GRU context assignment, load, unload,
migration, etc..

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: kernel services provide by driver
Jack Steiner [Wed, 30 Jul 2008 05:33:57 +0000 (22:33 -0700)]
GRU Driver: kernel services provide by driver

This file contains functions for handling services provided to other
kernel modules that use the GRU.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: page faults & exceptions
Jack Steiner [Wed, 30 Jul 2008 05:33:57 +0000 (22:33 -0700)]
GRU Driver: page faults & exceptions

This file contains the functions that manage GRU page faults and
exceptions.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: driver initialization, file & vma ops
Jack Steiner [Wed, 30 Jul 2008 05:33:56 +0000 (22:33 -0700)]
GRU Driver: driver initialization, file & vma ops

This file contains the functions for initializing the driver, handling
file & vma operations and for processing IOCTL requests from the user.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: kernel services header files
Jack Steiner [Wed, 30 Jul 2008 05:33:56 +0000 (22:33 -0700)]
GRU Driver: kernel services header files

This patch contains the header file used to export GRU services to other
kernel drivers such as XPMEM or XPNET.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoGRU Driver: driver internal header files
Jack Steiner [Wed, 30 Jul 2008 05:33:55 +0000 (22:33 -0700)]
GRU Driver: driver internal header files

This patch contains header files internal to the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>