]> err.no Git - linux-2.6/log
linux-2.6
16 years agofib_trie: handle empty tree
Stephen Hemminger [Tue, 12 Feb 2008 05:12:49 +0000 (21:12 -0800)]
fib_trie: handle empty tree

This fixes possible problems when trie_firstleaf() returns NULL
to trie_leafindex().

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4]: Remove IP_TOS setting privilege checks.
David S. Miller [Tue, 12 Feb 2008 01:50:30 +0000 (17:50 -0800)]
[IPV4]: Remove IP_TOS setting privilege checks.

Various RFCs have all sorts of things to say about the CS field of the
DSCP value.  In particular they try to make the distinction between
values that should be used by "user applications" and things like
routing daemons.

This seems to have influenced the CAP_NET_ADMIN check which exists for
IP_TOS socket option settings, but in fact it has an off-by-one error
so it wasn't allowing CS5 which is meant for "user applications" as
well.

Further adding to the inconsistency and brokenness here, IPV6 does not
validate the DSCP values specified for the IPV6_TCLASS socket option.

The real actual uses of these TOS values are system specific in the
final analysis, and these RFC recommendations are just that, "a
recommendation".  In fact the standards very purposefully use
"SHOULD" and "SHOULD NOT" when describing how these values can be
used.

In the final analysis the only clean way to provide consistency here
is to remove the CAP_NET_ADMIN check.  The alternatives just don't
work out:

1) If we add the CAP_NET_ADMIN check to ipv6, this can break existing
   setups.

2) If we just fix the off-by-one error in the class comparison in
   IPV4, certain DSCP values can be used in IPV6 but not IPV4 by
   default.  So people will just ask for a sysctl asking to
   override that.

I checked several other freely available kernel trees and they
do not make any privilege checks in this area like we do.  For
the BSD stacks, this goes back all the way to Stevens Volume 2
and beyond.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
David S. Miller [Wed, 13 Feb 2008 01:51:26 +0000 (17:51 -0800)]
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

16 years agoWMI: initialize wmi_blocks.list even if ACPI is disabled
Linus Torvalds [Tue, 12 Feb 2008 04:52:01 +0000 (20:52 -0800)]
WMI: initialize wmi_blocks.list even if ACPI is disabled

Even if we don't want to register the WMI driver, we should initialize
the wmi_blocks list to be empty, since we don't want the wmi helper
functions to oops just because that basic list has not even been set up.

With this, "find_guid()" will happily return "not found" rather than
oopsing all over the place, and the callers will then just automatically
return false or AE_NOT_FOUND as appropriate.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: vdso_install fix
Roland McGrath [Mon, 11 Feb 2008 22:38:51 +0000 (14:38 -0800)]
x86: vdso_install fix

The makefile magic for installing the 32-bit vdso images on disk had a
little error.  A single-line change would fix that bug, but this does a
little more to reduce the error-prone duplication of this bit of
makefile variable magic.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomempolicy: silently restrict nodemask to allowed nodes
KOSAKI Motohiro [Tue, 12 Feb 2008 04:30:22 +0000 (13:30 +0900)]
mempolicy: silently restrict nodemask to allowed nodes

Kosaki Motohito noted that "numactl --interleave=all ..." failed in the
presence of memoryless nodes.  This patch attempts to fix that problem.

Some background:

numactl --interleave=all calls set_mempolicy(2) with a fully populated
[out to MAXNUMNODES] nodemask.  set_mempolicy() [in do_set_mempolicy()]
calls contextualize_policy() which requires that the nodemask be a
subset of the current task's mems_allowed; else EINVAL will be returned.

A task's mems_allowed will always be a subset of node_states[N_HIGH_MEMORY]
i.e., nodes with memory.  So, a fully populated nodemask will be
declared invalid if it includes memoryless nodes.

  NOTE:  the same thing will occur when running in a cpuset
         with restricted mem_allowed--for the same reason:
         node mask contains dis-allowed nodes.

mbind(2), on the other hand, just masks off any nodes in the nodemask
that are not included in the caller's mems_allowed.

In each case [mbind() and set_mempolicy()], mpol_check_policy() will
complain [again, resulting in EINVAL] if the nodemask contains any
memoryless nodes.  This is somewhat redundant as mpol_new() will remove
memoryless nodes for interleave policy, as will bind_zonelist()--called
by mpol_new() for BIND policy.

Proposed fix:

1) modify contextualize_policy logic to:
   a) remember whether the incoming node mask is empty.
   b) if not, restrict the nodemask to allowed nodes, as is
      currently done in-line for mbind().  This guarantees
      that the resulting mask includes only nodes with memory.

      NOTE:  this is a [benign, IMO] change in behavior for
             set_mempolicy().  Dis-allowed nodes will be
             silently ignored, rather than returning an error.

   c) fold this code into mpol_check_policy(), replace 2 calls to
      contextualize_policy() to call mpol_check_policy() directly
      and remove contextualize_policy().

2) In existing mpol_check_policy() logic, after "contextualization":
   a) MPOL_DEFAULT:  require that in coming mask "was_empty"
   b) MPOL_{BIND|INTERLEAVE}:  require that contextualized nodemask
      contains at least one node.
   c) add a case for MPOL_PREFERRED:  if in coming was not empty
      and resulting mask IS empty, user specified invalid nodes.
      Return EINVAL.
   c) remove the now redundant check for memoryless nodes

3) remove the now redundant masking of policy nodes for interleave
   policy from mpol_new().

4) Now that mpol_check_policy() contextualizes the nodemask, remove
   the in-line nodes_and() from sys_mbind().  I believe that this
   restores mbind() to the behavior before the memoryless-nodes
   patch series.  E.g., we'll no longer treat an invalid nodemask
   with MPOL_PREFERRED as local allocation.

[ Patch history:

  v1 -> v2:
   - Communicate whether or not incoming node mask was empty to
     mpol_check_policy() for better error checking.
   - As suggested by David Rientjes, remove the now unused
     cpuset_nodes_subset_current_mems_allowed() from cpuset.h

  v2 -> v3:
   - As suggested by Kosaki Motohito, fold the "contextualization"
     of policy nodemask into mpol_check_policy().  Looks a little
     cleaner. ]

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tested-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Tue, 12 Feb 2008 04:44:58 +0000 (20:44 -0800)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Fix build for sim_defconfig

16 years agoBe more robust about bad arguments in get_user_pages()
Jonathan Corbet [Mon, 11 Feb 2008 23:17:33 +0000 (16:17 -0700)]
Be more robust about bad arguments in get_user_pages()

So I spent a while pounding my head against my monitor trying to figure
out the vmsplice() vulnerability - how could a failure to check for
*read* access turn into a root exploit? It turns out that it's a buffer
overflow problem which is made easy by the way get_user_pages() is
coded.

In particular, "len" is a signed int, and it is only checked at the
*end* of a do {} while() loop.  So, if it is passed in as zero, the loop
will execute once and decrement len to -1.  At that point, the loop will
proceed until the next invalid address is found; in the process, it will
likely overflow the pages array passed in to get_user_pages().

I think that, if get_user_pages() has been asked to grab zero pages,
that's what it should do.  Thus this patch; it is, among other things,
enough to block the (already fixed) root exploit and any others which
might be lurking in similar code.  I also think that the number of pages
should be unsigned, but changing the prototype of this function probably
requires some more careful review.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Tue, 12 Feb 2008 04:43:14 +0000 (20:43 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  mlx4_core: Fix build break (missing include)

16 years agoAdd Matt to MAINTAINERS as a SLAB allocator maintainer
Pekka Enberg [Mon, 11 Feb 2008 21:52:47 +0000 (23:52 +0200)]
Add Matt to MAINTAINERS as a SLAB allocator maintainer

Matt is already the maintainer of SLOB which is one of the "SLAB" allocators in
the kernel so add him to MAINTAINERS.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Tue, 12 Feb 2008 04:42:11 +0000 (20:42 -0800)]
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  sata_mv: platform driver allocs dma without create
  pata_ninja32: setup changes
  pata_legacy: typo fix
  pata_amd: Note in the module description it handles Nvidia
  sata_mv: fix loop with last port
  libata: ignore deverr on SETXFER if mode is configured
  pata_via: fix SATA cable detection on cx700

16 years agoMake topology fallback macros reference their arguments.
Andi Kleen [Mon, 11 Feb 2008 19:03:17 +0000 (20:03 +0100)]
Make topology fallback macros reference their arguments.

This avoids warnings with unreferenced variables in the !NUMA case.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomlx4_core: Fix build break (missing include)
Olof Johansson [Mon, 11 Feb 2008 02:22:57 +0000 (20:22 -0600)]
mlx4_core: Fix build break (missing include)

Commit 313abe55 ("mlx4_core: For 64-bit systems, vmap() kernel queue
buffers") caused this to pop up on powerpc allyesconfig, looks like a
missing include file:

    drivers/net/mlx4/alloc.c: In function 'mlx4_buf_alloc':
    drivers/net/mlx4/alloc.c:162: error: implicit declaration of function 'vmap'
    drivers/net/mlx4/alloc.c:162: error: 'VM_MAP' undeclared (first use in this function)
    drivers/net/mlx4/alloc.c:162: error: (Each undeclared identifier is reported only once
    drivers/net/mlx4/alloc.c:162: error: for each function it appears in.)
    drivers/net/mlx4/alloc.c:162: warning: assignment makes pointer from integer without a cast
    drivers/net/mlx4/alloc.c: In function 'mlx4_buf_free':
    drivers/net/mlx4/alloc.c:187: error: implicit declaration of function 'vunmap'

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years ago[IA64] Fix build for sim_defconfig
Tony Luck [Mon, 11 Feb 2008 21:23:46 +0000 (13:23 -0800)]
[IA64] Fix build for sim_defconfig

Commit bdc807871d58285737d50dc6163d0feb72cb0dc2 broke the build
for this config because the sim_defconfig selects CONFIG_HZ=250
but include/asm-ia64/param.h has an ifdef for the simulator to
force HZ to 32.  So we ended up with a kernel/timeconst.h set
for HZ=250 ... which then failed the check for the right HZ
value and died with:

Drop the #ifdef magic from param.h and make force CONFIG_HZ=32
directly for the simulator.

Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years agosata_mv: platform driver allocs dma without create
Byron Bradley [Sun, 10 Feb 2008 21:17:30 +0000 (21:17 +0000)]
sata_mv: platform driver allocs dma without create

When the sata_mv driver is used as a platform driver,
mv_create_dma_pools() is never called so it fails when trying
to alloc in mv_pool_start().

Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Acked-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_ninja32: setup changes
Alan Cox [Fri, 8 Feb 2008 15:25:10 +0000 (15:25 +0000)]
pata_ninja32: setup changes

Forcibly set more of the configuration at init time. This seems to fix at
least one problem reported. We don't know what most of these bits do, but
we do know what windows stuffs there.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_legacy: typo fix
Alan Cox [Fri, 8 Feb 2008 15:23:38 +0000 (15:23 +0000)]
pata_legacy: typo fix

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_amd: Note in the module description it handles Nvidia
Alan Cox [Fri, 8 Feb 2008 15:22:39 +0000 (15:22 +0000)]
pata_amd: Note in the module description it handles Nvidia

This has confused a few people so fix it

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv: fix loop with last port
Yinghai Lu [Thu, 7 Feb 2008 23:06:17 +0000 (15:06 -0800)]
sata_mv: fix loop with last port

commit f351b2d638c3cb0b95adde3549b7bfaf3f991dfa
        sata_mv: Support SoC controllers

cause panic:

scsi 4:0:0:0: Direct-Access     ATA      HITACHI HDS7225S V44O PQ: 0 ANSI: 5
sd 4:0:0:0: [sde] 488390625 512-byte hardware sectors (250056 MB)
sd 4:0:0:0: [sde] Write Protect is off
sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
sd 4:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 4:0:0:0: [sde] 488390625 512-byte hardware sectors (250056 MB)
sd 4:0:0:0: [sde] Write Protect is off
sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
sd 4:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sde:<1>BUG: unable to handle kernel NULL pointer dereference at 000000000000001a
IP: [<ffffffff806262c7>] mv_interrupt+0x21c/0x4cc
PGD 0
Oops: 0000 [1] SMP
CPU 3
Modules linked in:
Pid: 0, comm: swapper Not tainted 2.6.24-smp-08636-g0afc2ed-dirty #26
RIP: 0010:[<ffffffff806262c7>]  [<ffffffff806262c7>] mv_interrupt+0x21c/0x4cc
RSP: 0000:ffff8102050bbec8  EFLAGS: 00010297
RAX: 0000000000000008 RBX: 0000000000000000 RCX: 0000000000000003
RDX: 0000000000008000 RSI: 0000000000000286 RDI: ffff8102035180e0
RBP: 0000000000000001 R08: 0000000000000003 R09: ffff8102036613e0
R10: 0000000000000002 R11: ffffffff8061474c R12: ffff8102035bf828
R13: 0000000000000008 R14: ffff81020348ece8 R15: ffffc20002cb2000
FS:  0000000000000000(0000) GS:ffff810405025700(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 000000000000001a CR3: 0000000000201000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810405094000, task ffff8102050b28c0)
Stack:  000000010000000c 0002040000220400 0000001100000002 ffff81020348eda8
 0000000000000001 ffff8102035f2cc0 0000000000000000 0000000000000000
 0000000000000018 0000000000000000 0000000000000000 ffffffff80269ee8
Call Trace:
 <IRQ>  [<ffffffff80269ee8>] ? handle_IRQ_event+0x25/0x53
 [<ffffffff8026b393>] ? handle_fasteoi_irq+0x90/0xc8
 [<ffffffff802218e2>] ? do_IRQ+0xf1/0x15f
 [<ffffffff8021df24>] ? default_idle+0x0/0x55
 [<ffffffff8021f361>] ? ret_from_intr+0x0/0xa
 <EOI>  [<ffffffff8023010c>] ? lapic_next_event+0x0/0xa
 [<ffffffff8021df55>] ? default_idle+0x31/0x55
 [<ffffffff8021df50>] ? default_idle+0x2c/0x55
 [<ffffffff8021df24>] ? default_idle+0x0/0x55
 [<ffffffff8021e00b>] ? cpu_idle+0x92/0xb8

Code: 41 14 85 c0 89 44 24 14 0f 84 9d 02 00 00 f7 d0 01 d6 41 89 d5 89 41 14 8b 41 14 89 34 24 e9 7e 02 00 00 49 63 c5 49 8b 5c c6 48 <f6> 43 1a 80 4c 8b a3 20 37 00 00 0f 85 62 02 00 00 31 c9 41 83
RIP  [<ffffffff806262c7>] mv_interrupt+0x21c/0x4cc
 RSP <ffff8102050bbec8>
CR2: 000000000000001a
---[ end trace 2583b5f7a5350584 ]---
Kernel panic - not syncing: Aiee, killing interrupt handler!

last_port already include port0 base.
this patch change use last_port directly, and move pp assignment later.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: ignore deverr on SETXFER if mode is configured
Tejun Heo [Thu, 7 Feb 2008 01:34:08 +0000 (10:34 +0900)]
libata: ignore deverr on SETXFER if mode is configured

Some controllers (VIA CX700) raise device error on SETXFER even after
mode configuration succeeded.  Update ata_dev_set_mode() such that
device error is ignored if transfer mode is configured correctly.  To
implement this, device is revalidated even after device error on
SETXFER.

This fixes kernel bugzilla bug 8563.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_via: fix SATA cable detection on cx700
Tejun Heo [Thu, 7 Feb 2008 01:18:53 +0000 (10:18 +0900)]
pata_via: fix SATA cable detection on cx700

The first port of cx700 is SATA.  Fix cable detection.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agox86: remove over noisy debug printk
Thomas Gleixner [Sun, 10 Feb 2008 22:57:36 +0000 (23:57 +0100)]
x86: remove over noisy debug printk

pageattr-test.c contains a noisy debug printk that people reported.
The condition under which it prints (randomly tapping into a mem_map[]
hole and not being able to c_p_a() there) is valid behavior and not
interesting to report.

Remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Linus Torvalds [Mon, 11 Feb 2008 17:22:23 +0000 (09:22 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: fix make V=1

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Mon, 11 Feb 2008 17:21:26 +0000 (09:21 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
  selinux: support 64-bit capabilities

16 years agoPrevent IDE boot ops on NUMA system
Andi Kleen [Mon, 11 Feb 2008 00:35:20 +0000 (01:35 +0100)]
Prevent IDE boot ops on NUMA system

Without this patch a Opteron test system here oopses at boot with
current git.

Calling to_pci_dev() on a NULL pointer gives a negative value so the
following NULL pointer check never triggers and then an illegal address
is referenced.  Check the unadjusted original device pointer for NULL
instead.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
Linus Torvalds [Mon, 11 Feb 2008 17:19:47 +0000 (09:19 -0800)]
Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux

* 'for-linus' of git://linux-nfs.org/~bfields/linux:
  SUNPRC: Fix printk format warning
  nfsd: clean up svc_reserve_auth()
  NLM: don't requeue block if it was invalidated while GRANT_MSG was in flight
  NLM: don't reattempt GRANT_MSG when there is already an RPC in flight
  NLM: have server-side RPC clients default to soft RPC tasks
  NLM: set RPC_CLNT_CREATE_NOPING for NLM RPC clients

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Mon, 11 Feb 2008 17:19:22 +0000 (09:19 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide: remove stale comment from ide-lib.c
  ide: fix comment in init_irq()
  ide: ide_init_port() bugfix
  ide-disk: fix flush requests (take 2)
  ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option
  bast-ide: build fix
  ide-tape: remove never executed code
  ide: fix ide/legacy/gayle.c compilation
  ide-cd: replace ntohs with generic byteorder macro be16_to_cpu
  ide: remove stale version number
  pdc202xx_old: always enable burst mode
  palm_bk3710: use struct ide_port_info
  palm_bk3710: port initialization/probing bugfix
  palm_bk3710: fix ide_unregister() usage
  palm_bk3710: ide_register_hw() -> ide_device_add()
  ide: insert BUG_ON() into __ide_set_handler() (take 2)
  cs5520: remove stale comment
  ide: another possible ide panic fix for blk-end-request

16 years agokbuild: fix make V=1
Sam Ravnborg [Mon, 11 Feb 2008 13:26:26 +0000 (14:26 +0100)]
kbuild: fix make V=1

When make -s support were added to filechk to
combination created with make V=1 were not
covered.
Fix it by explicitly cover this case too.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Mike Frysinger <vapier@gentoo.org>
16 years agonet/phy/fixed.c: fix a use-after-free
Adrian Bunk [Sat, 2 Feb 2008 21:15:02 +0000 (23:15 +0200)]
net/phy/fixed.c: fix a use-after-free

This patch fixes a use-after-free introduced by
commit a79d8e93d300adb84cccc38ac396cfb118c238ad and spotted by the
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agodrivers/net/sis190: fix section mismatch warning in sis190_get_mac_addr
Sergio Luis [Sun, 10 Feb 2008 20:56:25 +0000 (17:56 -0300)]
drivers/net/sis190: fix section mismatch warning in sis190_get_mac_addr

Fix following warnings:
WARNING: drivers/net/sis190.o(.text+0x103): Section mismatch in reference from the function sis190_get_mac_addr() to the function .devinit.text:sis190_get_mac_addr_from_apc()
WARNING: drivers/net/sis190.o(.text+0x10e): Section mismatch in reference from the function sis190_get_mac_addr() to the function .devinit.text:sis190_get_mac_addr_from_eeprom()

Annotate sis190_get_mac_addr() with __devinit.

Signed-off-by: Sergio Luis <sergio@uece.br>
 sis190.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoUse proper abstractions in quirk_intel_irqbalance
Matthew Wilcox [Mon, 11 Feb 2008 04:18:15 +0000 (23:18 -0500)]
Use proper abstractions in quirk_intel_irqbalance

Since we may not have a pci_dev for the device we need to access, we can't
use pci_read_config_word.  But raw_pci_read is an internal implementation
detail; it's better to use the architected pci_bus_read_config_word
interface.  Using PCI_DEVFN instead of a mysterious constant helps
reassure everyone that we really do intend to access device 8.

[ Thanks to Grant Grundler for pointing out to me that this is exactly
  what the write immediately above this is doing -- enabling device 8 to
  respond to config space cycles.
- Matthew

  Grant also says:

"Can you also add a comment which points at the Intel
 documentation?

 The 'Intel E7320 Memory Controller Hub (MCH) Datasheet' at

  http://download.intel.com/design/chipsets/datashts/30300702.pdf

 Page 69 documents register F4h (DEVPRES1).

 And I just doubled checked that the 0xf4 register value is
 restored later in the quirk (obvious when you look at the code
 but not from the patch"

  so here it is.
 - Linus ]

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoclaw/lcs/netiucv: check s390dbf level before sprints
Peter Tiedemann [Fri, 8 Feb 2008 12:09:05 +0000 (13:09 +0100)]
claw/lcs/netiucv: check s390dbf level before sprints

additional check of s390dbf level results in better performance
if the default low debugging level is active.

Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolcs: avoid/reduce unused s390dbf debug areas.
Peter Tiedemann [Fri, 8 Feb 2008 12:09:04 +0000 (13:09 +0100)]
lcs: avoid/reduce unused s390dbf debug areas.

Since lcs makes use of 1 debug area only, the number of debug areas
is reduced, while the number of pages per area is increased.

Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetiucv: change name of nop function
Ursula Braun [Fri, 8 Feb 2008 12:09:03 +0000 (13:09 +0100)]
netiucv: change name of nop function

Dummy NOP actions for fsm-statemachines have to be defined
separately for every using module of fsm-statemachines.
Thus the generic name fsm_action_nop is replaced by
module specific name netiucv_action_nop.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetiucv: Remember to set driver->owner.
Cornelia Huck [Fri, 8 Feb 2008 12:09:02 +0000 (13:09 +0100)]
netiucv: Remember to set driver->owner.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoclaw: removal of volatile variables
Ursula Braun [Fri, 8 Feb 2008 12:09:01 +0000 (13:09 +0100)]
claw: removal of volatile variables

Volatile variables queme_switch and pk_delay are not used anyway.
They are just a left over from an unused timer based packing logic.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoforcedeth: tx pause watermarks
Ayaz Abdulla [Tue, 5 Feb 2008 17:30:01 +0000 (12:30 -0500)]
forcedeth: tx pause watermarks

New chipsets introduced variant Rx FIFO sizes that need to be taken into
account when setting up the tx pause watermarks. This patch introduces
the new device feature flags based on a version and implements the new
watermarks.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoforcedeth: tx collision fix
Ayaz Abdulla [Tue, 5 Feb 2008 17:29:49 +0000 (12:29 -0500)]
forcedeth: tx collision fix

This patch supports a new fix in hardware regarding tx collisions. In
the cases where we are in autoneg mode and the link partner is in forced
mode, we need to setup the tx deferral register differently in order to
reduce collisions on the wire.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agocxgb3: Handle ARP completions that mark neighbors stale.
Steve Wise [Wed, 6 Feb 2008 18:05:19 +0000 (12:05 -0600)]
cxgb3: Handle ARP completions that mark neighbors stale.

When ARP completes due to a request rather than a reply the neighbor is
marked NUD_STALE instead of reachable (see arp_process()).  The handler
for the resulting netevent needs to check also for NUD_STALE.

Failure to use the arp entry can cause RDMA connection failures.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoMerge branch 'r6040' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev...
Jeff Garzik [Mon, 11 Feb 2008 16:07:34 +0000 (11:07 -0500)]
Merge branch 'r6040' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6 into upstream-fixes

16 years agoDM9000: Show the MAC address source after printing MAC
Ben Dooks [Tue, 5 Feb 2008 00:02:23 +0000 (00:02 +0000)]
DM9000: Show the MAC address source after printing MAC

Show whether the MAC address was read from the EEPROM or
the onboard PAR registers.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Update retry count whilst identifying chip
Ben Dooks [Tue, 5 Feb 2008 00:02:22 +0000 (00:02 +0000)]
DM9000: Update retry count whilst identifying chip

Reading the ID register does not always return the correct ID
from the device, so we retry several times to see if we get
a correct value.

These failures seem to be excaserbated by the speed of the
access to the chip (possibly time between issuing the address
and then the data cycle).

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add support for MII ioctl() calls
Ben Dooks [Tue, 5 Feb 2008 00:02:21 +0000 (00:02 +0000)]
DM9000: Add support for MII ioctl() calls

Add entry to handle the MII ioctl() calls via the
generic_mii_ioctl call.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add platform flag for no attached EEPROM
Ben Dooks [Tue, 5 Feb 2008 00:02:20 +0000 (00:02 +0000)]
DM9000: Add platform flag for no attached EEPROM

Allow the platform data to specify to the DM9000 driver
that there is no posibility of an attached EEPROM on the
device, so default all reads to 0xff and ignore any
write operations.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Remove redudant use of "& 0xff"
Ben Dooks [Tue, 5 Feb 2008 00:02:19 +0000 (00:02 +0000)]
DM9000: Remove redudant use of "& 0xff"

The writing of the data should implicitly truncate
the data to 8bits, so do not bother with the ands
in the code.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Remove cal_CRC() and use ether_crc_le instead
Ben Dooks [Tue, 5 Feb 2008 00:02:18 +0000 (00:02 +0000)]
DM9000: Remove cal_CRC() and use ether_crc_le instead

Remove the cal_CRC as this is basically wrappering the
ether_crc_le function, and is only being used by the
multicast hash table functions.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Fix delays used by EEPROM read and write
Ben Dooks [Tue, 5 Feb 2008 00:02:17 +0000 (00:02 +0000)]
DM9000: Fix delays used by EEPROM read and write

The code was using a delay of 8ms, when it should have been
using the EEPROM status flag from the device to indicate the
EEPROM transaction had finished.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Use netif_msg to enable debugging options
Ben Dooks [Tue, 5 Feb 2008 00:02:16 +0000 (00:02 +0000)]
DM9000: Use netif_msg to enable debugging options

Use the netif_msg_*() macros to enable the debugging based
on the board's msg_enable field. The output still goes via
the dev_dbg() macros, so will be tagged and output as
appropriate.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Remove unnecessary changelog in header comment
Ben Dooks [Tue, 5 Feb 2008 00:02:15 +0000 (00:02 +0000)]
DM9000: Remove unnecessary changelog in header comment

We have a perfectly good version control system, so we do not
need to duplicate change comments in the header for this code.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Ensure spinlock held whilst accessing EEPROM registers
Ben Dooks [Tue, 5 Feb 2008 00:02:14 +0000 (00:02 +0000)]
DM9000: Ensure spinlock held whilst accessing EEPROM registers

Ensure we hold the spinlock whilst the registers and being
modified even though we hold the overall lock. This should
protect against an interrupt happening whilst we are using
the device.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Remove EEPROM initialisation code.
Ben Dooks [Tue, 5 Feb 2008 00:02:13 +0000 (00:02 +0000)]
DM9000: Remove EEPROM initialisation code.

Remove the old hack to program an initial EEPROM setting
into the DM9000 as we now have ethtool support for reading
and writing the EEPROM.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add ethtool control of msg_enable value
Ben Dooks [Tue, 5 Feb 2008 00:02:12 +0000 (00:02 +0000)]
DM9000: Add ethtool control of msg_enable value

Allow the msg_enable value to be read and written by
the ethtool interface.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add ethtool support for reading and writing EEPROM
Ben Dooks [Tue, 5 Feb 2008 00:02:11 +0000 (00:02 +0000)]
DM9000: Add ethtool support for reading and writing EEPROM

Add ethtool support to access the configuration EEPROM
connected to the DM9000.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add mutex to protect access
Ben Dooks [Tue, 5 Feb 2008 00:02:10 +0000 (00:02 +0000)]
DM9000: Add mutex to protect access

Add a mutex to serialise access to the chip functions from
entries such as the ethtool and the MII code. This should
reduce the amount of time the spinlock is held to protect
the address register.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Remove barely used SROM array read.
Ben Dooks [Tue, 5 Feb 2008 00:02:09 +0000 (00:02 +0000)]
DM9000: Remove barely used SROM array read.

The srom array in the board data is only being used in the device probe
routines. The probe also only uses the first 6 bytes of an array
we spend 512ms reading 128 bytes from. Change to reading the
MAC area directly to the MAC address structure.

As a side product, we rename the read_srom_word to dm9000_read_eeprom
to bring it into line with the rest of the driver. No change is made
to the delay in this function, which will be dealt with in a later
patch.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Use msleep() instead of udelay()
Ben Dooks [Tue, 5 Feb 2008 00:02:08 +0000 (00:02 +0000)]
DM9000: Use msleep() instead of udelay()

We can use sleeping functions when reading and writing the
PHY registers, so let us sleep instead of busy waiting for
the PHY.

Note, this also fixes a bug reading the PHY where only 100uS
was being used instead of 150uS

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Do not sleep with spinlock and IRQs held
Ben Dooks [Tue, 5 Feb 2008 00:02:07 +0000 (00:02 +0000)]
DM9000: Do not sleep with spinlock and IRQs held

The phy read and write routines call udelay() with the board
lock held, and with the posibility of IRQs being disabled. Since
these delays can be up to 500usec, and are only required as we
have to save the chip's address register.

To improve the behaviour, hold the lock whilst we are writing
and then restore the state before the delay and then repeat
the process once the delay has happened.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add initial ethtool support
Ben Dooks [Tue, 5 Feb 2008 00:02:06 +0000 (00:02 +0000)]
DM9000: Add initial ethtool support

Add support for ethtool operations for the DM9000.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Remove old timer based poll routines
Ben Dooks [Tue, 5 Feb 2008 00:02:05 +0000 (00:02 +0000)]
DM9000: Remove old timer based poll routines

Remove the timer based MII phy polling, as this is
currently broken with the new EEPROM code that now
uses mutexes to protect the phy access.

This will need to be replaced in the future by some
form of mutex safe mechanism for reading the MII
phy status.

The replacement has not been done here as changing
this patch, which is early in the sequence has quite
a knock-on effect. Once this series is merged, then
a new presentation of an patch to poll the MII link
status can be added.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Pass IRQ flags via platform resources
Ben Dooks [Tue, 5 Feb 2008 00:02:04 +0000 (00:02 +0000)]
DM9000: Pass IRQ flags via platform resources

Use the flags in the IRQ resource to specify the type of
IRQ being requested, so that systems which do not have
level-based interrupts, or change the interrupt in some
other way can specify this without making an #ifdef mess
in the driver.

This is specifically designed to undo the change in commit
4e4fc05a2b6e7bd2e0facd96e0c18dceb34d9349 which hardwires the
type for everyone but blackfin to IRQT_RISING, which breaks
all a number of Simtec boards which use (and setup in the
bootloader) active low IRQs.

Note, although there where originally objections due to
the use of IORESOURCE_IRQ and IRQT_ flags not sharing the
same definition, at least <include/linux/interrupt.h> notes
these are the same.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
CC: Daniel Mack <daniel@caiaq.de>
CC: Bryan Wu <bryan.wu@analog.com>
CC: Alex Landau <landau.alex@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000 update debugging macros to use debug level
Ben Dooks [Tue, 5 Feb 2008 00:02:03 +0000 (00:02 +0000)]
DM9000 update debugging macros to use debug level

Change the debug macros to use the compiler to elide any
unnecessary debug level, and to allow device configurable
debug control.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000 use dev_xxx() instead of printk for output.
Ben Dooks [Tue, 5 Feb 2008 00:02:02 +0000 (00:02 +0000)]
DM9000 use dev_xxx() instead of printk for output.

Move to using dev_dbg() and friends for the output of
information to the user.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Add platform data to specify external phy
Ben Dooks [Tue, 5 Feb 2008 00:02:01 +0000 (00:02 +0000)]
DM9000: Add platform data to specify external phy

Patch from: Laurent Pinchart <laurentp@cse-semaphore.com>

This patch adds a flag to the DM9000 platform data which, when set,
configures the device to use an external PHY.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Ben Dooks <ben-linuy@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoDM9000: Fix endian-ness of data accesses.
Ben Dooks [Tue, 5 Feb 2008 00:02:00 +0000 (00:02 +0000)]
DM9000: Fix endian-ness of data accesses.

Patch from: Laurent Pinchart <laurentp@cse-semaphore.com>

This patch splits the receive status in 8bit wide fields and convert the
packet length from little endian to CPU byte order.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoOptimize cxgb3 xmit path (a bit)
Krishna Kumar [Wed, 30 Jan 2008 07:00:16 +0000 (12:30 +0530)]
Optimize cxgb3 xmit path (a bit)

1. Add common code for stopping queue.
2. No need to call netif_stop_queue followed by netif_wake_queue (and
   infact a netif_start_queue could have been used instead), instead
   call stop_queue if required, and remove code under USE_GTS macro.
3. There is no need to check for netif_queue_stopped, as the network
   core guarantees that for us (I am sure every driver could remove
   that check, eg e1000 - I have tested that path a few billion times
   with about a few hundred thousand qstops but the condition never
   hit even once).

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe1000: Fix for 32 bits platforms with 64 bits resources
Benjamin Herrenschmidt [Fri, 16 Nov 2007 07:37:38 +0000 (18:37 +1100)]
e1000: Fix for 32 bits platforms with 64 bits resources

The e1000 driver stores the content of the PCI resources into
unsigned long's before ioremapping. This breaks on 32 bits
platforms that support 64 bits MMIO resources such as ppc 44x.

This fixes it by removing those temporary variables and passing
directly the result of pci_resource_start/len to ioremap.

The side effect is that I removed the assignments to the netdev
fields mem_start, mem_end and base_addr, which are totally useless
for PCI devices.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
--

 drivers/net/e1000/e1000_main.c |   18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: Add wireless support for PS3
Masakazu Mokuno [Thu, 7 Feb 2008 10:58:57 +0000 (19:58 +0900)]
PS3: gelic: Add wireless support for PS3

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Acked-by: Dan Williams <dcbw@redhat.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: Add support for dual network interface
Masakazu Mokuno [Thu, 7 Feb 2008 10:58:42 +0000 (19:58 +0900)]
PS3: gelic: Add support for dual network interface

Add support for dual network (net_device) interface so that ethernet
and wireless can own separate ethX interfaces.

V2
  - Fix the bug that bringing down and up the interface keeps rx
    disabled.
  - Make 'gelic_net_poll_controller()' extern , as David Woodhouse
    pointed out at the previous submission.
  - Fix weird usage of member names for the rx descriptor chain
V1
  - Export functions which are convenient for both interfaces
  - Move irq allocation/release code to driver probe/remove handlers
    because interfaces share interrupts.
  - Allocate skbs by using dev_alloc_skb() instead of netdev_alloc_skb()
    as the interfaces share the hardware rx queue.
  - Add gelic_port struct in order to abstract dual interface handling
  - Change handlers for hardware queues so that they can handle dual
    {source,destination} interfaces.
  - Use new NAPI functions
This is a prerequisite for the new PS3 wireless support.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: add support for port link status
Masakazu Mokuno [Thu, 7 Feb 2008 10:58:32 +0000 (19:58 +0900)]
PS3: gelic: add support for port link status

Add support for interrupt driven port link status detection.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: remove duplicated ethtool handlers
Masakazu Mokuno [Thu, 7 Feb 2008 10:58:20 +0000 (19:58 +0900)]
PS3: gelic: remove duplicated ethtool handlers

Remove some ethtool handlers, which duplicate functionality that was already
provided by the common ethtool handlers.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: code cleanup
Masakazu Mokuno [Thu, 7 Feb 2008 10:58:08 +0000 (19:58 +0900)]
PS3: gelic: code cleanup

Code cleanup:
 - Use appropriate prefixes for names instead of fixed 'gelic_net'
   so that objects of the functions, variables and constants can be estimated.
 - Remove definitions for IPSec offload to the gelic hardware.  This
   functionality is never supported on PS3.
 - Group constants with enum.
 - Use bitwise constants for interrupt status, instead of bit numbers to
   eliminate shift operations.
 - Style fixes.
Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: Add endianness macros
Masakazu Mokuno [Thu, 7 Feb 2008 10:57:54 +0000 (19:57 +0900)]
PS3: gelic: Add endianness macros

Mark the members of the structure for DMA descriptors with proper endian
annotations and use the appropriate accessor macros.
As the gelic driver works only on PS3, all these macros will be
expanded to null.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPS3: gelic: Fix the wrong dev_id passed
Masakazu Mokuno [Thu, 7 Feb 2008 10:57:41 +0000 (19:57 +0900)]
PS3: gelic: Fix the wrong dev_id passed

The device id for lv1_net_set_interrupt_status_indicator() is wrong.
This path would be invoked only in the case of an initialization failure.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago8139too fix for Dreamcast
Adrian McMenamin [Fri, 8 Feb 2008 11:21:58 +0000 (11:21 +0000)]
8139too fix for Dreamcast

Updates the 8139too driver to work with recently added
(a724605cb7a66d423a494a395f9a8ba871b8a1eb) declared coherent memory
patch for the Dreamcast.

Signed-off-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoni52: Remove 278 scripts/checkpatch errors
Alan Cox [Fri, 8 Feb 2008 15:27:38 +0000 (15:27 +0000)]
ni52: Remove 278 scripts/checkpatch errors

To kill the volatiles also switch it to stop poking ISA memory directly
without going through readb and friends.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopcnet32: Use print_mac
Don Fry [Fri, 8 Feb 2008 15:29:38 +0000 (07:29 -0800)]
pcnet32: Use print_mac

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopcnet32: use NET_IP_ALIGN instead of 2
Don Fry [Fri, 8 Feb 2008 15:32:26 +0000 (07:32 -0800)]
pcnet32: use NET_IP_ALIGN instead of 2

Change hard coded 2 to NET_IP_ALIGN.  Added new #define with comments.
Tested amd_64

Signed-off-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoselinux: support 64-bit capabilities
Stephen Smalley [Thu, 7 Feb 2008 16:21:04 +0000 (11:21 -0500)]
selinux: support 64-bit capabilities

Fix SELinux to handle 64-bit capabilities correctly, and to catch
future extensions of capabilities beyond 64 bits to ensure that SELinux
is properly updated.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoide: remove stale comment from ide-lib.c
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:15 +0000 (00:32 +0100)]
ide: remove stale comment from ide-lib.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix comment in init_irq()
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:15 +0000 (00:32 +0100)]
ide: fix comment in init_irq()

APUS support is gone...

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: ide_init_port() bugfix
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:15 +0000 (00:32 +0100)]
ide: ide_init_port() bugfix

On Sunday 10 February 2008, Atsushi Nemoto wrote:
> On Sun, 06 Jan 2008 18:03:10 +0100, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> > + /* reset DMA masks only for SFF-style DMA controllers */
> > + if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
> > + hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
>
> It might be too late, but "host_flags && IDE_HFLAGS_NO_DMA" seems
> wrong for me.

Fix regression caused by commmit c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd
("ide: add struct ide_port_info instances to legacy host drivers").

Reported-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-disk: fix flush requests (take 2)
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:14 +0000 (00:32 +0100)]
ide-disk: fix flush requests (take 2)

commit 813a0eb233ee67d7166241a8b389b6a76f2247f9
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date:   Fri Jan 25 22:17:10 2008 +0100

    ide: switch idedisk_prepare_flush() to use REQ_TYPE_ATA_TASKFILE requests

...

broke flush requests.

Allocating IDE command structure on the stack for flush requests is not
a very brilliant idea:

- idedisk_prepare_flush() only prepares the request and it doesn't wait
  for it to be completed

- there are can be multiple flush requests queued in the queue

Fix the problem (per hints from James Bottomley) by:
- dynamically allocating ide_task_t instance using kmalloc(..., GFP_ATOMIC)
- adding new taskfile flag (IDE_TFLAG_DYN)
- calling kfree() in ide_end_drive_command() if IDE_TFLAG_DYN is set
  (while at it rename 'args' to 'task' and fix whitespace damage)

[ This will be fixed properly before 2.6.25 but this bug is rather
  critical and the proper solution requires some more work + testing. ]

Thanks to Sebastian Siewior and Christoph Hellwig for reporting the
problem and testing patches (extra thanks to Sebastian for bisecting
it to the guilty commmit).

Tested-by: Sebastian Siewior <ide-bug@ml.breakpoint.cc>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option
Sergei Shtylyov [Sun, 10 Feb 2008 23:32:14 +0000 (00:32 +0100)]
ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option

Introduce new option CONFIG_BLK_DEV_IDEDMA_SFF for non-PCI SFF-8038i compatible
bus mastering IDE controllers (which there are a few known), thus fixing a hack
made for Palmchip BK3710 controller...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agobast-ide: build fix
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:14 +0000 (00:32 +0100)]
bast-ide: build fix

On Saturday 09 February 2008, Adrian Bunk wrote:
> Commit 9e016a719209d95338e314b46c3012cc7feaaeec causes the following
> compile error:
>
> <--  snip  -->
>
> ...
>   CC      drivers/ide/arm/bast-ide.o
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c: In function 'bastide_register':
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c:31: error: 'hwif' redeclared as different kind of symbol
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c:29: error: previous definition of 'hwif' was here
> make[4]: *** [drivers/ide/arm/bast-ide.o] Error 1
>
> <--  snip  -->

Remove 'ide_hwif_t **hwif' argument from bastide_register()
(together with write-only ifs[]).

Cc: Adrian Bunk <bunk@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove never executed code
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:14 +0000 (00:32 +0100)]
ide-tape: remove never executed code

rq->cmd[0] is never set to REQ_IDETAPE_READ_BUFFER so remove
REQ_IDETAPE_READ_BUFFER handling from idetape_create_write_cmd()
and the define itself.

Then remove no longer used idetape_create_read_buffer_cmd()
and IDETAPE_RETRIEVE_FAULTY_BLOCK define.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix ide/legacy/gayle.c compilation
Adrian Bunk [Sun, 10 Feb 2008 23:32:14 +0000 (00:32 +0100)]
ide: fix ide/legacy/gayle.c compilation

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: replace ntohs with generic byteorder macro be16_to_cpu
Borislav Petkov [Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)]
ide-cd: replace ntohs with generic byteorder macro be16_to_cpu

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove stale version number
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)]
ide: remove stale version number

On Thursday 03 January 2008, Robert Hancock wrote:

[...]

> How about getting rid of this stupid thing in drivers/ide/ide.c:
>
> #define       REVISION        "Revision: 7.00alpha2"
>
> which is used in:
>
> printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
>
> It's been 7.00alpha2 for god knows how long, so clearly this version
> number is not useful..

Cc: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopdc202xx_old: always enable burst mode
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)]
pdc202xx_old: always enable burst mode

Alan has noticed that distros always enabled burst mode
(+ datasheet confirms that it is the right thing to do).

Thus fix pdc202xx_old host driver to do it unconditionally
and remove no longer needed CONFIG_PDC202XX_BURST option.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: use struct ide_port_info
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)]
palm_bk3710: use struct ide_port_info

* Factor out cable detection to palm_bk3710_cable_detect().

* Add palm_bk3710_init_hwif() (->init_hwif method implementation).

* Remove needless ->quirkproc initialization.

* Add missing ->pio_mask initialization.

* Use ATA_* defines for setting ->{ultra,mwdma}_mask.

* Add 'struct ide_port_info palm_bk3710_port_info' and pass it to
  ide_device_add().  Then remove open-coded 'hwif' initialization.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: port initialization/probing bugfix
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:13 +0000 (00:32 +0100)]
palm_bk3710: port initialization/probing bugfix

Probe port _after_ it is fully initialized.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: fix ide_unregister() usage
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:12 +0000 (00:32 +0100)]
palm_bk3710: fix ide_unregister() usage

Don't set 'restore' flag for ide_unregister() when initializing new
interface.

[ identical change as done to bast-ide/ide-cs/delkin_cb host drivers
  by commit 909f4369bca30f9a186316a3bf2b4a9c1e702a25 ]

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopalm_bk3710: ide_register_hw() -> ide_device_add()
Bartlomiej Zolnierkiewicz [Sun, 10 Feb 2008 23:32:12 +0000 (00:32 +0100)]
palm_bk3710: ide_register_hw() -> ide_device_add()

* Convert palm_bk3710 host driver to use ide_device_add() instead of
  ide_register_hw() (while at it drop doing "ide_unregister()" loop which
  tries to unregister _all_ IDE interfaces if useable ide_hwifs[] slot
  cannot be find).

  [ identical change as done to bast-ide/ide-cs/delkin_cb host drivers
    by commit 9e016a719209d95338e314b46c3012cc7feaaeec ]

* Rename 'ide_ctlr_info' to 'hw' and 'index' to 'i' while at it.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: insert BUG_ON() into __ide_set_handler() (take 2)
Sergei Shtylyov [Sun, 10 Feb 2008 23:32:12 +0000 (00:32 +0100)]
ide: insert BUG_ON() into __ide_set_handler() (take 2)

Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the start
of __ide_set_handler() with mere BUG_ON() while removing such from the caller,
ide_execute_command(). Fix up the code formatting, while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agocs5520: remove stale comment
Benjamin Herrenschmidt [Sun, 10 Feb 2008 23:32:12 +0000 (00:32 +0100)]
cs5520: remove stale comment

Remove stale comment from the cs5520 IDE driver.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: another possible ide panic fix for blk-end-request
Kiyoshi Ueda [Sun, 10 Feb 2008 23:32:11 +0000 (00:32 +0100)]
ide: another possible ide panic fix for blk-end-request

I have reviewed all blk-end-request patches again to confirm whether
there are any similar problems with the last week's ide-cd panic:
    http://lkml.org/lkml/2008/1/29/140

And I found a possible similar bug in ide-io change:
ide_end_drive_cmd() could be called for blk_pc_request() which could
have bios.  To complete such requests correctly, we need to pass
the actual size of the request.
Otherwise, __blk_end_request() returns 1 because the request still has
bios, and the system will BUG() unnecessarily.

The following patch fixes the bug and should be applied on top of
Linus' git.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoSUNPRC: Fix printk format warning
Roland Dreier [Sat, 9 Feb 2008 00:02:04 +0000 (16:02 -0800)]
SUNPRC: Fix printk format warning

net/sunrpc/xprtrdma/svc_rdma_sendto.c:160: warning: format '%llx'
expects type 'long long unsigned int', but argument 3 has type 'u64'

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agonfsd: clean up svc_reserve_auth()
J. Bruce Fields [Fri, 8 Feb 2008 04:10:21 +0000 (23:10 -0500)]
nfsd: clean up svc_reserve_auth()

This is a void function attempting to return the return value from
another void function, which seems harmless but extremely weird, and
apparently makes some compilers complain.

While we're there, clean up a little (e.g. the switch statement had a
minor style problem and seemed overkill as long as there's only one
case).

Thanks to Trond for noticing this.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM: don't requeue block if it was invalidated while GRANT_MSG was in flight
Jeff Layton [Wed, 6 Feb 2008 16:34:13 +0000 (11:34 -0500)]
NLM: don't requeue block if it was invalidated while GRANT_MSG was in flight

It's possible for lockd to catch a SIGKILL while a GRANT_MSG callback
is in flight. If this happens we don't want lockd to insert the block
back into the nlm_blocked list.

This helps that situation, but there's still a possible race. Fixing
that will mean adding real locking for nlm_blocked.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoNLM: don't reattempt GRANT_MSG when there is already an RPC in flight
Jeff Layton [Wed, 6 Feb 2008 16:34:12 +0000 (11:34 -0500)]
NLM: don't reattempt GRANT_MSG when there is already an RPC in flight

With the current scheme in nlmsvc_grant_blocked, we can end up with more
than one GRANT_MSG callback for a block in flight. Right now, we requeue
the block unconditionally so that a GRANT_MSG callback is done again in
30s. If the client is unresponsive, it can take more than 30s for the
call already in flight to time out.

There's no benefit to having more than one GRANT_MSG RPC queued up at a
time, so put it on the list with a timeout of NLM_NEVER before doing the
RPC call. If the RPC call submission fails, we requeue it with a short
timeout. If it works, then nlmsvc_grant_callback will end up requeueing
it with a shorter timeout after it completes.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>