Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
Merge 4.9.250 into android-msm-bluecross-4.9
Browse files Browse the repository at this point in the history
Changes in 4.9.250: (34 commits)
        x86/entry/64: Add instruction suffix
        ALSA: hda/ca0132 - Fix work handling in delayed HP detection
        ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk
        ALSA: usb-audio: fix sync-ep altsetting sanity check
        ALSA: hda/realtek - Support Dell headset mode for ALC3271
        ALSA: hda - Fix a wrong FIXUP for alc289 on Dell machines
        ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236
        vfio/pci: Move dummy_resources_list init in vfio_pci_probe()
        s390/dasd: fix hanging device offline processing
        USB: serial: digi_acceleport: fix write-wakeup deadlocks
        net: ipv6: keep sk status consistent after datagram connect failure
        l2tp: fix races with ipv4-mapped ipv6 addresses
        uapi: move constants from <linux/kernel.h> to <linux/const.h>
        of: fix linker-section match-table corruption
        reiserfs: add check for an invalid ih_entry_count
        misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_ctx_get_chkpt_doorbells()
        media: gp8psk: initialize stats at power control logic
        ALSA: seq: Use bool for snd_seq_queue internal flags
        module: set MODULE_STATE_GOING state when a module fails to load
        quota: Don't overflow quota file offsets
        powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe()
        module: delay kobject uevent until after module init call
        kdev_t: always inline major/minor helper functions
        xen/xenbus: Allow watches discard events before queueing
        xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
        xen/xenbus/xen_bus_type: Support will_handle watch callback
        xen/xenbus: Count pending messages for each watch
        xenbus/xenbus_backend: Disallow pending watch messages
        iio: bmi160_core: Fix sparse warning due to incorrect type in assignment
        iio:imu:bmi160: Fix too large a buffer.
        iio:imu:bmi160: Fix alignment and data leak issues
        iio:magnetometer:mag3110: Fix alignment and data leak issues.
        mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
        Linux 4.9.250

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Conflicts:
	net/ipv6/datagram.c
  • Loading branch information
nathanchance committed Jan 9, 2021
2 parents 59a3bd9 + 7e8e7dc commit 240becc
Show file tree
Hide file tree
Showing 40 changed files with 240 additions and 168 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 249
SUBLEVEL = 250
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/mpic_msgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)

/* IO map the message register block. */
of_address_to_resource(np, 0, &rsrc);
msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc));
msgr_block_addr = devm_ioremap(&dev->dev, rsrc.start, resource_size(&rsrc));
if (!msgr_block_addr) {
dev_err(&dev->dev, "Failed to iomap MPIC message registers");
return -EFAULT;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/entry/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ENDPROC(native_usergs_sysret64)

.macro TRACE_IRQS_IRETQ
#ifdef CONFIG_TRACE_IRQFLAGS
bt $9, EFLAGS(%rsp) /* interrupts off? */
btl $9, EFLAGS(%rsp) /* interrupts off? */
jnc 1f
TRACE_IRQS_ON
1:
Expand Down
3 changes: 2 additions & 1 deletion drivers/block/xen-blkback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ static int xen_blkbk_probe(struct xenbus_device *dev,
/* setup back pointer */
be->blkif->be = be;

err = xenbus_watch_pathfmt(dev, &be->backend_watch, backend_changed,
err = xenbus_watch_pathfmt(dev, &be->backend_watch, NULL,
backend_changed,
"%s/%s", dev->nodename, "physical-device");
if (err)
goto fail;
Expand Down
12 changes: 9 additions & 3 deletions drivers/iio/imu/bmi160/bmi160_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ enum bmi160_sensor_type {

struct bmi160_data {
struct regmap *regmap;
/*
* Ensure natural alignment for timestamp if present.
* Max length needed: 2 * 3 channels + 4 bytes padding + 8 byte ts.
* If fewer channels are enabled, less space may be needed, as
* long as the timestamp is still aligned to 8 bytes.
*/
__le16 buf[12] __aligned(8);
};

const struct regmap_config bmi160_regmap_config = {
Expand Down Expand Up @@ -385,7 +392,6 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct bmi160_data *data = iio_priv(indio_dev);
s16 buf[16]; /* 3 sens x 3 axis x s16 + 3 x s16 pad + 4 x s16 tstamp */
int i, ret, j = 0, base = BMI160_REG_DATA_MAGN_XOUT_L;
__le16 sample;

Expand All @@ -395,10 +401,10 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p)
&sample, sizeof(__le16));
if (ret < 0)
goto done;
buf[j++] = sample;
data->buf[j++] = sample;
}

iio_push_to_buffers_with_timestamp(indio_dev, buf,
iio_push_to_buffers_with_timestamp(indio_dev, data->buf,
iio_get_time_ns(indio_dev));
done:
iio_trigger_notify_done(indio_dev->trig);
Expand Down
13 changes: 9 additions & 4 deletions drivers/iio/magnetometer/mag3110.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ struct mag3110_data {
struct i2c_client *client;
struct mutex lock;
u8 ctrl_reg1;
/* Ensure natural alignment of timestamp */
struct {
__be16 channels[3];
u8 temperature;
s64 ts __aligned(8);
} scan;
};

static int mag3110_request(struct mag3110_data *data)
Expand Down Expand Up @@ -262,10 +268,9 @@ static irqreturn_t mag3110_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct mag3110_data *data = iio_priv(indio_dev);
u8 buffer[16]; /* 3 16-bit channels + 1 byte temp + padding + ts */
int ret;

ret = mag3110_read(data, (__be16 *) buffer);
ret = mag3110_read(data, data->scan.channels);
if (ret < 0)
goto done;

Expand All @@ -274,10 +279,10 @@ static irqreturn_t mag3110_trigger_handler(int irq, void *p)
MAG3110_DIE_TEMP);
if (ret < 0)
goto done;
buffer[6] = ret;
data->scan.temperature = ret;
}

iio_push_to_buffers_with_timestamp(indio_dev, buffer,
iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
iio_get_time_ns(indio_dev));

done:
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/dvb-usb/gp8psk.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d)

static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff)
{
u8 status, buf;
u8 status = 0, buf;
int gp_product_id = le16_to_cpu(d->udev->descriptor.idProduct);

if (onoff) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/vmw_vmci/vmci_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ static int vmci_ctx_get_chkpt_doorbells(struct vmci_ctx *context,
return VMCI_ERROR_MORE_DATA;
}

dbells = kmalloc(data_size, GFP_ATOMIC);
dbells = kzalloc(data_size, GFP_ATOMIC);
if (!dbells)
return VMCI_ERROR_NO_MEM;

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/marvell/mwifiex/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,

memset(adhoc_start->ssid, 0, IEEE80211_MAX_SSID_LEN);

if (req_ssid->ssid_len > IEEE80211_MAX_SSID_LEN)
req_ssid->ssid_len = IEEE80211_MAX_SSID_LEN;
memcpy(adhoc_start->ssid, req_ssid->ssid, req_ssid->ssid_len);

mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: SSID = %s\n",
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/xen-netback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,14 @@ static int xen_register_credit_watch(struct xenbus_device *dev,
return -ENOMEM;
snprintf(node, maxlen, "%s/rate", dev->nodename);
vif->credit_watch.node = node;
vif->credit_watch.will_handle = NULL;
vif->credit_watch.callback = xen_net_rate_changed;
err = register_xenbus_watch(&vif->credit_watch);
if (err) {
pr_err("Failed to set watcher %s\n", vif->credit_watch.node);
kfree(node);
vif->credit_watch.node = NULL;
vif->credit_watch.will_handle = NULL;
vif->credit_watch.callback = NULL;
}
return err;
Expand Down Expand Up @@ -1038,7 +1040,7 @@ static void connect(struct backend_info *be)
xenvif_carrier_on(be->vif);

unregister_hotplug_status_watch(be);
err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
hotplug_status_changed,
"%s/%s", dev->nodename, "hotplug-status");
if (!err)
Expand Down
10 changes: 9 additions & 1 deletion drivers/s390/block/dasd_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,19 @@ static int read_unit_address_configuration(struct dasd_device *device,
spin_unlock_irqrestore(&lcu->lock, flags);

rc = dasd_sleep_on(cqr);
if (rc && !suborder_not_supported(cqr)) {
if (!rc)
goto out;

if (suborder_not_supported(cqr)) {
/* suborder not supported or device unusable for IO */
rc = -EOPNOTSUPP;
} else {
/* IO failed but should be retried */
spin_lock_irqsave(&lcu->lock, flags);
lcu->flags |= NEED_UAC_UPDATE;
spin_unlock_irqrestore(&lcu->lock, flags);
}
out:
dasd_kfree_request(cqr, cqr->memdev);
return rc;
}
Expand Down
45 changes: 13 additions & 32 deletions drivers/usb/serial/digi_acceleport.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/wait.h>
Expand Down Expand Up @@ -201,14 +200,12 @@ struct digi_port {
int dp_throttle_restart;
wait_queue_head_t dp_flush_wait;
wait_queue_head_t dp_close_wait; /* wait queue for close */
struct work_struct dp_wakeup_work;
struct usb_serial_port *dp_port;
};


/* Local Function Declarations */

static void digi_wakeup_write_lock(struct work_struct *work);
static int digi_write_oob_command(struct usb_serial_port *port,
unsigned char *buf, int count, int interruptible);
static int digi_write_inb_command(struct usb_serial_port *port,
Expand Down Expand Up @@ -355,26 +352,6 @@ __releases(lock)
return timeout;
}


/*
* Digi Wakeup Write
*
* Wake up port, line discipline, and tty processes sleeping
* on writes.
*/

static void digi_wakeup_write_lock(struct work_struct *work)
{
struct digi_port *priv =
container_of(work, struct digi_port, dp_wakeup_work);
struct usb_serial_port *port = priv->dp_port;
unsigned long flags;

spin_lock_irqsave(&priv->dp_port_lock, flags);
tty_port_tty_wakeup(&port->port);
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
}

/*
* Digi Write OOB Command
*
Expand Down Expand Up @@ -985,6 +962,7 @@ static void digi_write_bulk_callback(struct urb *urb)
struct digi_serial *serial_priv;
int ret = 0;
int status = urb->status;
bool wakeup;

/* port and serial sanity check */
if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) {
Expand All @@ -1011,6 +989,7 @@ static void digi_write_bulk_callback(struct urb *urb)
}

/* try to send any buffered data on this port */
wakeup = true;
spin_lock(&priv->dp_port_lock);
priv->dp_write_urb_in_use = 0;
if (priv->dp_out_buf_len > 0) {
Expand All @@ -1026,19 +1005,18 @@ static void digi_write_bulk_callback(struct urb *urb)
if (ret == 0) {
priv->dp_write_urb_in_use = 1;
priv->dp_out_buf_len = 0;
wakeup = false;
}
}
/* wake up processes sleeping on writes immediately */
tty_port_tty_wakeup(&port->port);
/* also queue up a wakeup at scheduler time, in case we */
/* lost the race in write_chan(). */
schedule_work(&priv->dp_wakeup_work);

spin_unlock(&priv->dp_port_lock);

if (ret && ret != -EPERM)
dev_err_console(port,
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
__func__, ret, priv->dp_port_num);

if (wakeup)
tty_port_tty_wakeup(&port->port);
}

static int digi_write_room(struct tty_struct *tty)
Expand Down Expand Up @@ -1238,7 +1216,6 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num)
init_waitqueue_head(&priv->dp_transmit_idle_wait);
init_waitqueue_head(&priv->dp_flush_wait);
init_waitqueue_head(&priv->dp_close_wait);
INIT_WORK(&priv->dp_wakeup_work, digi_wakeup_write_lock);
priv->dp_port = port;

init_waitqueue_head(&port->write_wait);
Expand Down Expand Up @@ -1524,13 +1501,14 @@ static int digi_read_oob_callback(struct urb *urb)
rts = C_CRTSCTS(tty);

if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) {
bool wakeup = false;

spin_lock(&priv->dp_port_lock);
/* convert from digi flags to termiox flags */
if (val & DIGI_READ_INPUT_SIGNALS_CTS) {
priv->dp_modem_signals |= TIOCM_CTS;
/* port must be open to use tty struct */
if (rts)
tty_port_tty_wakeup(&port->port);
wakeup = true;
} else {
priv->dp_modem_signals &= ~TIOCM_CTS;
/* port must be open to use tty struct */
Expand All @@ -1549,6 +1527,9 @@ static int digi_read_oob_callback(struct urb *urb)
priv->dp_modem_signals &= ~TIOCM_CD;

spin_unlock(&priv->dp_port_lock);

if (wakeup)
tty_port_tty_wakeup(&port->port);
} else if (opcode == DIGI_CMD_TRANSMIT_IDLE) {
spin_lock(&priv->dp_port_lock);
priv->dp_transmit_idle = 1;
Expand Down
4 changes: 1 addition & 3 deletions drivers/vfio/pci/vfio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ static void vfio_pci_probe_mmaps(struct vfio_pci_device *vdev)
int bar;
struct vfio_pci_dummy_resource *dummy_res;

INIT_LIST_HEAD(&vdev->dummy_resources_list);

for (bar = PCI_STD_RESOURCES; bar <= PCI_STD_RESOURCE_END; bar++) {
res = vdev->pdev->resource + bar;

Expand Down Expand Up @@ -1547,7 +1545,7 @@ static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
vdev->irq_type = VFIO_PCI_NUM_IRQS;
mutex_init(&vdev->igate);
spin_lock_init(&vdev->irqlock);

INIT_LIST_HEAD(&vdev->dummy_resources_list);
mutex_init(&vdev->vma_lock);
INIT_LIST_HEAD(&vdev->vma_list);
init_rwsem(&vdev->memory_lock);
Expand Down
2 changes: 1 addition & 1 deletion drivers/xen/xen-pciback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ static int xen_pcibk_xenbus_probe(struct xenbus_device *dev,

/* watch the backend node for backend configuration information */
err = xenbus_watch_path(dev, dev->nodename, &pdev->be_watch,
xen_pcibk_be_watch);
NULL, xen_pcibk_be_watch);
if (err)
goto out;

Expand Down
8 changes: 7 additions & 1 deletion drivers/xen/xenbus/xenbus_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,22 @@ EXPORT_SYMBOL_GPL(xenbus_strstate);
*/
int xenbus_watch_path(struct xenbus_device *dev, const char *path,
struct xenbus_watch *watch,
bool (*will_handle)(struct xenbus_watch *,
const char **, unsigned int),
void (*callback)(struct xenbus_watch *,
const char **, unsigned int))
{
int err;

watch->node = path;
watch->will_handle = will_handle;
watch->callback = callback;

err = register_xenbus_watch(watch);

if (err) {
watch->node = NULL;
watch->will_handle = NULL;
watch->callback = NULL;
xenbus_dev_fatal(dev, err, "adding watch on %s", path);
}
Expand All @@ -152,6 +156,8 @@ EXPORT_SYMBOL_GPL(xenbus_watch_path);
*/
int xenbus_watch_pathfmt(struct xenbus_device *dev,
struct xenbus_watch *watch,
bool (*will_handle)(struct xenbus_watch *,
const char **, unsigned int),
void (*callback)(struct xenbus_watch *,
const char **, unsigned int),
const char *pathfmt, ...)
Expand All @@ -168,7 +174,7 @@ int xenbus_watch_pathfmt(struct xenbus_device *dev,
xenbus_dev_fatal(dev, -ENOMEM, "allocating path for watch");
return -ENOMEM;
}
err = xenbus_watch_path(dev, path, watch, callback);
err = xenbus_watch_path(dev, path, watch, will_handle, callback);

if (err)
kfree(path);
Expand Down
1 change: 1 addition & 0 deletions drivers/xen/xenbus/xenbus_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ static int watch_otherend(struct xenbus_device *dev)
container_of(dev->dev.bus, struct xen_bus_type, bus);

return xenbus_watch_pathfmt(dev, &dev->otherend_watch,
bus->otherend_will_handle,
bus->otherend_changed,
"%s/%s", dev->otherend, "state");
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/xen/xenbus/xenbus_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct xen_bus_type {
int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename);
int (*probe)(struct xen_bus_type *bus, const char *type,
const char *dir);
bool (*otherend_will_handle)(struct xenbus_watch *watch,
const char **vec, unsigned int len);
void (*otherend_changed)(struct xenbus_watch *watch, const char **vec,
unsigned int len);
struct bus_type bus;
Expand Down
Loading

0 comments on commit 240becc

Please sign in to comment.