From cedaa1dd6d4ee7b89303abdaf9abf5bfe9918a1d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 9 Mar 2012 10:03:56 -0800 Subject: [PATCH] 3.0-stable patches added patches: dm-io-fix-discard-support.patch dm-raid-fix-flush-support.patch drm-radeon-kms-set-sx_misc-in-the-r6xx-blit-code-v2.patch net-usbnet-avoid-recursive-locking-in-usbnet_stop.patch --- queue-3.0/dm-io-fix-discard-support.patch | 84 +++++++++++++++++++ queue-3.0/dm-raid-fix-flush-support.patch | 35 ++++++++ ...set-sx_misc-in-the-r6xx-blit-code-v2.patch | 49 +++++++++++ ...oid-recursive-locking-in-usbnet_stop.patch | 59 +++++++++++++ queue-3.0/series | 4 + 5 files changed, 231 insertions(+) create mode 100644 queue-3.0/dm-io-fix-discard-support.patch create mode 100644 queue-3.0/dm-raid-fix-flush-support.patch create mode 100644 queue-3.0/drm-radeon-kms-set-sx_misc-in-the-r6xx-blit-code-v2.patch create mode 100644 queue-3.0/net-usbnet-avoid-recursive-locking-in-usbnet_stop.patch diff --git a/queue-3.0/dm-io-fix-discard-support.patch b/queue-3.0/dm-io-fix-discard-support.patch new file mode 100644 index 00000000000..10cdb42b81e --- /dev/null +++ b/queue-3.0/dm-io-fix-discard-support.patch @@ -0,0 +1,84 @@ +From 0c535e0d6f463365c29623350dbd91642363c39b Mon Sep 17 00:00:00 2001 +From: Milan Broz +Date: Wed, 7 Mar 2012 19:09:37 +0000 +Subject: dm io: fix discard support + +From: Milan Broz + +commit 0c535e0d6f463365c29623350dbd91642363c39b upstream. + +This patch fixes a crash by recognising discards in dm_io. + +Currently dm_mirror can send REQ_DISCARD bios if running over a +discard-enabled device and without support in dm_io the system +crashes badly. + +BUG: unable to handle kernel paging request at 00800000 +IP: __bio_add_page.part.17+0xf5/0x1e0 +... + bio_add_page+0x56/0x70 + dispatch_io+0x1cf/0x240 [dm_mod] + ? km_get_page+0x50/0x50 [dm_mod] + ? vm_next_page+0x20/0x20 [dm_mod] + ? mirror_flush+0x130/0x130 [dm_mirror] + dm_io+0xdc/0x2b0 [dm_mod] +... + +Introduced in 2.6.38-rc1 by commit 5fc2ffeabb9ee0fc0e71ff16b49f34f0ed3d05b4 +(dm raid1: support discard). + +Signed-off-by: Milan Broz +Acked-by: Mike Snitzer +Signed-off-by: Alasdair G Kergon +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-io.c | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +--- a/drivers/md/dm-io.c ++++ b/drivers/md/dm-io.c +@@ -296,6 +296,8 @@ static void do_region(int rw, unsigned r + unsigned offset; + unsigned num_bvecs; + sector_t remaining = where->count; ++ struct request_queue *q = bdev_get_queue(where->bdev); ++ sector_t discard_sectors; + + /* + * where->count may be zero if rw holds a flush and we need to +@@ -305,9 +307,12 @@ static void do_region(int rw, unsigned r + /* + * Allocate a suitably sized-bio. + */ +- num_bvecs = dm_sector_div_up(remaining, +- (PAGE_SIZE >> SECTOR_SHIFT)); +- num_bvecs = min_t(int, bio_get_nr_vecs(where->bdev), num_bvecs); ++ if (rw & REQ_DISCARD) ++ num_bvecs = 1; ++ else ++ num_bvecs = min_t(int, bio_get_nr_vecs(where->bdev), ++ dm_sector_div_up(remaining, (PAGE_SIZE >> SECTOR_SHIFT))); ++ + bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios); + bio->bi_sector = where->sector + (where->count - remaining); + bio->bi_bdev = where->bdev; +@@ -315,10 +320,14 @@ static void do_region(int rw, unsigned r + bio->bi_destructor = dm_bio_destructor; + store_io_and_region_in_bio(bio, io, region); + +- /* +- * Try and add as many pages as possible. +- */ +- while (remaining) { ++ if (rw & REQ_DISCARD) { ++ discard_sectors = min_t(sector_t, q->limits.max_discard_sectors, remaining); ++ bio->bi_size = discard_sectors << SECTOR_SHIFT; ++ remaining -= discard_sectors; ++ } else while (remaining) { ++ /* ++ * Try and add as many pages as possible. ++ */ + dp->get_page(dp, &page, &len, &offset); + len = min(len, to_bytes(remaining)); + if (!bio_add_page(bio, page, len, offset)) diff --git a/queue-3.0/dm-raid-fix-flush-support.patch b/queue-3.0/dm-raid-fix-flush-support.patch new file mode 100644 index 00000000000..1069ab9163b --- /dev/null +++ b/queue-3.0/dm-raid-fix-flush-support.patch @@ -0,0 +1,35 @@ +From 0ca93de9b789e0eb05e103f0c04de72df13da73a Mon Sep 17 00:00:00 2001 +From: Jonathan E Brassow +Date: Wed, 7 Mar 2012 19:09:48 +0000 +Subject: dm raid: fix flush support + +From: Jonathan E Brassow + +commit 0ca93de9b789e0eb05e103f0c04de72df13da73a upstream. + +Fix dm-raid flush support. + +Both md and dm have support for flush, but the dm-raid target +forgot to set the flag to indicate that flushes should be +passed on. (Important for data integrity e.g. with writeback cache +enabled.) + +Signed-off-by: Jonathan Brassow +Acked-by: Mike Snitzer +Signed-off-by: Alasdair G Kergon +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-raid.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/md/dm-raid.c ++++ b/drivers/md/dm-raid.c +@@ -468,6 +468,7 @@ static int raid_ctr(struct dm_target *ti + INIT_WORK(&rs->md.event_work, do_table_event); + ti->split_io = rs->md.chunk_sectors; + ti->private = rs; ++ ti->num_flush_requests = 1; + + mutex_lock(&rs->md.reconfig_mutex); + ret = md_run(&rs->md); diff --git a/queue-3.0/drm-radeon-kms-set-sx_misc-in-the-r6xx-blit-code-v2.patch b/queue-3.0/drm-radeon-kms-set-sx_misc-in-the-r6xx-blit-code-v2.patch new file mode 100644 index 00000000000..6cdee21796d --- /dev/null +++ b/queue-3.0/drm-radeon-kms-set-sx_misc-in-the-r6xx-blit-code-v2.patch @@ -0,0 +1,49 @@ +From cf00790dea6f210ddd01a6656da58c7c9a4ea0e4 Mon Sep 17 00:00:00 2001 +From: Marek Olšák +Date: Wed, 7 Mar 2012 23:33:00 +0100 +Subject: drm/radeon/kms: set SX_MISC in the r6xx blit code (v2) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Marek Olšák + +commit cf00790dea6f210ddd01a6656da58c7c9a4ea0e4 upstream. + +Mesa may set it to 1, causing all primitives to be killed. + +v2: also update the r7xx code + +Signed-off-by: Marek Olšák +Reviewed-by: Alex Deucher +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/r600_blit_shaders.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/gpu/drm/radeon/r600_blit_shaders.c ++++ b/drivers/gpu/drm/radeon/r600_blit_shaders.c +@@ -314,6 +314,10 @@ const u32 r6xx_default_state[] = + 0x00000000, /* VGT_VTX_CNT_EN */ + + 0xc0016900, ++ 0x000000d4, ++ 0x00000000, /* SX_MISC */ ++ ++ 0xc0016900, + 0x000002c8, + 0x00000000, /* VGT_STRMOUT_BUFFER_EN */ + +@@ -626,6 +630,10 @@ const u32 r7xx_default_state[] = + 0x00000000, /* VGT_VTX_CNT_EN */ + + 0xc0016900, ++ 0x000000d4, ++ 0x00000000, /* SX_MISC */ ++ ++ 0xc0016900, + 0x000002c8, + 0x00000000, /* VGT_STRMOUT_BUFFER_EN */ + diff --git a/queue-3.0/net-usbnet-avoid-recursive-locking-in-usbnet_stop.patch b/queue-3.0/net-usbnet-avoid-recursive-locking-in-usbnet_stop.patch new file mode 100644 index 00000000000..a990039b57f --- /dev/null +++ b/queue-3.0/net-usbnet-avoid-recursive-locking-in-usbnet_stop.patch @@ -0,0 +1,59 @@ +From 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d Mon Sep 17 00:00:00 2001 +From: Sebastian Siewior +Date: Wed, 7 Mar 2012 10:19:28 +0000 +Subject: net/usbnet: avoid recursive locking in usbnet_stop() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sebastian Siewior + +commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d upstream. + +|kernel BUG at kernel/rtmutex.c:724! +|[] (rt_spin_lock_slowlock+0x108/0x2bc) from [] (defer_bh+0x1c/0xb4) +|[] (defer_bh+0x1c/0xb4) from [] (rx_complete+0x14c/0x194) +|[] (rx_complete+0x14c/0x194) from [] (usb_hcd_giveback_urb+0xa0/0xf0) +|[] (usb_hcd_giveback_urb+0xa0/0xf0) from [] (musb_giveback+0x34/0x40) +|[] (musb_giveback+0x34/0x40) from [] (musb_advance_schedule+0xb4/0x1c0) +|[] (musb_advance_schedule+0xb4/0x1c0) from [] (musb_cleanup_urb.isra.9+0x80/0x8c) +|[] (musb_cleanup_urb.isra.9+0x80/0x8c) from [] (musb_urb_dequeue+0xec/0x108) +|[] (musb_urb_dequeue+0xec/0x108) from [] (unlink1+0xbc/0xcc) +|[] (unlink1+0xbc/0xcc) from [] (usb_hcd_unlink_urb+0x54/0xa8) +|[] (usb_hcd_unlink_urb+0x54/0xa8) from [] (unlink_urbs.isra.17+0x2c/0x58) +|[] (unlink_urbs.isra.17+0x2c/0x58) from [] (usbnet_terminate_urbs+0x94/0x10c) +|[] (usbnet_terminate_urbs+0x94/0x10c) from [] (usbnet_stop+0x100/0x15c) +|[] (usbnet_stop+0x100/0x15c) from [] (__dev_close_many+0x94/0xc8) + +defer_bh() takes the lock which is hold during unlink_urbs(). The safe +walk suggest that the skb will be removed from the list and this is done +by defer_bh() so it seems to be okay to drop the lock here. + +Reported-by: Aníbal Almeida Pinto +Signed-off-by: Sebastian Andrzej Siewior +Acked-by: Oliver Neukum +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/usb/usbnet.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -585,6 +585,7 @@ static int unlink_urbs (struct usbnet *d + entry = (struct skb_data *) skb->cb; + urb = entry->urb; + ++ spin_unlock_irqrestore(&q->lock, flags); + // during some PM-driven resume scenarios, + // these (async) unlinks complete immediately + retval = usb_unlink_urb (urb); +@@ -592,6 +593,7 @@ static int unlink_urbs (struct usbnet *d + netdev_dbg(dev->net, "unlink urb err, %d\n", retval); + else + count++; ++ spin_lock_irqsave(&q->lock, flags); + } + spin_unlock_irqrestore (&q->lock, flags); + return count; diff --git a/queue-3.0/series b/queue-3.0/series index 8368b041f9e..e5f28f2f523 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -60,3 +60,7 @@ hwmon-pmbus_core-fix-maximum-number-of-pout-alarm-attributes.patch hwmon-jc42-add-support-for-st-microelectronics-stts2002-and-stts3000.patch hwmon-jc42-add-support-for-at30ts00-ts3000gb2-tse2002gb2-and-mcp9804.patch carl9170-fix-memory-accounting-when-sta-is-in-power-save-mode.patch +drm-radeon-kms-set-sx_misc-in-the-r6xx-blit-code-v2.patch +net-usbnet-avoid-recursive-locking-in-usbnet_stop.patch +dm-io-fix-discard-support.patch +dm-raid-fix-flush-support.patch -- 2.47.3