Applied assortment of Arch Linux ARM patches
This commit is contained in:
@@ -23,14 +23,16 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
|
||||
static int regcache_rbtree_exit(struct regmap *map);
|
||||
|
||||
struct regcache_rbtree_node {
|
||||
/* the actual rbtree node holding this block */
|
||||
struct rb_node node;
|
||||
/* base register handled by this block */
|
||||
unsigned int base_reg;
|
||||
/* block of adjacent registers */
|
||||
void *block;
|
||||
/* Which registers are present */
|
||||
long *cache_present;
|
||||
/* base register handled by this block */
|
||||
unsigned int base_reg;
|
||||
/* number of registers available in the block */
|
||||
unsigned int blklen;
|
||||
/* the actual rbtree node holding this block */
|
||||
struct rb_node node;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct regcache_rbtree_ctx {
|
||||
|
||||
@@ -265,6 +265,9 @@
|
||||
#include <asm/irq.h>
|
||||
#include <asm/irq_regs.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/completion.h>
|
||||
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/random.h>
|
||||
@@ -397,6 +400,7 @@ static struct poolinfo {
|
||||
*/
|
||||
static DECLARE_WAIT_QUEUE_HEAD(random_read_wait);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(urandom_init_wait);
|
||||
static struct fasync_struct *fasync;
|
||||
|
||||
static bool debug;
|
||||
@@ -606,8 +610,11 @@ retry:
|
||||
|
||||
if (!r->initialized && nbits > 0) {
|
||||
r->entropy_total += nbits;
|
||||
if (r->entropy_total > 128)
|
||||
if (r->entropy_total > 128) {
|
||||
r->initialized = 1;
|
||||
if (r == &nonblocking_pool)
|
||||
prandom_reseed_late();
|
||||
}
|
||||
}
|
||||
|
||||
trace_credit_entropy_bits(r->name, nbits, entropy_count,
|
||||
@@ -1015,13 +1022,14 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
|
||||
{
|
||||
ssize_t ret = 0, i;
|
||||
__u8 tmp[EXTRACT_SIZE];
|
||||
int large_request = (nbytes > 256);
|
||||
|
||||
trace_extract_entropy_user(r->name, nbytes, r->entropy_count, _RET_IP_);
|
||||
xfer_secondary_pool(r, nbytes);
|
||||
nbytes = account(r, nbytes, 0, 0);
|
||||
|
||||
while (nbytes) {
|
||||
if (need_resched()) {
|
||||
if (large_request && need_resched()) {
|
||||
if (signal_pending(current)) {
|
||||
if (ret == 0)
|
||||
ret = -ERESTARTSYS;
|
||||
@@ -1155,8 +1163,7 @@ void rand_initialize_disk(struct gendisk *disk)
|
||||
#endif
|
||||
|
||||
static ssize_t
|
||||
random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||
{
|
||||
_random_read(int nonblock, char __user *buf, size_t nbytes){
|
||||
ssize_t n, retval = 0, count = 0;
|
||||
|
||||
if (nbytes == 0)
|
||||
@@ -1180,7 +1187,7 @@ random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||
n*8, (nbytes-n)*8);
|
||||
|
||||
if (n == 0) {
|
||||
if (file->f_flags & O_NONBLOCK) {
|
||||
if (nonblock) {
|
||||
retval = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
@@ -1211,6 +1218,12 @@ random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||
return (count ? count : retval);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||
{
|
||||
return _random_read(file->f_flags & O_NONBLOCK, buf, nbytes);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||
{
|
||||
@@ -1337,6 +1350,29 @@ const struct file_operations urandom_fops = {
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
|
||||
SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count,
|
||||
unsigned int, flags)
|
||||
{
|
||||
if (flags & ~(GRND_NONBLOCK|GRND_RANDOM))
|
||||
return -EINVAL;
|
||||
|
||||
if (count > INT_MAX)
|
||||
count = INT_MAX;
|
||||
|
||||
if (flags & GRND_RANDOM)
|
||||
return _random_read(flags & GRND_NONBLOCK, buf, count);
|
||||
|
||||
if (unlikely(nonblocking_pool.initialized == 0)) {
|
||||
if (flags & GRND_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
wait_event_interruptible(urandom_init_wait,
|
||||
nonblocking_pool.initialized);
|
||||
if (signal_pending(current))
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
return urandom_read(NULL, buf, count, NULL);
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Random UUID interface
|
||||
*
|
||||
|
||||
@@ -6212,7 +6212,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
|
||||
mddev->ctime != info->ctime ||
|
||||
mddev->level != info->level ||
|
||||
/* mddev->layout != info->layout || */
|
||||
!mddev->persistent != info->not_persistent||
|
||||
mddev->persistent == info->not_persistent||
|
||||
mddev->chunk_sectors != info->chunk_size >> 9 ||
|
||||
/* ignore bottom 8 bits of state, and allow SB_BITMAP_PRESENT to change */
|
||||
((state^info->state) & 0xfffffe00)
|
||||
|
||||
@@ -1530,7 +1530,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
|
||||
if (kc == KEY_KEYBOARD && !ictx->release_code) {
|
||||
ictx->last_keycode = kc;
|
||||
if (!nomouse) {
|
||||
ictx->pad_mouse = ~(ictx->pad_mouse) & 0x1;
|
||||
ictx->pad_mouse = !ictx->pad_mouse;
|
||||
dev_dbg(dev, "toggling to %s mode\n",
|
||||
ictx->pad_mouse ? "mouse" : "keyboard");
|
||||
spin_unlock_irqrestore(&ictx->kc_lock, flags);
|
||||
|
||||
@@ -67,7 +67,7 @@ static int ec_get_version(struct cros_ec_device *ec, char *str, int maxlen)
|
||||
}
|
||||
if (resp.current_image >= ARRAY_SIZE(current_image_name))
|
||||
resp.current_image = 3; /* invalid */
|
||||
snprintf(str, maxlen, "%s\n%s\n%s\n\%s\n", CROS_EC_DEV_VERSION,
|
||||
snprintf(str, maxlen, "%s\n%s\n%s\n%s\n", CROS_EC_DEV_VERSION,
|
||||
resp.version_string_ro, resp.version_string_rw,
|
||||
current_image_name[resp.current_image]);
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ static ssize_t store_rgb(struct device *dev, struct device_attribute *attr,
|
||||
return (ok && i == 0) ? count : -EINVAL;
|
||||
}
|
||||
|
||||
static const char const *seqname[] = {
|
||||
static const char *seqname[] = {
|
||||
"ERROR", "S5", "S3", "S0", "S5S3", "S3S0",
|
||||
"S0S3", "S3S5", "STOP", "RUN", "PULSE", "TEST", "KONAMI",
|
||||
};
|
||||
|
||||
@@ -537,21 +537,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
|
||||
goto err_add_intf;
|
||||
}
|
||||
|
||||
/* Create AP interface by default */
|
||||
if (!mwifiex_add_virtual_intf(adapter->wiphy, "uap%d",
|
||||
NL80211_IFTYPE_AP, NULL, NULL)) {
|
||||
mwifiex_dbg(adapter, ERROR,
|
||||
"cannot create default AP interface\n");
|
||||
goto err_add_intf;
|
||||
}
|
||||
|
||||
/* Create P2P interface by default */
|
||||
if (!mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d",
|
||||
NL80211_IFTYPE_P2P_CLIENT, NULL, NULL)) {
|
||||
mwifiex_dbg(adapter, ERROR,
|
||||
"cannot create default P2P interface\n");
|
||||
goto err_add_intf;
|
||||
}
|
||||
rtnl_unlock();
|
||||
|
||||
mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
#include "main.h"
|
||||
|
||||
#define SD8786_DEFAULT_FW_NAME "mrvl/sd8786_uapsta.bin"
|
||||
#define SD8787_DEFAULT_FW_NAME "mrvl/sd8787_uapsta.bin"
|
||||
#define SD8797_DEFAULT_FW_NAME "mrvl/sd8797_uapsta.bin"
|
||||
#define SD8897_DEFAULT_FW_NAME "mrvl/sd8897_uapsta.bin"
|
||||
#define SD8787_DEFAULT_FW_NAME "mrvl/sd8787_uapsta_cros.bin"
|
||||
#define SD8797_DEFAULT_FW_NAME "mrvl/sd8797_uapsta_cros.bin"
|
||||
#define SD8897_DEFAULT_FW_NAME "mrvl/sd8897_uapsta_cros.bin"
|
||||
|
||||
#define BLOCK_MODE 1
|
||||
#define BYTE_MODE 0
|
||||
|
||||
@@ -309,7 +309,6 @@ static void zd1201_usbrx(struct urb *urb)
|
||||
if (data[urb->actual_length-1] == ZD1201_PACKET_RXDATA) {
|
||||
int datalen = urb->actual_length-1;
|
||||
unsigned short len, fc, seq;
|
||||
struct hlist_node *node;
|
||||
|
||||
len = ntohs(*(__be16 *)&data[datalen-2]);
|
||||
if (len>datalen)
|
||||
@@ -362,7 +361,7 @@ static void zd1201_usbrx(struct urb *urb)
|
||||
hlist_add_head(&frag->fnode, &zd->fraglist);
|
||||
goto resubmit;
|
||||
}
|
||||
hlist_for_each_entry(frag, node, &zd->fraglist, fnode)
|
||||
hlist_for_each_entry(frag, &zd->fraglist, fnode)
|
||||
if (frag->seq == (seq&IEEE80211_SCTL_SEQ))
|
||||
break;
|
||||
if (!frag)
|
||||
@@ -1831,14 +1830,14 @@ err_zd:
|
||||
static void zd1201_disconnect(struct usb_interface *interface)
|
||||
{
|
||||
struct zd1201 *zd = usb_get_intfdata(interface);
|
||||
struct hlist_node *node, *node2;
|
||||
struct hlist_node *node2;
|
||||
struct zd1201_frag *frag;
|
||||
|
||||
if (!zd)
|
||||
return;
|
||||
usb_set_intfdata(interface, NULL);
|
||||
|
||||
hlist_for_each_entry_safe(frag, node, node2, &zd->fraglist, fnode) {
|
||||
hlist_for_each_entry_safe(frag, node2, &zd->fraglist, fnode) {
|
||||
hlist_del_init(&frag->fnode);
|
||||
kfree_skb(frag->skb);
|
||||
kfree(frag);
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
#define CONT_MODE_IR 2
|
||||
#define CONT_MODE_PROX 3
|
||||
|
||||
static const char const *isl29018_cont_modes[] = {
|
||||
static const char *isl29018_cont_modes[] = {
|
||||
"once",
|
||||
"als",
|
||||
"ir",
|
||||
|
||||
@@ -767,30 +767,35 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
|
||||
static int read_cardpda(struct pda *pda, wlandevice_t *wlandev)
|
||||
{
|
||||
int result = 0;
|
||||
struct p80211msg_p2req_readpda msg;
|
||||
struct p80211msg_p2req_readpda *msg;
|
||||
|
||||
msg = kzalloc(sizeof(*msg), GFP_KERNEL);
|
||||
if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
/* set up the msg */
|
||||
msg.msgcode = DIDmsg_p2req_readpda;
|
||||
msg.msglen = sizeof(msg);
|
||||
strcpy(msg.devname, wlandev->name);
|
||||
msg.pda.did = DIDmsg_p2req_readpda_pda;
|
||||
msg.pda.len = HFA384x_PDA_LEN_MAX;
|
||||
msg.pda.status = P80211ENUM_msgitem_status_no_value;
|
||||
msg.resultcode.did = DIDmsg_p2req_readpda_resultcode;
|
||||
msg.resultcode.len = sizeof(u32);
|
||||
msg.resultcode.status = P80211ENUM_msgitem_status_no_value;
|
||||
msg->msgcode = DIDmsg_p2req_readpda;
|
||||
msg->msglen = sizeof(msg);
|
||||
strcpy(msg->devname, wlandev->name);
|
||||
msg->pda.did = DIDmsg_p2req_readpda_pda;
|
||||
msg->pda.len = HFA384x_PDA_LEN_MAX;
|
||||
msg->pda.status = P80211ENUM_msgitem_status_no_value;
|
||||
msg->resultcode.did = DIDmsg_p2req_readpda_resultcode;
|
||||
msg->resultcode.len = sizeof(u32);
|
||||
msg->resultcode.status = P80211ENUM_msgitem_status_no_value;
|
||||
|
||||
if (prism2mgmt_readpda(wlandev, &msg) != 0) {
|
||||
if (prism2mgmt_readpda(wlandev, msg) != 0) {
|
||||
/* prism2mgmt_readpda prints an errno if appropriate */
|
||||
result = -1;
|
||||
} else if (msg.resultcode.data == P80211ENUM_resultcode_success) {
|
||||
memcpy(pda->buf, msg.pda.data, HFA384x_PDA_LEN_MAX);
|
||||
} else if (msg->resultcode.data == P80211ENUM_resultcode_success) {
|
||||
memcpy(pda->buf, msg->pda.data, HFA384x_PDA_LEN_MAX);
|
||||
result = mkpdrlist(pda);
|
||||
} else {
|
||||
/* resultcode must've been something other than success */
|
||||
result = -1;
|
||||
}
|
||||
|
||||
kfree(msg);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1406,7 +1406,7 @@ static int soctherm_init_platform_data(struct platform_device *pdev)
|
||||
therm = &plat_data->therm[tsensor2therm_map[i]];
|
||||
s = &plat_data->sensor_data[i];
|
||||
s->sensor_enable = s->zone_enable;
|
||||
s->sensor_enable = s->sensor_enable ?: therm->zone_enable;
|
||||
s->sensor_enable = s->sensor_enable ? s->sensor_enable : therm->zone_enable;
|
||||
}
|
||||
|
||||
/* Pdiv */
|
||||
|
||||
@@ -1129,7 +1129,7 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
|
||||
|
||||
for (i = 0; i < (128 - edid[2]) / DETAILED_TIMING_DESCRIPTION_SIZE;
|
||||
i++, block += DETAILED_TIMING_DESCRIPTION_SIZE)
|
||||
if (PIXEL_CLOCK)
|
||||
if (PIXEL_CLOCK != 0)
|
||||
edt[num++] = block - edid;
|
||||
|
||||
/* Yikes, EDID data is totally useless */
|
||||
|
||||
Reference in New Issue
Block a user