aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPraneeth Bajjuri2017-08-28 18:03:19 -0500
committerPraneeth Bajjuri2017-08-28 18:03:19 -0500
commitdda8acaf6f2d9bddce62c305edf6b3071f04c136 (patch)
tree612f8b7b18ff3a84184ddc0ce456b9b0287cace6 /block
parentb22bbe0c5fa4fd5eb4609108a750b28a744a643e (diff)
parenteabbcea7629d5f2ec91568f7bd104536614107db (diff)
downloadkernel-omap-6AM.1.3-rvc-video.tar.gz
kernel-omap-6AM.1.3-rvc-video.tar.xz
kernel-omap-6AM.1.3-rvc-video.zip
Merge branch 'p-ti-lsk-android-linux-4.4.y' of git://git.omapzoom.org/kernel/omap into 6AM.1.3-rvc-video6AM.1.3-rvc-video
* 'p-ti-lsk-android-linux-4.4.y' of git://git.omapzoom.org/kernel/omap: (2048 commits) ARM: dts: dra7: Remove deprecated PCI compatible string ARM: dts: dra76-evm: Enable x2 PCIe lanes ARM: dts: DRA72x: Use PCIe compatible specific to dra72 ARM: dts: DRA74x: Use PCIe compatible specific to dra74 ARM: dts: dra7: Add properties to enable PCIe x2 lane mode PCI: dwc: pci-dra7xx: Enable x2 mode support PCI: dwc: dra7xx: Add support for SoC specific compatible strings dt-bindings: PCI: dra7xx: Add properties to enable x2 lane in dra7 dt-bindings: PCI: dra7xx: Add SoC specific compatible strings ARM: dts: dra7-evm: Move pcie RC node to common file ARM: dts: dra76-evm: add higher speed MMC/SD modes Linux 4.4.84 usb: qmi_wwan: add D-Link DWM-222 device ID usb: optimize acpi companion search for usb port devices perf/x86: Fix LBR related crashes on Intel Atom pids: make task_tgid_nr_ns() safe Sanitize 'move_pages()' permission checks irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup() irqchip/atmel-aic: Fix unbalanced of_node_put() in aic_common_irq_fixup() x86/asm/64: Clear AC on NMI entries ... Signed-off-by: Praneeth Bajjuri <praneeth@ti.com> Conflicts: arch/arm/boot/dts/Makefile drivers/gpu/drm/omapdrm/dss/dispc.c
Diffstat (limited to 'block')
-rw-r--r--block/bio.c12
-rw-r--r--block/blk-core.c40
-rw-r--r--block/blk-integrity.c22
-rw-r--r--block/blk-mq.c23
-rw-r--r--block/genhd.c1
-rw-r--r--block/partition-generic.c1
-rw-r--r--block/partitions/msdos.c2
-rw-r--r--block/scsi_ioctl.c3
8 files changed, 60 insertions, 44 deletions
diff --git a/block/bio.c b/block/bio.c
index 46e2cc1d4016..14263fab94d3 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -373,10 +373,14 @@ static void punt_bios_to_rescuer(struct bio_set *bs)
373 bio_list_init(&punt); 373 bio_list_init(&punt);
374 bio_list_init(&nopunt); 374 bio_list_init(&nopunt);
375 375
376 while ((bio = bio_list_pop(current->bio_list))) 376 while ((bio = bio_list_pop(&current->bio_list[0])))
377 bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio); 377 bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio);
378 current->bio_list[0] = nopunt;
378 379
379 *current->bio_list = nopunt; 380 bio_list_init(&nopunt);
381 while ((bio = bio_list_pop(&current->bio_list[1])))
382 bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio);
383 current->bio_list[1] = nopunt;
380 384
381 spin_lock(&bs->rescue_lock); 385 spin_lock(&bs->rescue_lock);
382 bio_list_merge(&bs->rescue_list, &punt); 386 bio_list_merge(&bs->rescue_list, &punt);
@@ -464,7 +468,9 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
464 * we retry with the original gfp_flags. 468 * we retry with the original gfp_flags.
465 */ 469 */
466 470
467 if (current->bio_list && !bio_list_empty(current->bio_list)) 471 if (current->bio_list &&
472 (!bio_list_empty(&current->bio_list[0]) ||
473 !bio_list_empty(&current->bio_list[1])))
468 gfp_mask &= ~__GFP_DIRECT_RECLAIM; 474 gfp_mask &= ~__GFP_DIRECT_RECLAIM;
469 475
470 p = mempool_alloc(bs->bio_pool, gfp_mask); 476 p = mempool_alloc(bs->bio_pool, gfp_mask);
diff --git a/block/blk-core.c b/block/blk-core.c
index 25f25271b42a..be43481bcb12 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2023,7 +2023,14 @@ end_io:
2023 */ 2023 */
2024blk_qc_t generic_make_request(struct bio *bio) 2024blk_qc_t generic_make_request(struct bio *bio)
2025{ 2025{
2026 struct bio_list bio_list_on_stack; 2026 /*
2027 * bio_list_on_stack[0] contains bios submitted by the current
2028 * make_request_fn.
2029 * bio_list_on_stack[1] contains bios that were submitted before
2030 * the current make_request_fn, but that haven't been processed
2031 * yet.
2032 */
2033 struct bio_list bio_list_on_stack[2];
2027 blk_qc_t ret = BLK_QC_T_NONE; 2034 blk_qc_t ret = BLK_QC_T_NONE;
2028 2035
2029 if (!generic_make_request_checks(bio)) 2036 if (!generic_make_request_checks(bio))
@@ -2040,7 +2047,7 @@ blk_qc_t generic_make_request(struct bio *bio)
2040 * should be added at the tail 2047 * should be added at the tail
2041 */ 2048 */
2042 if (current->bio_list) { 2049 if (current->bio_list) {
2043 bio_list_add(current->bio_list, bio); 2050 bio_list_add(&current->bio_list[0], bio);
2044 goto out; 2051 goto out;
2045 } 2052 }
2046 2053
@@ -2059,24 +2066,39 @@ blk_qc_t generic_make_request(struct bio *bio)
2059 * bio_list, and call into ->make_request() again. 2066 * bio_list, and call into ->make_request() again.
2060 */ 2067 */
2061 BUG_ON(bio->bi_next); 2068 BUG_ON(bio->bi_next);
2062 bio_list_init(&bio_list_on_stack); 2069 bio_list_init(&bio_list_on_stack[0]);
2063 current->bio_list = &bio_list_on_stack; 2070 current->bio_list = bio_list_on_stack;
2064 do { 2071 do {
2065 struct request_queue *q = bdev_get_queue(bio->bi_bdev); 2072 struct request_queue *q = bdev_get_queue(bio->bi_bdev);
2066 2073
2067 if (likely(blk_queue_enter(q, __GFP_DIRECT_RECLAIM) == 0)) { 2074 if (likely(blk_queue_enter(q, __GFP_DIRECT_RECLAIM) == 0)) {
2075 struct bio_list lower, same;
2076
2077 /* Create a fresh bio_list for all subordinate requests */
2078 bio_list_on_stack[1] = bio_list_on_stack[0];
2079 bio_list_init(&bio_list_on_stack[0]);
2068 2080
2069 ret = q->make_request_fn(q, bio); 2081 ret = q->make_request_fn(q, bio);
2070 2082
2071 blk_queue_exit(q); 2083 blk_queue_exit(q);
2072 2084 /* sort new bios into those for a lower level
2073 bio = bio_list_pop(current->bio_list); 2085 * and those for the same level
2086 */
2087 bio_list_init(&lower);
2088 bio_list_init(&same);
2089 while ((bio = bio_list_pop(&bio_list_on_stack[0])) != NULL)
2090 if (q == bdev_get_queue(bio->bi_bdev))
2091 bio_list_add(&same, bio);
2092 else
2093 bio_list_add(&lower, bio);
2094 /* now assemble so we handle the lowest level first */
2095 bio_list_merge(&bio_list_on_stack[0], &lower);
2096 bio_list_merge(&bio_list_on_stack[0], &same);
2097 bio_list_merge(&bio_list_on_stack[0], &bio_list_on_stack[1]);
2074 } else { 2098 } else {
2075 struct bio *bio_next = bio_list_pop(current->bio_list);
2076
2077 bio_io_error(bio); 2099 bio_io_error(bio);
2078 bio = bio_next;
2079 } 2100 }
2101 bio = bio_list_pop(&bio_list_on_stack[0]);
2080 } while (bio); 2102 } while (bio);
2081 current->bio_list = NULL; /* deactivate */ 2103 current->bio_list = NULL; /* deactivate */
2082 2104
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index d69c5c79f98e..478f572cb1e7 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -412,12 +412,13 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template
412 412
413 bi->flags = BLK_INTEGRITY_VERIFY | BLK_INTEGRITY_GENERATE | 413 bi->flags = BLK_INTEGRITY_VERIFY | BLK_INTEGRITY_GENERATE |
414 template->flags; 414 template->flags;
415 bi->interval_exp = ilog2(queue_logical_block_size(disk->queue)); 415 bi->interval_exp = template->interval_exp ? :
416 ilog2(queue_logical_block_size(disk->queue));
416 bi->profile = template->profile ? template->profile : &nop_profile; 417 bi->profile = template->profile ? template->profile : &nop_profile;
417 bi->tuple_size = template->tuple_size; 418 bi->tuple_size = template->tuple_size;
418 bi->tag_size = template->tag_size; 419 bi->tag_size = template->tag_size;
419 420
420 blk_integrity_revalidate(disk); 421 disk->queue->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES;
421} 422}
422EXPORT_SYMBOL(blk_integrity_register); 423EXPORT_SYMBOL(blk_integrity_register);
423 424
@@ -430,26 +431,11 @@ EXPORT_SYMBOL(blk_integrity_register);
430 */ 431 */
431void blk_integrity_unregister(struct gendisk *disk) 432void blk_integrity_unregister(struct gendisk *disk)
432{ 433{
433 blk_integrity_revalidate(disk); 434 disk->queue->backing_dev_info.capabilities &= ~BDI_CAP_STABLE_WRITES;
434 memset(&disk->queue->integrity, 0, sizeof(struct blk_integrity)); 435 memset(&disk->queue->integrity, 0, sizeof(struct blk_integrity));
435} 436}
436EXPORT_SYMBOL(blk_integrity_unregister); 437EXPORT_SYMBOL(blk_integrity_unregister);
437 438
438void blk_integrity_revalidate(struct gendisk *disk)
439{
440 struct blk_integrity *bi = &disk->queue->integrity;
441
442 if (!(disk->flags & GENHD_FL_UP))
443 return;
444
445 if (bi->profile)
446 disk->queue->backing_dev_info.capabilities |=
447 BDI_CAP_STABLE_WRITES;
448 else
449 disk->queue->backing_dev_info.capabilities &=
450 ~BDI_CAP_STABLE_WRITES;
451}
452
453void blk_integrity_add(struct gendisk *disk) 439void blk_integrity_add(struct gendisk *disk)
454{ 440{
455 if (kobject_init_and_add(&disk->integrity_kobj, &integrity_ktype, 441 if (kobject_init_and_add(&disk->integrity_kobj, &integrity_ktype,
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 6cfc6b200366..0d1af3e44efb 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1259,12 +1259,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
1259 1259
1260 blk_queue_split(q, &bio, q->bio_split); 1260 blk_queue_split(q, &bio, q->bio_split);
1261 1261
1262 if (!is_flush_fua && !blk_queue_nomerges(q)) { 1262 if (!is_flush_fua && !blk_queue_nomerges(q) &&
1263 if (blk_attempt_plug_merge(q, bio, &request_count, 1263 blk_attempt_plug_merge(q, bio, &request_count, &same_queue_rq))
1264 &same_queue_rq)) 1264 return BLK_QC_T_NONE;
1265 return BLK_QC_T_NONE;
1266 } else
1267 request_count = blk_plug_queued_count(q);
1268 1265
1269 rq = blk_mq_map_request(q, bio, &data); 1266 rq = blk_mq_map_request(q, bio, &data);
1270 if (unlikely(!rq)) 1267 if (unlikely(!rq))
@@ -1355,9 +1352,11 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
1355 1352
1356 blk_queue_split(q, &bio, q->bio_split); 1353 blk_queue_split(q, &bio, q->bio_split);
1357 1354
1358 if (!is_flush_fua && !blk_queue_nomerges(q) && 1355 if (!is_flush_fua && !blk_queue_nomerges(q)) {
1359 blk_attempt_plug_merge(q, bio, &request_count, NULL)) 1356 if (blk_attempt_plug_merge(q, bio, &request_count, NULL))
1360 return BLK_QC_T_NONE; 1357 return BLK_QC_T_NONE;
1358 } else
1359 request_count = blk_plug_queued_count(q);
1361 1360
1362 rq = blk_mq_map_request(q, bio, &data); 1361 rq = blk_mq_map_request(q, bio, &data);
1363 if (unlikely(!rq)) 1362 if (unlikely(!rq))
@@ -1471,7 +1470,7 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
1471 INIT_LIST_HEAD(&tags->page_list); 1470 INIT_LIST_HEAD(&tags->page_list);
1472 1471
1473 tags->rqs = kzalloc_node(set->queue_depth * sizeof(struct request *), 1472 tags->rqs = kzalloc_node(set->queue_depth * sizeof(struct request *),
1474 GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY, 1473 GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY,
1475 set->numa_node); 1474 set->numa_node);
1476 if (!tags->rqs) { 1475 if (!tags->rqs) {
1477 blk_mq_free_tags(tags); 1476 blk_mq_free_tags(tags);
@@ -1497,7 +1496,7 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
1497 1496
1498 do { 1497 do {
1499 page = alloc_pages_node(set->numa_node, 1498 page = alloc_pages_node(set->numa_node,
1500 GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY | __GFP_ZERO, 1499 GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY | __GFP_ZERO,
1501 this_order); 1500 this_order);
1502 if (page) 1501 if (page)
1503 break; 1502 break;
@@ -1518,7 +1517,7 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
1518 * Allow kmemleak to scan these pages as they contain pointers 1517 * Allow kmemleak to scan these pages as they contain pointers
1519 * to additional allocations like via ops->init_request(). 1518 * to additional allocations like via ops->init_request().
1520 */ 1519 */
1521 kmemleak_alloc(p, order_to_size(this_order), 1, GFP_KERNEL); 1520 kmemleak_alloc(p, order_to_size(this_order), 1, GFP_NOIO);
1522 entries_per_page = order_to_size(this_order) / rq_size; 1521 entries_per_page = order_to_size(this_order) / rq_size;
1523 to_do = min(entries_per_page, set->queue_depth - i); 1522 to_do = min(entries_per_page, set->queue_depth - i);
1524 left -= to_do * rq_size; 1523 left -= to_do * rq_size;
diff --git a/block/genhd.c b/block/genhd.c
index fad9db981675..a87e77626504 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -664,7 +664,6 @@ void del_gendisk(struct gendisk *disk)
664 664
665 kobject_put(disk->part0.holder_dir); 665 kobject_put(disk->part0.holder_dir);
666 kobject_put(disk->slave_dir); 666 kobject_put(disk->slave_dir);
667 disk->driverfs_dev = NULL;
668 if (!sysfs_deprecated) 667 if (!sysfs_deprecated)
669 sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk))); 668 sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
670 pm_runtime_set_memalloc_noio(disk_to_dev(disk), false); 669 pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 91327dbfbb1d..19cf33b91a5a 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -446,7 +446,6 @@ rescan:
446 446
447 if (disk->fops->revalidate_disk) 447 if (disk->fops->revalidate_disk)
448 disk->fops->revalidate_disk(disk); 448 disk->fops->revalidate_disk(disk);
449 blk_integrity_revalidate(disk);
450 check_disk_size_change(disk, bdev); 449 check_disk_size_change(disk, bdev);
451 bdev->bd_invalidated = 0; 450 bdev->bd_invalidated = 0;
452 if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) 451 if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c
index 93e7c1b32edd..5610cd537da7 100644
--- a/block/partitions/msdos.c
+++ b/block/partitions/msdos.c
@@ -300,6 +300,8 @@ static void parse_bsd(struct parsed_partitions *state,
300 continue; 300 continue;
301 bsd_start = le32_to_cpu(p->p_offset); 301 bsd_start = le32_to_cpu(p->p_offset);
302 bsd_size = le32_to_cpu(p->p_size); 302 bsd_size = le32_to_cpu(p->p_size);
303 if (memcmp(flavour, "bsd\0", 4) == 0)
304 bsd_start += offset;
303 if (offset == bsd_start && size == bsd_size) 305 if (offset == bsd_start && size == bsd_size)
304 /* full parent partition, we have it already */ 306 /* full parent partition, we have it already */
305 continue; 307 continue;
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 0774799942e0..c6fee7437be4 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -182,6 +182,9 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
182 __set_bit(WRITE_16, filter->write_ok); 182 __set_bit(WRITE_16, filter->write_ok);
183 __set_bit(WRITE_LONG, filter->write_ok); 183 __set_bit(WRITE_LONG, filter->write_ok);
184 __set_bit(WRITE_LONG_2, filter->write_ok); 184 __set_bit(WRITE_LONG_2, filter->write_ok);
185 __set_bit(WRITE_SAME, filter->write_ok);
186 __set_bit(WRITE_SAME_16, filter->write_ok);
187 __set_bit(WRITE_SAME_32, filter->write_ok);
185 __set_bit(ERASE, filter->write_ok); 188 __set_bit(ERASE, filter->write_ok);
186 __set_bit(GPCMD_MODE_SELECT_10, filter->write_ok); 189 __set_bit(GPCMD_MODE_SELECT_10, filter->write_ok);
187 __set_bit(MODE_SELECT, filter->write_ok); 190 __set_bit(MODE_SELECT, filter->write_ok);