Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'als-3.18/kernel.lnx.3.18.r33-rel' into …
Browse files Browse the repository at this point in the history
…XOS-8.1

* als-3.18/kernel.lnx.3.18.r33-rel: (83 commits)
  Linux 3.18.128
  drm/ast: Remove existing framebuffers before loading driver
  af_unix: move unix_mknod() out of bindlock
  tty: wipe buffer if not echoing data
  tty: wipe buffer.
  scsi: qla2xxx: do not queue commands when unloading
  scsi: ufs: fix race between clock gating and devfreq scaling work
  scsi: ufshcd: Fix race between clk scaling and ungate work
  scsi: ufs: fix bugs related to null pointer access and array size
  cw1200: Don't leak memory if krealloc failes
  Input: xpad - add support for Xbox1 PDP Camo series gamepad
  Input: xpad - fix GPD Win 2 controller name
  Input: xpad - add GPD Win 2 Controller USB IDs
  Input: xpad - avoid using __set_bit() for capabilities
  Input: xpad - fix some coding style issues
  Input: xpad - add PDP device id 0x02a4
  Input: xpad - add support for PDP Xbox One controllers
  Input: xpad - validate USB endpoint type during probe
  Input: xpad - fix PowerA init quirk for some gamepad models
  Input: xpad - constify usb_device_id
  ...
  • Loading branch information
msfjarvis committed Dec 1, 2018
2 parents bac9040 + f992767 commit 40dacd1
Show file tree
Hide file tree
Showing 26 changed files with 997 additions and 338 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 127
SUBLEVEL = 128
EXTRAVERSION =
NAME = Diseased Newt

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# Copyright (C) 1995-2001 by Russell King

LDFLAGS_vmlinux :=-p --no-undefined -X
LDFLAGS_vmlinux :=--no-undefined -X
CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
GZFLAGS :=-9
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ static long vphn_get_associativity(unsigned long cpu,

switch (rc) {
case H_FUNCTION:
printk(KERN_INFO
printk_once(KERN_INFO
"VPHN is not supported. Disabling polling...\n");
stop_topology_update();
break;
Expand Down
6 changes: 0 additions & 6 deletions drivers/block/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,12 +1297,6 @@ static void destroy_devices(unsigned int nr)

for (i = 0; i < nr; i++) {
zram = &zram_devices[i];
/*
* Remove sysfs first, so no one will perform a disksize
* store while we destroy the devices
*/
sysfs_remove_group(&disk_to_dev(zram->disk)->kobj,
&zram_disk_attr_group);

zram_reset_device(zram);

Expand Down
7 changes: 6 additions & 1 deletion drivers/cpufreq/imx6q-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)
/* Ensure the arm clock divider is what we expect */
ret = clk_set_rate(arm_clk, new_freq * 1000);
if (ret) {
int ret1;

dev_err(cpu_dev, "failed to set clock rate: %d\n", ret);
regulator_set_voltage_tol(arm_reg, volt_old, 0);
ret1 = regulator_set_voltage_tol(arm_reg, volt_old, 0);
if (ret1)
dev_warn(cpu_dev,
"failed to restore vddarm voltage: %d\n", ret1);
return ret;
}

Expand Down
21 changes: 21 additions & 0 deletions drivers/gpu/drm/ast/ast_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,29 @@ static const struct pci_device_id pciidlist[] = {

MODULE_DEVICE_TABLE(pci, pciidlist);

static void ast_kick_out_firmware_fb(struct pci_dev *pdev)
{
struct apertures_struct *ap;
bool primary = false;

ap = alloc_apertures(1);
if (!ap)
return;

ap->ranges[0].base = pci_resource_start(pdev, 0);
ap->ranges[0].size = pci_resource_len(pdev, 0);

#ifdef CONFIG_X86
primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
#endif
remove_conflicting_framebuffers(ap, "astdrmfb", primary);
kfree(ap);
}

static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
ast_kick_out_firmware_fb(pdev);

return drm_get_pci_dev(pdev, ent, &driver);
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/ast/ast_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc,
}
ast_bo_unreserve(bo);

ast_set_offset_reg(crtc);
ast_set_start_address_crt1(crtc, (u32)gpu_addr);

return 0;
Expand Down Expand Up @@ -1249,7 +1250,7 @@ static int ast_cursor_move(struct drm_crtc *crtc,
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc7, ((y >> 8) & 0x07));

/* dummy write to fire HWC */
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xCB, 0xFF, 0x00);
ast_show_cursor(crtc);

return 0;
}
1,088 changes: 842 additions & 246 deletions drivers/input/joystick/xpad.c

Large diffs are not rendered by default.

48 changes: 35 additions & 13 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,34 @@ void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
}
EXPORT_SYMBOL_GPL(can_put_echo_skb);

struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr)
{
struct can_priv *priv = netdev_priv(dev);
struct sk_buff *skb = priv->echo_skb[idx];
struct canfd_frame *cf;

if (idx >= priv->echo_skb_max) {
netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n",
__func__, idx, priv->echo_skb_max);
return NULL;
}

if (!skb) {
netdev_err(dev, "%s: BUG! Trying to echo non existing skb: can_priv::echo_skb[%u]\n",
__func__, idx);
return NULL;
}

/* Using "struct canfd_frame::len" for the frame
* length is supported on both CAN and CANFD frames.
*/
cf = (struct canfd_frame *)skb->data;
*len_ptr = cf->len;
priv->echo_skb[idx] = NULL;

return skb;
}

/*
* Get the skb from the stack and loop it back locally
*
Expand All @@ -352,22 +380,16 @@ EXPORT_SYMBOL_GPL(can_put_echo_skb);
*/
unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx)
{
struct can_priv *priv = netdev_priv(dev);

BUG_ON(idx >= priv->echo_skb_max);

if (priv->echo_skb[idx]) {
struct sk_buff *skb = priv->echo_skb[idx];
struct can_frame *cf = (struct can_frame *)skb->data;
u8 dlc = cf->can_dlc;
struct sk_buff *skb;
u8 len;

netif_rx(priv->echo_skb[idx]);
priv->echo_skb[idx] = NULL;
skb = __can_get_echo_skb(dev, idx, &len);
if (!skb)
return 0;

return dlc;
}
netif_rx(skb);

return 0;
return len;
}
EXPORT_SYMBOL_GPL(can_get_echo_skb);

Expand Down
16 changes: 9 additions & 7 deletions drivers/net/wireless/cw1200/wsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,16 +1807,18 @@ static int wsm_buf_reserve(struct wsm_buf *buf, size_t extra_size)
{
size_t pos = buf->data - buf->begin;
size_t size = pos + extra_size;
u8 *tmp;

size = round_up(size, FWLOAD_BLOCK_SIZE);

buf->begin = krealloc(buf->begin, size, GFP_KERNEL | GFP_DMA);
if (buf->begin) {
buf->data = &buf->begin[pos];
buf->end = &buf->begin[size];
return 0;
} else {
buf->end = buf->data = buf->begin;
tmp = krealloc(buf->begin, size, GFP_KERNEL | GFP_DMA);
if (!tmp) {
wsm_buf_deinit(buf);
return -ENOMEM;
}

buf->begin = tmp;
buf->data = &buf->begin[pos];
buf->end = &buf->begin[size];
return 0;
}
5 changes: 5 additions & 0 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,11 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
srb_t *sp;
int rval;

if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags))) {
cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command;
}

if (ha->flags.eeh_busy) {
if (ha->flags.pci_channel_io_perm_failure) {
ql_dbg(ql_dbg_aer, vha, 0x9010,
Expand Down
19 changes: 17 additions & 2 deletions drivers/tty/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,29 @@ static int receive_room(struct tty_struct *tty)
return left;
}

/* If we are not echoing the data, perhaps this is a secret so erase it */
static inline void zero_buffer(struct tty_struct *tty, u8 *buffer, int size)
{
bool icanon = !!L_ICANON(tty);
bool no_echo = !L_ECHO(tty);

if (icanon && no_echo)
memset(buffer, 0x00, size);
}

static inline int tty_copy_to_user(struct tty_struct *tty,
void __user *to,
const void *from,
void *from,
unsigned long n)
{
struct n_tty_data *ldata = tty->disc_data;
int retval;

tty_audit_add_data(tty, from, n, ldata->icanon);
return copy_to_user(to, from, n);
retval = copy_to_user(to, from, n);
if (!retval)
zero_buffer(tty, from, n);
return retval;
}

/**
Expand Down Expand Up @@ -2004,6 +2018,7 @@ static int copy_from_read_buf(struct tty_struct *tty,
is_eof = n == 1 && read_buf(ldata, tail) == EOF_CHAR(tty);
tty_audit_add_data(tty, read_buf_addr(ldata, tail), n,
ldata->icanon);
zero_buffer(tty, read_buf_addr(ldata, tail), n);
smp_store_release(&ldata->read_tail, ldata->read_tail + n);
/* Turn single EOF into zero-length read */
if (L_EXTPROC(tty) && ldata->icanon && is_eof &&
Expand Down
2 changes: 2 additions & 0 deletions drivers/tty/tty_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ receive_buf(struct tty_struct *tty, struct tty_buffer *head, int count)
disc->ops->receive_buf(tty, p, f, count);
}
head->read += count;
if (count > 0)
memset(p, 0, count);
return count;
}

Expand Down
4 changes: 3 additions & 1 deletion drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2802,7 +2802,9 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
USB_PORT_FEAT_C_BH_PORT_RESET);
usb_clear_port_feature(hub->hdev, port1,
USB_PORT_FEAT_C_PORT_LINK_STATE);
usb_clear_port_feature(hub->hdev, port1,

if (udev)
usb_clear_port_feature(hub->hdev, port1,
USB_PORT_FEAT_C_CONNECTION);

/*
Expand Down
11 changes: 0 additions & 11 deletions fs/9p/vfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ static inline int dt_type(struct p9_wstat *mistat)
return rettype;
}

static void p9stat_init(struct p9_wstat *stbuf)
{
stbuf->name = NULL;
stbuf->uid = NULL;
stbuf->gid = NULL;
stbuf->muid = NULL;
stbuf->extension = NULL;
}

/**
* v9fs_alloc_rdir_buf - Allocate buffer used for read and readdir
* @filp: opened file structure
Expand Down Expand Up @@ -136,12 +127,10 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
rdir->tail = err;
}
while (rdir->head < rdir->tail) {
p9stat_init(&st);
err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
rdir->tail - rdir->head, &st);
if (err) {
p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
p9stat_free(&st);
return -EIO;
}
reclen = st.size+2;
Expand Down
9 changes: 6 additions & 3 deletions fs/bfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)

s->s_magic = BFS_MAGIC;

if (le32_to_cpu(bfs_sb->s_start) > le32_to_cpu(bfs_sb->s_end)) {
if (le32_to_cpu(bfs_sb->s_start) > le32_to_cpu(bfs_sb->s_end) ||
le32_to_cpu(bfs_sb->s_start) < BFS_BSIZE) {
printf("Superblock is corrupted\n");
goto out1;
}
Expand All @@ -358,9 +359,11 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
sizeof(struct bfs_inode)
+ BFS_ROOT_INO - 1;
imap_len = (info->si_lasti / 8) + 1;
info->si_imap = kzalloc(imap_len, GFP_KERNEL);
if (!info->si_imap)
info->si_imap = kzalloc(imap_len, GFP_KERNEL | __GFP_NOWARN);
if (!info->si_imap) {
printf("Cannot allocate %u bytes\n", imap_len);
goto out1;
}
for (i = 0; i < BFS_ROOT_INO; i++)
set_bit(i, info->si_imap);

Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
if (!sdp)
return NULL;

sb->s_fs_info = sdp;
sdp->sd_vfs = sb;
sdp->sd_lkstats = alloc_percpu(struct gfs2_pcpu_lkstats);
if (!sdp->sd_lkstats) {
kfree(sdp);
return NULL;
}
sb->s_fs_info = sdp;

set_bit(SDF_NOJOURNALID, &sdp->sd_flags);
gfs2_tune_init(&sdp->sd_tune);
Expand Down
1 change: 1 addition & 0 deletions include/linux/can/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ void can_bus_off(struct net_device *dev);

void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
unsigned int idx);
struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr);
unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
void can_free_echo_skb(struct net_device *dev, unsigned int idx);

Expand Down
15 changes: 9 additions & 6 deletions kernel/debug/kdb/kdb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static char *kdb_read(char *buffer, size_t bufsize)
int count;
int i;
int diag, dtab_count;
int key;
int key, buf_size, ret;
static int last_crlf;

diag = kdbgetintenv("DTABCOUNT", &dtab_count);
Expand Down Expand Up @@ -343,9 +343,8 @@ static char *kdb_read(char *buffer, size_t bufsize)
else
p_tmp = tmpbuffer;
len = strlen(p_tmp);
count = kallsyms_symbol_complete(p_tmp,
sizeof(tmpbuffer) -
(p_tmp - tmpbuffer));
buf_size = sizeof(tmpbuffer) - (p_tmp - tmpbuffer);
count = kallsyms_symbol_complete(p_tmp, buf_size);
if (tab == 2 && count > 0) {
kdb_printf("\n%d symbols are found.", count);
if (count > dtab_count) {
Expand All @@ -357,9 +356,13 @@ static char *kdb_read(char *buffer, size_t bufsize)
}
kdb_printf("\n");
for (i = 0; i < count; i++) {
if (WARN_ON(!kallsyms_symbol_next(p_tmp, i)))
ret = kallsyms_symbol_next(p_tmp, i, buf_size);
if (WARN_ON(!ret))
break;
kdb_printf("%s ", p_tmp);
if (ret != -E2BIG)
kdb_printf("%s ", p_tmp);
else
kdb_printf("%s... ", p_tmp);
*(p_tmp + len) = '\0';
}
if (i >= dtab_count)
Expand Down
2 changes: 1 addition & 1 deletion kernel/debug/kdb/kdb_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ typedef struct __ksymtab {
unsigned long sym_start;
unsigned long sym_end;
} kdb_symtab_t;
extern int kallsyms_symbol_next(char *prefix_name, int flag);
extern int kallsyms_symbol_next(char *prefix_name, int flag, int buf_size);
extern int kallsyms_symbol_complete(char *prefix_name, int max_len);

/* Exported Symbols for kernel loadable modules to use. */
Expand Down
Loading

0 comments on commit 40dacd1

Please sign in to comment.