Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync up with Linus #30

Merged
merged 32 commits into from
Feb 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f99dbfa
cifs: use memzero_explicit to clear stack buffer
muggenhor Jan 6, 2015
ca7df8e
Complete oplock break jobs before closing file handle
spuiuk Jan 15, 2015
3d009c8
gpio: omap: Fix bad device access with setup_irq()
tmlind Jan 16, 2015
b184c38
gpio: mcp23s08: handle default gpio base
sonicz Jan 20, 2015
7a1ceba
cifs: fix MUST SecurityFlags filtering
Jan 22, 2015
c2273a1
ARM: 8288/1: dma-mapping: don't detach devices without an IOMMU durin…
wildea01 Jan 16, 2015
c2607f7
ARM: 8294/1: ATAG_DTB_COMPAT: remove the DT workspace's hardcoded 64K…
Jan 27, 2015
ed46092
ARM: 8295/1: fix v7M build for !CONFIG_PRINTK
Jan 28, 2015
fba2890
ARM: 8298/1: ARM_KERNMEM_PERMS only works with MMU enabled
arndb Jan 28, 2015
7417011
Revert "blk-mq: fix hctx/ctx kobject use-after-free"
Jan 29, 2015
e09aae7
blk-mq: release mq's kobjects in blk_release_queue()
Jan 29, 2015
0f303db
gpio: sysfs: fix memory leak in gpiod_export_link
jhovold Jan 26, 2015
49d2ca8
gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
jhovold Jan 26, 2015
a84544a
Revert "IPoIB: No longer use flush as a parameter"
rolandd Jan 30, 2015
4e0ab20
Revert "IPoIB: Make ipoib_mcast_stop_thread flush the workqueue"
rolandd Jan 30, 2015
0306eda
Revert "IPoIB: Use dedicated workqueues per interface"
rolandd Jan 30, 2015
bb75963
Revert "IPoIB: change init sequence ordering"
rolandd Jan 30, 2015
962121b
Revert "IPoIB: fix mcast_dev_flush/mcast_restart_task race"
rolandd Jan 30, 2015
e7a623d
Revert "IPoIB: fix MCAST_FLAG_BUSY usage"
rolandd Jan 30, 2015
c6a7ec7
Revert "IPoIB: Make the carrier_on_task race aware"
rolandd Jan 30, 2015
4143a95
Revert "IPoIB: Consolidate rtnl_lock tasks in workqueue"
rolandd Jan 30, 2015
b1b02fe
md/raid5: fix another livelock caused by non-aligned writes.
neilbrown Feb 1, 2015
d959014
md/bitmap: fix a might_sleep() warning.
neilbrown Feb 2, 2015
8e64806
ARM: 8299/1: mm: ensure local active ASID is marked as allocated on r…
wildea01 Jan 29, 2015
7e36ef8
IB/core: Temporarily disable ex_query_device uverb
haggaie Feb 1, 2015
ecb7b12
Merge branches 'ipoib' and 'odp' into for-next
rolandd Feb 3, 2015
0dc17d1
Merge tag 'gpio-v3.19-5' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Feb 3, 2015
0f98c38
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
torvalds Feb 3, 2015
59acf65
Merge tag 'md/3.19-fixes' of git://neil.brown.name/md
torvalds Feb 4, 2015
dc6d684
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kern…
torvalds Feb 4, 2015
5659c0e
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
torvalds Feb 4, 2015
5ee0e96
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
torvalds Feb 4, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions arch/arm/boot/compressed/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,37 @@ restart: adr r0, LC0
* OK... Let's do some funky business here.
* If we do have a DTB appended to zImage, and we do have
* an ATAG list around, we want the later to be translated
* and folded into the former here. To be on the safe side,
* let's temporarily move the stack away into the malloc
* area. No GOT fixup has occurred yet, but none of the
* code we're about to call uses any global variable.
* and folded into the former here. No GOT fixup has occurred
* yet, but none of the code we're about to call uses any
* global variable.
*/
add sp, sp, #0x10000

/* Get the initial DTB size */
ldr r5, [r6, #4]
#ifndef __ARMEB__
/* convert to little endian */
eor r1, r5, r5, ror #16
bic r1, r1, #0x00ff0000
mov r5, r5, ror #8
eor r5, r5, r1, lsr #8
#endif
/* 50% DTB growth should be good enough */
add r5, r5, r5, lsr #1
/* preserve 64-bit alignment */
add r5, r5, #7
bic r5, r5, #7
/* clamp to 32KB min and 1MB max */
cmp r5, #(1 << 15)
movlo r5, #(1 << 15)
cmp r5, #(1 << 20)
movhi r5, #(1 << 20)
/* temporarily relocate the stack past the DTB work space */
add sp, sp, r5

stmfd sp!, {r0-r3, ip, lr}
mov r0, r8
mov r1, r6
sub r2, sp, r6
mov r2, r5
bl atags_to_fdt

/*
Expand All @@ -285,11 +306,11 @@ restart: adr r0, LC0
bic r0, r0, #1
add r0, r0, #0x100
mov r1, r6
sub r2, sp, r6
mov r2, r5
bleq atags_to_fdt

ldmfd sp!, {r0-r3, ip, lr}
sub sp, sp, #0x10000
sub sp, sp, r5
#endif

mov r8, r6 @ use the appended device tree
Expand All @@ -306,7 +327,7 @@ restart: adr r0, LC0
subs r1, r5, r1
addhi r9, r9, r1

/* Get the dtb's size */
/* Get the current DTB size */
ldr r5, [r6, #4]
#ifndef __ARMEB__
/* convert r5 (dtb size) to little endian */
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/kernel/entry-v7m.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@

__invalid_entry:
v7m_exception_entry
#ifdef CONFIG_PRINTK
adr r0, strerr
mrs r1, ipsr
mov r2, lr
bl printk
#endif
mov r0, sp
bl show_regs
1: b 1b
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ config ARCH_SUPPORTS_BIG_ENDIAN

config ARM_KERNMEM_PERMS
bool "Restrict kernel memory permissions"
depends on MMU
help
If this is set, kernel memory other than kernel text (and rodata)
will be made non-executable. The tradeoff is that each region is
Expand Down
26 changes: 11 additions & 15 deletions arch/arm/mm/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,17 @@ static void flush_context(unsigned int cpu)
/* Update the list of reserved ASIDs and the ASID bitmap. */
bitmap_clear(asid_map, 0, NUM_USER_ASIDS);
for_each_possible_cpu(i) {
if (i == cpu) {
asid = 0;
} else {
asid = atomic64_xchg(&per_cpu(active_asids, i), 0);
/*
* If this CPU has already been through a
* rollover, but hasn't run another task in
* the meantime, we must preserve its reserved
* ASID, as this is the only trace we have of
* the process it is still running.
*/
if (asid == 0)
asid = per_cpu(reserved_asids, i);
__set_bit(asid & ~ASID_MASK, asid_map);
}
asid = atomic64_xchg(&per_cpu(active_asids, i), 0);
/*
* If this CPU has already been through a
* rollover, but hasn't run another task in
* the meantime, we must preserve its reserved
* ASID, as this is the only trace we have of
* the process it is still running.
*/
if (asid == 0)
asid = per_cpu(reserved_asids, i);
__set_bit(asid & ~ASID_MASK, asid_map);
per_cpu(reserved_asids, i) = asid;
}

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,9 @@ static void arm_teardown_iommu_dma_ops(struct device *dev)
{
struct dma_iommu_mapping *mapping = dev->archdata.mapping;

if (!mapping)
return;

__arm_iommu_detach_device(dev);
arm_iommu_release_mapping(mapping);
}
Expand Down
25 changes: 2 additions & 23 deletions block/blk-mq-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,6 @@

static void blk_mq_sysfs_release(struct kobject *kobj)
{
struct request_queue *q;

q = container_of(kobj, struct request_queue, mq_kobj);
free_percpu(q->queue_ctx);
}

static void blk_mq_ctx_release(struct kobject *kobj)
{
struct blk_mq_ctx *ctx;

ctx = container_of(kobj, struct blk_mq_ctx, kobj);
kobject_put(&ctx->queue->mq_kobj);
}

static void blk_mq_hctx_release(struct kobject *kobj)
{
struct blk_mq_hw_ctx *hctx;

hctx = container_of(kobj, struct blk_mq_hw_ctx, kobj);
kfree(hctx);
}

struct blk_mq_ctx_sysfs_entry {
Expand Down Expand Up @@ -338,13 +318,13 @@ static struct kobj_type blk_mq_ktype = {
static struct kobj_type blk_mq_ctx_ktype = {
.sysfs_ops = &blk_mq_sysfs_ops,
.default_attrs = default_ctx_attrs,
.release = blk_mq_ctx_release,
.release = blk_mq_sysfs_release,
};

static struct kobj_type blk_mq_hw_ktype = {
.sysfs_ops = &blk_mq_hw_sysfs_ops,
.default_attrs = default_hw_ctx_attrs,
.release = blk_mq_hctx_release,
.release = blk_mq_sysfs_release,
};

static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
Expand Down Expand Up @@ -375,7 +355,6 @@ static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
return ret;

hctx_for_each_ctx(hctx, ctx, i) {
kobject_get(&q->mq_kobj);
ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu);
if (ret)
break;
Expand Down
23 changes: 21 additions & 2 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,27 @@ static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set,
mutex_unlock(&set->tag_list_lock);
}

/*
* It is the actual release handler for mq, but we do it from
* request queue's release handler for avoiding use-after-free
* and headache because q->mq_kobj shouldn't have been introduced,
* but we can't group ctx/kctx kobj without it.
*/
void blk_mq_release(struct request_queue *q)
{
struct blk_mq_hw_ctx *hctx;
unsigned int i;

/* hctx kobj stays in hctx */
queue_for_each_hw_ctx(q, hctx, i)
kfree(hctx);

kfree(q->queue_hw_ctx);

/* ctx kobj stays in queue_ctx */
free_percpu(q->queue_ctx);
}

struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set)
{
struct blk_mq_hw_ctx **hctxs;
Expand Down Expand Up @@ -2000,10 +2021,8 @@ void blk_mq_free_queue(struct request_queue *q)

percpu_ref_exit(&q->mq_usage_counter);

kfree(q->queue_hw_ctx);
kfree(q->mq_map);

q->queue_hw_ctx = NULL;
q->mq_map = NULL;

mutex_lock(&all_q_mutex);
Expand Down
2 changes: 2 additions & 0 deletions block/blk-mq.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ extern void blk_mq_sysfs_unregister(struct request_queue *q);

extern void blk_mq_rq_timed_out(struct request *req, bool reserved);

void blk_mq_release(struct request_queue *q);

/*
* Basic implementation of sparser bitmap, allowing the user to spread
* the bits over more cachelines.
Expand Down
2 changes: 2 additions & 0 deletions block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ static void blk_release_queue(struct kobject *kobj)

if (!q->mq_ops)
blk_free_flush_queue(q->fq);
else
blk_mq_release(q);

blk_trace_shutdown(q);

Expand Down
17 changes: 10 additions & 7 deletions drivers/gpio/gpio-mcp23s08.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,11 @@ static int mcp230xx_probe(struct i2c_client *client,
client->irq = irq_of_parse_and_map(client->dev.of_node, 0);
} else {
pdata = dev_get_platdata(&client->dev);
if (!pdata || !gpio_is_valid(pdata->base)) {
dev_dbg(&client->dev, "invalid platform data\n");
return -EINVAL;
if (!pdata) {
pdata = devm_kzalloc(&client->dev,
sizeof(struct mcp23s08_platform_data),
GFP_KERNEL);
pdata->base = -1;
}
}

Expand Down Expand Up @@ -924,10 +926,11 @@ static int mcp23s08_probe(struct spi_device *spi)
} else {
type = spi_get_device_id(spi)->driver_data;
pdata = dev_get_platdata(&spi->dev);
if (!pdata || !gpio_is_valid(pdata->base)) {
dev_dbg(&spi->dev,
"invalid or missing platform data\n");
return -EINVAL;
if (!pdata) {
pdata = devm_kzalloc(&spi->dev,
sizeof(struct mcp23s08_platform_data),
GFP_KERNEL);
pdata->base = -1;
}

for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) {
Expand Down
39 changes: 33 additions & 6 deletions drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ struct gpio_bank {
#define BANK_USED(bank) (bank->mod_usage || bank->irq_usage)
#define LINE_USED(line, offset) (line & (BIT(offset)))

static void omap_gpio_unmask_irq(struct irq_data *d);

static int omap_irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
{
return bank->chip.base + gpio_irq;
Expand Down Expand Up @@ -477,6 +479,16 @@ static int omap_gpio_is_input(struct gpio_bank *bank, int mask)
return readl_relaxed(reg) & mask;
}

static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned gpio,
unsigned offset)
{
if (!LINE_USED(bank->mod_usage, offset)) {
omap_enable_gpio_module(bank, offset);
omap_set_gpio_direction(bank, offset, 1);
}
bank->irq_usage |= BIT(GPIO_INDEX(bank, gpio));
}

static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
{
struct gpio_bank *bank = omap_irq_data_get_bank(d);
Expand Down Expand Up @@ -506,15 +518,11 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
spin_lock_irqsave(&bank->lock, flags);
offset = GPIO_INDEX(bank, gpio);
retval = omap_set_gpio_triggering(bank, offset, type);
if (!LINE_USED(bank->mod_usage, offset)) {
omap_enable_gpio_module(bank, offset);
omap_set_gpio_direction(bank, offset, 1);
} else if (!omap_gpio_is_input(bank, BIT(offset))) {
omap_gpio_init_irq(bank, gpio, offset);
if (!omap_gpio_is_input(bank, BIT(offset))) {
spin_unlock_irqrestore(&bank->lock, flags);
return -EINVAL;
}

bank->irq_usage |= BIT(GPIO_INDEX(bank, gpio));
spin_unlock_irqrestore(&bank->lock, flags);

if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
Expand Down Expand Up @@ -792,6 +800,24 @@ static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
pm_runtime_put(bank->dev);
}

static unsigned int omap_gpio_irq_startup(struct irq_data *d)
{
struct gpio_bank *bank = omap_irq_data_get_bank(d);
unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
unsigned long flags;
unsigned offset = GPIO_INDEX(bank, gpio);

if (!BANK_USED(bank))
pm_runtime_get_sync(bank->dev);

spin_lock_irqsave(&bank->lock, flags);
omap_gpio_init_irq(bank, gpio, offset);
spin_unlock_irqrestore(&bank->lock, flags);
omap_gpio_unmask_irq(d);

return 0;
}

static void omap_gpio_irq_shutdown(struct irq_data *d)
{
struct gpio_bank *bank = omap_irq_data_get_bank(d);
Expand Down Expand Up @@ -1181,6 +1207,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
if (!irqc)
return -ENOMEM;

irqc->irq_startup = omap_gpio_irq_startup,
irqc->irq_shutdown = omap_gpio_irq_shutdown,
irqc->irq_ack = omap_gpio_ack_irq,
irqc->irq_mask = omap_gpio_mask_irq,
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpio/gpiolib-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ int gpiod_export_link(struct device *dev, const char *name,
if (tdev != NULL) {
status = sysfs_create_link(&dev->kobj, &tdev->kobj,
name);
put_device(tdev);
} else {
status = -ENODEV;
}
Expand Down Expand Up @@ -695,7 +696,7 @@ int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value)
}

status = sysfs_set_active_low(desc, dev, value);

put_device(dev);
unlock:
mutex_unlock(&sysfs_lock);

Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
struct ib_udata *uhw) = {
[IB_USER_VERBS_EX_CMD_CREATE_FLOW] = ib_uverbs_ex_create_flow,
[IB_USER_VERBS_EX_CMD_DESTROY_FLOW] = ib_uverbs_ex_destroy_flow,
[IB_USER_VERBS_EX_CMD_QUERY_DEVICE] = ib_uverbs_ex_query_device
};

static void ib_uverbs_add_one(struct ib_device *device);
Expand Down
Loading