safe/jmp/linux-2.6
13 years agoSUNRPC: Ensure rpcauth_prune_expired() respects the nr_to_scan parameter
Trond Myklebust [Thu, 13 May 2010 16:51:06 +0000 (12:51 -0400)]
SUNRPC: Ensure rpcauth_prune_expired() respects the nr_to_scan parameter

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Ensure memory shrinker doesn't waste time in rpcauth_prune_expired()
Trond Myklebust [Thu, 13 May 2010 16:51:06 +0000 (12:51 -0400)]
SUNRPC: Ensure memory shrinker doesn't waste time in rpcauth_prune_expired()

The 'cred_unused' list, that is traversed by rpcauth_cache_shrinker is
ordered by time. If we hit a credential that is under the 60 second garbage
collection moratorium, we should exit because we know at that point that
all successive credentials are subject to the same moratorium...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Dont run rpcauth_cache_shrinker() when gfp_mask is GFP_NOFS
Trond Myklebust [Thu, 13 May 2010 16:51:03 +0000 (12:51 -0400)]
SUNRPC: Dont run rpcauth_cache_shrinker() when gfp_mask is GFP_NOFS

Under some circumstances, put_rpccred() can end up allocating memory, so
check the gfp_mask to prevent deadlocks.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Read requests can use GFP_KERNEL.
Trond Myklebust [Thu, 13 May 2010 16:51:03 +0000 (12:51 -0400)]
NFS: Read requests can use GFP_KERNEL.

There is no danger of deadlock should the allocation trigger page
writeback.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Clean up nfs_create_request()
Trond Myklebust [Thu, 13 May 2010 16:51:02 +0000 (12:51 -0400)]
NFS: Clean up nfs_create_request()

There is no point in looping if we're out of memory.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Don't use GFP_KERNEL in rpcsec_gss downcalls
Trond Myklebust [Thu, 13 May 2010 16:51:02 +0000 (12:51 -0400)]
NFS: Don't use GFP_KERNEL in rpcsec_gss downcalls

Again, we can deadlock if the memory reclaim triggers a writeback that
requires a rpcsec_gss credential lookup.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Don't use GFP_KERNEL allocations in state recovery
Trond Myklebust [Thu, 13 May 2010 16:51:01 +0000 (12:51 -0400)]
NFSv4: Don't use GFP_KERNEL allocations in state recovery

We do not want to have the state recovery thread kick off and wait for a
memory reclaim, since that may deadlock when the writebacks end up
waiting for the state recovery thread to complete.

The safe thing is therefore to use GFP_NOFS in all open, close,
delegation return, lock, etc. operations that may be called by the
state recovery thread.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Fix xs_setup_bc_tcp()
Trond Myklebust [Wed, 12 May 2010 21:50:23 +0000 (17:50 -0400)]
SUNRPC: Fix xs_setup_bc_tcp()

It is a BUG for anybody to call this function without setting
args->bc_xprt. Trying to return an error value is just wrong, since the
user cannot fix this: it is a programming error, not a user error.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Replace jiffies-based metrics with ktime-based metrics
Chuck Lever [Fri, 7 May 2010 17:34:47 +0000 (13:34 -0400)]
SUNRPC: Replace jiffies-based metrics with ktime-based metrics

Currently RPC performance metrics that tabulate elapsed time use
jiffies time values.  This is problematic on systems that use slow
jiffies (for instance 100HZ systems built for paravirtualized
environments).  It is also a problem for computing precise latency
statistics for advanced network transports, such as InfiniBand,
that can have round-trip latencies significanly faster than a single
clock tick.

For the RPC client, adopt the high resolution time stamp mechanism
already used by the network layer and blktrace: ktime.

We use ktime format time stamps for all internal computations, and
convert to milliseconds for presentation.  As a result, we need only
addition operations in the performance critical paths; multiply/divide
is required only for presentation.

We could report RTT metrics in microseconds.  In fact the mountstats
format is versioned to accomodate exactly this kind of interface
improvement.

For now, however, we'll stay with millisecond precision for
presentation to maintain backwards compatibility with the handful of
currently deployed user space tools.  At a later point, we'll move to
an API such as BDI_STATS where a finer timestamp precision can be
reported.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoktime: introduce ktime_to_ms()
Chuck Lever [Fri, 7 May 2010 17:34:37 +0000 (13:34 -0400)]
ktime: introduce ktime_to_ms()

To report ktime statistics to user space in milliseconds, a new helper
is required.

When considering how to do this conversion, I didn't immediately see
why the extra step of converting ktime to a timeval was needed.  To
make that more clear, introduce a couple of large comments.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: RPC metrics and RTT estimator should use same RTT value
Chuck Lever [Fri, 7 May 2010 17:34:27 +0000 (13:34 -0400)]
SUNRPC: RPC metrics and RTT estimator should use same RTT value

Compute an RPC request's RTT once, and use that value both for reporting
RPC metrics, and for adjusting the RTT context used by the RPC client's RTT
estimator algorithm.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Calldata for nfs4_renew_done()
Chuck Lever [Fri, 7 May 2010 17:34:17 +0000 (13:34 -0400)]
NFS: Calldata for nfs4_renew_done()

I'm about to change task->tk_start from a jiffies value to a ktime_t
value in order to make RPC RTT reporting more precise.

Recently (commit dc96aef9) nfs4_renew_done() started to reference
task->tk_start so that a jiffies value no longer had to be passed
from nfs4_proc_async_renew().  This allowed the calldata to point to
an nfs_client instead.

Changing task->tk_start to a ktime_t value makes it effectively
useless for renew timestamps, so we need to restore the pre-dc96aef9
logic that provided a jiffies "start" timestamp to nfs4_renew_done().

Both an nfs_client pointer and a timestamp need to be passed to
nfs4_renew_done(), so create a new nfs_renewdata structure that
contains both, resembling what is already done for delegreturn,
lock, and unlock.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Squelch compiler warning in nfs_add_server_stats()
Chuck Lever [Fri, 7 May 2010 17:34:08 +0000 (13:34 -0400)]
NFS: Squelch compiler warning in nfs_add_server_stats()

Clean up:

fs/nfs/iostat.h: In function ‘nfs_add_server_stats’:
fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions
fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions
fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions
fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions

Commit fce22848 replaced the open-coded per-cpu logic in several
functions in fs/nfs/iostat.h with a single invocation of
this_cpu_ptr().  This macro assumes its second argument is signed,
not unsigned.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Clean up fscache_uniq mount option
Chuck Lever [Fri, 7 May 2010 17:33:58 +0000 (13:33 -0400)]
NFS: Clean up fscache_uniq mount option

Clean up: fscache_uniq takes a string, so it should be included
with the other string mount option definitions, by convention.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Squelch compiler warning
Chuck Lever [Fri, 7 May 2010 17:33:48 +0000 (13:33 -0400)]
NFS: Squelch compiler warning

Seen with -Wextra:

/home/cel/linux/fs/nfs/fscache.c: In function ‘__nfs_readpages_from_fscache’:
/home/cel/linux/fs/nfs/fscache.c:479: warning: comparison between signed and unsigned integer expressions

The comparison implicitly converts "int" to "unsigned", making it
safe.  But there's no need for the implicit type conversions here, and
the dfprintk() already uses a "%u" formatter for "npages."  Better to
reduce confusion.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Trivial cleanups in include/linux/sunrpc/xdr.h
Chuck Lever [Fri, 7 May 2010 17:33:30 +0000 (13:33 -0400)]
SUNRPC: Trivial cleanups in include/linux/sunrpc/xdr.h

Clean up: Update the documenting comment, and fix some minor white
space issues.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Clean up the NFSv4 setclientid operation
Trond Myklebust [Fri, 16 Apr 2010 20:43:06 +0000 (16:43 -0400)]
NFSv4: Clean up the NFSv4 setclientid operation

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Allow attribute caching with 'noac' mounts if client holds a delegation
Trond Myklebust [Fri, 16 Apr 2010 20:42:46 +0000 (16:42 -0400)]
NFSv4: Allow attribute caching with 'noac' mounts if client holds a delegation

If the server has given us a delegation on a file, we _know_ that we can
cache the attribute information even when the user has specified 'noac'.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Fail over more quickly on connect errors
Trond Myklebust [Fri, 16 Apr 2010 20:42:12 +0000 (16:42 -0400)]
SUNRPC: Fail over more quickly on connect errors

We should not allow soft tasks to wait for longer than the major timeout
period when waiting for a reconnect to occur.

Remove the field xprt->connect_timeout since it has been obsoleted by
xprt->reestablish_timeout.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Move the test for XPRT_CONNECTING into xprt_connect()
Trond Myklebust [Fri, 16 Apr 2010 20:41:57 +0000 (16:41 -0400)]
SUNRPC: Move the test for XPRT_CONNECTING into xprt_connect()

This fixes a bug with setting xprt->stat.connect_start.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Cleanup - make rpc_new_task() call rpc_release_calldata on failure
Trond Myklebust [Fri, 16 Apr 2010 20:41:10 +0000 (16:41 -0400)]
SUNRPC: Cleanup - make rpc_new_task() call rpc_release_calldata on failure

Also have it return an ERR_PTR(-ENOMEM) instead of a null pointer.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Clean up xprt_release()
Trond Myklebust [Fri, 16 Apr 2010 20:37:01 +0000 (16:37 -0400)]
SUNRPC: Clean up xprt_release()

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Fix up the documentation for nfs_do_refmount
Trond Myklebust [Mon, 19 Apr 2010 23:26:23 +0000 (19:26 -0400)]
NFSv4: Fix up the documentation for nfs_do_refmount

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Replace nfsroot on-stack filehandle
Trond Myklebust [Mon, 19 Apr 2010 23:14:28 +0000 (19:14 -0400)]
NFS: Replace nfsroot on-stack filehandle

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Cleanup file handle allocations in fs/nfs/super.c
Trond Myklebust [Mon, 19 Apr 2010 23:05:48 +0000 (19:05 -0400)]
NFS: Cleanup file handle allocations in fs/nfs/super.c

Use the new helper functions instead of open coding.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Prevent the mount code from looping forever on broken exports
Trond Myklebust [Fri, 16 Apr 2010 20:22:52 +0000 (16:22 -0400)]
NFS: Prevent the mount code from looping forever on broken exports

Keep a global count of how many referrals that the current task has
traversed on a path lookup. Return ELOOP if the count exceeds
MAX_NESTED_LINKS.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs3_proc_getacl() and nfs3_proc_setacl()
Trond Myklebust [Fri, 16 Apr 2010 20:22:52 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs3_proc_getacl() and nfs3_proc_setacl()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs_statfs()
Trond Myklebust [Fri, 16 Apr 2010 20:22:52 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs_statfs()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs_setattr()
Trond Myklebust [Fri, 16 Apr 2010 20:22:52 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs_setattr()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs4_proc_create()
Trond Myklebust [Fri, 16 Apr 2010 20:22:51 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs4_proc_create()

Move the O_EXCL open handling into _nfs4_do_open() where it belongs. Doing
so also allows us to reuse the struct fattr from the opendata.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_proc_symlink()
Trond Myklebust [Fri, 16 Apr 2010 20:22:51 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_proc_symlink()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_proc_create
Trond Myklebust [Fri, 16 Apr 2010 20:22:51 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_proc_create

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_rmdir
Trond Myklebust [Fri, 16 Apr 2010 20:22:50 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_rmdir

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs_proc_remove()
Trond Myklebust [Fri, 16 Apr 2010 20:22:50 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs_proc_remove()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs3_proc_readlink()
Trond Myklebust [Fri, 16 Apr 2010 20:22:50 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs3_proc_readlink()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_link()
Trond Myklebust [Fri, 16 Apr 2010 20:22:49 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_link()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs_readdir()
Trond Myklebust [Fri, 16 Apr 2010 20:22:49 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs_readdir()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs3_proc_rename() and nfs4_proc_rename()
Trond Myklebust [Fri, 16 Apr 2010 20:22:49 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs3_proc_rename() and nfs4_proc_rename()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce stack footprint of nfs_revalidate_inode()
Trond Myklebust [Fri, 16 Apr 2010 20:22:49 +0000 (16:22 -0400)]
NFS: Reduce stack footprint of nfs_revalidate_inode()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Reduce stack footprint of nfs4_proc_access() and nfs3_proc_access()
Trond Myklebust [Fri, 16 Apr 2010 20:22:48 +0000 (16:22 -0400)]
NFSv4: Reduce stack footprint of nfs4_proc_access() and nfs3_proc_access()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Reduce the stack footprint of nfs4_remote_referral_get_sb
Trond Myklebust [Fri, 16 Apr 2010 20:22:48 +0000 (16:22 -0400)]
NFSv4: Reduce the stack footprint of nfs4_remote_referral_get_sb

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Reduce stack footprint of nfs4_get_root()
Trond Myklebust [Fri, 16 Apr 2010 20:22:48 +0000 (16:22 -0400)]
NFSv4: Reduce stack footprint of nfs4_get_root()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_follow_remote_path()
Trond Myklebust [Fri, 16 Apr 2010 20:22:48 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_follow_remote_path()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_lookup
Trond Myklebust [Fri, 16 Apr 2010 20:22:47 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_lookup

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Reduce the stack footprint of try_location()
Trond Myklebust [Fri, 16 Apr 2010 20:22:46 +0000 (16:22 -0400)]
NFSv4: Reduce the stack footprint of try_location()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_create_server
Trond Myklebust [Fri, 16 Apr 2010 20:22:46 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_create_server

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Reduce the stack footprint of nfs_follow_mountpoint()
Trond Myklebust [Fri, 16 Apr 2010 20:22:46 +0000 (16:22 -0400)]
NFS: Reduce the stack footprint of nfs_follow_mountpoint()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFSv4: Eliminate nfs4_path_walk()
Trond Myklebust [Fri, 16 Apr 2010 20:22:46 +0000 (16:22 -0400)]
NFSv4: Eliminate nfs4_path_walk()

All we really want is the ability to retrieve the root file handle. We no
longer need the ability to walk down the path, since that is now done in
nfs_follow_remote_path().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Add helper functions for allocating filehandles and fattr structs
Trond Myklebust [Fri, 16 Apr 2010 20:22:45 +0000 (16:22 -0400)]
NFS: Add helper functions for allocating filehandles and fattr structs

NFS Filehandles and struct fattr are really too large to be allocated on
the stack. This patch adds in a couple of helper functions to allocate them
dynamically instead.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Advertise rc4-hmac enctype support in the rpcsec_gss/krb5 upcall
Trond Myklebust [Thu, 8 Apr 2010 18:25:20 +0000 (14:25 -0400)]
gss_krb5: Advertise rc4-hmac enctype support in the rpcsec_gss/krb5 upcall

Update the upcall info indicating which Kerberos enctypes
the kernel supports

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Add support for rc4-hmac encryption
Kevin Coffman [Wed, 17 Mar 2010 17:03:06 +0000 (13:03 -0400)]
gss_krb5: Add support for rc4-hmac encryption

Add necessary changes to add kernel support for the rc4-hmac Kerberos
encryption type used by Microsoft and described in rfc4757.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Use confounder length in wrap code
Kevin Coffman [Wed, 17 Mar 2010 17:03:05 +0000 (13:03 -0400)]
gss_krb5: Use confounder length in wrap code

All encryption types use a confounder at the beginning of the
wrap token.  In all encryption types except arcfour-hmac, the
confounder is the same as the blocksize.  arcfour-hmac has a
blocksize of one, but uses an eight byte confounder.

Add an entry to the crypto framework definitions for the
confounder length and change the wrap/unwrap code to use
the confounder length rather than assuming it is always
the blocksize.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogssd_krb5: More arcfour-hmac support
Kevin Coffman [Wed, 17 Mar 2010 17:03:04 +0000 (13:03 -0400)]
gssd_krb5: More arcfour-hmac support

For the arcfour-hmac support, the make_seq_num and get_seq_num
functions need access to the kerberos context structure.
This will be used in a later patch.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Save the raw session key in the context
Kevin Coffman [Wed, 17 Mar 2010 17:03:03 +0000 (13:03 -0400)]
gss_krb5: Save the raw session key in the context

This is needed for deriving arcfour-hmac keys "on the fly"
using the sequence number or checksu

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogssd_krb5: arcfour-hmac support
Kevin Coffman [Wed, 17 Mar 2010 17:03:02 +0000 (13:03 -0400)]
gssd_krb5: arcfour-hmac support

For arcfour-hmac support, the make_checksum function needs a usage
field to correctly calculate the checksum differently for MIC and
WRAP tokens.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Advertise AES enctype support in the rpcsec_gss/krb5 upcall
Trond Myklebust [Thu, 8 Apr 2010 18:23:06 +0000 (14:23 -0400)]
gss_krb5: Advertise AES enctype support in the rpcsec_gss/krb5 upcall

Update upcall info indicating which Kerberos enctypes
the kernel supports

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: add remaining pieces to enable AES encryption support
Kevin Coffman [Wed, 17 Mar 2010 17:03:00 +0000 (13:03 -0400)]
gss_krb5: add remaining pieces to enable AES encryption support

Add the remaining pieces to enable support for Kerberos AES
encryption types.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: add support for new token formats in rfc4121
Kevin Coffman [Wed, 17 Mar 2010 17:02:59 +0000 (13:02 -0400)]
gss_krb5: add support for new token formats in rfc4121

This is a step toward support for AES encryption types which are
required to use the new token formats defined in rfc4121.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
[SteveD: Fixed a typo in gss_verify_mic_v2()]
Signed-off-by: Steve Dickson <steved@redhat.com>
[Trond: Got rid of the TEST_ROTATE/TEST_EXTRA_COUNT crap]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoxdr: Add an export for the helper function write_bytes_to_xdr_buf()
Kevin Coffman [Wed, 17 Mar 2010 17:02:58 +0000 (13:02 -0400)]
xdr: Add an export for the helper function write_bytes_to_xdr_buf()

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Advertise triple-des enctype support in the rpcsec_gss/krb5 upcall
Trond Myklebust [Thu, 8 Apr 2010 18:21:12 +0000 (14:21 -0400)]
gss_krb5: Advertise triple-des enctype support in the rpcsec_gss/krb5 upcall

Update the upcall info indicating which Kerberos enctypes the kernel
supports.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: add support for triple-des encryption
Kevin Coffman [Wed, 17 Mar 2010 17:02:55 +0000 (13:02 -0400)]
gss_krb5: add support for triple-des encryption

Add the final pieces to support the triple-des encryption type.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Add upcall info indicating supported kerberos enctypes
Trond Myklebust [Thu, 8 Apr 2010 18:09:58 +0000 (14:09 -0400)]
gss_krb5: Add upcall info indicating supported kerberos enctypes

The text based upcall now indicates which Kerberos encryption types are
supported by the kernel rpcsecgss code.  This is used by gssd to
determine which encryption types it should attempt to negotiate
when creating a context with a server.

The server principal's database and keytab encryption types are
what limits what it should negotiate.  Therefore, its keytab
should be created with only the enctypes listed by this file.

Currently we support des-cbc-crc, des-cbc-md4 and des-cbc-md5

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: handle new context format from gssd
Kevin Coffman [Wed, 17 Mar 2010 17:02:54 +0000 (13:02 -0400)]
gss_krb5: handle new context format from gssd

For encryption types other than DES, gssd sends down context information
in a new format.  This new format includes the information needed to
support the new Kerberos GSS-API tokens defined in rfc4121.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: import functionality to derive keys into the kernel
Kevin Coffman [Wed, 17 Mar 2010 17:02:53 +0000 (13:02 -0400)]
gss_krb5: import functionality to derive keys into the kernel

Import the code to derive Kerberos keys from a base key into the
kernel.  This will allow us to change the format of the context
information sent down from gssd to include only a single key.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: add ability to have a keyed checksum (hmac)
Kevin Coffman [Wed, 17 Mar 2010 17:02:52 +0000 (13:02 -0400)]
gss_krb5: add ability to have a keyed checksum (hmac)

Encryption types besides DES may use a keyed checksum (hmac).
Modify the make_checksum() function to allow for a key
and take care of enctype-specific processing such as truncating
the resulting hash.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: introduce encryption type framework
Kevin Coffman [Wed, 17 Mar 2010 17:02:51 +0000 (13:02 -0400)]
gss_krb5: introduce encryption type framework

Add enctype framework and change functions to use the generic
values from it rather than the values hard-coded for des.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: prepare for new context format
Kevin Coffman [Wed, 17 Mar 2010 17:02:50 +0000 (13:02 -0400)]
gss_krb5: prepare for new context format

Prepare for new context format by splitting out the old "v1"
context processing function

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: split up functions in preparation of adding new enctypes
Kevin Coffman [Wed, 17 Mar 2010 17:02:49 +0000 (13:02 -0400)]
gss_krb5: split up functions in preparation of adding new enctypes

Add encryption type to the krb5 context structure and use it to switch
to the correct functions depending on the encryption type.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Don't expect blocksize to always be 8 when calculating padding
J. Bruce Fields [Wed, 17 Mar 2010 17:02:48 +0000 (13:02 -0400)]
gss_krb5: Don't expect blocksize to always be 8 when calculating padding

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Added and improved code comments
Kevin Coffman [Wed, 17 Mar 2010 17:02:47 +0000 (13:02 -0400)]
gss_krb5: Added and improved code comments

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agogss_krb5: Introduce encryption type framework
Kevin Coffman [Wed, 17 Mar 2010 17:02:46 +0000 (13:02 -0400)]
gss_krb5: Introduce encryption type framework

Make the client and server code consistent regarding the extra buffer
space made available for the auth code when wrapping data.

Add some comments/documentation about the available buffer space
in the xdr_buf head and tail when gss_wrap is called.

Add a compile-time check to make sure we are not exceeding the available
buffer space.

Add a central function to shift head data.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoMerge branch 'for-linus' of git://git.infradead.org/users/eparis/notify
Linus Torvalds [Fri, 14 May 2010 18:49:42 +0000 (11:49 -0700)]
Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notify

* 'for-linus' of git://git.infradead.org/users/eparis/notify:
  inotify: don't leak user struct on inotify release
  inotify: race use after free/double free in inotify inode marks
  inotify: clean up the inotify_add_watch out path
  Inotify: undefined reference to `anon_inode_getfd'

Manual merge to remove duplicate "select ANON_INODES" from Kconfig file

13 years agoMerge branch 'davinci-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 14 May 2010 18:43:52 +0000 (11:43 -0700)]
Merge branch 'davinci-fixes-for-linus-2' of git://git./linux/kernel/git/khilman/linux-davinci

* 'davinci-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci:
  DA830: fix USB 2.0 clock entry

13 years agoDA830: fix USB 2.0 clock entry
Sergei Shtylyov [Thu, 13 May 2010 18:51:51 +0000 (22:51 +0400)]
DA830: fix USB 2.0 clock entry

DA8xx OHCI driver fails to load due to failing clk_get() call for the USB 2.0
clock. Arrange matching USB 2.0 clock by the clock name instead of the device.
(Adding another CLK() entry for "ohci.0" device won't do -- in the future I'll
also have to enable USB 2.0 clock to configure CPPI 4.1 module, in which case
I won't have any device at all.)

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
13 years agoinotify: don't leak user struct on inotify release
Pavel Emelyanov [Wed, 12 May 2010 22:34:07 +0000 (15:34 -0700)]
inotify: don't leak user struct on inotify release

inotify_new_group() receives a get_uid-ed user_struct and saves the
reference on group->inotify_data.user.  The problem is that free_uid() is
never called on it.

Issue seem to be introduced by 63c882a0 (inotify: reimplement inotify
using fsnotify) after 2.6.30.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Eric Paris <eparis@parisplace.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
13 years agoinotify: race use after free/double free in inotify inode marks
Eric Paris [Tue, 11 May 2010 21:17:40 +0000 (17:17 -0400)]
inotify: race use after free/double free in inotify inode marks

There is a race in the inotify add/rm watch code.  A task can find and
remove a mark which doesn't have all of it's references.  This can
result in a use after free/double free situation.

Task A Task B
------------ -----------
inotify_new_watch()
 allocate a mark (refcnt == 1)
 add it to the idr
inotify_rm_watch()
 inotify_remove_from_idr()
  fsnotify_put_mark()
      refcnt hits 0, free
 take reference because we are on idr
 [at this point it is a use after free]
 [time goes on]
 refcnt may hit 0 again, double free

The fix is to take the reference BEFORE the object can be found in the
idr.

Signed-off-by: Eric Paris <eparis@redhat.com>
Cc: <stable@kernel.org>
13 years agoinotify: clean up the inotify_add_watch out path
Eric Paris [Tue, 11 May 2010 21:16:23 +0000 (17:16 -0400)]
inotify: clean up the inotify_add_watch out path

inotify_add_watch explictly frees the unused inode mark, but it can just
use the generic code.  Just do that.

Signed-off-by: Eric Paris <eparis@redhat.com>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 14 May 2010 14:56:45 +0000 (07:56 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  vhost: fix barrier pairing

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Fri, 14 May 2010 14:55:42 +0000 (07:55 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  mmap_min_addr check CAP_SYS_RAWIO only for write

13 years agoMerge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze
Linus Torvalds [Fri, 14 May 2010 14:29:29 +0000 (07:29 -0700)]
Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze

* 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Fix module loading on system with WB cache
  microblaze: export assembly functions used by modules
  microblaze: Remove powerpc code from Microblaze port
  microblaze: Remove compilation warnings in cache macro
  microblaze: export assembly functions used by modules
  microblaze: fix get_user/put_user side-effects
  microblaze: re-enable interrupts before calling schedule

13 years agoMerge branch 'net-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
David S. Miller [Fri, 14 May 2010 10:42:49 +0000 (03:42 -0700)]
Merge branch 'net-2.6' of git://git./linux/kernel/git/mst/vhost

13 years agommap_min_addr check CAP_SYS_RAWIO only for write
Kees Cook [Thu, 22 Apr 2010 19:19:17 +0000 (12:19 -0700)]
mmap_min_addr check CAP_SYS_RAWIO only for write

Redirecting directly to lsm, here's the patch discussed on lkml:
http://lkml.org/lkml/2010/4/22/219

The mmap_min_addr value is useful information for an admin to see without
being root ("is my system vulnerable to kernel NULL pointer attacks?") and
its setting is trivially easy for an attacker to determine by calling
mmap() in PAGE_SIZE increments starting at 0, so trying to keep it private
has no value.

Only require CAP_SYS_RAWIO if changing the value, not reading it.

Comment from Serge :

  Me, I like to write my passwords with light blue pen on dark blue
  paper, pasted on my window - if you're going to get my password, you're
  gonna get a headache.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
(cherry picked from commit 822cceec7248013821d655545ea45d1c6a9d15b3)

13 years agomicroblaze: Fix module loading on system with WB cache
Michal Simek [Fri, 14 May 2010 05:40:46 +0000 (07:40 +0200)]
microblaze: Fix module loading on system with WB cache

There is necessary to flush whole dcache. Icache work should be
done in kernel/module.c.

Signed-off-by: Michal Simek <monstr@monstr.eu>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Thu, 13 May 2010 21:48:10 +0000 (14:48 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sameo/mfd-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: Clean up after WM83xx AUXADC interrupt if it arrives late

13 years agoMerge branch 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Thu, 13 May 2010 21:36:19 +0000 (14:36 -0700)]
Merge branch 'kvm-updates/2.6.34' of git://git./virt/kvm/kvm

* 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: PPC: Keep index within boundaries in kvmppc_44x_emul_tlbwe()
  KVM: VMX: blocked-by-sti must not defer NMI injections
  KVM: x86: Call vcpu_load and vcpu_put in cpuid_update
  KVM: SVM: Fix wrong intercept masks on 32 bit
  KVM: convert ioapic lock to spinlock

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
Linus Torvalds [Thu, 13 May 2010 19:21:44 +0000 (12:21 -0700)]
Merge git://git./linux/kernel/git/gregkh/tty-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
  serial: imx.c: fix CTS trigger level lower to avoid lost chars
  tty: Fix unbalanced BKL handling in error path
  serial: mpc52xx_uart: fix null pointer dereference

13 years agoserial: imx.c: fix CTS trigger level lower to avoid lost chars
Valentin Longchamp [Wed, 5 May 2010 09:47:07 +0000 (11:47 +0200)]
serial: imx.c: fix CTS trigger level lower to avoid lost chars

The imx CTS trigger level is left at its reset value that is 32
chars. Since the RX FIFO has 32 entries, when CTS is raised, the
FIFO already is full. However, some serial port devices first empty
their TX FIFO before stopping when CTS is raised, resulting in lost
chars.

This patch sets the trigger level lower so that other chars arrive
after CTS is raised, there is still room for 16 of them.

Signed-off-by: Valentin Longchamp<valentin.longchamp@epfl.ch>
Tested-by: Philippe Rétornaz<philippe.retornaz@epfl.ch>
Acked-by: Wolfram Sang<w.sang@pengutronix.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: Fix unbalanced BKL handling in error path
Alan Cox [Tue, 4 May 2010 19:42:36 +0000 (20:42 +0100)]
tty: Fix unbalanced BKL handling in error path

Arnd noted:

After the "retry_open:" label, we first get the tty_mutex
and then the BKL. However a the end of tty_open, we jump
back to retry_open with the BKL still held. If we run into
this case, the tty_open function will be left with the BKL
still held.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: mpc52xx_uart: fix null pointer dereference
Anatolij Gustschin [Tue, 4 May 2010 22:18:59 +0000 (00:18 +0200)]
serial: mpc52xx_uart: fix null pointer dereference

Commit 6acc6833510db8f72b5ef343296d97480555fda9
introduced NULL pointer dereference and kernel crash
on ppc32 machines while booting. Fix this bug now.

Reported-by: Leonardo Chiquitto <leonardo.lists@gmail.com>
Tested-by: Leonardo Chiquitto <leonardo.lists@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench...
Linus Torvalds [Thu, 13 May 2010 17:36:16 +0000 (10:36 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sfrench/cifs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  cifs: guard against hardlinking directories

13 years agovfs: Fix O_NOFOLLOW behavior for paths with trailing slashes
Jan Kara [Thu, 13 May 2010 10:52:57 +0000 (12:52 +0200)]
vfs: Fix O_NOFOLLOW behavior for paths with trailing slashes

According to specification

mkdir d; ln -s d a; open("a/", O_NOFOLLOW | O_RDONLY)

should return success but currently it returns ELOOP.  This is a
regression caused by path lookup cleanup patch series.

Fix the code to ignore O_NOFOLLOW in case the provided path has trailing
slashes.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Marius Tolzmann <tolzmann@molgen.mpg.de>
Acked-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Thu, 13 May 2010 14:35:26 +0000 (07:35 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ice1724 - Fix ESI Maya44 capture source control
  ALSA: pcm - Use pgprot_noncached() for MIPS non-coherent archs
  ALSA: virtuoso: fix Xonar D1/DX front panel microphone
  ALSA: hda - Add hp-dv4 model for IDT 92HD71bx
  ALSA: hda - Fix mute-LED GPIO pin for HP dv series
  ALSA: hda: Fix 0 dB for Lenovo models using Conexant CX20549 (Venice)

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Thu, 13 May 2010 14:28:43 +0000 (07:28 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ad7877 - keep dma rx buffers in seperate cache lines
  Input: psmouse - reset all types of mice before reconnecting
  Input: elantech - use all 3 bytes when checking version
  Input: iforce - fix Guillemot Jet Leader 3D entry
  Input: iforce - add Guillemot Jet Leader Force Feedback

13 years agomfd: Clean up after WM83xx AUXADC interrupt if it arrives late
Mark Brown [Fri, 2 Apr 2010 12:08:39 +0000 (13:08 +0100)]
mfd: Clean up after WM83xx AUXADC interrupt if it arrives late

In certain circumstances, especially under heavy load, the AUXADC
completion interrupt may be detected after we've timed out waiting for
it.  That conversion would still succeed but the next conversion will
see the completion that was signalled by the interrupt for the previous
conversion and therefore not wait for the AUXADC conversion to run,
causing it to report failure.

Provide a simple, non-invasive cleanup by using try_wait_for_completion()
to ensure that the completion is not signalled before we wait.  Since
the AUXADC is run within a mutex we know there can only have been at
most one AUXADC interrupt outstanding.  A more involved change should
follow for the next merge window.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
13 years agomicroblaze: export assembly functions used by modules
Michal Simek [Thu, 13 May 2010 10:11:42 +0000 (12:11 +0200)]
microblaze: export assembly functions used by modules

Export __strncpy_user, memory_size, ioremap_bot for modules.

Signed-off-by: Michal Simek <monstr@monstr.eu>
13 years agomicroblaze: Remove powerpc code from Microblaze port
Michal Simek [Thu, 13 May 2010 10:09:54 +0000 (12:09 +0200)]
microblaze: Remove powerpc code from Microblaze port

Remove eeh_add_device_tree_late which is powerpc specific code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
13 years agomicroblaze: Remove compilation warnings in cache macro
Michal Simek [Thu, 13 May 2010 08:55:47 +0000 (10:55 +0200)]
microblaze: Remove compilation warnings in cache macro

CC      arch/microblaze/kernel/cpu/cache.o
arch/microblaze/kernel/cpu/cache.c: In function '__invalidate_dcache_range_wb':
arch/microblaze/kernel/cpu/cache.c:398: warning: ISO C90 forbids mixed declarations and code
arch/microblaze/kernel/cpu/cache.c: In function '__flush_dcache_range_wb':
arch/microblaze/kernel/cpu/cache.c:509: warning: ISO C90 forbids mixed declara

Signed-off-by: Michal Simek <monstr@monstr.eu>
13 years agomicroblaze: export assembly functions used by modules
Steven J. Magnani [Tue, 27 Apr 2010 18:00:35 +0000 (13:00 -0500)]
microblaze: export assembly functions used by modules

Modules that use copy_{to,from}_user(), memcpy(), and memset() fail to build
in certain circumstances.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
13 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Thu, 13 May 2010 08:07:15 +0000 (10:07 +0200)]
Merge branch 'fix/hda' into for-linus

13 years agoInput: ad7877 - keep dma rx buffers in seperate cache lines
Oskar Schirmer [Thu, 13 May 2010 07:42:23 +0000 (00:42 -0700)]
Input: ad7877 - keep dma rx buffers in seperate cache lines

With dma based spi transmission, data corruption is observed
occasionally. With dma buffers located right next to msg and
xfer fields, cache lines correctly flushed in preparation for
dma usage may be polluted again when writing to fields in the
same cache line.

Make sure cache fields used with dma do not share cache lines
with fields changed during dma handling. As both fields are part
of a struct that is allocated via kzalloc, thus cache aligned,
moving the fields to the 1st position and insert padding for
alignment does the job.

Signed-off-by: Oskar Schirmer <os@emlix.com>
Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Oliver Schneidewind <osw@emlix.com>
Signed-off-by: Johannes Weiner <jw@emlix.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
[dtor@mail.ru - changed to use ___cacheline_aligned as suggested
 by akpm]
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>