openwrt/staging/blogic.git
17 years agomm: fault feedback #2
Nick Piggin [Thu, 19 Jul 2007 08:47:05 +0000 (01:47 -0700)]
mm: fault feedback #2

This patch completes Linus's wish that the fault return codes be made into
bit flags, which I agree makes everything nicer.  This requires requires
all handle_mm_fault callers to be modified (possibly the modifications
should go further and do things like fault accounting in handle_mm_fault --
however that would be for another patch).

[akpm@linux-foundation.org: fix alpha build]
[akpm@linux-foundation.org: fix s390 build]
[akpm@linux-foundation.org: fix sparc build]
[akpm@linux-foundation.org: fix sparc64 build]
[akpm@linux-foundation.org: fix ia64 build]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ian Molton <spyro@f2s.com>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Matthew Wilcox <willy@debian.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Richard Curnow <rc@rc0.org.uk>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Cc: Chris Zankel <chris@zankel.net>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ Still apparently needs some ARM and PPC loving - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agomm: fault feedback #1
Nick Piggin [Thu, 19 Jul 2007 08:47:03 +0000 (01:47 -0700)]
mm: fault feedback #1

Change ->fault prototype.  We now return an int, which contains
VM_FAULT_xxx code in the low byte, and FAULT_RET_xxx code in the next byte.
 FAULT_RET_ code tells the VM whether a page was found, whether it has been
locked, and potentially other things.  This is not quite the way he wanted
it yet, but that's changed in the next patch (which requires changes to
arch code).

This means we no longer set VM_CAN_INVALIDATE in the vma in order to say
that a page is locked which requires filemap_nopage to go away (because we
can no longer remain backward compatible without that flag), but we were
going to do that anyway.

struct fault_data is renamed to struct vm_fault as Linus asked. address
is now a void __user * that we should firmly encourage drivers not to use
without really good reason.

The page is now returned via a page pointer in the vm_fault struct.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoDocument ->page_mkwrite() locking
Mark Fasheh [Thu, 19 Jul 2007 08:47:01 +0000 (01:47 -0700)]
Document ->page_mkwrite() locking

There seems to be very little documentation about this callback in general.
The locking in particular is a bit tricky, so it's worth having this in
writing.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoocfs2: release page lock before calling ->page_mkwrite
Mark Fasheh [Thu, 19 Jul 2007 08:47:00 +0000 (01:47 -0700)]
ocfs2: release page lock before calling ->page_mkwrite

__do_fault() was calling ->page_mkwrite() with the page lock held, which
violates the locking rules for that callback.  Release and retake the page
lock around the callback to avoid deadlocking file systems which manually
take it.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.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>
17 years agomm: merge populate and nopage into fault (fixes nonlinear)
Nick Piggin [Thu, 19 Jul 2007 08:46:59 +0000 (01:46 -0700)]
mm: merge populate and nopage into fault (fixes nonlinear)

Nonlinear mappings are (AFAIKS) simply a virtual memory concept that encodes
the virtual address -> file offset differently from linear mappings.

->populate is a layering violation because the filesystem/pagecache code
should need to know anything about the virtual memory mapping.  The hitch here
is that the ->nopage handler didn't pass down enough information (ie.  pgoff).
 But it is more logical to pass pgoff rather than have the ->nopage function
calculate it itself anyway (because that's a similar layering violation).

Having the populate handler install the pte itself is likewise a nasty thing
to be doing.

This patch introduces a new fault handler that replaces ->nopage and
->populate and (later) ->nopfn.  Most of the old mechanism is still in place
so there is a lot of duplication and nice cleanups that can be removed if
everyone switches over.

The rationale for doing this in the first place is that nonlinear mappings are
subject to the pagefault vs invalidate/truncate race too, and it seemed stupid
to duplicate the synchronisation logic rather than just consolidate the two.

After this patch, MAP_NONBLOCK no longer sets up ptes for pages present in
pagecache.  Seems like a fringe functionality anyway.

NOPAGE_REFAULT is removed.  This should be implemented with ->fault, and no
users have hit mainline yet.

[akpm@linux-foundation.org: cleanup]
[randy.dunlap@oracle.com: doc. fixes for readahead]
[akpm@linux-foundation.org: build fix]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agomm: fix fault vs invalidate race for linear mappings
Nick Piggin [Thu, 19 Jul 2007 08:46:57 +0000 (01:46 -0700)]
mm: fix fault vs invalidate race for linear mappings

Fix the race between invalidate_inode_pages and do_no_page.

Andrea Arcangeli identified a subtle race between invalidation of pages from
pagecache with userspace mappings, and do_no_page.

The issue is that invalidation has to shoot down all mappings to the page,
before it can be discarded from the pagecache.  Between shooting down ptes to
a particular page, and actually dropping the struct page from the pagecache,
do_no_page from any process might fault on that page and establish a new
mapping to the page just before it gets discarded from the pagecache.

The most common case where such invalidation is used is in file truncation.
This case was catered for by doing a sort of open-coded seqlock between the
file's i_size, and its truncate_count.

Truncation will decrease i_size, then increment truncate_count before
unmapping userspace pages; do_no_page will read truncate_count, then find the
page if it is within i_size, and then check truncate_count under the page
table lock and back out and retry if it had subsequently been changed (ptl
will serialise against unmapping, and ensure a potentially updated
truncate_count is actually visible).

Complexity and documentation issues aside, the locking protocol fails in the
case where we would like to invalidate pagecache inside i_size.  do_no_page
can come in anytime and filemap_nopage is not aware of the invalidation in
progress (as it is when it is outside i_size).  The end result is that
dangling (->mapping == NULL) pages that appear to be from a particular file
may be mapped into userspace with nonsense data.  Valid mappings to the same
place will see a different page.

Andrea implemented two working fixes, one using a real seqlock, another using
a page->flags bit.  He also proposed using the page lock in do_no_page, but
that was initially considered too heavyweight.  However, it is not a global or
per-file lock, and the page cacheline is modified in do_no_page to increment
_count and _mapcount anyway, so a further modification should not be a large
performance hit.  Scalability is not an issue.

This patch implements this latter approach.  ->nopage implementations return
with the page locked if it is possible for their underlying file to be
invalidated (in that case, they must set a special vm_flags bit to indicate
so).  do_no_page only unlocks the page after setting up the mapping
completely.  invalidation is excluded because it holds the page lock during
invalidation of each page (and ensures that the page is not mapped while
holding the lock).

This also allows significant simplifications in do_no_page, because we have
the page locked in the right place in the pagecache from the start.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoMerge branch 'isdn-fix' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6
Linus Torvalds [Thu, 19 Jul 2007 01:38:25 +0000 (18:38 -0700)]
Merge branch 'isdn-fix' of /linux/kernel/git/jgarzik/misc-2.6

* 'isdn-fix' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  ISDN HiSax: uninitialized return in hisax_cs_setup

17 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Thu, 19 Jul 2007 01:33:45 +0000 (18:33 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  eHEA: Fix bonding support
  Blackfin ethernet driver: on chip ethernet MAC controller driver
  fix wrong argument of tc35815_read_plat_dev_addr()
  ARM/ETHER3: Handle multicast frames.
  SAA9730: Handle multicast frames.
  NI5010: Handle multicast frames.
  NS83820: Handle multicast frames.
  Fix RGMII-ID handling in gianfar
  Fix Vitesse RGMII-ID support
  Add phy-connection-type to gianfar nodes
  Fix Vitesse 824x PHY interrupt acking
  [PATCH] zd1211rw: Add ID for Siemens Gigaset USB Stick 54
  [PATCH] zd1211rw: Add ID for Planex GW-US54GXS
  [PATCH] Update version ipw2200 stamp to 1.2.2
  [PATCH] ipw2200: Fix ipw_isr() comments error on shared IRQ
  [PATCH] Fix ipw2200 set wrong power parameter causing firmware error
  [PATCH] ipw2100: Fix `iwpriv set_power` error
  [PATCH] softmac: Channel is listed twice in scan output

17 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Thu, 19 Jul 2007 01:32:28 +0000 (18:32 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (24 commits)
  [CIFS] merge conflict in fs/cifs/export.c
  [CIFS] Allow disabling CIFS Unix Extensions as mount option
  [CIFS] More whitespace/formatting fixes (noticed by checkpatch)
  [CIFS] Typo in previous patch
  [CIFS] zero_user_page() conversions
  [CIFS] use simple_prepare_write to zero page data
  [CIFS] Fix build break - inet.h not included when experimental ifdef off
  [CIFS] Add support for new POSIX unlink
  [CIFS] whitespace/formatting fixes
  [CIFS] Fix oops in cifs_create when nfsd server exports cifs mount
  [CIFS] whitespace cleanup
  [CIFS] Fix packet signatures for NTLMv2 case
  [CIFS] more whitespace fixes
  [CIFS] more whitespace cleanup
  [CIFS] whitespace cleanup
  [CIFS] whitespace cleanup
  [CIFS] ipv6 support no longer experimental
  [CIFS] Mount should fail if server signing off but client mount option requires it
  [CIFS] whitespace fixes
  [CIFS] Fix sign mount option and sign proc config setting
  ...

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/docs-2.6
Linus Torvalds [Thu, 19 Jul 2007 01:28:34 +0000 (18:28 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/docs-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/docs-2.6:
  zh_CN/HOWTO: update URLs of git trees
  Chinese translation of Documentation/stable_api_nonsense.txt
  HOWTO: add Chinese translation of Documentation/HOWTO
  Documentation: add Japanese translated stable_api_nonsense.txt
  HOWTO: add Japanese translation of Documentation/HOWTO

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Linus Torvalds [Thu, 19 Jul 2007 01:28:08 +0000 (18:28 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/driver-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
  sysfs: cosmetic clean up on node creation failure paths
  sysfs: kill an extra put in sysfs_create_link() failure path
  Driver core: check return code of sysfs_create_link()
  HOWTO: Add the knwon_regression URI to the documentation
  dev_vdbg() documentation
  dev_vdbg(), available with -DVERBOSE_DEBUG
  sysfs: make sysfs_init_inode() static
  sysfs: fix sysfs root inode nlink accounting
  Documentation fix devres.txt: lib/iomap.c -> lib/devres.c
  sysfs: avoid kmem_cache_free(NULL)
  PM: remove deprecated dpm_runtime_* routines
  PM: Remove deprecated sysfs files
  Driver core: accept all valid action-strings in uevent-trigger
  debugfs: remove rmdir() non-empty complaint

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/uio-2.6
Linus Torvalds [Thu, 19 Jul 2007 01:27:50 +0000 (18:27 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/uio-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/uio-2.6:
  UIO: Hilscher CIF card driver
  UIO: Documentation
  UIO: Add the User IO core code

17 years agoMerge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
Linus Torvalds [Thu, 19 Jul 2007 01:27:00 +0000 (18:27 -0700)]
Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux

* 'for-linus' of git://linux-nfs.org/~bfields/linux:
  locks: fix vfs_test_lock() comment
  locks: make posix_test_lock() interface more consistent
  nfs: disable leases over NFS
  gfs2: stop giving out non-cluster-coherent leases
  locks: export setlease to filesystems
  locks: provide a file lease method enabling cluster-coherent leases
  locks: rename lease functions to reflect locks.c conventions
  locks: share more common lease code
  locks: clean up lease_alloc()
  locks: convert an -EINVAL return to a BUG
  leases: minor break_lease() comment clarification

17 years agoMerge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
Linus Torvalds [Thu, 19 Jul 2007 01:26:18 +0000 (18:26 -0700)]
Merge branch 'for-linus' of /linux/kernel/git/roland/infiniband

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband: (29 commits)
  IB/mthca: Simplify use of size0 in work request posting
  IB/mthca: Factor out setting WQE UD segment entries
  IB/mthca: Factor out setting WQE remote address and atomic segment entries
  IB/mlx4: Factor out setting other WQE segments
  IB/mlx4: Factor out setting WQE data segment entries
  IB/mthca: Factor out setting WQE data segment entries
  IB/mlx4: Return receive queue sizes for userspace QPs from query QP
  IB/mlx4: Increase max outstanding RDMA reads as target
  RDMA/cma: Remove local write permission from QP access flags
  IB/mthca: Use uninitialized_var() for f0
  IB/cm: Make internal function cm_get_ack_delay() static
  IB/ipath: Remove ipath_get_user_pages_nocopy()
  IB/ipath: Make a few functions static
  mlx4_core: Reset device when internal error is detected
  IB/iser: Make a couple of functions static
  IB/mthca: Fix printk format used for firmware version in warning
  IB/mthca: Schedule MSI support for removal
  IB/ehca: Fix warnings issued by checkpatch.pl
  IB/ehca: Restructure ehca_set_pagebuf()
  IB/ehca: MR/MW structure refactoring
  ...

17 years agoMerge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Steve French [Thu, 19 Jul 2007 00:38:57 +0000 (00:38 +0000)]
Merge branch 'master' of /linux/kernel/git/torvalds/linux-2.6

Conflicts:

fs/cifs/export.c

17 years ago[CIFS] merge conflict in fs/cifs/export.c
Steve French [Thu, 19 Jul 2007 00:32:25 +0000 (00:32 +0000)]
[CIFS] merge conflict in fs/cifs/export.c

Signed-off-by: Steve French <sfrench@us.ibm.com>
17 years ago[CIFS] Allow disabling CIFS Unix Extensions as mount option
Steve French [Wed, 18 Jul 2007 23:21:09 +0000 (23:21 +0000)]
[CIFS] Allow disabling CIFS Unix Extensions as mount option

Previously the only way to do this was to umount all mounts to that server,
turn off a proc setting (/proc/fs/cifs/LinuxExtensionsEnabled).

Fixes Samba bugzilla bug number: 4582 (and also 2008)

Signed-off-by: Steve French <sfrench@us.ibm.com>
17 years agolocks: fix vfs_test_lock() comment
J. Bruce Fields [Fri, 11 May 2007 20:22:50 +0000 (16:22 -0400)]
locks: fix vfs_test_lock() comment

Thanks to Doug Chapman for pointing out that the comment here is
inconsistent with the function prototype.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agolocks: make posix_test_lock() interface more consistent
J. Bruce Fields [Fri, 11 May 2007 20:09:32 +0000 (16:09 -0400)]
locks: make posix_test_lock() interface more consistent

Since posix_test_lock(), like fcntl() and ->lock(), indicates absence or
presence of a conflict lock by setting fl_type to, respectively, F_UNLCK
or something other than F_UNLCK, the return value is no longer needed.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agonfs: disable leases over NFS
J. Bruce Fields [Fri, 8 Jun 2007 19:23:34 +0000 (15:23 -0400)]
nfs: disable leases over NFS

As Peter Staubach says elsewhere
(http://marc.info/?l=linux-kernel&m=118113649526444&w=2):

> The problem is that some file system such as NFSv2 and NFSv3 do
> not have sufficient support to be able to support leases correctly.
> In particular for these two file systems, there is no over the wire
> protocol support.
>
> Currently, these two file systems fail the fcntl(F_SETLEASE) call
> accidentally, due to a reference counting difference.  These file
> systems should fail more consciously, with a proper error to
> indicate that the call is invalid for them.

Define an nfs setlease method that just returns -EINVAL.

If someone can demonstrate a real need, perhaps we could reenable
them in the presence of the "nolock" mount option.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: Peter Staubach <staubach@redhat.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years agogfs2: stop giving out non-cluster-coherent leases
Marc Eshel [Mon, 15 Jan 2007 23:33:36 +0000 (18:33 -0500)]
gfs2: stop giving out non-cluster-coherent leases

Since gfs2 can't prevent conflicting opens or leases on other nodes, we
probably shouldn't allow it to give out leases at all.

Put the newly defined lease operation into use in gfs2 by turning off
lease, unless we're using the "nolock' locking module (in which case all
locking is local anyway).

Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Steven Whitehouse <swhiteho@redhat.com>
17 years agolocks: export setlease to filesystems
J. Bruce Fields [Wed, 4 Jul 2007 21:21:37 +0000 (17:21 -0400)]
locks: export setlease to filesystems

Export setlease so it can used by filesystems to implement their lease
methods.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agolocks: provide a file lease method enabling cluster-coherent leases
J. Bruce Fields [Tue, 14 Nov 2006 20:51:40 +0000 (15:51 -0500)]
locks: provide a file lease method enabling cluster-coherent leases

Currently leases are only kept locally, so there's no way for a distributed
filesystem to enforce them against multiple clients.  We're particularly
interested in the case of nfsd exporting a cluster filesystem, in which
case nfsd needs cluster-coherent leases in order to implement delegations
correctly.

Also add some documentation.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
17 years agolocks: rename lease functions to reflect locks.c conventions
J. Bruce Fields [Thu, 7 Jun 2007 21:09:49 +0000 (17:09 -0400)]
locks: rename lease functions to reflect locks.c conventions

We've been using the convention that vfs_foo is the function that calls
a filesystem-specific foo method if it exists, or falls back on a
generic method if it doesn't; thus vfs_foo is what is called when some
other part of the kernel (normally lockd or nfsd) wants to get a lock,
whereas foo is what filesystems call to use the underlying local
functionality as part of their lock implementation.

So rename setlease to vfs_setlease (which will call a
filesystem-specific setlease after a later patch) and __setlease to
setlease.

Also, vfs_setlease need only be GPL-exported as long as it's only needed
by lockd and nfsd.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agolocks: share more common lease code
J. Bruce Fields [Thu, 31 May 2007 21:03:46 +0000 (17:03 -0400)]
locks: share more common lease code

Share more code between setlease (used by nfsd) and fcntl.

Also some minor cleanup.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Acked-by: Christoph Hellwig <hch@infradead.org>
17 years agolocks: clean up lease_alloc()
J. Bruce Fields [Thu, 1 Mar 2007 19:34:35 +0000 (14:34 -0500)]
locks: clean up lease_alloc()

Return the newly allocated structure as the return value instead of
using a struct ** parameter.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
17 years agolocks: convert an -EINVAL return to a BUG
J. Bruce Fields [Sat, 30 Jun 2007 16:40:32 +0000 (12:40 -0400)]
locks: convert an -EINVAL return to a BUG

There's no point trying to return an error in these cases, which all represent
bugs in the callers.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
17 years agoleases: minor break_lease() comment clarification
david m. richter [Wed, 9 May 2007 20:10:27 +0000 (16:10 -0400)]
leases: minor break_lease() comment clarification

clarify that break_lease() checks for presence of any lock, not just leases.

Signed-off-by: David M. Richter <richterd@citi.umich.edu>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agozh_CN/HOWTO: update URLs of git trees
Li Yang [Tue, 26 Jun 2007 03:15:27 +0000 (11:15 +0800)]
zh_CN/HOWTO: update URLs of git trees

Addressing patch from Stefan Richter:
HOWTO: update URLs of git trees
(It will be better if we update this to commit-id later)

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoChinese translation of Documentation/stable_api_nonsense.txt
TripleX [Thu, 21 Jun 2007 17:20:36 +0000 (01:20 +0800)]
Chinese translation of Documentation/stable_api_nonsense.txt

This is a Chinese translated version of
Documentation/stable_api_nonsense.txt.

From: TripleX <zhongyu@18mail.cn>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoHOWTO: add Chinese translation of Documentation/HOWTO
Li Yang [Thu, 21 Jun 2007 14:40:17 +0000 (22:40 +0800)]
HOWTO: add Chinese translation of Documentation/HOWTO

This is a Chinese translated version of Documentation/HOWTO.  Currently
Chinese involvement in Linux kernel is very low, especially comparing to
its largest population base.  Language could be the main obstacle.  Hope
this document will help more Chinese to contribute to Linux kernel.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: TripleX Chung <xxx.phy@gmail.com>
Signed-off-by: Maggie Chen <chenqi@beyondsoft.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDocumentation: add Japanese translated stable_api_nonsense.txt
IKEDA, Munehiro [Tue, 12 Jun 2007 00:46:04 +0000 (09:46 +0900)]
Documentation: add Japanese translated stable_api_nonsense.txt

Signed-off-by: IKEDA, Munehiro <m-ikeda@ds.jp.nec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoHOWTO: add Japanese translation of Documentation/HOWTO
Tsugikazu Shibata [Tue, 12 Jun 2007 08:16:12 +0000 (17:16 +0900)]
HOWTO: add Japanese translation of Documentation/HOWTO

Add the japanese translation of the Documentation/HOWTO file.

Signed-off-by: Tsugikazu Shibata <tshibata@ab.jp.nec.com>
Cc: IKEDA Munehiro <m-ikeda@ds.jp.nec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUIO: Hilscher CIF card driver
Hans-Jürgen Koch [Fri, 2 Mar 2007 12:03:12 +0000 (13:03 +0100)]
UIO: Hilscher CIF card driver

this is a patch that adds support for Hilscher CIF DeviceNet and
Profibus cards. I tested it on a Kontron CPX board, and Thomas reviewed
it.

You can find the user space part here:

http://www.osadl.org/projects/downloads/UIO/user/cif-0.1.0.tar.gz

Notes: cif_api.c is the main file you want to look at. It contains the
functions to open, close, mmap and so on. cif_dps.c adds functions
specific to Profibus cards, and cif_dn.c contains functions for
DeviceNet cards.  cif.c is a universal playground, it's just a small
test program.  The user space part of this UIO driver is still work in
progress, and not everything is tested yet. At the moment, the thread in
cif_api.c contains some code that artificially makes the card generate
interrupts, this was added for testing and will be removed later. But
the driver already contains all the functions needed for useful
operation, so it gives a good idea of how such a thing looks like.

For comparison, here's what you get from the manufacturer
(www.hilscher.com) when you ask for a Linux 2.6 driver:

http://www.tglx.de/private/hjk/cif-orig-2.6.tar.bz2

WARNING: Don't look at the code for too long, you might become sick :-)

Signed-off-by: Hans-Jürgen Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUIO: Documentation
Hans J. Koch [Mon, 11 Dec 2006 15:59:59 +0000 (16:59 +0100)]
UIO: Documentation

Documentation for the UIO interface

From: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUIO: Add the User IO core code
Hans J. Koch [Thu, 7 Dec 2006 09:58:29 +0000 (10:58 +0100)]
UIO: Add the User IO core code

This interface allows the ability to write the majority of a driver in
userspace with only a very small shell of a driver in the kernel itself.
It uses a char device and sysfs to interact with a userspace process to
process interrupts and control memory accesses.

See the docbook documentation for more details on how to use this
interface.

From: Hans J. Koch <hjk@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: cosmetic clean up on node creation failure paths
Tejun Heo [Wed, 18 Jul 2007 07:38:11 +0000 (16:38 +0900)]
sysfs: cosmetic clean up on node creation failure paths

Node addition failure is detected by testing return value of
sysfs_addfm_finish() which returns the number of added and removed
nodes.  As the function is called as the last step of addition right
on top of error handling block, the if blocks looked like the
following.

if (sysfs_addrm_finish(&acxt))
success handling, usually return;
/* fall through to error handling */

This is the opposite of usual convention in sysfs and makes the code
difficult to understand.  This patch inverts the test and makes those
blocks look more like others.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Gabriel C <nix.or.die@googlemail.com>
Cc: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: kill an extra put in sysfs_create_link() failure path
Tejun Heo [Wed, 18 Jul 2007 07:14:45 +0000 (16:14 +0900)]
sysfs: kill an extra put in sysfs_create_link() failure path

There is a subtle bug in sysfs_create_link() failure path.  When
symlink creation fails because there's already a node with the same
name, the target sysfs_dirent is put twice - once by failure path of
sysfs_create_link() and once more when the symlink is released.

Fix it by making only the symlink node responsible for putting
target_sd.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Gabriel C <nix.or.die@googlemail.com>
Cc: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: check return code of sysfs_create_link()
Cornelia Huck [Wed, 18 Jul 2007 08:43:47 +0000 (01:43 -0700)]
Driver core: check return code of sysfs_create_link()

Check for return value of sysfs_create_link() in device_add() and
device_rename().  Add helper functions device_add_class_symlinks() and
device_remove_class_symlinks() to make the code easier to read.

[akpm@linux-foundation.org: fix unused var warnings]

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoHOWTO: Add the knwon_regression URI to the documentation
Paolo Ciarrocchi [Mon, 16 Jul 2007 21:55:05 +0000 (23:55 +0200)]
HOWTO: Add the knwon_regression URI to the documentation

We should let everybody know about where the regression
list is hosted. The more is known the more it is used.

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Cc: Li Yang <leoli@freescale.com>
Cc: TripleX Chung <xxx.phy@gmail.com>
Cc: Maggie Chen <chenqi@beyondsoft.com>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tsugikazu Shibata <tshibata@ab.jp.nec.com>
Cc: IKEDA Munehiro <m-ikeda@ds.jp.nec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodev_vdbg() documentation
David Brownell [Fri, 13 Jul 2007 23:32:09 +0000 (16:32 -0700)]
dev_vdbg() documentation

Update CodingStyle to talk about "-DDEBUG" message conventions and the
new "-DVERBOSE_DEBUG" convention.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodev_vdbg(), available with -DVERBOSE_DEBUG
David Brownell [Fri, 13 Jul 2007 05:08:22 +0000 (22:08 -0700)]
dev_vdbg(), available with -DVERBOSE_DEBUG

This defines a dev_vdbg() call, which is enabled with -DVERBOSE_DEBUG.
When enabled, dev_vdbg() acts just like dev_dbg().  When disabled, it is a
NOP ...  just like dev_dbg() without -DDEBUG.  The specific code was moved
out of a USB patch, but lots of drivers have similar support.

That is, code can now be written to use an additional level of debug
output, selected at compile time.  Many driver authors have found this
idiom to be very useful.  A typical usage model is for "normal" debug
messages to focus on fault paths and not be very "chatty", so that those
messages can be left on during normal operation without much of a
performance or syslog load.  On the other hand "verbose" messages would be
noisy enough that they wouldn't normally be enabled; they might even affect
timings enough to change system or driver behavior.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: make sysfs_init_inode() static
Tejun Heo [Wed, 18 Jul 2007 05:30:28 +0000 (14:30 +0900)]
sysfs: make sysfs_init_inode() static

With sysfs_fill_super() converted to use sysfs_get_inode(), there is
no user of sysfs_init_inode() outside of fs/sysfs/inode.c.  Make it
static.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: fix sysfs root inode nlink accounting
Tejun Heo [Wed, 18 Jul 2007 05:29:06 +0000 (14:29 +0900)]
sysfs: fix sysfs root inode nlink accounting

While making sysfs indoes hashed, sysfs root inode was left out.  Now
that nlink accounting depends on the inode being on the hash, sysfs
root inode nlink isn't adjusted properly.

Put sysfs root inode on the inode hash by allocating it using
sysfs_get_inode() like other sysfs inodes.  While at it, massage
comments a bit.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDocumentation fix devres.txt: lib/iomap.c -> lib/devres.c
Brandon Philips [Wed, 18 Jul 2007 05:09:34 +0000 (22:09 -0700)]
Documentation fix devres.txt: lib/iomap.c -> lib/devres.c

Signed-off-by: Brandon Philips <bphilips@suse.de>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: avoid kmem_cache_free(NULL)
Akinobu Mita [Sat, 14 Jul 2007 02:03:35 +0000 (11:03 +0900)]
sysfs: avoid kmem_cache_free(NULL)

kmem_cache_free() with NULL is not allowed. But it may happen
if out of memory error is triggered in sysfs_new_dirent().
This patch fixes that error handling.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPM: remove deprecated dpm_runtime_* routines
Alan Stern [Thu, 12 Jul 2007 20:57:22 +0000 (16:57 -0400)]
PM: remove deprecated dpm_runtime_* routines

This patch (as933) removes the deprecated dpm_runtime_suspend() and
dpm_runtime_resume() routines from the PM core.  The only user of
those routines is the PCMCIA ds driver; local replacements are added.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPM: Remove deprecated sysfs files
Alan Stern [Thu, 12 Jul 2007 20:55:07 +0000 (16:55 -0400)]
PM: Remove deprecated sysfs files

This patch (as932) removes the deprecated sysfs .../power/state
attribute files.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: accept all valid action-strings in uevent-trigger
Kay Sievers [Sun, 8 Jul 2007 20:29:26 +0000 (22:29 +0200)]
Driver core: accept all valid action-strings in uevent-trigger

This allows the uevent file to handle any type of uevent action to be
triggered by userspace instead of just the "add" uevent.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodebugfs: remove rmdir() non-empty complaint
Jens Axboe [Wed, 11 Jul 2007 12:53:28 +0000 (14:53 +0200)]
debugfs: remove rmdir() non-empty complaint

Hi,

This patch kills the pointless debugfs rmdir() printk() when called on a
non-empty directory. blktrace will sometimes have to call it a few times
when forcefully ending a trace, which polutes the log with pointless
warnings.

Rationale:

- It's more code to work-around this "problem" in the debugfs users, and
  you would have to add code to check for empty directories to do so (or
  assume that debugfs is using simple_ helpers, but that would be a
  layering violation).

- Other rmdir() implementations don't complain about something this
  silly.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoeHEA: Fix bonding support
Thomas Klein [Wed, 18 Jul 2007 15:34:09 +0000 (17:34 +0200)]
eHEA: Fix bonding support

The driver didn't allow an interface's MAC address to be modified if the
respective interface wasn't setup - a failing Hcall was the result. Thus
bonding wasn't usable. The fix moves the failing Hcall which was registering
a MAC address for the reception of BC packets in firmware from the port up
and down functions to the port resources setup functions. Additionally the
missing update of the last_rx member of the netdev structure was added.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoBlackfin ethernet driver: on chip ethernet MAC controller driver
Bryan Wu [Tue, 17 Jul 2007 06:43:44 +0000 (14:43 +0800)]
Blackfin ethernet driver: on chip ethernet MAC controller driver

This patch implements the driver necessary use the Analog Devices
Blackfin processor's on-chip ethernet MAC controller.

[try#2]
 - add timeout control
 - kill dma_config_reg bitfields
 - some trivial cleanup

[try#3]
 - add endianess check
 - add DRV_NAME, DRV_VERSION... driver information string
 - add some comments for silicon anomaly and dma API confusion
 - some code trivial cleanup

[try#4]
 - add Blackfin latest GPIO pin mux opertion with Michael Hennerich's
  help and Dan's review
 - rewrite the DMA descriptor list operation in a more readable way
  by Joe's review

[try#5]
 - cleanup some coding style by Joe's review.

[try#6]
 - 1.1 version fix a bug when set up multicast list pointed by Mr. yoshfuji
 - rearrange the desc_list_free function.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Dan Williams <dcbw@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofix wrong argument of tc35815_read_plat_dev_addr()
Yoichi Yuasa [Wed, 18 Jul 2007 02:13:42 +0000 (11:13 +0900)]
fix wrong argument of tc35815_read_plat_dev_addr()

Fix wrong argument of tc35815_read_plat_dev_addr()

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoMerge branch 'upstream-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git...
Jeff Garzik [Wed, 18 Jul 2007 22:31:03 +0000 (18:31 -0400)]
Merge branch 'upstream-jgarzik' of git://git./linux/kernel/git/linville/wireless-2.6 into upstream

17 years agoARM/ETHER3: Handle multicast frames.
YOSHIFUJI Hideaki / 吉藤英明 [Tue, 17 Jul 2007 04:45:43 +0000 (13:45 +0900)]
ARM/ETHER3: Handle multicast frames.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoSAA9730: Handle multicast frames.
YOSHIFUJI Hideaki / 吉藤英明 [Tue, 17 Jul 2007 04:46:00 +0000 (13:46 +0900)]
SAA9730: Handle multicast frames.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoNI5010: Handle multicast frames.
YOSHIFUJI Hideaki / 吉藤英明 [Tue, 17 Jul 2007 04:45:50 +0000 (13:45 +0900)]
NI5010: Handle multicast frames.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoNS83820: Handle multicast frames.
YOSHIFUJI Hideaki / 吉藤英明 [Tue, 17 Jul 2007 04:45:54 +0000 (13:45 +0900)]
NS83820: Handle multicast frames.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoFix RGMII-ID handling in gianfar
Andy Fleming [Wed, 11 Jul 2007 16:43:07 +0000 (11:43 -0500)]
Fix RGMII-ID handling in gianfar

The TSEC/eTSEC can detect the interface to the PHY automatically,
but it isn't able to detect whether the RGMII connection needs internal
delay.  So we need to detect that change in the device tree, propagate
it to the platform data, and then check it if we're in RGMII.  This fixes
a bug on the 8641D HPCN board where the Vitesse PHY doesn't use the delay
for RGMII.

Signed-off-by: Andy Fleming <afleming@freescale.com>
17 years agoFix Vitesse RGMII-ID support
Andy Fleming [Wed, 11 Jul 2007 16:42:35 +0000 (11:42 -0500)]
Fix Vitesse RGMII-ID support

The Vitesse PHY on the 8641D needs to be set up with internal delay to
work in RGMII mode.  So we add skew when it is set to RGMII_ID mode.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Haruki Dai <Dai.Haruki@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
17 years agoAdd phy-connection-type to gianfar nodes
Andy Fleming [Tue, 10 Jul 2007 22:28:49 +0000 (17:28 -0500)]
Add phy-connection-type to gianfar nodes

The TSEC/eTSEC automatically detect their PHY interface type, unless
the type is RGMII-ID (RGMII with internal delay).  In that situation,
it just detects RGMII.  In order to fix this, we need to pass in rgmii-id
if that is the connection type.

Signed-off-by: Andy Fleming <afleming@freescale.com>
17 years agoFix Vitesse 824x PHY interrupt acking
Andy Fleming [Tue, 10 Jul 2007 21:42:04 +0000 (16:42 -0500)]
Fix Vitesse 824x PHY interrupt acking

The Vitesse 824x PHY doesn't allow an interrupt to be cleared if
the mask bit for that interrupt isn't set.  This means that the PHY
Lib's order of handling interrupts (disable, then clear) breaks on this
PHY.  However, clearing then disabling the interrupt opens up the code
for a silly race condition.  So rather than change the PHY Lib, we change
the Vitesse driver so it always clears interrupts before disabling them.
Further, the ack function only clears the interrupt if interrupts are
enabled.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: Haiying Wang <Haiying.Wang@freescale.com>
17 years agoISDN HiSax: uninitialized return in hisax_cs_setup
Florin Malita [Wed, 18 Jul 2007 22:04:46 +0000 (18:04 -0400)]
ISDN HiSax: uninitialized return in hisax_cs_setup

Coverity (1792) spotted a possibly uninitialized return value in case of
kmalloc() failure:

1116 static int hisax_cs_setup(int cardnr, struct IsdnCard *card,
1117                           struct IsdnCardState *cs)
1119         int ret;
1120
1121         if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) {
1122                 printk(KERN_WARNING "HiSax: No memory for isac rcvbuf\n");
1123                 ll_unload(cs);
1124                 goto outf_cs;
...
1165 outf_cs:
1166         kfree(cs);
1167         card->cs = NULL;
1168         return ret;

The straightforward solution would be to just add the missing
initialization but hardcoding the return value in the out_cs branch
(only taken on failure) seems to work just as well and it allows killing
a couple of other lines too.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofirewire: fw-sbp2: convert to new SCSI data buffer accessors
Stefan Richter [Mon, 16 Jul 2007 19:05:41 +0000 (21:05 +0200)]
firewire: fw-sbp2: convert to new SCSI data buffer accessors

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fix memory leak of fw_request instances
Stefan Richter [Tue, 17 Jul 2007 00:15:36 +0000 (02:15 +0200)]
firewire: fix memory leak of fw_request instances

Found and debugged by Jay Fenlason <fenlason@redhat.com>.
The bug was especially noticeable with direct I/O over fw-sbp2.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: remove bogus check in fw_core_handle_request
Stefan Richter [Tue, 17 Jul 2007 00:13:48 +0000 (02:13 +0200)]
firewire: remove bogus check in fw_core_handle_request

This check is bogus:
  - Maximum asynchronous payload size for S800...S3200 is 4096.
  - The p->payload_length is totally uninteresting.  Only the
    request->length of the subsequently allocated and initialized
    struct fw_request is of significance.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-ohci: fix "scheduling while atomic"
Stefan Richter [Thu, 12 Jul 2007 20:25:14 +0000 (22:25 +0200)]
firewire: fw-ohci: fix "scheduling while atomic"

context_stop is called by bus_reset_tasklet, among else.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-ohci: flush MMIO write before msleep
Stefan Richter [Thu, 12 Jul 2007 20:24:19 +0000 (22:24 +0200)]
firewire: fw-ohci: flush MMIO write before msleep

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoIB/mthca: Simplify use of size0 in work request posting
Roland Dreier [Wed, 18 Jul 2007 20:28:29 +0000 (13:28 -0700)]
IB/mthca: Simplify use of size0 in work request posting

Current code sets size0 to 0 at the start of work request posting
functions and then handles size0 == 0 specially within the loop over
work requests.  Change this so size0 is set along with f0 the first
time through the loop (when nreq == 0).  This makes the code easier to
understand by making it clearer that f0 and size0 are always
initialized if nreq != 0 without having to know that size0 == 0
implies nreq == 0.

Also annotate size0 with uninitialized_var() so that this doesn't
introduce a new compiler warning.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Factor out setting WQE UD segment entries
Roland Dreier [Wed, 18 Jul 2007 20:21:14 +0000 (13:21 -0700)]
IB/mthca: Factor out setting WQE UD segment entries

Factor code to set UD entries out of the work request posting
functions into inline functions set_tavor_ud_seg() and
set_arbel_ud_seg().  This doesn't change the generated code in any
significant way, and makes the source easier on the eyes.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen...
Linus Torvalds [Wed, 18 Jul 2007 19:57:52 +0000 (12:57 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/hskinnemoen/avr32-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  [AVR32] Initialize phy_mask for both macb devices
  [AVR32] Fix atomic_add_unless() and atomic_sub_unless()
  [AVR32] Correct misspelled CONFIG_BLK_DEV_INITRD variable.
  [AVR32] Fix build error in parse_tag_rdimg()
  [AVR32] Don't wire up macb0 unless SW6 is in default position
  [AVR32] Wire up SSC platform device 0 as TX on ATSTK1000 board
  [AVR32] Add Atmel SSC driver platform device to AT32AP architecture
  [AVR32] Remove optimization of unaligned word loads
  [AVR32] Make STK1000 mux settings configurable
  [AVR32] CPU frequency scaling for AT32AP
  [AVR32] Split SM device into PM, RTC, WDT and EIC
  [AVR32] faster avr32 unaligned access

17 years agoIB/mthca: Factor out setting WQE remote address and atomic segment entries
Roland Dreier [Wed, 18 Jul 2007 19:55:42 +0000 (12:55 -0700)]
IB/mthca: Factor out setting WQE remote address and atomic segment entries

Factor code to set remote address and atomic segment entries out of the
work request posting functions into inline functions set_raddr_seg()
and set_atomic_seg().  This doesn't change the generated code in any
significant way, and makes the source easier on the eyes.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux...
Linus Torvalds [Wed, 18 Jul 2007 19:13:02 +0000 (12:13 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/hpa/linux-2.6-x86setup

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup:
  [PATCH] x86: do not recompile boot for each build
  [x86 setup] Save/restore DS around invocations of INT 10h
  [x86 setup] VGA: Clear the Protect bit before setting the vertical height
  [x86 setup] Fix assembly constraints
  [x86 setup] build/tools.c: fix comment
  [x86 setup] MAINTAINERS: document x86 setup code git tree

17 years agoi386: fixup TRACE_IRQ breakage
Peter Zijlstra [Wed, 18 Jul 2007 18:59:22 +0000 (20:59 +0200)]
i386: fixup TRACE_IRQ breakage

The TRACE_IRQS_ON function in iret_exc: calls a C function without
ensuring that the segments are set properly. Move the trace function and
the enabling of interrupt into the C stub.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoHandle bogus %cs selector in single-step instruction decoding
Roland McGrath [Mon, 16 Jul 2007 08:03:16 +0000 (01:03 -0700)]
Handle bogus %cs selector in single-step instruction decoding

The code for LDT segment selectors was not robust in the face of a bogus
selector set in %cs via ptrace before the single-step was done.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoIB/mlx4: Factor out setting other WQE segments
Roland Dreier [Wed, 18 Jul 2007 18:47:55 +0000 (11:47 -0700)]
IB/mlx4: Factor out setting other WQE segments

Factor code to set remote address, atomic and datagram segments out of
mlx4_ib_post_send() into small helper functions.  This doesn't change
the generated code in any significant way, and makes the source easier
on the eyes.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years ago[AVR32] Initialize phy_mask for both macb devices
Haavard Skinnemoen [Wed, 18 Jul 2007 18:32:49 +0000 (20:32 +0200)]
[AVR32] Initialize phy_mask for both macb devices

The STK1000 uses pullups on the MDIO lines to the PHY, but they are
too weak. This causes the PHY layer to detect PHYs on all possible MII
addresses. Mask out all but the correct address to prevent this from
happening.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Fix atomic_add_unless() and atomic_sub_unless()
Haavard Skinnemoen [Wed, 18 Jul 2007 18:06:04 +0000 (20:06 +0200)]
[AVR32] Fix atomic_add_unless() and atomic_sub_unless()

These functions depend on "result" being initalized to 0, but "result"
is not included as an input constraint to the inline assembly block
following its initialization, only as an output constraint. Thus gcc
thinks it doesn't need to initialize it, so result ends up undefined
if the "unless" condition is true.

This fixes an oops in sunrpc where the faulty atomics caused
rpciod_up() to not start the workqueue as it should.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Correct misspelled CONFIG_BLK_DEV_INITRD variable.
Robert P. J. Day [Thu, 12 Jul 2007 22:31:08 +0000 (18:31 -0400)]
[AVR32] Correct misspelled CONFIG_BLK_DEV_INITRD variable.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Fix build error in parse_tag_rdimg()
Haavard Skinnemoen [Fri, 13 Jul 2007 09:26:01 +0000 (11:26 +0200)]
[AVR32] Fix build error in parse_tag_rdimg()

This code is inside an #ifdef with a misspelled config symbol, so it
hasn't been used for a long time. Fix it before fixing the config
symbol to keep bisection working.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years agoIB/mlx4: Factor out setting WQE data segment entries
Roland Dreier [Wed, 18 Jul 2007 18:46:27 +0000 (11:46 -0700)]
IB/mlx4: Factor out setting WQE data segment entries

Factor code to set data segment entries out of mlx4_ib_post_send()
into set_data_seg().  This cleans up the code and lets the compiler do
a better job -- on x86_64:

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-16 (-16)
function                                     old     new   delta
mlx4_ib_post_send                           1598    1582     -16

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years ago[AVR32] Don't wire up macb0 unless SW6 is in default position
Kristoffer Nyborg Gregertsen [Fri, 6 Jul 2007 12:37:30 +0000 (14:37 +0200)]
[AVR32] Don't wire up macb0 unless SW6 is in default position

If the user wants to sacrifice macb0 for more GPIOs, let him.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Wire up SSC platform device 0 as TX on ATSTK1000 board
Hans-Christian Egtvedt [Fri, 6 Jul 2007 12:34:03 +0000 (14:34 +0200)]
[AVR32] Wire up SSC platform device 0 as TX on ATSTK1000 board

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Add Atmel SSC driver platform device to AT32AP architecture
Hans-Christian Egtvedt [Fri, 6 Jul 2007 12:31:55 +0000 (14:31 +0200)]
[AVR32] Add Atmel SSC driver platform device to AT32AP architecture

This patch adds register definitions, clocks and IRQs to the platform devices.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Remove optimization of unaligned word loads
Haavard Skinnemoen [Wed, 20 Jun 2007 13:29:15 +0000 (15:29 +0200)]
[AVR32] Remove optimization of unaligned word loads

If we let unaligned word loads bypass the generic unaligned handling,
gcc may combine it with a swap.b instruction and turn it into a ldwsp
instruction, which does not work with unaligned addresses.

Revert the optimization to prevent the RNDIS driver from crashing.
Hopefully we'll figure something out later (it may be better to do the
optimization in gcc.)

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Make STK1000 mux settings configurable
David Brownell [Tue, 12 Jun 2007 12:34:47 +0000 (14:34 +0200)]
[AVR32] Make STK1000 mux settings configurable

This adds some STK1002-specific config options covering the jumper settings,
so the kernel can automatically be configured to include the relevant devices.

One of them replaces the previous internal SW2_DEFAULT setting; SPI config
is affected by two of the jumpers; and a fourth one switches between LCD and
the second Ethernet connector.  (There's more that to be done.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] CPU frequency scaling for AT32AP
Hans-Christian Egtvedt [Mon, 4 Jun 2007 14:10:57 +0000 (16:10 +0200)]
[AVR32] CPU frequency scaling for AT32AP

This patch enables CPU frequency scaling for AT32AP devices. This will
enable the CPU to scale between the speed of the high speed bus and
the master clock and thus save some power.

The patch also adds a parent to cpu_clk and a cpu_clk_set_rate to
enable changing the CPU clock divider in a sane way.

The driver does not check if the given rate is 0, thus resulting in a
div by 0.  I think this check should be go into the clk_set_rate
framework, and not here.

Tested on AT32AP7000/ATSTK1000.

Hardware documentation can be found in the AT32AP7000 datasheet.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[AVR32] Split SM device into PM, RTC, WDT and EIC
Haavard Skinnemoen [Mon, 4 Jun 2007 10:58:30 +0000 (12:58 +0200)]
[AVR32] Split SM device into PM, RTC, WDT and EIC

Split the SM platform device into separate platform devices for PM,
RTC, WDT and EIC. This is more correct according to the documentation
and allows us to simplify the code a little.

Also turn the EIC driver into a real platform driver.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
17 years ago[AVR32] faster avr32 unaligned access
David Brownell [Sat, 26 May 2007 01:47:47 +0000 (18:47 -0700)]
[AVR32] faster avr32 unaligned access

Use a more conventional implementation for unaligned access, and include
an AT32AP-specific optimization:  the CPU will handle unaligned words.

The result is always faster and smaller for 8, 16, and 32 bit values.
For 64 bit quantities, it's presumably larger.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
17 years ago[PATCH] x86: do not recompile boot for each build
Sam Ravnborg [Tue, 17 Jul 2007 20:27:22 +0000 (22:27 +0200)]
[PATCH] x86: do not recompile boot for each build

Keep the arch/i386/boot directory from being rebuilt every time.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
17 years ago[x86 setup] Save/restore DS around invocations of INT 10h
H. Peter Anvin [Mon, 16 Jul 2007 18:58:24 +0000 (11:58 -0700)]
[x86 setup] Save/restore DS around invocations of INT 10h

There exists at least one card, Trident TVGA8900CL (BIOS dated 1992/9/8)
which clobbers DS when "scrolling in an SVGA text mode of more than
800x600 pixels."  Although we are extremely unlikely to run into that
situation, it is cheap insurance to save and restore DS, and it only adds
a grand total of 50 bytes to the total output.

Pointed out by Etienne Lorrain.

Cc: Etienne Lorrain <etienne_lorrain@yahoo.fr>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
17 years ago[x86 setup] VGA: Clear the Protect bit before setting the vertical height
H. Peter Anvin [Tue, 17 Jul 2007 23:16:10 +0000 (16:16 -0700)]
[x86 setup] VGA: Clear the Protect bit before setting the vertical height

If the user has asked for the vertical height registers to be recomputed
by setting bit 15 in the video mode number, we do so without clearing the
Protect bit in the Vertical Retrace Register before setting the Overflow
register.  As a result, if the VGA BIOS had set the Protect bit, the
write to the Overflow register will be dropped, and bits [9:8] of the
vertical height will be left unchanged.

This is a bug imported from the assembly version of this code.  It was
pointed out by Etienne Lorrain.

Cc: Etienne Lorrain <etienne_lorrain@yahoo.fr>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
17 years ago[x86 setup] Fix assembly constraints
H. Peter Anvin [Sat, 14 Jul 2007 23:47:13 +0000 (16:47 -0700)]
[x86 setup] Fix assembly constraints

Fix incorrect assembly constraints.  In particular, fix memory
constraints used inside push..pop, which can cause invalid operation
since gcc may generate %esp-relative references.

Additionally:

outl() should have "dN" not "dn".

query_mca() shouldn't listen 16/32-bit registers in an 8-bit only
context.

has_eflag(): the "mask" is only used well after both the stack pointer
and the output registers have been touched; this requires the output
registers to be earlyclobbers (=&) and the input to exclude memory (so
"ri", not "g").

Thanks to Etienne Lorrain and Chuck Ebbert for prompting this review.

Cc: Etienne Lorrain <etienne_lorrain@yahoo.fr>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
17 years ago[x86 setup] build/tools.c: fix comment
H. Peter Anvin [Fri, 13 Jul 2007 23:28:27 +0000 (16:28 -0700)]
[x86 setup] build/tools.c: fix comment

Correct a comment in arch/i386/boot/build/tools.c; we now build the
kernel from only two components instead of three, since the boot
sector has been integrated in the setup code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
17 years ago[x86 setup] MAINTAINERS: document x86 setup code git tree
H. Peter Anvin [Fri, 13 Jul 2007 23:26:55 +0000 (16:26 -0700)]
[x86 setup] MAINTAINERS: document x86 setup code git tree

Document the existence of a published git tree for the x86 setup code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
17 years agoIB/mthca: Factor out setting WQE data segment entries
Roland Dreier [Wed, 18 Jul 2007 18:30:34 +0000 (11:30 -0700)]
IB/mthca: Factor out setting WQE data segment entries

Factor code to set data segment entries out of the work request
posting functions into inline functions mthca_set_data_seg() and
mthca_set_data_seg_inval().  This makes the code more readable and
also allows the compiler to do a better job -- on x86_64:

add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-69 (-69)
function                                     old     new   delta
mthca_arbel_post_srq_recv                    373     369      -4
mthca_arbel_post_receive                     570     562      -8
mthca_tavor_post_srq_recv                    520     508     -12
mthca_tavor_post_send                       1344    1330     -14
mthca_arbel_post_send                       1481    1467     -14
mthca_tavor_post_receive                     792     775     -17

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Wed, 18 Jul 2007 18:25:58 +0000 (11:25 -0700)]
Merge branch 'master' of ssh:///linux/kernel/git/mchehab/v4l-dvb

* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (126 commits)
  V4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code
  V4L/DVB (5846): Clean up setting state and scheduling timeouts
  V4L/DVB (5844): ivtv: add high volume debugging flag
  V4L/DVB (5843): ivtv: fix missing signal_pending check.
  V4L/DVB (5842): ivtv: Add locking to ensure stream setup is atomic.
  V4L/DVB (5841): tveeprom: add support for Philips FQ1216LME MK3 tuner.
  V4L/DVB (5840): fix dst and cx24123: tune() callback changed signess for delay
  V4L/DVB (5838): dvb-core: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
  V4L/DVB (5837): stv0299: Fix signedness warning (gcc 4.1.1, kernel 2.6.22)
  V4L/DVB (5836): dvb-ttpci: re-initialize aspect ratio and pan scan after arm crash
  V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
  V4L/DVB (5834): dvb-core: fix signedness warnings and const stripping
  V4L/DVB (5832): ir-common: optimize bit extract function
  V4L/DVB (5831): stradis: use ARRAY_SIZE
  V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update
  V4L/DVB (5828): Kconfig: Added GemTek USB radio and removed experimental dependency.
  V4L/DVB (5826): Usbvision: video mux cleanup
  V4L/DVB (5825): Alter the tuner type for the WinTV USB UK PAL model.
  V4L/DVB (5824): Usbvision: Hauppauge WinTV USB SECAM_L fix
  V4L/DVB (5821): Saa7134: add remote control support for LifeView FlyDVB-S LR300
  ...

17 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Wed, 18 Jul 2007 17:32:00 +0000 (10:32 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: extent macros cleanup
  Fix compilation with EXT_DEBUG, also fix leXX_to_cpu conversions.
  ext4: remove extra IS_RDONLY() check
  ext4: Use is_power_of_2()
  Use zero_user_page() in ext4 where possible
  ext4: Remove 65000 subdirectory limit
  ext4: Expand extra_inodes space per the s_{want,min}_extra_isize fields
  ext4: Add nanosecond timestamps
  jbd2: Move jbd2-debug file to debugfs
  jbd2: Fix CONFIG_JBD_DEBUG ifdef to be CONFIG_JBD2_DEBUG
  ext4: Set the journal JBD2_FEATURE_INCOMPAT_64BIT on large devices
  ext4: Make extents code sanely handle on-disk corruption
  ext4: copy i_flags to inode flags on write
  ext4: Enable extents by default
  Change on-disk format to support 2^15 uninitialized extents
  write support for preallocated blocks
  fallocate support in ext4
  sys_fallocate() implementation on i386, x86_64 and powerpc

17 years agoMerge branch 'upstream' of git://git.infradead.org/~dedekind/ubi-2.6
Linus Torvalds [Wed, 18 Jul 2007 17:27:24 +0000 (10:27 -0700)]
Merge branch 'upstream' of git://git.infradead.org/~dedekind/ubi-2.6

* 'upstream' of git://git.infradead.org/~dedekind/ubi-2.6: (28 commits)
  UBI: fix compile warning
  UBI: fix error handling in erase worker
  UBI: fix comments
  UBI: remove unneeded error checks
  UBI: cleanup usage of try_module_get
  UBI: fix overflow bug
  UBI: bugfix in max_sqnum calculation
  UBI: bugfix in sqnum calculation
  UBI: fix signed-unsigned multiplication
  UBI: fix bug in atomic_leb_change()
  UBI: fix message
  UBI: fix debugging stuff
  UBI: bugfix in error path
  UBI: use is_power_of_2()
  UBI: fix freeing ubi->vtbl while unloading
  UBI: fix MAINTAINERS
  UBI: bugfix in ubi_leb_change()
  UBI: kill homegrown endian macros
  UBI: cleanup ioctl handling
  UBI: error path bugfix
  ...

17 years agoV4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code
Robert P. J. Day [Mon, 16 Jul 2007 13:47:51 +0000 (10:47 -0300)]
V4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>