mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
This is the 4.14.100 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlxmZZoACgkQONu9yGCS aT6WeQ//VV1Ap7gBdL4trsHKvLqeKw6CcaC4UPEQUhPkDIlZMSPhrNF+XH70RXM+ iQ41jlMW1JJSgUynAy9Ls9VQAZOYZ3ME5DAe7QBZtw38liCqpwVAQ3CLPxAx4Z8M g1ehoruJeTvl7hW643nBSWPnhaVTIjk86x5tsy7v0b46pBYnBuwUPWaNAHDQ696/ jQS/Y7+IHh8MWbQOSMIDkEHhc+3WvOUG6OkZLDd24AYG8XOCGV07S7bzWSQH70sn 9J+F5iHLABCPYtXKSJkCSlJKBQwIHMmxfMSms2Dxo7p34oEt2PTHxuTCVDoXGVm/ aIfr6myaizGZgWxU4obQu4HBniAlAhcx8wX8ChzbMJuOD2yN3UuDqLfS2wft3gYB jZQyiiZl4JA/vNVrY7ygWl/Gozc5893i0Rg+hIgQVbp49MkzX0fA9vxHIqY5eckF 1ixUco9e3NlfAm+3jqcpbsM0j4TJYKRotJgpPYx0yOWIbI8/eaPWjzvRnVaOAxyR ABWDEmeTvhOCrozOnN7TOjioRwPB6Hs18FY17C8bSA75y6BMyoWvUkg3HkR5QXp0 aqdAuRZ7kuYY/gv6Kla5VtYaZF9tkZSbU7fUEWh2tarPnWVQxaLFE7eXLy4WyNzK Maiwh48Qct/jokSEIl6Aq6PNnhxcwvo1qoPZ+awPROYZ7M2lfKQ= =nMNG -----END PGP SIGNATURE----- Merge 4.14.100 into android-4.14 Changes in 4.14.100 mtd: rawnand: gpmi: fix MX28 bus master lockup problem iio: adc: axp288: Fix TS-pin handling iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius signal: Always notice exiting tasks signal: Better detection of synchronous signals misc: vexpress: Off by one in vexpress_syscfg_exec() samples: mei: use /dev/mei0 instead of /dev/mei debugfs: fix debugfs_rename parameter checking tracing: uprobes: Fix typo in pr_fmt string mips: cm: reprime error cause MIPS: OCTEON: don't set octeon_dma_bar_type if PCI is disabled MIPS: VDSO: Include $(ccflags-vdso) in o32,n32 .lds builds ARM: iop32x/n2100: fix PCI IRQ mapping ARM: tango: Improve ARCH_MULTIPLATFORM compatibility mac80211: ensure that mgmt tx skbs have tailroom for encryption drm/modes: Prevent division by zero htotal drm/vmwgfx: Fix setting of dma masks drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user HID: debug: fix the ring buffer implementation Revert "ext4: use ext4_write_inode() when fsyncing w/o a journal" libceph: avoid KEEPALIVE_PENDING races in ceph_con_keepalive() xfrm: refine validation of template and selector families batman-adv: Avoid WARN on net_device without parent in netns batman-adv: Force mac header to start of data on xmit perf tests attr: Fix task term values perf tests attr: Fix group stat tests perf tests attr: Make hw events optional uio: Reduce return paths from uio_write() uio: Prevent device destruction while fds are open uio: use request_threaded_irq instead uio: change to use the mutex lock instead of the spin lock uio: fix crash after the device is unregistered uio: fix wrong return value from uio_mmap() uio: fix possible circular locking dependency Revert "uio: use request_threaded_irq instead" Linux 4.14.100 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
4dd44f441d
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 99
|
||||
SUBLEVEL = 100
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
@ -75,8 +75,7 @@ void __init n2100_map_io(void)
|
||||
/*
|
||||
* N2100 PCI.
|
||||
*/
|
||||
static int __init
|
||||
n2100_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
|
||||
static int n2100_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
|
||||
{
|
||||
int irq;
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <linux/suspend.h>
|
||||
#include <asm/suspend.h>
|
||||
#include "smc.h"
|
||||
#include "pm.h"
|
||||
|
||||
static int tango_pm_powerdown(unsigned long arg)
|
||||
{
|
||||
@ -24,10 +25,7 @@ static const struct platform_suspend_ops tango_pm_ops = {
|
||||
.valid = suspend_valid_only_mem,
|
||||
};
|
||||
|
||||
static int __init tango_pm_init(void)
|
||||
void __init tango_pm_init(void)
|
||||
{
|
||||
suspend_set_ops(&tango_pm_ops);
|
||||
return 0;
|
||||
}
|
||||
|
||||
late_initcall(tango_pm_init);
|
||||
|
7
arch/arm/mach-tango/pm.h
Normal file
7
arch/arm/mach-tango/pm.h
Normal file
@ -0,0 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
#ifdef CONFIG_SUSPEND
|
||||
void __init tango_pm_init(void);
|
||||
#else
|
||||
#define tango_pm_init NULL
|
||||
#endif
|
@ -2,6 +2,7 @@
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include "smc.h"
|
||||
#include "pm.h"
|
||||
|
||||
static void tango_l2c_write(unsigned long val, unsigned int reg)
|
||||
{
|
||||
@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
|
||||
.dt_compat = tango_dt_compat,
|
||||
.l2c_aux_mask = ~0,
|
||||
.l2c_write_sec = tango_l2c_write,
|
||||
.init_late = tango_pm_init,
|
||||
MACHINE_END
|
||||
|
@ -457,5 +457,5 @@ void mips_cm_error_report(void)
|
||||
}
|
||||
|
||||
/* reprime cause register */
|
||||
write_gcr_error_cause(0);
|
||||
write_gcr_error_cause(cm_error);
|
||||
}
|
||||
|
@ -572,6 +572,11 @@ static int __init octeon_pci_setup(void)
|
||||
if (octeon_has_feature(OCTEON_FEATURE_PCIE))
|
||||
return 0;
|
||||
|
||||
if (!octeon_is_pci_host()) {
|
||||
pr_notice("Not in host mode, PCI Controller not initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Point pcibios_map_irq() to the PCI version of it */
|
||||
octeon_pcibios_map_irq = octeon_pci_pcibios_map_irq;
|
||||
|
||||
@ -583,11 +588,6 @@ static int __init octeon_pci_setup(void)
|
||||
else
|
||||
octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG;
|
||||
|
||||
if (!octeon_is_pci_host()) {
|
||||
pr_notice("Not in host mode, PCI Controller not initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* PCI I/O and PCI MEM values */
|
||||
set_io_port_base(OCTEON_PCI_IOSPACE_BASE);
|
||||
ioport_resource.start = 0;
|
||||
|
@ -121,7 +121,7 @@ $(obj)/%-o32.o: $(src)/%.c FORCE
|
||||
$(call cmd,force_checksrc)
|
||||
$(call if_changed_rule,cc_o_c)
|
||||
|
||||
$(obj)/vdso-o32.lds: KBUILD_CPPFLAGS := -mabi=32
|
||||
$(obj)/vdso-o32.lds: KBUILD_CPPFLAGS := $(ccflags-vdso) -mabi=32
|
||||
$(obj)/vdso-o32.lds: $(src)/vdso.lds.S FORCE
|
||||
$(call if_changed_dep,cpp_lds_S)
|
||||
|
||||
@ -161,7 +161,7 @@ $(obj)/%-n32.o: $(src)/%.c FORCE
|
||||
$(call cmd,force_checksrc)
|
||||
$(call if_changed_rule,cc_o_c)
|
||||
|
||||
$(obj)/vdso-n32.lds: KBUILD_CPPFLAGS := -mabi=n32
|
||||
$(obj)/vdso-n32.lds: KBUILD_CPPFLAGS := $(ccflags-vdso) -mabi=n32
|
||||
$(obj)/vdso-n32.lds: $(src)/vdso.lds.S FORCE
|
||||
$(call if_changed_dep,cpp_lds_S)
|
||||
|
||||
|
@ -751,7 +751,7 @@ int drm_mode_hsync(const struct drm_display_mode *mode)
|
||||
if (mode->hsync)
|
||||
return mode->hsync;
|
||||
|
||||
if (mode->htotal < 0)
|
||||
if (mode->htotal <= 0)
|
||||
return 0;
|
||||
|
||||
calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
|
||||
|
@ -604,13 +604,16 @@ out_fixup:
|
||||
static int vmw_dma_masks(struct vmw_private *dev_priv)
|
||||
{
|
||||
struct drm_device *dev = dev_priv->dev;
|
||||
int ret = 0;
|
||||
|
||||
if (intel_iommu_enabled &&
|
||||
ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64));
|
||||
if (dev_priv->map_mode != vmw_dma_phys &&
|
||||
(sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) {
|
||||
DRM_INFO("Restricting DMA addresses to 44 bits.\n");
|
||||
return dma_set_mask(dev->dev, DMA_BIT_MASK(44));
|
||||
return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44));
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
static int vmw_dma_masks(struct vmw_private *dev_priv)
|
||||
|
@ -3818,7 +3818,7 @@ int vmw_execbuf_fence_commands(struct drm_file *file_priv,
|
||||
*p_fence = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/kfifo.h>
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/slab.h>
|
||||
@ -457,7 +458,7 @@ static char *resolv_usage_page(unsigned page, struct seq_file *f) {
|
||||
char *buf = NULL;
|
||||
|
||||
if (!f) {
|
||||
buf = kzalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC);
|
||||
buf = kzalloc(HID_DEBUG_BUFSIZE, GFP_ATOMIC);
|
||||
if (!buf)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
@ -661,17 +662,12 @@ EXPORT_SYMBOL_GPL(hid_dump_device);
|
||||
/* enqueue string to 'events' ring buffer */
|
||||
void hid_debug_event(struct hid_device *hdev, char *buf)
|
||||
{
|
||||
unsigned i;
|
||||
struct hid_debug_list *list;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&hdev->debug_list_lock, flags);
|
||||
list_for_each_entry(list, &hdev->debug_list, node) {
|
||||
for (i = 0; buf[i]; i++)
|
||||
list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] =
|
||||
buf[i];
|
||||
list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE;
|
||||
}
|
||||
list_for_each_entry(list, &hdev->debug_list, node)
|
||||
kfifo_in(&list->hid_debug_fifo, buf, strlen(buf));
|
||||
spin_unlock_irqrestore(&hdev->debug_list_lock, flags);
|
||||
|
||||
wake_up_interruptible(&hdev->debug_wait);
|
||||
@ -722,8 +718,7 @@ void hid_dump_input(struct hid_device *hdev, struct hid_usage *usage, __s32 valu
|
||||
hid_debug_event(hdev, buf);
|
||||
|
||||
kfree(buf);
|
||||
wake_up_interruptible(&hdev->debug_wait);
|
||||
|
||||
wake_up_interruptible(&hdev->debug_wait);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(hid_dump_input);
|
||||
|
||||
@ -1088,8 +1083,8 @@ static int hid_debug_events_open(struct inode *inode, struct file *file)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!(list->hid_debug_buf = kzalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_KERNEL))) {
|
||||
err = -ENOMEM;
|
||||
err = kfifo_alloc(&list->hid_debug_fifo, HID_DEBUG_FIFOSIZE, GFP_KERNEL);
|
||||
if (err) {
|
||||
kfree(list);
|
||||
goto out;
|
||||
}
|
||||
@ -1109,77 +1104,57 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct hid_debug_list *list = file->private_data;
|
||||
int ret = 0, len;
|
||||
int ret = 0, copied;
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
|
||||
mutex_lock(&list->read_mutex);
|
||||
while (ret == 0) {
|
||||
if (list->head == list->tail) {
|
||||
add_wait_queue(&list->hdev->debug_wait, &wait);
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (kfifo_is_empty(&list->hid_debug_fifo)) {
|
||||
add_wait_queue(&list->hdev->debug_wait, &wait);
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
|
||||
while (list->head == list->tail) {
|
||||
if (file->f_flags & O_NONBLOCK) {
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
if (signal_pending(current)) {
|
||||
ret = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!list->hdev || !list->hdev->debug) {
|
||||
ret = -EIO;
|
||||
set_current_state(TASK_RUNNING);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* allow O_NONBLOCK from other threads */
|
||||
mutex_unlock(&list->read_mutex);
|
||||
schedule();
|
||||
mutex_lock(&list->read_mutex);
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
while (kfifo_is_empty(&list->hid_debug_fifo)) {
|
||||
if (file->f_flags & O_NONBLOCK) {
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
|
||||
set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&list->hdev->debug_wait, &wait);
|
||||
if (signal_pending(current)) {
|
||||
ret = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
/* if list->hdev is NULL we cannot remove_wait_queue().
|
||||
* if list->hdev->debug is 0 then hid_debug_unregister()
|
||||
* was already called and list->hdev is being destroyed.
|
||||
* if we add remove_wait_queue() here we can hit a race.
|
||||
*/
|
||||
if (!list->hdev || !list->hdev->debug) {
|
||||
ret = -EIO;
|
||||
set_current_state(TASK_RUNNING);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* allow O_NONBLOCK from other threads */
|
||||
mutex_unlock(&list->read_mutex);
|
||||
schedule();
|
||||
mutex_lock(&list->read_mutex);
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
}
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&list->hdev->debug_wait, &wait);
|
||||
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
/* pass the ringbuffer contents to userspace */
|
||||
copy_rest:
|
||||
if (list->tail == list->head)
|
||||
goto out;
|
||||
if (list->tail > list->head) {
|
||||
len = list->tail - list->head;
|
||||
if (len > count)
|
||||
len = count;
|
||||
|
||||
if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
ret += len;
|
||||
list->head += len;
|
||||
} else {
|
||||
len = HID_DEBUG_BUFSIZE - list->head;
|
||||
if (len > count)
|
||||
len = count;
|
||||
|
||||
if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
list->head = 0;
|
||||
ret += len;
|
||||
count -= len;
|
||||
if (count > 0)
|
||||
goto copy_rest;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* pass the fifo content to userspace, locking is not needed with only
|
||||
* one concurrent reader and one concurrent writer
|
||||
*/
|
||||
ret = kfifo_to_user(&list->hid_debug_fifo, buffer, count, &copied);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = copied;
|
||||
out:
|
||||
mutex_unlock(&list->read_mutex);
|
||||
return ret;
|
||||
@ -1190,7 +1165,7 @@ static unsigned int hid_debug_events_poll(struct file *file, poll_table *wait)
|
||||
struct hid_debug_list *list = file->private_data;
|
||||
|
||||
poll_wait(file, &list->hdev->debug_wait, wait);
|
||||
if (list->head != list->tail)
|
||||
if (!kfifo_is_empty(&list->hid_debug_fifo))
|
||||
return POLLIN | POLLRDNORM;
|
||||
if (!list->hdev->debug)
|
||||
return POLLERR | POLLHUP;
|
||||
@ -1205,7 +1180,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file)
|
||||
spin_lock_irqsave(&list->hdev->debug_list_lock, flags);
|
||||
list_del(&list->node);
|
||||
spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags);
|
||||
kfree(list->hid_debug_buf);
|
||||
kfifo_free(&list->hid_debug_fifo);
|
||||
kfree(list);
|
||||
|
||||
return 0;
|
||||
@ -1256,4 +1231,3 @@ void hid_debug_exit(void)
|
||||
{
|
||||
debugfs_remove_recursive(hid_debug_root);
|
||||
}
|
||||
|
||||
|
@ -27,9 +27,18 @@
|
||||
#include <linux/iio/machine.h>
|
||||
#include <linux/iio/driver.h>
|
||||
|
||||
#define AXP288_ADC_EN_MASK 0xF1
|
||||
#define AXP288_ADC_TS_PIN_GPADC 0xF2
|
||||
#define AXP288_ADC_TS_PIN_ON 0xF3
|
||||
/*
|
||||
* This mask enables all ADCs except for the battery temp-sensor (TS), that is
|
||||
* left as-is to avoid breaking charging on devices without a temp-sensor.
|
||||
*/
|
||||
#define AXP288_ADC_EN_MASK 0xF0
|
||||
#define AXP288_ADC_TS_ENABLE 0x01
|
||||
|
||||
#define AXP288_ADC_TS_CURRENT_ON_OFF_MASK GENMASK(1, 0)
|
||||
#define AXP288_ADC_TS_CURRENT_OFF (0 << 0)
|
||||
#define AXP288_ADC_TS_CURRENT_ON_WHEN_CHARGING (1 << 0)
|
||||
#define AXP288_ADC_TS_CURRENT_ON_ONDEMAND (2 << 0)
|
||||
#define AXP288_ADC_TS_CURRENT_ON (3 << 0)
|
||||
|
||||
enum axp288_adc_id {
|
||||
AXP288_ADC_TS,
|
||||
@ -44,6 +53,7 @@ enum axp288_adc_id {
|
||||
struct axp288_adc_info {
|
||||
int irq;
|
||||
struct regmap *regmap;
|
||||
bool ts_enabled;
|
||||
};
|
||||
|
||||
static const struct iio_chan_spec axp288_adc_channels[] = {
|
||||
@ -123,21 +133,33 @@ static int axp288_adc_read_channel(int *val, unsigned long address,
|
||||
return IIO_VAL_INT;
|
||||
}
|
||||
|
||||
static int axp288_adc_set_ts(struct regmap *regmap, unsigned int mode,
|
||||
unsigned long address)
|
||||
/*
|
||||
* The current-source used for the battery temp-sensor (TS) is shared
|
||||
* with the GPADC. For proper fuel-gauge and charger operation the TS
|
||||
* current-source needs to be permanently on. But to read the GPADC we
|
||||
* need to temporary switch the TS current-source to ondemand, so that
|
||||
* the GPADC can use it, otherwise we will always read an all 0 value.
|
||||
*/
|
||||
static int axp288_adc_set_ts(struct axp288_adc_info *info,
|
||||
unsigned int mode, unsigned long address)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* channels other than GPADC do not need to switch TS pin */
|
||||
/* No need to switch the current-source if the TS pin is disabled */
|
||||
if (!info->ts_enabled)
|
||||
return 0;
|
||||
|
||||
/* Channels other than GPADC do not need the current source */
|
||||
if (address != AXP288_GP_ADC_H)
|
||||
return 0;
|
||||
|
||||
ret = regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, mode);
|
||||
ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
|
||||
AXP288_ADC_TS_CURRENT_ON_OFF_MASK, mode);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* When switching to the GPADC pin give things some time to settle */
|
||||
if (mode == AXP288_ADC_TS_PIN_GPADC)
|
||||
if (mode == AXP288_ADC_TS_CURRENT_ON_ONDEMAND)
|
||||
usleep_range(6000, 10000);
|
||||
|
||||
return 0;
|
||||
@ -153,14 +175,14 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev,
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
switch (mask) {
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
if (axp288_adc_set_ts(info->regmap, AXP288_ADC_TS_PIN_GPADC,
|
||||
if (axp288_adc_set_ts(info, AXP288_ADC_TS_CURRENT_ON_ONDEMAND,
|
||||
chan->address)) {
|
||||
dev_err(&indio_dev->dev, "GPADC mode\n");
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
ret = axp288_adc_read_channel(val, chan->address, info->regmap);
|
||||
if (axp288_adc_set_ts(info->regmap, AXP288_ADC_TS_PIN_ON,
|
||||
if (axp288_adc_set_ts(info, AXP288_ADC_TS_CURRENT_ON,
|
||||
chan->address))
|
||||
dev_err(&indio_dev->dev, "TS pin restore\n");
|
||||
break;
|
||||
@ -172,13 +194,35 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int axp288_adc_set_state(struct regmap *regmap)
|
||||
static int axp288_adc_initialize(struct axp288_adc_info *info)
|
||||
{
|
||||
/* ADC should be always enabled for internal FG to function */
|
||||
if (regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, AXP288_ADC_TS_PIN_ON))
|
||||
return -EIO;
|
||||
int ret, adc_enable_val;
|
||||
|
||||
return regmap_write(regmap, AXP20X_ADC_EN1, AXP288_ADC_EN_MASK);
|
||||
/*
|
||||
* Determine if the TS pin is enabled and set the TS current-source
|
||||
* accordingly.
|
||||
*/
|
||||
ret = regmap_read(info->regmap, AXP20X_ADC_EN1, &adc_enable_val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (adc_enable_val & AXP288_ADC_TS_ENABLE) {
|
||||
info->ts_enabled = true;
|
||||
ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
|
||||
AXP288_ADC_TS_CURRENT_ON_OFF_MASK,
|
||||
AXP288_ADC_TS_CURRENT_ON);
|
||||
} else {
|
||||
info->ts_enabled = false;
|
||||
ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
|
||||
AXP288_ADC_TS_CURRENT_ON_OFF_MASK,
|
||||
AXP288_ADC_TS_CURRENT_OFF);
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Turn on the ADC for all channels except TS, leave TS as is */
|
||||
return regmap_update_bits(info->regmap, AXP20X_ADC_EN1,
|
||||
AXP288_ADC_EN_MASK, AXP288_ADC_EN_MASK);
|
||||
}
|
||||
|
||||
static const struct iio_info axp288_adc_iio_info = {
|
||||
@ -209,7 +253,7 @@ static int axp288_adc_probe(struct platform_device *pdev)
|
||||
* Set ADC to enabled state at all time, including system suspend.
|
||||
* otherwise internal fuel gauge functionality may be affected.
|
||||
*/
|
||||
ret = axp288_adc_set_state(axp20x->regmap);
|
||||
ret = axp288_adc_initialize(info);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "unable to enable ADC device\n");
|
||||
return ret;
|
||||
|
@ -453,9 +453,8 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
switch (chan->type) {
|
||||
case IIO_TEMP:
|
||||
*val = 1; /* 0.01 */
|
||||
*val2 = 100;
|
||||
break;
|
||||
*val = 10;
|
||||
return IIO_VAL_INT;
|
||||
case IIO_PH:
|
||||
*val = 1; /* 0.001 */
|
||||
*val2 = 1000;
|
||||
@ -486,7 +485,7 @@ static int atlas_write_raw(struct iio_dev *indio_dev,
|
||||
int val, int val2, long mask)
|
||||
{
|
||||
struct atlas_data *data = iio_priv(indio_dev);
|
||||
__be32 reg = cpu_to_be32(val);
|
||||
__be32 reg = cpu_to_be32(val / 10);
|
||||
|
||||
if (val2 != 0 || val < 0 || val > 20000)
|
||||
return -EINVAL;
|
||||
|
@ -61,7 +61,7 @@ static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,
|
||||
int tries;
|
||||
long timeout;
|
||||
|
||||
if (WARN_ON(index > func->num_templates))
|
||||
if (WARN_ON(index >= func->num_templates))
|
||||
return -EINVAL;
|
||||
|
||||
command = readl(syscfg->base + SYS_CFGCTRL);
|
||||
|
@ -168,9 +168,10 @@ int gpmi_init(struct gpmi_nand_data *this)
|
||||
|
||||
/*
|
||||
* Reset BCH here, too. We got failures otherwise :(
|
||||
* See later BCH reset for explanation of MX23 handling
|
||||
* See later BCH reset for explanation of MX23 and MX28 handling
|
||||
*/
|
||||
ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
|
||||
ret = gpmi_reset_block(r->bch_regs,
|
||||
GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
|
||||
if (ret)
|
||||
goto err_out;
|
||||
|
||||
@ -275,13 +276,11 @@ int bch_set_geometry(struct gpmi_nand_data *this)
|
||||
|
||||
/*
|
||||
* Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
|
||||
* chip, otherwise it will lock up. So we skip resetting BCH on the MX23.
|
||||
* On the other hand, the MX28 needs the reset, because one case has been
|
||||
* seen where the BCH produced ECC errors constantly after 10000
|
||||
* consecutive reboots. The latter case has not been seen on the MX23
|
||||
* yet, still we don't know if it could happen there as well.
|
||||
* chip, otherwise it will lock up. So we skip resetting BCH on the MX23
|
||||
* and MX28.
|
||||
*/
|
||||
ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
|
||||
ret = gpmi_reset_block(r->bch_regs,
|
||||
GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
|
||||
if (ret)
|
||||
goto err_out;
|
||||
|
||||
|
@ -215,7 +215,20 @@ static ssize_t name_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct uio_device *idev = dev_get_drvdata(dev);
|
||||
return sprintf(buf, "%s\n", idev->info->name);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info) {
|
||||
ret = -EINVAL;
|
||||
dev_err(dev, "the device has been unregistered\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = sprintf(buf, "%s\n", idev->info->name);
|
||||
|
||||
out:
|
||||
mutex_unlock(&idev->info_lock);
|
||||
return ret;
|
||||
}
|
||||
static DEVICE_ATTR_RO(name);
|
||||
|
||||
@ -223,7 +236,20 @@ static ssize_t version_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct uio_device *idev = dev_get_drvdata(dev);
|
||||
return sprintf(buf, "%s\n", idev->info->version);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info) {
|
||||
ret = -EINVAL;
|
||||
dev_err(dev, "the device has been unregistered\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = sprintf(buf, "%s\n", idev->info->version);
|
||||
|
||||
out:
|
||||
mutex_unlock(&idev->info_lock);
|
||||
return ret;
|
||||
}
|
||||
static DEVICE_ATTR_RO(version);
|
||||
|
||||
@ -272,7 +298,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
|
||||
if (!map_found) {
|
||||
map_found = 1;
|
||||
idev->map_dir = kobject_create_and_add("maps",
|
||||
&idev->dev->kobj);
|
||||
&idev->dev.kobj);
|
||||
if (!idev->map_dir) {
|
||||
ret = -ENOMEM;
|
||||
goto err_map;
|
||||
@ -301,7 +327,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
|
||||
if (!portio_found) {
|
||||
portio_found = 1;
|
||||
idev->portio_dir = kobject_create_and_add("portio",
|
||||
&idev->dev->kobj);
|
||||
&idev->dev.kobj);
|
||||
if (!idev->portio_dir) {
|
||||
ret = -ENOMEM;
|
||||
goto err_portio;
|
||||
@ -344,7 +370,7 @@ err_map_kobj:
|
||||
kobject_put(&map->kobj);
|
||||
}
|
||||
kobject_put(idev->map_dir);
|
||||
dev_err(idev->dev, "error creating sysfs files (%d)\n", ret);
|
||||
dev_err(&idev->dev, "error creating sysfs files (%d)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -381,7 +407,7 @@ static int uio_get_minor(struct uio_device *idev)
|
||||
idev->minor = retval;
|
||||
retval = 0;
|
||||
} else if (retval == -ENOSPC) {
|
||||
dev_err(idev->dev, "too many uio devices\n");
|
||||
dev_err(&idev->dev, "too many uio devices\n");
|
||||
retval = -EINVAL;
|
||||
}
|
||||
mutex_unlock(&minor_lock);
|
||||
@ -417,8 +443,9 @@ EXPORT_SYMBOL_GPL(uio_event_notify);
|
||||
static irqreturn_t uio_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
struct uio_device *idev = (struct uio_device *)dev_id;
|
||||
irqreturn_t ret = idev->info->handler(irq, idev->info);
|
||||
irqreturn_t ret;
|
||||
|
||||
ret = idev->info->handler(irq, idev->info);
|
||||
if (ret == IRQ_HANDLED)
|
||||
uio_event_notify(idev->info);
|
||||
|
||||
@ -444,9 +471,11 @@ static int uio_open(struct inode *inode, struct file *filep)
|
||||
goto out;
|
||||
}
|
||||
|
||||
get_device(&idev->dev);
|
||||
|
||||
if (!try_module_get(idev->owner)) {
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
goto err_module_get;
|
||||
}
|
||||
|
||||
listener = kmalloc(sizeof(*listener), GFP_KERNEL);
|
||||
@ -459,11 +488,19 @@ static int uio_open(struct inode *inode, struct file *filep)
|
||||
listener->event_count = atomic_read(&idev->event);
|
||||
filep->private_data = listener;
|
||||
|
||||
if (idev->info->open) {
|
||||
ret = idev->info->open(idev->info, inode);
|
||||
if (ret)
|
||||
goto err_infoopen;
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info) {
|
||||
mutex_unlock(&idev->info_lock);
|
||||
ret = -EINVAL;
|
||||
goto err_alloc_listener;
|
||||
}
|
||||
|
||||
if (idev->info && idev->info->open)
|
||||
ret = idev->info->open(idev->info, inode);
|
||||
mutex_unlock(&idev->info_lock);
|
||||
if (ret)
|
||||
goto err_infoopen;
|
||||
|
||||
return 0;
|
||||
|
||||
err_infoopen:
|
||||
@ -472,6 +509,9 @@ err_infoopen:
|
||||
err_alloc_listener:
|
||||
module_put(idev->owner);
|
||||
|
||||
err_module_get:
|
||||
put_device(&idev->dev);
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
@ -490,11 +530,14 @@ static int uio_release(struct inode *inode, struct file *filep)
|
||||
struct uio_listener *listener = filep->private_data;
|
||||
struct uio_device *idev = listener->dev;
|
||||
|
||||
if (idev->info->release)
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (idev->info && idev->info->release)
|
||||
ret = idev->info->release(idev->info, inode);
|
||||
mutex_unlock(&idev->info_lock);
|
||||
|
||||
module_put(idev->owner);
|
||||
kfree(listener);
|
||||
put_device(&idev->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -502,9 +545,15 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait)
|
||||
{
|
||||
struct uio_listener *listener = filep->private_data;
|
||||
struct uio_device *idev = listener->dev;
|
||||
unsigned int ret = 0;
|
||||
|
||||
if (!idev->info->irq)
|
||||
return -EIO;
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info || !idev->info->irq)
|
||||
ret = -EIO;
|
||||
mutex_unlock(&idev->info_lock);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
poll_wait(filep, &idev->wait, wait);
|
||||
if (listener->event_count != atomic_read(&idev->event))
|
||||
@ -518,11 +567,16 @@ static ssize_t uio_read(struct file *filep, char __user *buf,
|
||||
struct uio_listener *listener = filep->private_data;
|
||||
struct uio_device *idev = listener->dev;
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
ssize_t retval;
|
||||
ssize_t retval = 0;
|
||||
s32 event_count;
|
||||
|
||||
if (!idev->info->irq)
|
||||
return -EIO;
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info || !idev->info->irq)
|
||||
retval = -EIO;
|
||||
mutex_unlock(&idev->info_lock);
|
||||
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
if (count != sizeof(s32))
|
||||
return -EINVAL;
|
||||
@ -570,20 +624,32 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
|
||||
ssize_t retval;
|
||||
s32 irq_on;
|
||||
|
||||
if (!idev->info->irq)
|
||||
return -EIO;
|
||||
|
||||
if (count != sizeof(s32))
|
||||
return -EINVAL;
|
||||
|
||||
if (!idev->info->irqcontrol)
|
||||
return -ENOSYS;
|
||||
|
||||
if (copy_from_user(&irq_on, buf, count))
|
||||
return -EFAULT;
|
||||
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info) {
|
||||
retval = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!idev->info || !idev->info->irq) {
|
||||
retval = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!idev->info->irqcontrol) {
|
||||
retval = -ENOSYS;
|
||||
goto out;
|
||||
}
|
||||
|
||||
retval = idev->info->irqcontrol(idev->info, irq_on);
|
||||
|
||||
out:
|
||||
mutex_unlock(&idev->info_lock);
|
||||
return retval ? retval : sizeof(s32);
|
||||
}
|
||||
|
||||
@ -605,10 +671,20 @@ static int uio_vma_fault(struct vm_fault *vmf)
|
||||
struct page *page;
|
||||
unsigned long offset;
|
||||
void *addr;
|
||||
int ret = 0;
|
||||
int mi;
|
||||
|
||||
int mi = uio_find_mem_index(vmf->vma);
|
||||
if (mi < 0)
|
||||
return VM_FAULT_SIGBUS;
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info) {
|
||||
ret = VM_FAULT_SIGBUS;
|
||||
goto out;
|
||||
}
|
||||
|
||||
mi = uio_find_mem_index(vmf->vma);
|
||||
if (mi < 0) {
|
||||
ret = VM_FAULT_SIGBUS;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to subtract mi because userspace uses offset = N*PAGE_SIZE
|
||||
@ -623,7 +699,11 @@ static int uio_vma_fault(struct vm_fault *vmf)
|
||||
page = vmalloc_to_page(addr);
|
||||
get_page(page);
|
||||
vmf->page = page;
|
||||
return 0;
|
||||
|
||||
out:
|
||||
mutex_unlock(&idev->info_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct vm_operations_struct uio_logical_vm_ops = {
|
||||
@ -648,6 +728,7 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
|
||||
struct uio_device *idev = vma->vm_private_data;
|
||||
int mi = uio_find_mem_index(vma);
|
||||
struct uio_mem *mem;
|
||||
|
||||
if (mi < 0)
|
||||
return -EINVAL;
|
||||
mem = idev->info->mem + mi;
|
||||
@ -689,30 +770,46 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
|
||||
|
||||
vma->vm_private_data = idev;
|
||||
|
||||
mutex_lock(&idev->info_lock);
|
||||
if (!idev->info) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
mi = uio_find_mem_index(vma);
|
||||
if (mi < 0)
|
||||
return -EINVAL;
|
||||
if (mi < 0) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
requested_pages = vma_pages(vma);
|
||||
actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK)
|
||||
+ idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT;
|
||||
if (requested_pages > actual_pages)
|
||||
return -EINVAL;
|
||||
if (requested_pages > actual_pages) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (idev->info->mmap) {
|
||||
ret = idev->info->mmap(idev->info, vma);
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch (idev->info->mem[mi].memtype) {
|
||||
case UIO_MEM_PHYS:
|
||||
return uio_mmap_physical(vma);
|
||||
ret = uio_mmap_physical(vma);
|
||||
break;
|
||||
case UIO_MEM_LOGICAL:
|
||||
case UIO_MEM_VIRTUAL:
|
||||
return uio_mmap_logical(vma);
|
||||
ret = uio_mmap_logical(vma);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
out:
|
||||
mutex_unlock(&idev->info_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations uio_fops = {
|
||||
@ -800,6 +897,13 @@ static void release_uio_class(void)
|
||||
uio_major_cleanup();
|
||||
}
|
||||
|
||||
static void uio_device_release(struct device *dev)
|
||||
{
|
||||
struct uio_device *idev = dev_get_drvdata(dev);
|
||||
|
||||
kfree(idev);
|
||||
}
|
||||
|
||||
/**
|
||||
* uio_register_device - register a new userspace IO device
|
||||
* @owner: module that creates the new device
|
||||
@ -823,13 +927,14 @@ int __uio_register_device(struct module *owner,
|
||||
|
||||
info->uio_dev = NULL;
|
||||
|
||||
idev = devm_kzalloc(parent, sizeof(*idev), GFP_KERNEL);
|
||||
idev = kzalloc(sizeof(*idev), GFP_KERNEL);
|
||||
if (!idev) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
idev->owner = owner;
|
||||
idev->info = info;
|
||||
mutex_init(&idev->info_lock);
|
||||
init_waitqueue_head(&idev->wait);
|
||||
atomic_set(&idev->event, 0);
|
||||
|
||||
@ -837,14 +942,19 @@ int __uio_register_device(struct module *owner,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
idev->dev = device_create(&uio_class, parent,
|
||||
MKDEV(uio_major, idev->minor), idev,
|
||||
"uio%d", idev->minor);
|
||||
if (IS_ERR(idev->dev)) {
|
||||
printk(KERN_ERR "UIO: device register failed\n");
|
||||
ret = PTR_ERR(idev->dev);
|
||||
idev->dev.devt = MKDEV(uio_major, idev->minor);
|
||||
idev->dev.class = &uio_class;
|
||||
idev->dev.parent = parent;
|
||||
idev->dev.release = uio_device_release;
|
||||
dev_set_drvdata(&idev->dev, idev);
|
||||
|
||||
ret = dev_set_name(&idev->dev, "uio%d", idev->minor);
|
||||
if (ret)
|
||||
goto err_device_create;
|
||||
|
||||
ret = device_register(&idev->dev);
|
||||
if (ret)
|
||||
goto err_device_create;
|
||||
}
|
||||
|
||||
ret = uio_dev_add_attributes(idev);
|
||||
if (ret)
|
||||
@ -874,7 +984,7 @@ int __uio_register_device(struct module *owner,
|
||||
err_request_irq:
|
||||
uio_dev_del_attributes(idev);
|
||||
err_uio_dev_add_attributes:
|
||||
device_destroy(&uio_class, MKDEV(uio_major, idev->minor));
|
||||
device_unregister(&idev->dev);
|
||||
err_device_create:
|
||||
uio_free_minor(idev);
|
||||
return ret;
|
||||
@ -897,12 +1007,16 @@ void uio_unregister_device(struct uio_info *info)
|
||||
|
||||
uio_free_minor(idev);
|
||||
|
||||
mutex_lock(&idev->info_lock);
|
||||
uio_dev_del_attributes(idev);
|
||||
|
||||
if (info->irq && info->irq != UIO_IRQ_CUSTOM)
|
||||
free_irq(info->irq, idev);
|
||||
|
||||
device_destroy(&uio_class, MKDEV(uio_major, idev->minor));
|
||||
idev->info = NULL;
|
||||
mutex_unlock(&idev->info_lock);
|
||||
|
||||
device_unregister(&idev->dev);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -766,6 +766,13 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
|
||||
struct dentry *dentry = NULL, *trap;
|
||||
struct name_snapshot old_name;
|
||||
|
||||
if (IS_ERR(old_dir))
|
||||
return old_dir;
|
||||
if (IS_ERR(new_dir))
|
||||
return new_dir;
|
||||
if (IS_ERR_OR_NULL(old_dentry))
|
||||
return old_dentry;
|
||||
|
||||
trap = lock_rename(new_dir, old_dir);
|
||||
/* Source or destination directories don't exist? */
|
||||
if (d_really_is_negative(old_dir) || d_really_is_negative(new_dir))
|
||||
|
@ -116,16 +116,8 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = file_write_and_wait_range(file, start, end);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!journal) {
|
||||
struct writeback_control wbc = {
|
||||
.sync_mode = WB_SYNC_ALL
|
||||
};
|
||||
|
||||
ret = ext4_write_inode(inode, &wbc);
|
||||
ret = __generic_file_fsync(file, start, end, datasync);
|
||||
if (!ret)
|
||||
ret = ext4_sync_parent(inode);
|
||||
if (test_opt(inode->i_sb, BARRIER))
|
||||
@ -133,6 +125,9 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = file_write_and_wait_range(file, start, end);
|
||||
if (ret)
|
||||
return ret;
|
||||
/*
|
||||
* data=writeback,ordered:
|
||||
* The caller's filemap_fdatawrite()/wait will sync the data.
|
||||
|
@ -24,7 +24,10 @@
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
#include <linux/kfifo.h>
|
||||
|
||||
#define HID_DEBUG_BUFSIZE 512
|
||||
#define HID_DEBUG_FIFOSIZE 512
|
||||
|
||||
void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
|
||||
void hid_dump_report(struct hid_device *, int , u8 *, int);
|
||||
@ -37,11 +40,8 @@ void hid_debug_init(void);
|
||||
void hid_debug_exit(void);
|
||||
void hid_debug_event(struct hid_device *, char *);
|
||||
|
||||
|
||||
struct hid_debug_list {
|
||||
char *hid_debug_buf;
|
||||
int head;
|
||||
int tail;
|
||||
DECLARE_KFIFO_PTR(hid_debug_fifo, char);
|
||||
struct fasync_struct *fasync;
|
||||
struct hid_device *hdev;
|
||||
struct list_head node;
|
||||
@ -64,4 +64,3 @@ struct hid_debug_list {
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef _UIO_DRIVER_H_
|
||||
#define _UIO_DRIVER_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
@ -68,12 +69,13 @@ struct uio_port {
|
||||
|
||||
struct uio_device {
|
||||
struct module *owner;
|
||||
struct device *dev;
|
||||
struct device dev;
|
||||
int minor;
|
||||
atomic_t event;
|
||||
struct fasync_struct *async_queue;
|
||||
wait_queue_head_t wait;
|
||||
struct uio_info *info;
|
||||
struct mutex info_lock;
|
||||
struct kobject *map_dir;
|
||||
struct kobject *portio_dir;
|
||||
};
|
||||
|
@ -672,6 +672,48 @@ void signal_wake_up_state(struct task_struct *t, unsigned int state)
|
||||
kick_process(t);
|
||||
}
|
||||
|
||||
static int dequeue_synchronous_signal(siginfo_t *info)
|
||||
{
|
||||
struct task_struct *tsk = current;
|
||||
struct sigpending *pending = &tsk->pending;
|
||||
struct sigqueue *q, *sync = NULL;
|
||||
|
||||
/*
|
||||
* Might a synchronous signal be in the queue?
|
||||
*/
|
||||
if (!((pending->signal.sig[0] & ~tsk->blocked.sig[0]) & SYNCHRONOUS_MASK))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Return the first synchronous signal in the queue.
|
||||
*/
|
||||
list_for_each_entry(q, &pending->list, list) {
|
||||
/* Synchronous signals have a postive si_code */
|
||||
if ((q->info.si_code > SI_USER) &&
|
||||
(sigmask(q->info.si_signo) & SYNCHRONOUS_MASK)) {
|
||||
sync = q;
|
||||
goto next;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
next:
|
||||
/*
|
||||
* Check if there is another siginfo for the same signal.
|
||||
*/
|
||||
list_for_each_entry_continue(q, &pending->list, list) {
|
||||
if (q->info.si_signo == sync->info.si_signo)
|
||||
goto still_pending;
|
||||
}
|
||||
|
||||
sigdelset(&pending->signal, sync->info.si_signo);
|
||||
recalc_sigpending();
|
||||
still_pending:
|
||||
list_del_init(&sync->list);
|
||||
copy_siginfo(info, &sync->info);
|
||||
__sigqueue_free(sync);
|
||||
return info->si_signo;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove signals in mask from the pending set and queue.
|
||||
* Returns 1 if any signals were found.
|
||||
@ -2225,6 +2267,11 @@ relock:
|
||||
goto relock;
|
||||
}
|
||||
|
||||
/* Has this task already been marked for death? */
|
||||
ksig->info.si_signo = signr = SIGKILL;
|
||||
if (signal_group_exit(signal))
|
||||
goto fatal;
|
||||
|
||||
for (;;) {
|
||||
struct k_sigaction *ka;
|
||||
|
||||
@ -2238,7 +2285,15 @@ relock:
|
||||
goto relock;
|
||||
}
|
||||
|
||||
signr = dequeue_signal(current, ¤t->blocked, &ksig->info);
|
||||
/*
|
||||
* Signals generated by the execution of an instruction
|
||||
* need to be delivered before any other pending signals
|
||||
* so that the instruction pointer in the signal stack
|
||||
* frame points to the faulting instruction.
|
||||
*/
|
||||
signr = dequeue_synchronous_signal(&ksig->info);
|
||||
if (!signr)
|
||||
signr = dequeue_signal(current, ¤t->blocked, &ksig->info);
|
||||
|
||||
if (!signr)
|
||||
break; /* will return 0 */
|
||||
@ -2320,6 +2375,7 @@ relock:
|
||||
continue;
|
||||
}
|
||||
|
||||
fatal:
|
||||
spin_unlock_irq(&sighand->siglock);
|
||||
|
||||
/*
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) IBM Corporation, 2010-2012
|
||||
* Author: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
|
||||
*/
|
||||
#define pr_fmt(fmt) "trace_kprobe: " fmt
|
||||
#define pr_fmt(fmt) "trace_uprobe: " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/byteorder/generic.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@ -172,8 +171,10 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
|
||||
parent_dev = __dev_get_by_index((struct net *)parent_net,
|
||||
dev_get_iflink(net_dev));
|
||||
/* if we got a NULL parent_dev there is something broken.. */
|
||||
if (WARN(!parent_dev, "Cannot find parent device"))
|
||||
if (!parent_dev) {
|
||||
pr_err("Cannot find parent device\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (batadv_mutual_parents(net_dev, net, parent_dev, parent_net))
|
||||
return false;
|
||||
|
@ -213,6 +213,8 @@ static int batadv_interface_tx(struct sk_buff *skb,
|
||||
|
||||
netif_trans_update(soft_iface);
|
||||
vid = batadv_get_vid(skb, 0);
|
||||
|
||||
skb_reset_mac_header(skb);
|
||||
ethhdr = eth_hdr(skb);
|
||||
|
||||
switch (ntohs(ethhdr->h_proto)) {
|
||||
|
@ -3210,9 +3210,10 @@ void ceph_con_keepalive(struct ceph_connection *con)
|
||||
dout("con_keepalive %p\n", con);
|
||||
mutex_lock(&con->mutex);
|
||||
clear_standby(con);
|
||||
con_flag_set(con, CON_FLAG_KEEPALIVE_PENDING);
|
||||
mutex_unlock(&con->mutex);
|
||||
if (con_flag_test_and_set(con, CON_FLAG_KEEPALIVE_PENDING) == 0 &&
|
||||
con_flag_test_and_set(con, CON_FLAG_WRITE_PENDING) == 0)
|
||||
|
||||
if (con_flag_test_and_set(con, CON_FLAG_WRITE_PENDING) == 0)
|
||||
queue_con(con);
|
||||
}
|
||||
EXPORT_SYMBOL(ceph_con_keepalive);
|
||||
|
@ -1856,9 +1856,16 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,
|
||||
int head_need, bool may_encrypt)
|
||||
{
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct ieee80211_hdr *hdr;
|
||||
bool enc_tailroom;
|
||||
int tail_need = 0;
|
||||
|
||||
if (may_encrypt && sdata->crypto_tx_tailroom_needed_cnt) {
|
||||
hdr = (struct ieee80211_hdr *) skb->data;
|
||||
enc_tailroom = may_encrypt &&
|
||||
(sdata->crypto_tx_tailroom_needed_cnt ||
|
||||
ieee80211_is_mgmt(hdr->frame_control));
|
||||
|
||||
if (enc_tailroom) {
|
||||
tail_need = IEEE80211_ENCRYPT_TAILROOM;
|
||||
tail_need -= skb_tailroom(skb);
|
||||
tail_need = max_t(int, tail_need, 0);
|
||||
@ -1866,8 +1873,7 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
if (skb_cloned(skb) &&
|
||||
(!ieee80211_hw_check(&local->hw, SUPPORTS_CLONED_SKBS) ||
|
||||
!skb_clone_writable(skb, ETH_HLEN) ||
|
||||
(may_encrypt && sdata->crypto_tx_tailroom_needed_cnt)))
|
||||
!skb_clone_writable(skb, ETH_HLEN) || enc_tailroom))
|
||||
I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
|
||||
else if (head_need || tail_need)
|
||||
I802_DEBUG_INC(local->tx_expand_skb_head);
|
||||
|
@ -1482,10 +1482,15 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family)
|
||||
if (!ut[i].family)
|
||||
ut[i].family = family;
|
||||
|
||||
if ((ut[i].mode == XFRM_MODE_TRANSPORT) &&
|
||||
(ut[i].family != prev_family))
|
||||
return -EINVAL;
|
||||
|
||||
switch (ut[i].mode) {
|
||||
case XFRM_MODE_TUNNEL:
|
||||
case XFRM_MODE_BEET:
|
||||
break;
|
||||
default:
|
||||
if (ut[i].family != prev_family)
|
||||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (ut[i].mode >= XFRM_MODE_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -117,7 +117,7 @@ static bool mei_init(struct mei *me, const uuid_le *guid,
|
||||
|
||||
me->verbose = verbose;
|
||||
|
||||
me->fd = open("/dev/mei", O_RDWR);
|
||||
me->fd = open("/dev/mei0", O_RDWR);
|
||||
if (me->fd == -1) {
|
||||
mei_err(me, "Cannot establish a handle to the Intel MEI driver\n");
|
||||
goto err;
|
||||
|
@ -23,7 +23,7 @@ comm=1
|
||||
freq=1
|
||||
inherit_stat=0
|
||||
enable_on_exec=1
|
||||
task=0
|
||||
task=1
|
||||
watermark=0
|
||||
precise_ip=0|1|2|3
|
||||
mmap_data=0
|
||||
|
@ -17,5 +17,6 @@ sample_type=327
|
||||
read_format=4
|
||||
mmap=0
|
||||
comm=0
|
||||
task=0
|
||||
enable_on_exec=0
|
||||
disabled=0
|
||||
|
@ -23,7 +23,7 @@ sample_type=343
|
||||
|
||||
# PERF_FORMAT_ID | PERF_FORMAT_GROUP
|
||||
read_format=12
|
||||
|
||||
task=0
|
||||
mmap=0
|
||||
comm=0
|
||||
enable_on_exec=0
|
||||
|
@ -18,5 +18,6 @@ sample_type=327
|
||||
read_format=4
|
||||
mmap=0
|
||||
comm=0
|
||||
task=0
|
||||
enable_on_exec=0
|
||||
disabled=0
|
||||
|
@ -7,3 +7,4 @@ ret = 1
|
||||
# events are disabled by default when attached to cpu
|
||||
disabled=1
|
||||
enable_on_exec=0
|
||||
optional=1
|
||||
|
@ -4,3 +4,4 @@ args = -e cycles kill >/dev/null 2>&1
|
||||
ret = 1
|
||||
|
||||
[event:base-stat]
|
||||
optional=1
|
||||
|
@ -32,6 +32,7 @@ config=2
|
||||
fd=5
|
||||
type=0
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
|
||||
[event6:base-stat]
|
||||
@ -52,15 +53,18 @@ optional=1
|
||||
fd=8
|
||||
type=0
|
||||
config=1
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_INSTRUCTIONS
|
||||
[event9:base-stat]
|
||||
fd=9
|
||||
type=0
|
||||
config=4
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_MISSES
|
||||
[event10:base-stat]
|
||||
fd=10
|
||||
type=0
|
||||
config=5
|
||||
optional=1
|
||||
|
@ -33,6 +33,7 @@ config=2
|
||||
fd=5
|
||||
type=0
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
|
||||
[event6:base-stat]
|
||||
@ -53,18 +54,21 @@ optional=1
|
||||
fd=8
|
||||
type=0
|
||||
config=1
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_INSTRUCTIONS
|
||||
[event9:base-stat]
|
||||
fd=9
|
||||
type=0
|
||||
config=4
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_MISSES
|
||||
[event10:base-stat]
|
||||
fd=10
|
||||
type=0
|
||||
config=5
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
@ -74,6 +78,7 @@ config=5
|
||||
fd=11
|
||||
type=3
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
@ -83,6 +88,7 @@ config=0
|
||||
fd=12
|
||||
type=3
|
||||
config=65536
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_LL << 0 |
|
||||
@ -92,6 +98,7 @@ config=65536
|
||||
fd=13
|
||||
type=3
|
||||
config=2
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_LL << 0 |
|
||||
@ -101,3 +108,4 @@ config=2
|
||||
fd=14
|
||||
type=3
|
||||
config=65538
|
||||
optional=1
|
||||
|
@ -33,6 +33,7 @@ config=2
|
||||
fd=5
|
||||
type=0
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
|
||||
[event6:base-stat]
|
||||
@ -53,18 +54,21 @@ optional=1
|
||||
fd=8
|
||||
type=0
|
||||
config=1
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_INSTRUCTIONS
|
||||
[event9:base-stat]
|
||||
fd=9
|
||||
type=0
|
||||
config=4
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_MISSES
|
||||
[event10:base-stat]
|
||||
fd=10
|
||||
type=0
|
||||
config=5
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
@ -74,6 +78,7 @@ config=5
|
||||
fd=11
|
||||
type=3
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
@ -83,6 +88,7 @@ config=0
|
||||
fd=12
|
||||
type=3
|
||||
config=65536
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_LL << 0 |
|
||||
@ -92,6 +98,7 @@ config=65536
|
||||
fd=13
|
||||
type=3
|
||||
config=2
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_LL << 0 |
|
||||
@ -101,6 +108,7 @@ config=2
|
||||
fd=14
|
||||
type=3
|
||||
config=65538
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_L1I << 0 |
|
||||
@ -120,6 +128,7 @@ optional=1
|
||||
fd=16
|
||||
type=3
|
||||
config=65537
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_DTLB << 0 |
|
||||
@ -129,6 +138,7 @@ config=65537
|
||||
fd=17
|
||||
type=3
|
||||
config=3
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_DTLB << 0 |
|
||||
@ -138,6 +148,7 @@ config=3
|
||||
fd=18
|
||||
type=3
|
||||
config=65539
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_ITLB << 0 |
|
||||
@ -147,6 +158,7 @@ config=65539
|
||||
fd=19
|
||||
type=3
|
||||
config=4
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_ITLB << 0 |
|
||||
@ -156,3 +168,4 @@ config=4
|
||||
fd=20
|
||||
type=3
|
||||
config=65540
|
||||
optional=1
|
||||
|
@ -33,6 +33,7 @@ config=2
|
||||
fd=5
|
||||
type=0
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
|
||||
[event6:base-stat]
|
||||
@ -53,18 +54,21 @@ optional=1
|
||||
fd=8
|
||||
type=0
|
||||
config=1
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_INSTRUCTIONS
|
||||
[event9:base-stat]
|
||||
fd=9
|
||||
type=0
|
||||
config=4
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_MISSES
|
||||
[event10:base-stat]
|
||||
fd=10
|
||||
type=0
|
||||
config=5
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
@ -74,6 +78,7 @@ config=5
|
||||
fd=11
|
||||
type=3
|
||||
config=0
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
@ -83,6 +88,7 @@ config=0
|
||||
fd=12
|
||||
type=3
|
||||
config=65536
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE /
|
||||
# PERF_COUNT_HW_CACHE_LL << 0 |
|
||||
@ -92,6 +98,7 @@ config=65536
|
||||
fd=13
|
||||
type=3
|
||||
config=2
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_LL << 0 |
|
||||
@ -101,6 +108,7 @@ config=2
|
||||
fd=14
|
||||
type=3
|
||||
config=65538
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_L1I << 0 |
|
||||
@ -120,6 +128,7 @@ optional=1
|
||||
fd=16
|
||||
type=3
|
||||
config=65537
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_DTLB << 0 |
|
||||
@ -129,6 +138,7 @@ config=65537
|
||||
fd=17
|
||||
type=3
|
||||
config=3
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_DTLB << 0 |
|
||||
@ -138,6 +148,7 @@ config=3
|
||||
fd=18
|
||||
type=3
|
||||
config=65539
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_ITLB << 0 |
|
||||
@ -147,6 +158,7 @@ config=65539
|
||||
fd=19
|
||||
type=3
|
||||
config=4
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_ITLB << 0 |
|
||||
@ -156,6 +168,7 @@ config=4
|
||||
fd=20
|
||||
type=3
|
||||
config=65540
|
||||
optional=1
|
||||
|
||||
# PERF_TYPE_HW_CACHE,
|
||||
# PERF_COUNT_HW_CACHE_L1D << 0 |
|
||||
|
@ -6,6 +6,7 @@ ret = 1
|
||||
[event-1:base-stat]
|
||||
fd=1
|
||||
group_fd=-1
|
||||
read_format=3|15
|
||||
|
||||
[event-2:base-stat]
|
||||
fd=2
|
||||
@ -13,3 +14,4 @@ group_fd=1
|
||||
config=1
|
||||
disabled=0
|
||||
enable_on_exec=0
|
||||
read_format=3|15
|
||||
|
@ -6,6 +6,7 @@ ret = 1
|
||||
[event-1:base-stat]
|
||||
fd=1
|
||||
group_fd=-1
|
||||
read_format=3|15
|
||||
|
||||
[event-2:base-stat]
|
||||
fd=2
|
||||
@ -13,3 +14,4 @@ group_fd=1
|
||||
config=1
|
||||
disabled=0
|
||||
enable_on_exec=0
|
||||
read_format=3|15
|
||||
|
@ -5,3 +5,4 @@ ret = 1
|
||||
|
||||
[event:base-stat]
|
||||
inherit=0
|
||||
optional=1
|
||||
|
Loading…
x
Reference in New Issue
Block a user