aboutsummaryrefslogtreecommitdiffstats
path: root/lib/iommu-common.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2015-04-20ip_forward: Drop frames with attached skb->skSebastian Pöhn1-0/+3
Initial discussion was: [FYI] xfrm: Don't lookup sk_policy for timewait sockets Forwarded frames should not have a socket attached. Especially tw sockets will lead to panics later-on in the stack. This was observed with TPROXY assigning a tw socket and broken policy routing (misconfigured). As a result frame enters forwarding path instead of input. We cannot solve this in TPROXY as it cannot know that policy routing is broken. v2: Remove useless comment Signed-off-by: Sebastian Poehn <sebastian.poehn@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-20ARM: OMAP2+: Fix booting with configs that don't have MFD_SYSCONTony Lindgren1-0/+1
With the recent changes omaps have developed a dependency to MFD_SYSCON. This is used for system control module generic register area and some clocks. We do have it selected in omap2plus_defconfig, but targeted config files may not have it selected. Let's make sure it's selected like few other ARM platforms are already doing. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-04-20Input: lm8333 - fix broken email addressWolfram Sang1-2/+2
My Pengutronix address is not valid anymore, redirect people to the Pengutronix kernel team. Reported-by: Harald Geyer <harald@ccbib.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-20Input: cyapa - fix setting suspend scan rateDudley Du1-2/+2
The suspend scan rate value should not exceed 1000, unfortunately when implementing the limit we used max_t instead of min_t, causing the value to be at least 1000. Signed-off-by: Dudley Du <dudl@cypress.com> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-20Input: elan_i2c - fix calculating number of x and y traces.Duson Lin2-4/+4
According to Elan's firmware engineers we should not be subtracting 1 form the raw number of x and y traces so that the pitch size is correct. For example, if the touchpad x resolution is 2800 and x trace number is 20, the pitch size of x should be 2800/20 = 140, not 2800/19 = 147.36. Signed-off-by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-20Input: elan_i2c - report hovering contactsDuson Lin1-4/+11
When hover is detected report ABS_MT_DISTANCE as 1; for active contacts the distance is reported as 0. Signed-off-by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-20Input: elants_i2c - zero-extend hardware ID in firmware nameDmitry Torokhov1-1/+1
Let's zero-extend hardware id number when forming firmware file name, to avoid kernel requesting firmware like "elants_i2c_ 0.bin", which is quite unexpected. Acked-by: Charlie Mooney<charliemooney@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-20smp: don't use 16-bit words for atomic accessesLinus Torvalds1-1/+1
Yes, it should work, but it's a bad idea. Not only did ARM64 not have the 16-bit access code (there's a separate patch to add it), it's just not a good atomic type. Some architectures fundamentally don't do atomic accesses in them (alpha), and it's not like it saves any space here anyway because of structure packing issues. We normally should aim for flags to be "unsigned int" or "unsigned long". And if space is at a premium, use a single byte (although that causes problems on alpha again). There might be very special cases where a 16-byte entity is really wanted, but this is not one of them. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-20ceph: hold on to exclusive caps on complete directoriesYan, Zheng1-0/+12
If a directory is complete, we want to keep the exclusive cap. So that MDS does not end up revoking the shared cap on every create/unlink operation. Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20libceph: simplify our debugfs attr macroIlya Dryomov1-7/+1
No need to do single_open()'s job ourselves. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20ceph: show non-default options onlyIlya Dryomov1-5/+1
Don't pollute /proc/mounts with default options (presently these are dcache, nofsc and acl). Leave the acl/noacl however - it's a bit of a special case due to CONFIG_CEPH_FS_POSIX_ACL. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20libceph: expose client options through debugfsIlya Dryomov2-0/+25
Add a client_options attribute for showing libceph options. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20libceph, ceph: split ceph_show_options()Ilya Dryomov3-25/+53
Split ceph_show_options() into two pieces and move the piece responsible for printing client (libceph) options into net/ceph. This way people adding a libceph option wouldn't have to remember to update code in fs/ceph. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20rbd: mark block queue as non-rotationalIlya Dryomov1-2/+2
Set QUEUE_FLAG_NONROT. Following commit b277da0a8a59 ("block: disable entropy contributions for nonrot devices") we should also clear QUEUE_FLAG_ADD_RANDOM, but it's off by default for blk-mq drivers, so just note it in the comment. Also remove physical block size assignment - no sense in repeating defaults that are not going to change. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20libceph: don't overwrite specific con error msgsIlya Dryomov1-12/+13
- specific con->error_msg messages (e.g. "protocol version mismatch") end up getting overwritten by a catch-all "socket error on read / write", introduced in commit 3a140a0d5c4b ("libceph: report socket read/write error message") - "bad message sequence # for incoming message" loses to "bad crc" due to the fact that -EBADMSG is used for both Fix it, and tidy up con->error_msg assignments and pr_errs while at it. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20ceph: cleanup unsafe requests when reconnecting is deniedYan, Zheng1-0/+28
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: don't zero i_wrbuffer_ref when reconnecting is deniedYan, Zheng1-7/+0
remove_session_caps_cb() does not truncate dirty data in page cache, but zeros i_wrbuffer_ref/i_wrbuffer_ref_head. This will result negtive i_wrbuffer_ref/i_wrbuffer_ref_head Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: don't mark dirty caps when there is no auth capYan, Zheng2-2/+8
No i_auth_cap means reconnecting to MDS was denied. So don't add new dirty caps. Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: keep i_snap_realm while there are writersYan, Zheng1-9/+22
when reconnecting to MDS is denied, we remove session caps forcibly. But it's possible there are ongoing write, the write code needs to reference i_snap_realm. So if there are ongoing write, we keep i_snap_realm. Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20libceph: osdmap.h: Add missing format newlinesJoe Perches1-3/+2
To avoid possible interleaving, add missing '\n' to formats. Convert pr_warning to pr_warn while there. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20ceph: kstrdup() memory handlingSanidhya Kashyap3-13/+44
Currently, there is no check for the kstrdup() for r_path2, r_path1 and snapdir_name as various locations as there is a possibility of failure during memory pressure. Therefore, returning ENOMEM where the checks have been missed. Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com> Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: properly release page upon errorTaesoo Kim1-0/+4
When ceph_update_writeable_page fails (including -EAGAIN), it unlocks (w/ unlock_page) the page but does not 'release' (w/ page_cache_release) properly. Upon error, properly set *pagep to NULL, indicating an error. Signed-off-by: Taesoo Kim <tsgatesv@gmail.com> Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20rbd: be more informative on -ENOENT failuresIlya Dryomov1-3/+17
pr_info what exactly was the culprit: missing pool, image or snap. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2015-04-20ceph: match wait_for_completion_timeout return typeNicholas Mc Guire1-4/+5
return type of wait_for_completion_timeout is unsigned long not int. An appropriately named unsigned long is added and the assignment fixed up. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: use msecs_to_jiffies for time conversionNicholas Mc Guire1-1/+1
This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: remove redundant declarationFabian Frederick1-1/+0
ceph_aops was already defined extern in addr.c section Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: fix dcache/nocache mount optionYan, Zheng2-1/+4
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20ceph: drop cap releases in requests composed before cap reconnectYan, Zheng1-6/+13
These cap releases are stale because MDS will re-establish client caps according to the cap reconnect messages. Note: MDS can detect stale cap messages, so these stale cap releases are harmless even we don't drop them. Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-04-20omapdss: extend pm notifier to handle hibernationGrygorii Strashko1-0/+4
Add handling of missed events in omap_dss_pm_notif which are needed to support hibernation (suspend to disk). Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-04-20OMAPDSS: Correct video ports description file path in DT binding docJavier Martinez Canillas1-2/+2
The doc refers to Documentation/devicetree/bindings/video/video-ports.txt which does not exist. The documentation seems to be outdated and wants to refer to Documentation/devicetree/bindings/graph.txt instead. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-04-20OMAPDSS: disable VT switchTomi Valkeinen1-0/+3
We don't need VT switch when suspending/resuming, so disable it. This speeds up suspend/resume. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: NeilBrown <neil@brown.name>
2015-04-20media-bus: Fixup RGB444_1X12, RGB565_1X16, and YUV8_1X24 media bus formatPhilipp Zabel2-8/+8
Change the constant values for RGB444_1X12, RGB565_1X16, and YUV8_1X24 media bus formats in anticipation of a merge conflict with the media tree, where the old values are already taken by RBG888_1X24, RGB888_1X32_PADHI, and VUY8_1X24, respectively. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-19hexdump: avoid warning in test functionLinus Torvalds1-1/+1
The test_data_1_le[] array is a const array of const char *. To avoid dropping any const information, we need to use "const char * const *", not just "const char **". I'm not sure why the different test arrays end up having different const'ness, but let's make the pointer we use to traverse them as const as possible, since we modify neither the array of pointers _or_ the pointers we find in the array. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-19fs: take i_mutex during prepare_binprm for set[ug]id executablesJann Horn1-28/+48
This prevents a race between chown() and execve(), where chowning a setuid-user binary to root would momentarily make the binary setuid root. This patch was mostly written by Linus Torvalds. Signed-off-by: Jann Horn <jann@thejh.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-19smp: Fix error case handling in smp_call_function_*()Linus Torvalds1-1/+3
Commit 8053871d0f7f ("smp: Fix smp_call_function_single_async() locking") fixed the locking for the asynchronous smp-call case, but in the process of moving the lock handling around, one of the error cases ended up not unlocking the call data at all. This went unnoticed on x86, because this is a "caller is buggy" case, where the caller is trying to call a non-existent CPU. But apparently ARM does that (at least under qemu-arm). Bindly doing cross-cpu calls to random CPU's that aren't even online seems a bit fishy, but the error handling was clearly not correct. Simply add the missing "csd_unlock()" to the error path. Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net> Analyzed-by: Rabin Vincent <rabin@rab.in> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-19cpumask: remove __first_cpu / __next_cpuRusty Russell2-23/+2
They were for use by the deprecated first_cpu() and next_cpu() wrappers, but sparc used them directly. They're now replaced by cpumask_first / cpumask_next. And __next_cpu_nr is completely obsolete. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: David S. Miller <davem@davemloft.net>
2015-04-18iommu-common: Fix PARISC compile-time warningsSowmini Varadhan1-1/+5
Fixes warnings due to - no DMA_ERROR_CODE on PARISC, - sizeof (unsigned long) == 4 bytes on PARISC. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-18sparc: Make LDC use common iommu poll management functionsSowmini Varadhan1-88/+65
Note that this conversion is only being done to consolidate the code and ensure that the common code provides the sufficient abstraction. It is not expected to result in any noticeable performance improvement, as there is typically one ldc_iommu per vnet_port, and each one has 8k entries, with a typical request for 1-4 pages. Thus LDC uses npools == 1. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-18sparc: Make sparc64 use scalable lib/iommu-common.c functionsSowmini Varadhan4-242/+128
In iperf experiments running linux as the Tx side (TCP client) with 10 threads results in a severe performance drop when TSO is disabled, indicating a weakness in the software that can be avoided by using the scalable IOMMU arena DMA allocation. Baseline numbers before this patch: with default settings (TSO enabled) : 9-9.5 Gbps Disable TSO using ethtool- drops badly: 2-3 Gbps. After this patch, iperf client with 10 threads, can give a throughput of at least 8.5 Gbps, even when TSO is disabled. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-18Break up monolithic iommu table/lock into finer graularity pools and lockSowmini Varadhan3-1/+318
Investigation of multithreaded iperf experiments on an ethernet interface show the iommu->lock as the hottest lock identified by lockstat, with something of the order of 21M contentions out of 27M acquisitions, and an average wait time of 26 us for the lock. This is not efficient. A more scalable design is to follow the ppc model, where the iommu_map_table has multiple pools, each stretching over a segment of the map, and with a separate lock for each pool. This model allows for better parallelization of the iommu map search. This patch adds the iommu range alloc/free function infrastructure. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-18sparc: Revert generic IOMMU allocator.David S. Miller8-537/+325
I applied the wrong version of this patch series, V4 instead of V10, due to a patchwork bundling snafu. Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-18tools/power turbostat: correct dumped pkg-cstate-limit valueLen Brown1-9/+8
HSW expanded MSR_PKG_CST_CONFIG_CONTROL.Package-C-State-Limit, from bits[2:0] used by previous implementations, to [3:0]. The value 1000b is unlimited, and is used by BDW and SKL too. Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: calculate TSC frequency from CPUID(0x15) on SKLLen Brown1-1/+38
turbostat --debug ... CPUID(0x15): eax_crystal: 2 ebx_tsc: 100 ecx_crystal_hz: 0 TSC: 1200 MHz (24000000 Hz * 100 / 2 / 1000000) Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: correct DRAM RAPL units on recent Xeon processorsAndrey Semin1-3/+25
While not yet documented in the Software Developer's Manual, the data-sheet for modern Xeon states that DRAM RAPL ENERGY units are fixed at 15.3 uJ, rather than being discovered via MSR. Before this patch, DRAM energy on these products is over-stated by turbostat because the RAPL units are 4x larger. ref: "Xeon E5-2600 v3/E5-1600 v3 Datasheet Volume 2" http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/xeon-e5-v3-datasheet-vol-2.pdf Signed-off-by: Andrey Semin <andrey.semin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: Initial Skylake supportLen Brown2-13/+116
Skylake adds some additional residency counters. Skylake supports a different mix of RAPL registers from any previous product. In most other ways, Skylake is like Broadwell. Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in MakefileThomas D1-1/+5
Since commit ee0778a30153 ("tools/power: turbostat: make Makefile a bit more capable") turbostat's Makefile is using [...] BUILD_OUTPUT := $(PWD) [...] which obviously causes trouble when building "turbostat" with make -C /usr/src/linux/tools/power/x86/turbostat ARCH=x86 turbostat because GNU make does not update nor guarantee that $PWD is set. This patch changes the Makefile to use $CURDIR instead, which GNU make guarantees to set and update (i.e. when using "make -C ...") and also adds support for the O= option (see "make help" in your root of your kernel source tree for more details). Link: https://bugs.gentoo.org/show_bug.cgi?id=533918 Fixes: ee0778a30153 ("tools/power: turbostat: make Makefile a bit more capable") Signed-off-by: Thomas D. <whissi@whissi.de> Cc: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: modprobe msr, if neededLen Brown1-2/+3
Some distros (Ubuntu) ship the msr driver as a module. If turbosat is run as root on those systems, and discovers that there is no /dev/cpu/cpu0/msr, it will now "modprobe msr" for the user. If not root, the modprobe attempt will fail, and turbostat will exit as before: turbostat: no /dev/cpu/0/msr, Try "# modprobe msr" : No such file or directory Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: dump MSR_TURBO_RATIO_LIMIT2Len Brown1-36/+105
and up to 18 cores of turbo ratio limit when using the turbostat --debug option. Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18tools/power turbostat: use new MSR_TURBO_RATIO_LIMIT namesLen Brown1-4/+4
s/MSR_NHM_TURBO_RATIO_LIMIT/MSR_TURBO_RATIO_LIMIT/ s/MSR_IVT_TURBO_RATIO_LIMIT/MSR_TURBO_RATIO_LIMIT1/ syntax only -- use the documented strings describing these registers. Signed-off-by: Len Brown <len.brown@intel.com>
2015-04-18Bluetooth: hidp: Fix regression with older userspace and flags validationMarcel Holtmann1-1/+2
While it is not used by newer userspace anymore, the older userspace was utilizing HIDP_VIRTUAL_CABLE_UNPLUG and HIDP_BOOT_PROTOCOL_MODE flags when adding a new HIDP connection. The flags validation is important, but we can not break older userspace and with that allow providing these flags even if newer userspace does not use them anymore. Reported-and-tested-by: Jörg Otte <jrg.otte@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>