platform/kernel/linux-exynos.git
8 years agoOrangefs: improve gossip statements
Mike Marshall [Thu, 3 Mar 2016 18:46:48 +0000 (13:46 -0500)]
Orangefs: improve gossip statements

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: update orangefs.txt
Mike Marshall [Fri, 26 Feb 2016 19:39:08 +0000 (14:39 -0500)]
Orangefs: update orangefs.txt

Al Viro has cleaned up the way ops are processed and waited for,
now orangefs.txt has an overview of how it works. Several recent
related commits have added to the comments in the code as well.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: code sanitation.
Mike Marshall [Fri, 26 Feb 2016 15:21:12 +0000 (10:21 -0500)]
Orangefs: code sanitation.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: remove unused 'diff' function
Arnd Bergmann [Fri, 26 Feb 2016 12:54:09 +0000 (13:54 +0100)]
orangefs: remove unused 'diff' function

orangefs contains a helper function to calculate the difference
between two timeval structures. We are trying to remove all
instances of timespec from the kernel, and this one is not
used at all, so let's remove it now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: avoid time conversion function
Arnd Bergmann [Fri, 26 Feb 2016 12:54:10 +0000 (13:54 +0100)]
orangefs: avoid time conversion function

The new orangefs code uses a helper function to read a time field to
its private structures from struct iattr. This will conflict with the
move to 64-bit timestamps in the kernel and is generally not necessary.

This replaces the conversion with a simple cast to time64_t that shows
what is going on. As the orangefs-internal representation already uses
64-bit timestamps, there should be no ambiguity to negative values,
and the cast ensures that we treat them as times before 1970 on both
32-bit and 64-bit architectures, rather than times after 2038. This
patch keeps that behavior.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: clean up fill_default_sys_attrs
Martin Brandenburg [Sat, 20 Feb 2016 20:28:58 +0000 (15:28 -0500)]
orangefs: clean up fill_default_sys_attrs

Size and type are read-only and not in the mask. The times were left
unset despite being in the mask.

We zero-fill the times since the server will fill them in and we will
get the correct time when we fill the inode with getattr.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: we never lookup with sym_follow set
Martin Brandenburg [Sat, 20 Feb 2016 19:47:13 +0000 (14:47 -0500)]
orangefs: we never lookup with sym_follow set

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: remove vestigial async io code
Martin Brandenburg [Sat, 20 Feb 2016 19:26:01 +0000 (14:26 -0500)]
orangefs: remove vestigial async io code

I have verified that there is nothing in the userspace daemon version we
are implementing this protocol against that ever looks at this field.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: use ORANGEFS_NAME_LEN everywhere; remove ORANGEFS_NAME_MAX
Martin Brandenburg [Sat, 20 Feb 2016 19:22:40 +0000 (14:22 -0500)]
orangefs: use ORANGEFS_NAME_LEN everywhere; remove ORANGEFS_NAME_MAX

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: don't d_drop in d_revalidate since the caller will
Martin Brandenburg [Sat, 20 Feb 2016 18:10:47 +0000 (13:10 -0500)]
orangefs: don't d_drop in d_revalidate since the caller will

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: free readdir buffer index before the dir_emit loop
Martin Brandenburg [Wed, 17 Feb 2016 17:55:42 +0000 (12:55 -0500)]
orangefs: free readdir buffer index before the dir_emit loop

We only need it while the service operation is actually in progress
since it is only used to co-ordinate the client-core's memory use. The
kernel allocates its own space.

Also clean up some comments which mislead the reader into thinking
the readdir buffers are shared memory.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: code sanitation
Mike Marshall [Wed, 24 Feb 2016 21:54:27 +0000 (16:54 -0500)]
Orangefs: code sanitation

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: clean up orangefs_kernel_op_s comments.
Mike Marshall [Wed, 24 Feb 2016 18:24:14 +0000 (13:24 -0500)]
Orangefs: clean up orangefs_kernel_op_s comments.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: get rid of op refcounts
Al Viro [Fri, 19 Feb 2016 00:17:51 +0000 (19:17 -0500)]
orangefs: get rid of op refcounts

not needed anymore

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: have ..._clean_interrupted_...() wait for copy to/from daemon
Al Viro [Thu, 18 Feb 2016 23:59:44 +0000 (18:59 -0500)]
orangefs: have ..._clean_interrupted_...() wait for copy to/from daemon

* turn all those list_del(&op->list) into list_del_init()
* don't pick ops that are already given up in control device
  ->read()/->write_iter().
* have orangefs_clean_interrupted_operation() notice if op is currently
  being copied to/from daemon (by said ->read()/->write_iter()) and
  wait for that to finish.
* when we are done copying to/from daemon and find that it had been
  given up while we were doing that, wake the waiting ..._clean_interrupted_...

As the result, we are guaranteed that orangefs_clean_interrupted_operation(op)
doesn't return until nobody else can see op.  Moreover, we don't need to play
with op refcounts anymore.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: set correct ->downcall.status on failing to copy reply from daemon
Al Viro [Thu, 18 Feb 2016 23:53:41 +0000 (18:53 -0500)]
orangefs: set correct ->downcall.status on failing to copy reply from daemon

... and clean the end of control device ->write_iter() while we are at it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: remove vestigial ASYNC code
Mike Marshall [Tue, 16 Feb 2016 22:10:28 +0000 (17:10 -0500)]
Orangefs: remove vestigial ASYNC code

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: make some gossip statements more helpful.
Mike Marshall [Tue, 16 Feb 2016 22:09:09 +0000 (17:09 -0500)]
Orangefs: make some gossip statements more helpful.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: get rid of op->done
Al Viro [Sun, 14 Feb 2016 02:06:50 +0000 (21:06 -0500)]
orangefs: get rid of op->done

shouldn't be needed now

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs_readdir_index_put(): get rid of bufmap argument
Al Viro [Sun, 14 Feb 2016 02:04:51 +0000 (21:04 -0500)]
orangefs_readdir_index_put(): get rid of bufmap argument

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: bufmap rewrite
Al Viro [Sun, 14 Feb 2016 02:01:21 +0000 (21:01 -0500)]
orangefs: bufmap rewrite

new waiting-for-slot logics:
* make request for slot wait for bufmap to be set up if it
comes before it's installed *OR* while it's running down
* make closing control device wait for all slots to be freed
* waiting itself rewritten to (open-coded) analogues of wait_event_...
primitives - we would need wait_event_locked() and, pardon an obscenely
long name, wait_event_interruptible_exclusive_timeout_locked().
* we never wait for more than slot_timeout_secs in total and,
if during the wait the daemon goes away, we only allow
ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS for it to come back.
* (cosmetical) bitmap is used instead of an array of zeroes and ones
* old (and only reached if we are about to corrupt memory) waiting
for daemon restart in service_operation() removed.

[Martin's fixes folded]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs_bufmap_..._query(): don't bother with refcounts
Al Viro [Sat, 13 Feb 2016 16:16:37 +0000 (11:16 -0500)]
orangefs_bufmap_..._query(): don't bother with refcounts

... just hold the spinlock while fetching the field in question.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: lift handling of timeouts and attempts count to service_operation()
Al Viro [Sat, 13 Feb 2016 16:04:19 +0000 (11:04 -0500)]
orangefs: lift handling of timeouts and attempts count to service_operation()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoservice_operation(): don't block signals, just use ..._killable
Al Viro [Sat, 13 Feb 2016 15:49:24 +0000 (10:49 -0500)]
service_operation(): don't block signals, just use ..._killable

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: sanitize handling of request list
Al Viro [Sat, 13 Feb 2016 15:38:23 +0000 (10:38 -0500)]
orangefs: sanitize handling of request list

* checking that daemon is running (to decide whether we want to limit
the timeout) should be done *after* the damn thing is included into
the list; doing that before means that if the daemon gets shut down
in between, we'll end up waiting indefinitely (== up to kill -9).

* cancels should go into the head of the queue - the sooner they
are picked, the less work daemon has to do and the sooner we get to
free the slot held by aborted operation.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: get rid of loop in wait_for_matching_downcall()
Al Viro [Sat, 13 Feb 2016 15:15:22 +0000 (10:15 -0500)]
orangefs: get rid of loop in wait_for_matching_downcall()

turn op->waitq into struct completion...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: use S_ISREG(mode) and friends instead of mode & S_IFREG.
Martin Brandenburg [Fri, 5 Feb 2016 21:37:00 +0000 (16:37 -0500)]
orangefs: use S_ISREG(mode) and friends instead of mode & S_IFREG.

Suggestion from Dan Carpenter.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: delay freeing slot until cancel completes
Al Viro [Fri, 12 Feb 2016 04:07:19 +0000 (23:07 -0500)]
orangefs: delay freeing slot until cancel completes

Make cancels reuse the aborted read/write op, to make sure they do not
fail on lack of memory.

Don't issue a cancel unless the daemon has seen our read/write, has not
replied and isn't being shut down.

If cancel *is* issued, don't wait for it to complete; stash the slot
in there and just have it freed when cancel is finally replied to or
purged (and delay dropping the reference until then, obviously).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoget rid of bufmap argument of orangefs_bufmap_put()
Al Viro [Fri, 12 Feb 2016 02:34:52 +0000 (21:34 -0500)]
get rid of bufmap argument of orangefs_bufmap_put()

it's always equal to __orangefs_bufmap and the latter can't change
until we are done

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: get rid of handle_io_error()
Al Viro [Fri, 12 Feb 2016 02:28:52 +0000 (21:28 -0500)]
orangefs: get rid of handle_io_error()

the second caller never needs to cancel, actually

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: wait_for_direct_io(): restore the position in iter when restarting
Al Viro [Sun, 7 Feb 2016 06:25:06 +0000 (01:25 -0500)]
orangefs: wait_for_direct_io(): restore the position in iter when restarting

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: avoid freeing a slot twice in wait_for_direct_io()
Al Viro [Sat, 6 Feb 2016 19:59:38 +0000 (14:59 -0500)]
orangefs: avoid freeing a slot twice in wait_for_direct_io()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: added a couple of WARN_ONs, perhaps just temporarily.
Mike Marshall [Thu, 4 Feb 2016 21:28:31 +0000 (16:28 -0500)]
Orangefs: added a couple of WARN_ONs, perhaps just temporarily.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: Do not retrieve size from servers unless it it necessary.
Martin Brandenburg [Wed, 3 Feb 2016 21:56:24 +0000 (16:56 -0500)]
orangefs: Do not retrieve size from servers unless it it necessary.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: Implement inode_operations->permission().
Martin Brandenburg [Sat, 30 Jan 2016 18:46:54 +0000 (13:46 -0500)]
orangefs: Implement inode_operations->permission().

Thus d_revalidate is not obliged to check on as much, which will
eventually lead the way to hammering the filesystem servers much less.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: Only compare attributes specified in orangefs_inode_getattr.
Martin Brandenburg [Sat, 30 Jan 2016 18:46:11 +0000 (13:46 -0500)]
orangefs: Only compare attributes specified in orangefs_inode_getattr.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: clean up slab allocation.
Mike Marshall [Thu, 4 Feb 2016 18:48:16 +0000 (13:48 -0500)]
Orangefs: clean up slab allocation.

A couple of caches were no longer needed:

 - iov_iter improvements to orangefs_devreq_write_iter eliminated
   the need for the dev_req_cache.

 - removal (months ago) of the old AIO code eliminated the need
   for the kiocb_cache.

Also, deobfuscation of use of GFP_KERNEL when calling kmem_cache_(z)alloc
for remaining caches.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: improve gossip statement
Mike Marshall [Thu, 4 Feb 2016 18:29:27 +0000 (13:29 -0500)]
Orangefs: improve gossip statement

There were two just alike, making it hard maybe to tell which one
you were looking at in syslog... so I changed it a little by adding
some extra interesting tidbits to it...

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: Fix revalidate.
Martin Brandenburg [Thu, 28 Jan 2016 15:19:40 +0000 (10:19 -0500)]
orangefs: Fix revalidate.

Previously, it would update a live inode. This was fixed, but it did not
ever check that the inode attributes in the dcache are correct. This
checks all inode attributes and rejects any that are not correct, which
causes a lookup and thus a new getattr.

Perhaps inode_operations->permission should replace or augment some of
this.

There is no actual caching, and this does a rather excessive amount of
network operations back to the filesystem server.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: Util functions shouldn't operate on inode where it can be avoided.
Martin Brandenburg [Mon, 25 Jan 2016 20:33:39 +0000 (15:33 -0500)]
orangefs: Util functions shouldn't operate on inode where it can be avoided.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: clean up op_alloc()
Al Viro [Sat, 23 Jan 2016 19:04:31 +0000 (14:04 -0500)]
orangefs: clean up op_alloc()

fold orangefs_op_initialize() in there, don't bother locking something
nobody else could've seen yet, use kmem_cache_zalloc() instead of
explicit memset()...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: move handle_io_error() to file.c
Al Viro [Sat, 23 Jan 2016 18:50:37 +0000 (13:50 -0500)]
orangefs: move handle_io_error() to file.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: don't reinvent completion.h...
Al Viro [Sat, 23 Jan 2016 18:45:46 +0000 (13:45 -0500)]
orangefs: don't reinvent completion.h...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoif ORANGEFS_VFS_OP_FILE_IO request had been given up, don't bother waiting
Al Viro [Sat, 23 Jan 2016 18:27:50 +0000 (13:27 -0500)]
if ORANGEFS_VFS_OP_FILE_IO request had been given up, don't bother waiting

... we are not going to get woken up anyway, so it's just going to time out
and whine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: get rid of MSECS_TO_JIFFIES
Al Viro [Sat, 23 Jan 2016 18:17:55 +0000 (13:17 -0500)]
orangefs: get rid of MSECS_TO_JIFFIES

All timeouts are in _seconds_, so all calls are of form
MSECS_TO_JIFFIES(n * 1000), which is a convoluted way to
spell n * HZ.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs_clean_up_interrupted_operation: call with op->lock held
Al Viro [Sat, 23 Jan 2016 18:09:05 +0000 (13:09 -0500)]
orangefs_clean_up_interrupted_operation: call with op->lock held

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: reduce nesting in wait_for_matching_downcall()
Al Viro [Sat, 23 Jan 2016 18:04:19 +0000 (13:04 -0500)]
orangefs: reduce nesting in wait_for_matching_downcall()

reorder if branches...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: remove cargo-culting spin_lock_irqsave() in service_operation()
Al Viro [Sat, 23 Jan 2016 17:26:56 +0000 (12:26 -0500)]
orangefs: remove cargo-culting spin_lock_irqsave() in service_operation()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: hopefully saner op refcounting and locking
Al Viro [Sat, 23 Jan 2016 00:47:47 +0000 (19:47 -0500)]
orangefs: hopefully saner op refcounting and locking

* create with refcount 1
* make op_release() decrement and free if zero (i.e. old put_op()
  has become that).
* mark when submitter has given up waiting; from that point nobody
  else can move between the lists, change state, etc.
* have daemon read/write_iter grab a reference when picking op
  and *always* give it up in the end
* don't put into hash until we know it's been successfully passed to
  daemon

* move op->lock _lower_ than htab_in_progress_lock (and make sure
  to take it in purge_inprogress_ops())

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: make sure that reopening pvfs2-req won't overlap with the end of close
Al Viro [Sat, 23 Jan 2016 00:46:08 +0000 (19:46 -0500)]
orangefs: make sure that reopening pvfs2-req won't overlap with the end of close

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: nothing should remain in request list and in hash
Al Viro [Fri, 22 Jan 2016 18:34:32 +0000 (13:34 -0500)]
orangefs: nothing should remain in request list and in hash

... otherwise some thread is running in .text that is about to
be freed.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: move wakeups into set_op_state_{serviced,purged}()
Al Viro [Fri, 22 Jan 2016 04:17:37 +0000 (23:17 -0500)]
orangefs: move wakeups into set_op_state_{serviced,purged}()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: make wait_for_...downcall() static
Al Viro [Fri, 22 Jan 2016 03:58:58 +0000 (22:58 -0500)]
orangefs: make wait_for_...downcall() static

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: move wakeups into set_op_state_{serviced,purged}()
Al Viro [Fri, 22 Jan 2016 04:17:37 +0000 (23:17 -0500)]
orangefs: move wakeups into set_op_state_{serviced,purged}()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: make wait_for_...downcall() static
Al Viro [Fri, 22 Jan 2016 03:58:58 +0000 (22:58 -0500)]
orangefs: make wait_for_...downcall() static

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agomake orangefs_clean_up_interrupted_operation() static
Al Viro [Fri, 22 Jan 2016 03:21:41 +0000 (22:21 -0500)]
make orangefs_clean_up_interrupted_operation() static

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: kill orangefs_inode_s ->list
Al Viro [Fri, 22 Jan 2016 02:55:47 +0000 (21:55 -0500)]
orangefs: kill orangefs_inode_s ->list

no users...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: get rid of <censored> macros
Al Viro [Tue, 19 Jan 2016 17:26:13 +0000 (12:26 -0500)]
orangefs: get rid of <censored> macros

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: ->poll() doesn't need spinlock
Al Viro [Tue, 19 Jan 2016 17:07:49 +0000 (12:07 -0500)]
orangefs: ->poll() doesn't need spinlock

not just for list_empty()...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: kill ioctl32 rudiments
Al Viro [Tue, 19 Jan 2016 17:05:47 +0000 (12:05 -0500)]
orangefs: kill ioctl32 rudiments

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: ->poll() is only called between successful ->open() and ->release()
Al Viro [Tue, 19 Jan 2016 17:03:05 +0000 (12:03 -0500)]
orangefs: ->poll() is only called between successful ->open() and ->release()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: generic_file_open() is pointless for character devices
Al Viro [Tue, 19 Jan 2016 17:00:26 +0000 (12:00 -0500)]
orangefs: generic_file_open() is pointless for character devices

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoorangefs: use DEFINE_MUTEX (and mutex_init() had been too late)
Al Viro [Tue, 19 Jan 2016 16:33:40 +0000 (11:33 -0500)]
orangefs: use DEFINE_MUTEX (and mutex_init() had been too late)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: make gossip statement more palatable to xtensa
Mike Marshall [Tue, 19 Jan 2016 17:04:40 +0000 (12:04 -0500)]
Orangefs: make gossip statement more palatable to xtensa

Thanks to Intel's kbuild test robot

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: merge with V4.4
Mike Marshall [Fri, 15 Jan 2016 19:22:14 +0000 (14:22 -0500)]
Orangefs: merge with V4.4

Merge tag 'v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into current

Linux 4.4

8 years agoOrangefs: add verification to decode_dirents
Mike Marshall [Fri, 15 Jan 2016 18:10:52 +0000 (13:10 -0500)]
Orangefs: add verification to decode_dirents

Also add comments to decode_dirents and make it more readable.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: add protocol information to Documentation/filesystems/orangefs.txt
Mike Marshall [Wed, 13 Jan 2016 19:28:13 +0000 (14:28 -0500)]
Orangefs: add protocol information to Documentation/filesystems/orangefs.txt

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: make .statfs gossip_debug more complete.
Mike Marshall [Wed, 13 Jan 2016 16:38:14 +0000 (11:38 -0500)]
Orangefs: make .statfs gossip_debug more complete.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: define a minimum compatible userspace version.
Mike Marshall [Wed, 13 Jan 2016 16:36:25 +0000 (11:36 -0500)]
Orangefs: define a minimum compatible userspace version.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: change ORANGEFS_VERSION from "Unknown" to "upstream"
Mike Marshall [Wed, 13 Jan 2016 16:34:59 +0000 (11:34 -0500)]
Orangefs: change ORANGEFS_VERSION from "Unknown" to "upstream"

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: rename orangefs_kernel_op_s.aio_ref_count to just ref_count.
Mike Marshall [Wed, 13 Jan 2016 16:29:05 +0000 (11:29 -0500)]
Orangefs: rename orangefs_kernel_op_s.aio_ref_count to just ref_count.

The op structure's ref_count member hasn't got anything to do with
asynchronous I/O.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoOrangefs: implement .write_iter
Mike Marshall [Wed, 13 Jan 2016 16:18:12 +0000 (11:18 -0500)]
Orangefs: implement .write_iter

Until now, orangefs_devreq_write_iter has just been a wrapper for
the old-fashioned orangefs_devreq_writev... linux would call
.write_iter with "struct kiocb *iocb" and "struct iov_iter *iter"
and .write_iter would just:

        return pvfs2_devreq_writev(iocb->ki_filp,
                                   iter->iov,
                                   iter->nr_segs,
                                   &iocb->ki_pos);

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
8 years agoLinux 4.4 v4.4
Linus Torvalds [Sun, 10 Jan 2016 23:01:32 +0000 (15:01 -0800)]
Linux 4.4

8 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sat, 9 Jan 2016 22:53:48 +0000 (14:53 -0800)]
Merge tag 'scsi-fixes' of git://git./linux/kernel/git/jejb/scsi

Pull SCSI fix from James Bottomley:
 "A single fix for machines with pages > 4k (PPC mostly).

  There's a bug in our optimal transfer size code where we don't account
  for pages > 4k and can set the transfer size to be less than the page
  size causing nasty failures"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  sd: Reject optimal transfer length smaller than page size

8 years agoMerge tag 'pci-v4.4-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Linus Torvalds [Sat, 9 Jan 2016 22:44:44 +0000 (14:44 -0800)]
Merge tag 'pci-v4.4-fixes-4' of git://git./linux/kernel/git/helgaas/pci

Pull PCI fixlet from Bjorn Helgaas:
 "This marks the TI DRA7xx host bridge driver as broken.  Apparently it
  has never worked without some additional out-of-tree code, so I'm
  going to mark it broken now and remove it completely next cycle unless
  it's fixed"

* tag 'pci-v4.4-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: dra7xx: Mark driver as broken

8 years agovmstat: allocate vmstat_wq before it is used
Michal Hocko [Fri, 8 Jan 2016 10:18:29 +0000 (11:18 +0100)]
vmstat: allocate vmstat_wq before it is used

kernel test robot has reported the following crash:

  BUG: unable to handle kernel NULL pointer dereference at 00000100
  IP: [<c1074df6>] __queue_work+0x26/0x390
  *pdpt = 0000000000000000 *pde = f000ff53f000ff53 *pde = f000ff53f000ff53
  Oops: 0000 [#1] PREEMPT PREEMPT SMP SMP
  CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.4.0-rc4-00139-g373ccbe #1
  Workqueue: events vmstat_shepherd
  task: cb684600 ti: cb7ba000 task.ti: cb7ba000
  EIP: 0060:[<c1074df6>] EFLAGS: 00010046 CPU: 0
  EIP is at __queue_work+0x26/0x390
  EAX: 00000046 EBX: cbb37800 ECX: cbb37800 EDX: 00000000
  ESI: 00000000 EDI: 00000000 EBP: cb7bbe68 ESP: cb7bbe38
   DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
  CR0: 8005003b CR2: 00000100 CR3: 01fd5000 CR4: 000006b0
  Stack:
  Call Trace:
    __queue_delayed_work+0xa1/0x160
    queue_delayed_work_on+0x36/0x60
    vmstat_shepherd+0xad/0xf0
    process_one_work+0x1aa/0x4c0
    worker_thread+0x41/0x440
    kthread+0xb0/0xd0
    ret_from_kernel_thread+0x21/0x40

The reason is that start_shepherd_timer schedules the shepherd work item
which uses vmstat_wq (vmstat_shepherd) before setup_vmstat allocates
that workqueue so if the further initialization takes more than HZ we
might end up scheduling on a NULL vmstat_wq.  This is really unlikely
but not impossible.

Fixes: 373ccbe59270 ("mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress")
Reported-by: kernel test robot <ying.huang@linux.intel.com>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Tested-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: stable@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sat, 9 Jan 2016 00:11:05 +0000 (16:11 -0800)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Arnd Bergmann:
 "This is the final small set of ARM SoC bug fixes for linux-4.4, almost
  all regressions:

  OMAP:
   - data corruption on the Nokia N900 flash

  Allwinner:
   - Two defconfig change to get USB working again

  ARM Versatile:
   - Interrupt numbers gone bad after an older bug fix

  Nomadik:
   - Crashes from incorrect L2 cache settings

  VIA vt8500:
   - SD/MMC support on WM8650 never worked"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  dts: vt8500: Add SDHC node to DTS file for WM8650
  ARM: Fix broken USB support in multi_v7_defconfig for sunxi devices
  ARM: versatile: fix MMC/SD interrupt assignment
  ARM: nomadik: set latencies to 8 cycles
  ARM: OMAP2+: Fix onenand rate detection to avoid filesystem corruption
  ARM: Fix broken USB support in sunxi_defconfig

8 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Fri, 8 Jan 2016 23:58:14 +0000 (15:58 -0800)]
Merge tag 'for-linus' of git://git./virt/kvm/kvm

Pull KVM fix from Paolo Bonzini:
 "A simple fix.  I'm sending it before the merge window, because it
  refines a patch found in your master branch but not yet in the
  kvm/next branch that is destined for 4.5"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  kvm: x86: only channel 0 of the i8254 is linked to the HPET

8 years agoMerge tag 'pm+acpi-4.4-final' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 8 Jan 2016 23:50:59 +0000 (15:50 -0800)]
Merge tag 'pm+acpi-4.4-final' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Just one obvious fix that adds a missing function argument in ACPI
  code introduced recently (Kees Cook)"

* tag 'pm+acpi-4.4-final' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / property: avoid leaking format string into kobject name

8 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 8 Jan 2016 23:21:48 +0000 (15:21 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "A handful of x86 fixes:

   - a syscall ABI fix, fixing an Android breakage
   - a Xen PV guest fix relating to the RTC device, causing a
     non-working console
   - a Xen guest syscall stack frame fix
   - an MCE hotplug CPU crash fix"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/numachip: Fix NumaConnect2 MMCFG PCI access
  x86/entry: Restore traditional SYSENTER calling convention
  x86/entry: Fix some comments
  x86/paravirt: Prevent rtc_cmos platform device init on PV guests
  x86/xen: Avoid fast syscall path for Xen PV guests
  x86/mce: Ensure offline CPUs don't participate in rendezvous process

8 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 8 Jan 2016 21:57:13 +0000 (13:57 -0800)]
Merge branch 'sched-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
 "Misc scheduler fixes"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/core: Reset task's lockless wake-queues on fork()
  sched/core: Fix unserialized r-m-w scribbling stuff
  sched/core: Check tgid in is_global_init()
  sched/fair: Fix multiplication overflow on 32-bit systems

8 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 8 Jan 2016 21:52:59 +0000 (13:52 -0800)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "Two core subsystem fixes, plus a handful of tooling fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Fix race in swevent hash
  perf: Fix race in perf_event_exec()
  perf list: Robustify event printing routine
  perf list: Add support for PERF_COUNT_SW_BPF_OUT
  perf hists browser: Fix segfault if use symbol filter in cmdline
  perf hists browser: Reset selection when refresh
  perf hists browser: Add NULL pointer check to prevent crash
  perf buildid-list: Fix return value of perf buildid-list -k
  perf buildid-list: Show running kernel build id fix

8 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 8 Jan 2016 21:46:59 +0000 (13:46 -0800)]
Merge branch 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull irq fix from Ingo Molnar:
 "Fixes a core IRQ subsystem deadlock"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Prevent chip buslock deadlock

8 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 8 Jan 2016 21:39:09 +0000 (13:39 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block revert from Jens Axboe:
 "The previous pull request had a split fix for NVMe, however there are
  corner cases where that ends up blowing up.

  So let's revert it for 4.4.  The regression isn't introduced in this
  cycle, and it's "just" a performance regression, not a
  stability/integrity issue"

* 'for-linus' of git://git.kernel.dk/linux-block:
  Revert "block: Split bios on chunk boundaries"

8 years agoMerge tag 'dmaengine-fix-4.4' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Fri, 8 Jan 2016 20:23:00 +0000 (12:23 -0800)]
Merge tag 'dmaengine-fix-4.4' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
 "Late fixes for 4.4 are three fixes for drivers which include a revert
  of mic-x100 fix which is causing regression, xgene fix for double IRQ
  and async_tx fix to use GFP_NOWAIT"

* tag 'dmaengine-fix-4.4' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: xgene-dma: Fix double IRQ issue by setting IRQ_DISABLE_UNLAZY flag
  async_tx: use GFP_NOWAIT rather than GFP_IO
  dmaengine: Revert "dmaengine: mic_x100: add missing spin_unlock"

8 years agoMerge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Fri, 8 Jan 2016 20:18:45 +0000 (12:18 -0800)]
Merge branch 'dmi-for-linus' of git://git./linux/kernel/git/jdelvare/staging

Pull dmi fix from Jean Delvare.

* 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  firmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6

8 years agoMerge tag 'sound-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Fri, 8 Jan 2016 19:52:18 +0000 (11:52 -0800)]
Merge tag 'sound-4.4' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A slightly higher volume than a new year's wish, but not too
  worrisome: a large LOC is only for HD-audio device-specific quirks, so
  fairly safe to apply.  The rest ASoC fixes are all trivial and small;
  a simple replacement of mutex call with nested lock version, a few
  Arizona and Realtek codec fixes, and a regression fix for Skylake
  firmware handling"

* tag 'sound-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: Intel: Skylake: Fix the memory leak
  ASoC: Intel: Skylake: Revert previous broken fix memory leak fix
  ASoC: Use nested lock for snd_soc_dapm_mutex_lock
  ASoC: rt5645: add sys clk detection
  ALSA: hda - Add keycode map for alc input device
  ALSA: hda - Add mic mute hotkey quirk for Lenovo ThinkCentre AIO
  ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz

8 years agoMerge tag 'omap-for-v4.4/onenand-corruption' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Fri, 8 Jan 2016 16:46:45 +0000 (17:46 +0100)]
Merge tag 'omap-for-v4.4/onenand-corruption' of git://git./linux/kernel/git/tmlind/linux-omap into fixes

Pull "urgent onenand file system corruption fix for n900" from Tony Lindgren:

Last minute urgent pull request to prevent file system corruption
on Nokia N900.

Looks like we have a GPMC bus timing bug that has gone unnoticed
because of bootloader configured registers until few days ago. We
are not detecting the onenand clock rate properly unless we have
CONFIG_OMAP_GPMC_DEBUG set and this causes onenand corruption
that can be easily be reproduced.

There seems to be also an additional bug still lurking around for
onenand corruption. But that is still being investigated and
it does not seem to be GPMC timings related.

Meanwhile, it would be good to get this fix into v4.4 to prevent
wrong timings from corrupting onenand.

* tag 'omap-for-v4.4/onenand-corruption' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Fix onenand rate detection to avoid filesystem corruption

8 years agoRevert "block: Split bios on chunk boundaries"
Jens Axboe [Fri, 8 Jan 2016 16:00:29 +0000 (09:00 -0700)]
Revert "block: Split bios on chunk boundaries"

This reverts commit d3805611130af9b911e908af9f67a3f64f4f0914.

If we end up splitting on the first segment, we don't adjust
the sector count. That results in hitting a BUG() with attempting
to split 0 sectors.

As this is just a performance issue and not a regression since
4.3 release, let's just rever this change. That gives us more
time to test a real fix for 4.5, which would be marked for
stable anyway.

8 years agoPCI: dra7xx: Mark driver as broken
Richard Cochran [Fri, 8 Jan 2016 15:58:31 +0000 (09:58 -0600)]
PCI: dra7xx: Mark driver as broken

Mark the dra7xx PCI host driver as broken.  This driver was first merged in
v3.17 and has never worked.  Although the driver compiles just fine, it is
missing an essential device reset.  If the driver is included, the kernel
locks up hard shortly after booting, before any console output appears.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agofirmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6
Andrea Arcangeli [Fri, 8 Jan 2016 08:00:54 +0000 (09:00 +0100)]
firmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6

The dmi_ver wasn't updated correctly before the dmi_decode method run
to save the uuid.

That resulted in "dmidecode -s system-uuid" and
/sys/class/dmi/id/product_uuid disagreeing. The latter was buggy and
this fixes it.

Reported-by: Federico Simoncelli <fsimonce@redhat.com>
Fixes: 9f9c9cbb6057 ("drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists")
Fixes: 79bae42d51a5 ("dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
8 years agoACPI / property: avoid leaking format string into kobject name
Kees Cook [Thu, 7 Jan 2016 19:24:29 +0000 (11:24 -0800)]
ACPI / property: avoid leaking format string into kobject name

The dn->name is expected to be used as a literal, so add the missing
"%s".

Fixes: 263b4c1a64bc (ACPI / property: Expose data-only subnodes via sysfs)
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Thu, 7 Jan 2016 21:06:35 +0000 (13:06 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm nouveau fix from Dave Airlie:
 "Still not back to work, but I decided to forward this fix"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau/gr/nv40: fix oops in interrupt handler

8 years agoMerge tag 'iommu-fixes-v4.4-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 7 Jan 2016 20:56:23 +0000 (12:56 -0800)]
Merge tag 'iommu-fixes-v4.4-rc8' of git://git./linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:

 - Two build issues, one in the ipmmu-vmsa driver and one for the new
   generic dma-api implemention used on arm64

 - A performance fix for said dma-api implemention

 - An issue caused by a wrong offset in map_sg in the same code as above

* tag 'iommu-fixes-v4.4-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/dma: Use correct offset in map_sg
  iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled
  iommu/dma: Avoid unlikely high-order allocations
  iommu/dma: Add some missing #includes

8 years agoMerge tag 'trace-v4.4-rc4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Thu, 7 Jan 2016 20:42:22 +0000 (12:42 -0800)]
Merge tag 'trace-v4.4-rc4-4' of git://git./linux/kernel/git/rostedt/linux-trace

Pull ftrace fix from Steven Rostedt:
 "PeiyangX Qiu reported that if a module fails to load between calling
  ftrace_module_init() and do_init_module() that the allocations made in
  ftrace_module_init() will not be freed, resulting in a memory leak.

  The solution is to call ftrace_release_mod() on the failing module in
  the fail path befor do_init_module() is called.  This will remove any
  allocations made for that module, and nothing if ftrace_module_init()
  wasn't called yet for that module.

  Note, once do_init_module() is called, the MODULE_GOING notifiers are
  called for the failed module, which calls into the ftrace code to do
  the proper clean up (basically calling ftrace_release_mod())"

* tag 'trace-v4.4-rc4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ftrace/module: Call clean up function when module init fails early

8 years agoftrace/module: Call clean up function when module init fails early
Steven Rostedt (Red Hat) [Wed, 6 Jan 2016 01:32:47 +0000 (20:32 -0500)]
ftrace/module: Call clean up function when module init fails early

If the module init code fails after calling ftrace_module_init() and before
calling do_init_module(), we can suffer from a memory leak. This is because
ftrace_module_init() allocates pages to store the locations that ftrace
hooks are placed in the module text. If do_init_module() fails, it still
calls the MODULE_GOING notifiers which will tell ftrace to do a clean up of
the pages it allocated for the module. But if load_module() fails before
then, the pages allocated by ftrace_module_init() will never be freed.

Call ftrace_release_mod() on the module if load_module() fails before
getting to do_init_module().

Link: http://lkml.kernel.org/r/567CEA31.1070507@intel.com
Reported-by: "Qiu, PeiyangX" <peiyangx.qiu@intel.com>
Fixes: a949ae560a511 "ftrace/module: Hardcode ftrace_module_init() call into load_module()"
Cc: stable@vger.kernel.org # v2.6.38+
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
8 years agodts: vt8500: Add SDHC node to DTS file for WM8650
Roman Volkov [Fri, 1 Jan 2016 13:38:11 +0000 (16:38 +0300)]
dts: vt8500: Add SDHC node to DTS file for WM8650

Since WM8650 has the same 'WMT' SDHC controller as WM8505, and the driver
is already in the kernel, this node enables the controller support for
WM8650

Signed-off-by: Roman Volkov <rvolkov@v1ros.org>
Reviewed-by: Alexey Charkov <alchark@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
8 years agoARM: Fix broken USB support in multi_v7_defconfig for sunxi devices
Timo Sigurdsson [Fri, 1 Jan 2016 13:38:22 +0000 (14:38 +0100)]
ARM: Fix broken USB support in multi_v7_defconfig for sunxi devices

Commit 69fb4dcada77 ("power: Add an axp20x-usb-power driver") introduced a
new driver for the USB power supply used on various Allwinner based SBCs.
However, the driver was not added to multi_v7_defconfig which breaks USB
support for some boards (e.g. LeMaker BananaPi) as the kernel will now
turn off the USB power supply during boot by default if the driver isn't
present. (This was not the case in linux 4.3 or lower where the USB power
was always left on.)

Hence, add the driver to multi_v7_defconfig in order to keep USB support
working on those boards that require it.

Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
Tested-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
8 years agokvm: x86: only channel 0 of the i8254 is linked to the HPET
Paolo Bonzini [Thu, 7 Jan 2016 12:50:38 +0000 (13:50 +0100)]
kvm: x86: only channel 0 of the i8254 is linked to the HPET

While setting the KVM PIT counters in 'kvm_pit_load_count', if
'hpet_legacy_start' is set, the function disables the timer on
channel[0], instead of the respective index 'channel'. This is
because channels 1-3 are not linked to the HPET.  Fix the caller
to only activate the special HPET processing for channel 0.

Reported-by: P J P <pjp@fedoraproject.org>
Fixes: 0185604c2d82c560dab2f2933a18f797e74ab5a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoiommu/dma: Use correct offset in map_sg
Robin Murphy [Mon, 4 Jan 2016 16:19:42 +0000 (16:19 +0000)]
iommu/dma: Use correct offset in map_sg

When mapping a non-page-aligned scatterlist entry, we copy the original
offset to the output DMA address before aligning it to hand off to
iommu_map_sg(), then later adding the IOVA page address portion to get
the final mapped address. However, when the IOVA page size is smaller
than the CPU page size, it is the offset within the IOVA page we want,
not that within the CPU page, which can easily be larger than an IOVA
page and thus result in an incorrect final address.

Fix the bug by taking only the IOVA-aligned part of the offset as the
basis of the DMA address, not the whole thing.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>