Skip to content

Commit

Permalink
kernel.org: Update to Linux 3.0.99
Browse files Browse the repository at this point in the history
  • Loading branch information
andip71 committed Nov 18, 2013
1 parent dd1c74d commit 599ad71
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 40 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 = 0
SUBLEVEL = 98
SUBLEVEL = 99
EXTRAVERSION =
NAME = Sneaky Weasel

Expand Down
16 changes: 16 additions & 0 deletions arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,22 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
},
},
{ /* Handle problems with rebooting on the Dell PowerEdge C6100. */
.callback = set_pci_reboot,
.ident = "Dell PowerEdge C6100",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "C6100"),
},
},
{ /* Some C6100 machines were shipped with vendor being 'Dell'. */
.callback = set_pci_reboot,
.ident = "Dell PowerEdge C6100",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
DMI_MATCH(DMI_PRODUCT_NAME, "C6100"),
},
},
{ }
};

Expand Down
11 changes: 7 additions & 4 deletions arch/x86/platform/efi/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,13 @@ void __init efi_enter_virtual_mode(void)

for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
md = p;
if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
md->type != EFI_BOOT_SERVICES_CODE &&
md->type != EFI_BOOT_SERVICES_DATA)
continue;
if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
#ifdef CONFIG_X86_64
if (md->type != EFI_BOOT_SERVICES_CODE &&
md->type != EFI_BOOT_SERVICES_DATA)
#endif
continue;
}

size = md->num_pages << EFI_PAGE_SHIFT;
end = md->phys_addr + size;
Expand Down
13 changes: 12 additions & 1 deletion drivers/gpu/drm/i915/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,18 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
DRM_DEBUG_KMS("aux_ch native nack\n");
return -EREMOTEIO;
case AUX_NATIVE_REPLY_DEFER:
udelay(100);
/*
* For now, just give more slack to branch devices. We
* could check the DPCD for I2C bit rate capabilities,
* and if available, adjust the interval. We could also
* be more careful with DP-to-Legacy adapters where a
* long legacy cable may force very low I2C bit rates.
*/
if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
DP_DWN_STRM_PORT_PRESENT)
usleep_range(500, 600);
else
usleep_range(300, 400);
continue;
default:
DRM_ERROR("aux_ch invalid native reply 0x%02x\n",
Expand Down
19 changes: 16 additions & 3 deletions drivers/hwmon/applesmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,10 @@ static int applesmc_get_lower_bound(unsigned int *lo, const char *key)
while (begin != end) {
int middle = begin + (end - begin) / 2;
entry = applesmc_get_entry_by_index(middle);
if (IS_ERR(entry))
if (IS_ERR(entry)) {
*lo = 0;
return PTR_ERR(entry);
}
if (strcmp(entry->key, key) < 0)
begin = middle + 1;
else
Expand All @@ -364,8 +366,10 @@ static int applesmc_get_upper_bound(unsigned int *hi, const char *key)
while (begin != end) {
int middle = begin + (end - begin) / 2;
entry = applesmc_get_entry_by_index(middle);
if (IS_ERR(entry))
if (IS_ERR(entry)) {
*hi = smcreg.key_count;
return PTR_ERR(entry);
}
if (strcmp(key, entry->key) < 0)
end = middle;
else
Expand Down Expand Up @@ -485,16 +489,25 @@ static int applesmc_init_smcreg_try(void)
{
struct applesmc_registers *s = &smcreg;
bool left_light_sensor, right_light_sensor;
unsigned int count;
u8 tmp[1];
int ret;

if (s->init_complete)
return 0;

ret = read_register_count(&s->key_count);
ret = read_register_count(&count);
if (ret)
return ret;

if (s->cache && s->key_count != count) {
pr_warn("key count changed from %d to %d\n",
s->key_count, count);
kfree(s->cache);
s->cache = NULL;
}
s->key_count = count;

if (!s->cache)
s->cache = kcalloc(s->key_count, sizeof(*s->cache), GFP_KERNEL);
if (!s->cache)
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-snap-persistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
*/
INIT_WORK_ONSTACK(&req.work, do_metadata);
queue_work(ps->metadata_wq, &req.work);
flush_work(&req.work);
flush_workqueue(ps->metadata_wq);

return req.result;
}
Expand Down
5 changes: 2 additions & 3 deletions drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,17 +724,16 @@ static int calc_max_buckets(void)
*/
static int init_hash_tables(struct dm_snapshot *s)
{
sector_t hash_size, cow_dev_size, origin_dev_size, max_buckets;
sector_t hash_size, cow_dev_size, max_buckets;

/*
* Calculate based on the size of the original volume or
* the COW volume...
*/
cow_dev_size = get_dev_size(s->cow->bdev);
origin_dev_size = get_dev_size(s->origin->bdev);
max_buckets = calc_max_buckets();

hash_size = min(origin_dev_size, cow_dev_size) >> s->store->chunk_shift;
hash_size = cow_dev_size >> s->store->chunk_shift;
hash_size = min(hash_size, max_buckets);

if (hash_size < 64)
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/vt6656/main_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,8 @@ device_release_WPADEV(pDevice);
memset(pMgmt->abyCurrBSSID, 0, 6);
pMgmt->eCurrState = WMAC_STATE_IDLE;

pDevice->flags &= ~DEVICE_FLAGS_OPENED;

device_free_tx_bufs(pDevice);
device_free_rx_bufs(pDevice);
device_free_int_bufs(pDevice);
Expand All @@ -1239,7 +1241,6 @@ device_release_WPADEV(pDevice);
usb_free_urb(pDevice->pInterruptURB);

BSSvClearNodeDBTable(pDevice, 0);
pDevice->flags &=(~DEVICE_FLAGS_OPENED);

DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n");

Expand Down
16 changes: 16 additions & 0 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,22 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype,
if ((index & ~USB_DIR_IN) == 0)
return 0;
ret = findintfep(ps->dev, index);
if (ret < 0) {
/*
* Some not fully compliant Win apps seem to get
* index wrong and have the endpoint number here
* rather than the endpoint address (with the
* correct direction). Win does let this through,
* so we'll not reject it here but leave it to
* the device to not break KVM. But we warn.
*/
ret = findintfep(ps->dev, index ^ 0x80);
if (ret >= 0)
dev_info(&ps->dev->dev,
"%s: process %i (%s) requesting ep %02x but needs %02x\n",
__func__, task_pid_nr(current),
current->comm, index, index ^ 0x80);
}
if (ret >= 0)
ret = checkintf(ps, ret);
break;
Expand Down
14 changes: 12 additions & 2 deletions drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,12 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
/* Otherwise ring the doorbell(s) to restart queued transfers */
ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
}
ep->stopped_td = NULL;
ep->stopped_trb = NULL;

/* Clear stopped_td and stopped_trb if endpoint is not halted */
if (!(ep->ep_state & EP_HALTED)) {
ep->stopped_td = NULL;
ep->stopped_trb = NULL;
}

/*
* Drop the lock and complete the URBs in the cancelled TD list.
Expand Down Expand Up @@ -1377,6 +1381,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
inc_deq(xhci, xhci->cmd_ring, false);
return;
}
/* There is no command to handle if we get a stop event when the
* command ring is empty, event->cmd_trb points to the next
* unset command
*/
if (xhci->cmd_ring->dequeue == xhci->cmd_ring->enqueue)
return;
}

switch (le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3])
Expand Down
35 changes: 20 additions & 15 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,16 @@ static void spd_release_page(struct splice_pipe_desc *spd, unsigned int i)
* Check if we need to grow the arrays holding pages and partial page
* descriptions.
*/
int splice_grow_spd(struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
int splice_grow_spd(const struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
{
if (pipe->buffers <= PIPE_DEF_BUFFERS)
unsigned int buffers = ACCESS_ONCE(pipe->buffers);

spd->nr_pages_max = buffers;
if (buffers <= PIPE_DEF_BUFFERS)
return 0;

spd->pages = kmalloc(pipe->buffers * sizeof(struct page *), GFP_KERNEL);
spd->partial = kmalloc(pipe->buffers * sizeof(struct partial_page), GFP_KERNEL);
spd->pages = kmalloc(buffers * sizeof(struct page *), GFP_KERNEL);
spd->partial = kmalloc(buffers * sizeof(struct partial_page), GFP_KERNEL);

if (spd->pages && spd->partial)
return 0;
Expand All @@ -290,10 +293,9 @@ int splice_grow_spd(struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
return -ENOMEM;
}

void splice_shrink_spd(struct pipe_inode_info *pipe,
struct splice_pipe_desc *spd)
void splice_shrink_spd(struct splice_pipe_desc *spd)
{
if (pipe->buffers <= PIPE_DEF_BUFFERS)
if (spd->nr_pages_max <= PIPE_DEF_BUFFERS)
return;

kfree(spd->pages);
Expand All @@ -316,6 +318,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
struct splice_pipe_desc spd = {
.pages = pages,
.partial = partial,
.nr_pages_max = PIPE_DEF_BUFFERS,
.flags = flags,
.ops = &page_cache_pipe_buf_ops,
.spd_release = spd_release_page,
Expand All @@ -327,7 +330,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
index = *ppos >> PAGE_CACHE_SHIFT;
loff = *ppos & ~PAGE_CACHE_MASK;
req_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
nr_pages = min(req_pages, pipe->buffers);
nr_pages = min(req_pages, spd.nr_pages_max);

/*
* Lookup the (hopefully) full range of pages we need.
Expand Down Expand Up @@ -498,7 +501,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
if (spd.nr_pages)
error = splice_to_pipe(pipe, &spd);

splice_shrink_spd(pipe, &spd);
splice_shrink_spd(&spd);
return error;
}

Expand Down Expand Up @@ -599,6 +602,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
struct splice_pipe_desc spd = {
.pages = pages,
.partial = partial,
.nr_pages_max = PIPE_DEF_BUFFERS,
.flags = flags,
.ops = &default_pipe_buf_ops,
.spd_release = spd_release_page,
Expand All @@ -609,16 +613,16 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,

res = -ENOMEM;
vec = __vec;
if (pipe->buffers > PIPE_DEF_BUFFERS) {
vec = kmalloc(pipe->buffers * sizeof(struct iovec), GFP_KERNEL);
if (spd.nr_pages_max > PIPE_DEF_BUFFERS) {
vec = kmalloc(spd.nr_pages_max * sizeof(struct iovec), GFP_KERNEL);
if (!vec)
goto shrink_ret;
}

offset = *ppos & ~PAGE_CACHE_MASK;
nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;

for (i = 0; i < nr_pages && i < pipe->buffers && len; i++) {
for (i = 0; i < nr_pages && i < spd.nr_pages_max && len; i++) {
struct page *page;

page = alloc_page(GFP_USER);
Expand Down Expand Up @@ -666,7 +670,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
shrink_ret:
if (vec != __vec)
kfree(vec);
splice_shrink_spd(pipe, &spd);
splice_shrink_spd(&spd);
return res;

err:
Expand Down Expand Up @@ -1618,6 +1622,7 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
struct splice_pipe_desc spd = {
.pages = pages,
.partial = partial,
.nr_pages_max = PIPE_DEF_BUFFERS,
.flags = flags,
.ops = &user_page_pipe_buf_ops,
.spd_release = spd_release_page,
Expand All @@ -1633,13 +1638,13 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,

spd.nr_pages = get_iovec_page_array(iov, nr_segs, spd.pages,
spd.partial, flags & SPLICE_F_GIFT,
pipe->buffers);
spd.nr_pages_max);
if (spd.nr_pages <= 0)
ret = spd.nr_pages;
else
ret = splice_to_pipe(pipe, &spd);

splice_shrink_spd(pipe, &spd);
splice_shrink_spd(&spd);
return ret;
}

Expand Down
8 changes: 4 additions & 4 deletions include/linux/splice.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ struct partial_page {
struct splice_pipe_desc {
struct page **pages; /* page map */
struct partial_page *partial; /* pages[] may not be contig */
int nr_pages; /* number of pages in map */
int nr_pages; /* number of populated pages in map */
unsigned int nr_pages_max; /* pages[] & partial[] arrays size */
unsigned int flags; /* splice flags */
const struct pipe_buf_operations *ops;/* ops associated with output pipe */
void (*spd_release)(struct splice_pipe_desc *, unsigned int);
Expand Down Expand Up @@ -85,8 +86,7 @@ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
/*
* for dynamic pipe sizing
*/
extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
extern void splice_shrink_spd(struct pipe_inode_info *,
struct splice_pipe_desc *);
extern int splice_grow_spd(const struct pipe_inode_info *, struct splice_pipe_desc *);
extern void splice_shrink_spd(struct splice_pipe_desc *);

#endif
5 changes: 3 additions & 2 deletions kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@ static ssize_t subbuf_splice_actor(struct file *in,
struct splice_pipe_desc spd = {
.pages = pages,
.nr_pages = 0,
.nr_pages_max = PIPE_DEF_BUFFERS,
.partial = partial,
.flags = flags,
.ops = &relay_pipe_buf_ops,
Expand Down Expand Up @@ -1302,8 +1303,8 @@ static ssize_t subbuf_splice_actor(struct file *in,
ret += padding;

out:
splice_shrink_spd(pipe, &spd);
return ret;
splice_shrink_spd(&spd);
return ret;
}

static ssize_t relay_file_splice_read(struct file *in,
Expand Down
Loading

0 comments on commit 599ad71

Please sign in to comment.