aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-01fuse: abort: group pqueue accessesMiklos Szeredi1-1/+1
Rearrange fuse_abort_conn() so that processing queue accesses are grouped together. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: cleanup fuse_dev_do_read()Miklos Szeredi1-20/+20
- locked list_add() + list_del_init() cancel out - common handling of case when request is ended here in the read phase Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: move list_del_init() from request_end() into callersMiklos Szeredi1-1/+7
Signed-off-by: Miklos Szeredi <[email protected]>
2015-07-01fuse: duplicate ->connected in pqueueMiklos Szeredi3-3/+8
This will allow checking ->connected just with the processing queue lock. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: separate out processing queueMiklos Szeredi3-16/+30
This is just two fields: fc->io and fc->processing. This patch just rearranges the fields, no functional change. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: simplify request_wait()Miklos Szeredi1-25/+5
wait_event_interruptible_exclusive_locked() will do everything request_wait() does, so replace it. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: no fc->lock for iqueue partsMiklos Szeredi1-51/+20
Remove fc->lock protection from input queue members, now protected by fiq->waitq.lock. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: allow interrupt queuing without fc->lockMiklos Szeredi1-3/+9
Interrupt is only queued after the request has been sent to userspace. This is either done in request_wait_answer() or fuse_dev_do_read() depending on which state the request is in at the time of the interrupt. If it's not yet sent, then queuing the interrupt is postponed until the request is read. Otherwise (the request has already been read and is waiting for an answer) the interrupt is queued immedidately. We want to call queue_interrupt() without fc->lock protection, in which case there can be a race between the two functions: - neither of them queue the interrupt (thinking the other one has already done it). - both of them queue the interrupt The first one is prevented by adding memory barriers, the second is prevented by checking (under fiq->waitq.lock) if the interrupt has already been queued. Signed-off-by: Miklos Szeredi <[email protected]>
2015-07-01fuse: iqueue lockingMiklos Szeredi1-6/+45
Use fiq->waitq.lock for protecting members of struct fuse_iqueue and FR_PENDING request flag, previously protected by fc->lock. Following patches will remove fc->lock protection from these members. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: dev read: split list_moveMiklos Szeredi1-1/+2
Different lists will need different locks. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: abort: group iqueue accessesMiklos Szeredi1-5/+7
Rearrange fuse_abort_conn() so that input queue accesses are grouped together. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: duplicate ->connected in iqueueMiklos Szeredi4-11/+15
This will allow checking ->connected just with the input queue lock. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: separate out input queueMiklos Szeredi3-84/+111
The input queue contains normal requests (fc->pending), forgets (fc->forget_*) and interrupts (fc->interrupts). There's also fc->waitq and fc->fasync for waking up the readers of the fuse device when a request is available. The fc->reqctr is also moved to the input queue (assigned to the request when the request is added to the input queue. This patch just rearranges the fields, no functional change. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: req state use flagsMiklos Szeredi3-21/+21
Use flags for representing the state in fuse_req. This is needed since req->list will be protected by different locks in different states, hence we'll want the state itself to be split into distinct bits, each protected with the relevant lock in that state. Signed-off-by: Miklos Szeredi <[email protected]>
2015-07-01fuse: simplify req statesMiklos Szeredi3-9/+5
FUSE_REQ_INIT is actually the same state as FUSE_REQ_PENDING and FUSE_REQ_READING and FUSE_REQ_WRITING can be merged into a common FUSE_REQ_IO state. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: don't hold lock over request_wait_answer()Miklos Szeredi1-25/+20
Only hold fc->lock over sections of request_wait_answer() that actually need it. If wait_event_interruptible() returns zero, it means that the request finished. Need to add memory barriers, though, to make sure that all relevant data in the request is synchronized. Signed-off-by: Miklos Szeredi <[email protected]>
2015-07-01fuse: simplify unique ctrMiklos Szeredi2-7/+1
Since it's a 64bit counter, it's never gonna wrap around. Remove code dealing with that possibility. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: rework abortMiklos Szeredi1-11/+10
Splice fc->pending and fc->processing lists into a common kill list while holding fc->lock. By the time we release fc->lock, pending and processing lists are empty and the io list contains only locked requests. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: fold helpers into abortMiklos Szeredi1-55/+38
Fold end_io_requests() and end_queued_requests() into fuse_abort_conn(). Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: use per req lock for lock/unlock_request()Miklos Szeredi2-22/+24
Reuse req->waitq.lock for protecting FR_ABORTED and FR_LOCKED flags. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: req use bitopsMiklos Szeredi4-72/+71
Finer grained locking will mean there's no single lock to protect modification of bitfileds in fuse_req. So move to using bitops. Can use the non-atomic variants for those which happen while the request definitely has only one reference. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: simplify request abortMiklos Szeredi1-73/+46
- don't end the request while req->locked is true - make unlock_request() return an error if the connection was aborted Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: call fuse_abort_conn() in dev releaseMiklos Szeredi1-8/+3
fuse_abort_conn() does all the work done by fuse_dev_release() and more. "More" consists of: end_io_requests(fc); wake_up_all(&fc->waitq); kill_fasync(&fc->fasync, SIGIO, POLL_IN); All of which should be no-op (WARN_ON's added). Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: fold fuse_request_send_nowait() into single callerMiklos Szeredi1-22/+10
And the same with fuse_request_send_nowait_locked(). Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: check conn_error earlierMiklos Szeredi1-2/+4
fc->conn_error is set once in FUSE_INIT reply and never cleared. Check it in request allocation, there's no sense in doing all the preparation if sending will surely fail. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: account as waiting before queuing for backgroundMiklos Szeredi1-4/+8
Move accounting of fc->num_waiting to the point where the request actually starts waiting. This is earlier than the current queue_request() for background requests, since they might be waiting on the fc->bg_queue before being queued on fc->pending. Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: reset waitingMiklos Szeredi1-1/+3
Reset req->waiting in fuse_put_request(). This is needed for correct accounting in fc->num_waiting for reserved requests. Signed-off-by: Miklos Szeredi <[email protected]>
2015-07-01fuse: fix background request if not connectedMiklos Szeredi1-1/+4
request_end() expects fc->num_background and fc->active_background to have been incremented, which is not the case in fuse_request_send_nowait() failure path. So instead just call the ->end() callback (which is actually set by all callers). Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
2015-07-01fuse: initialize fc->release before calling itMiklos Szeredi1-1/+1
fc->release is called from fuse_conn_put() which was used in the error cleanup before fc->release was initialized. [Jeremiah Mahler <[email protected]>: assign fc->release after calling fuse_conn_init(fc) instead of before.] Signed-off-by: Miklos Szeredi <[email protected]> Fixes: a325f9b92273 ("fuse: update fuse_conn_init() and separate out fuse_conn_kill()") Cc: <[email protected]> #v2.6.31+
2015-06-21Linux 4.1Linus Torvalds1-1/+1
2015-06-20Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pendingLinus Torvalds1-3/+22
Pull scsi target fixes from Nicholas Bellinger: "Apologies for the late pull request. Here are the outstanding target-pending fixes for v4.1 code. The series contains three patches from Sagi + Co that address a few iser-target issues that have been uncovered during recent testing at Mellanox. Patch #1 has a v3.16+ stable tag, and #2-3 have v3.10+ stable tags" * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: iser-target: Fix possible use-after-free iser-target: release stale iser connections iser-target: Fix variable-length response error completion
2015-06-20Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds5-1/+18
Pull drm fixes from Dave Airlie: "A smattering of fixes, mgag200: don't accept modes that aren't aligned properly as hw can't do it i915: two regression fixes radeon: one query to allow userspace fixes one oops fixer for older hw with new options enabled" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/radeon: don't probe MST on hw we don't support it on drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query drm/mgag200: Reject non-character-cell-aligned mode widths Revert "drm/i915: Don't skip request retirement if the active list is empty" drm/i915: Always reset vma->ggtt_view.pages cache on unbinding
2015-06-19Merge tag 'clk-fixes-for-linus' of ↵Linus Torvalds4-8/+16
git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Michael Turquette: "Very late clk regression fixes for the ARM-based AT91 platform. These went unnoticed by me until recently, hence the late pull request" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: at91: fix h32mx prototype inclusion in pmc header clk: at91: trivial: typo in peripheral clock description clk: at91: fix PERIPHERAL_MAX_SHIFT definition clk: at91: pll: fix input range validity check
2015-06-19Merge tag 'sound-4.1' of ↵Linus Torvalds4-2/+45
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Nothing looks scary, just a few usual HD-audio regression fixes and fixup, in addition to a minor Kconfig dependency fix for the old MIPS drivers" * tag 'sound-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Fix unused label skip_i915 ALSA: hda - Fix noisy outputs on Dell XPS13 (2015 model) ALSA: mips: let SND_SGI_O2 select SND_PCM ALSA: hda - Fix audio crackles on Dell Latitude E7x40 ALSA: hda - adding a DAC/pin preference map for a HP Envy TS machine
2015-06-19Merge branch 'ccf/atmel-fixes-for-4.1' of ↵Michael Turquette4-8/+16
https://github.com/bbrezillon/linux-at91 into clk-fixes
2015-06-19clk: at91: fix h32mx prototype inclusion in pmc headerNicolas Ferre1-1/+1
Trivial fix that prevents to compile this pmc clock driver if h32mx clock is present but smd clock isn't. Signed-off-by: Nicolas Ferre <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Fixes: bcc5fd49a0fd ("clk: at91: add a driver for the h32mx clock") Cc: <[email protected]> # 3.18+
2015-06-19clk: at91: trivial: typo in peripheral clock descriptionNicolas Ferre1-1/+1
Signed-off-by: Nicolas Ferre <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
2015-06-19clk: at91: fix PERIPHERAL_MAX_SHIFT definitionBoris Brezillon1-4/+4
Fix the PERIPHERAL_MAX_SHIFT definition (3 instead of 4) and adapt the round_rate and set_rate logic accordingly. Signed-off-by: Boris Brezillon <[email protected]> Reported-by: "Wu, Songjun" <[email protected]>
2015-06-19clk: at91: pll: fix input range validity checkBoris Brezillon1-2/+10
The PLL impose a certain input range to work correctly, but it appears that this input range does not apply on the input clock (or parent clock) but on the input clock after it has passed the PLL divisor. Fix the implementation accordingly. Cc: <[email protected]> # v3.14+ Signed-off-by: Boris Brezillon <[email protected]> Reported-by: Jonas Andersson <[email protected]>
2015-06-18Merge branch 'i2c/for-current' of ↵Linus Torvalds1-3/+3
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c documentation fix from Wolfram Sang: "Here is a small documentation fix for I2C. We already had a user who unsuccessfully tried to get the new slave framework running with the currently broken example. So, before this happens again, I'd like to have this how-to-use section fixed for 4.1 already. So that no more hacking time is wasted" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: slave: fix the example how to instantiate from userspace
2015-06-18revert "cpumask: don't perform while loop in cpumask_next_and()"Andrew Morton1-5/+4
Revert commit 534b483a86e6 ("cpumask: don't perform while loop in cpumask_next_and()"). This was a minor optimization, but it puts a `struct cpumask' on the stack, which consumes too much stack space. Sergey Senozhatsky <[email protected]> Reported-by: Peter Zijlstra <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Tejun Heo <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Amir Vadai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2015-06-19Merge tag 'drm-intel-fixes-2015-06-18' of ↵Dave Airlie1-1/+4
git://anongit.freedesktop.org/drm-intel into drm-fixes one fix, one revert * tag 'drm-intel-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel: Revert "drm/i915: Don't skip request retirement if the active list is empty" drm/i915: Always reset vma->ggtt_view.pages cache on unbinding
2015-06-19Merge branch 'drm-fixes-4.1' of ↵Dave Airlie3-0/+9
git://people.freedesktop.org/~deathsimple/linux into drm-fixes two radeon fixes one MST fix, one query addition, destined for stable, and to fix a regression * 'drm-fixes-4.1' of git://people.freedesktop.org/~deathsimple/linux: drm/radeon: don't probe MST on hw we don't support it on drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query
2015-06-18drm/radeon: don't probe MST on hw we don't support it onDave Airlie1-0/+5
If you do radeon.mst=1 on a gpu without mst hw, and then plug some mst hw it will oops instead of falling back. So check we have DCE5 at least before proceeding. Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Christian König <[email protected]>
2015-06-18drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING queryMichel Dänzer2-0/+4
This tells userspace that it's safe to use the RADEON_VA_UNMAP operation of the DRM_RADEON_GEM_VA ioctl. Cc: [email protected] (NOTE: Backporting this commit requires at least backports of commits 26d4d129b6042197b4cbc8341c0618f99231af2f, 48afbd70ac7b6aa62e8d452091023941d8085f8a and c29c0876ec05d51a93508a39b90b92c29ba6423d as well, otherwise using RADEON_VA_UNMAP runs into trouble) Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Christian König <[email protected]>
2015-06-17Merge tag 'trace-fix-filter-4.1-rc8' of ↵Linus Torvalds1-2/+9
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing filter fix from Steven Rostedt: "Vince Weaver reported a warning when he added perf event filters into his fuzzer tests. There's a missing check of balanced operations when parenthesis are used, and this triggers a WARN_ON() and when reading the failure, the filter reports no failure occurred. The operands were not being checked if they match, this adds that" * tag 'trace-fix-filter-4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Have filter check for balanced ops
2015-06-17Merge git://git.kernel.org/pub/scm/virt/kvm/kvmLinus Torvalds1-10/+16
Pull kvm bugfix from Marcelo Tosatti: "Rrestore APIC migration functionality" * git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: fix lapic.timer_mode on restore
2015-06-17Kconfig: disable Media Controller for DVBMauro Carvalho Chehab1-0/+1
Since when we start discussions about the usage Media Controller for complex hardware, one thing become clear: the way it is, MC fails to map anything different than capture/output/m2m video-only streaming. The point is that MC has entities named as devnodes, but the only devnode used (before the DVB patches) is MEDIA_ENT_T_DEVNODE_V4L. Due to the way MC got implemented, however, this entity actually doesn't represent the devnode, but the hardware I/O engine that receives data via DMA. By coincidence, such DMA is associated with the V4L device node on webcam hardware, but this is not true even for other V4L2 devices. For example, on USB hardware, the DMA is done via the USB controller. The data passes though a in-kernel filter that strips off the URB headers. Other V4L2 devices like radio may not even have DMA. When it have, the DMA is done via ALSA, and not via the V4L devnode. In other words, MC is broken as a whole, but tagging it as BROKEN right now would do more harm than good. So, instead, let's mark, for now, the DVB part as broken and block all new changes to MC while we fix this mess, whith we hopefully will do for the next Kernel version. Requested-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2015-06-17Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6Linus Torvalds2-1/+3
Pull crypto fixes from Herbert Xu: "This fixes the following issues: - Crash in caam hash due to uninitialised buffer lengths. - Alignment issue in caam RNG that may lead to non-random output" * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: caam - fix RNG buffer cache alignment crypto: caam - improve initalization for context state saves
2015-06-17mm: shmem_zero_setup skip security check and lockdep conflict with XFSHugh Dickins1-1/+7
It appears that, at some point last year, XFS made directory handling changes which bring it into lockdep conflict with shmem_zero_setup(): it is surprising that mmap() can clone an inode while holding mmap_sem, but that has been so for many years. Since those few lockdep traces that I've seen all implicated selinux, I'm hoping that we can use the __shmem_file_setup(,,,S_PRIVATE) which v3.13's commit c7277090927a ("security: shmem: implement kernel private shmem inodes") introduced to avoid LSM checks on kernel-internal inodes: the mmap("/dev/zero") cloned inode is indeed a kernel-internal detail. This also covers the !CONFIG_SHMEM use of ramfs to support /dev/zero (and MAP_SHARED|MAP_ANONYMOUS). I thought there were also drivers which cloned inode in mmap(), but if so, I cannot locate them now. Reported-and-tested-by: Prarit Bhargava <[email protected]> Reported-and-tested-by: Daniel Wagner <[email protected]> Reported-and-tested-by: Morten Stevens <[email protected]> Signed-off-by: Hugh Dickins <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>