From 44df447b29a954efeec2f81f39336edf68773ec6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 11 Feb 2013 12:00:52 -0800 Subject: [PATCH] 3.7-stable patches added patches: ath9k_hw-fix-calibration-issues-on-chainmask-that-don-t-include-chain-0.patch dm-thin-fix-queue-limits-stacking.patch media-pwc-if-must-check-vb2_queue_init-success.patch mfd-db8500-prcmu-fix-irqdomain-usage.patch --- ...chainmask-that-don-t-include-chain-0.patch | 52 ++++++++++ .../dm-thin-fix-queue-limits-stacking.patch | 94 +++++++++++++++++++ ...if-must-check-vb2_queue_init-success.patch | 38 ++++++++ ...mfd-db8500-prcmu-fix-irqdomain-usage.patch | 52 ++++++++++ queue-3.7/series | 4 + 5 files changed, 240 insertions(+) create mode 100644 queue-3.7/ath9k_hw-fix-calibration-issues-on-chainmask-that-don-t-include-chain-0.patch create mode 100644 queue-3.7/dm-thin-fix-queue-limits-stacking.patch create mode 100644 queue-3.7/media-pwc-if-must-check-vb2_queue_init-success.patch create mode 100644 queue-3.7/mfd-db8500-prcmu-fix-irqdomain-usage.patch diff --git a/queue-3.7/ath9k_hw-fix-calibration-issues-on-chainmask-that-don-t-include-chain-0.patch b/queue-3.7/ath9k_hw-fix-calibration-issues-on-chainmask-that-don-t-include-chain-0.patch new file mode 100644 index 00000000000..e64704ccec5 --- /dev/null +++ b/queue-3.7/ath9k_hw-fix-calibration-issues-on-chainmask-that-don-t-include-chain-0.patch @@ -0,0 +1,52 @@ +From 4a8f199508d79ff8a7d1e22f47b912baaf225336 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 20 Jan 2013 21:55:20 +0100 +Subject: ath9k_hw: fix calibration issues on chainmask that don't include chain 0 + +From: Felix Fietkau + +commit 4a8f199508d79ff8a7d1e22f47b912baaf225336 upstream. + +Signed-off-by: Felix Fietkau +Signed-off-by: John W. Linville +Signed-off-by: CAI Qian +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/ar9003_calib.c | 2 ++ + drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 +- + drivers/net/wireless/ath/ath9k/hw.h | 1 + + 3 files changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c +@@ -903,6 +903,8 @@ static bool ar9003_hw_init_cal(struct at + AR_PHY_CL_TAB_1, + AR_PHY_CL_TAB_2 }; + ++ ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask); ++ + if (rtt) { + if (!ar9003_hw_rtt_restore(ah, chan)) + run_rtt_cal = true; +--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c +@@ -586,7 +586,7 @@ static void ar9003_hw_init_bb(struct ath + ath9k_hw_synth_delay(ah, chan, synthDelay); + } + +-static void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx) ++void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx) + { + if (ah->caps.tx_chainmask == 5 || ah->caps.rx_chainmask == 5) + REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP, +--- a/drivers/net/wireless/ath/ath9k/hw.h ++++ b/drivers/net/wireless/ath/ath9k/hw.h +@@ -1063,6 +1063,7 @@ int ar9003_paprd_create_curve(struct ath + int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); + int ar9003_paprd_init_table(struct ath_hw *ah); + bool ar9003_paprd_is_done(struct ath_hw *ah); ++void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx); + + /* Hardware family op attach helpers */ + void ar5008_hw_attach_phy_ops(struct ath_hw *ah); diff --git a/queue-3.7/dm-thin-fix-queue-limits-stacking.patch b/queue-3.7/dm-thin-fix-queue-limits-stacking.patch new file mode 100644 index 00000000000..7fe3e0cd8e1 --- /dev/null +++ b/queue-3.7/dm-thin-fix-queue-limits-stacking.patch @@ -0,0 +1,94 @@ +From 0f640dca08330dfc7820d610578e5935b5e654b2 Mon Sep 17 00:00:00 2001 +From: Mike Snitzer +Date: Thu, 31 Jan 2013 14:11:14 +0000 +Subject: dm thin: fix queue limits stacking + +From: Mike Snitzer + +commit 0f640dca08330dfc7820d610578e5935b5e654b2 upstream. + +thin_io_hints() is blindly copying the queue limits from the thin-pool +which can lead to incorrect limits being set. The fix here simply +deletes the thin_io_hints() hook which leaves the existing stacking +infrastructure to set the limits correctly. + +When a thin-pool uses an MD device for the data device a thin device +from the thin-pool must respect MD's constraints about disallowing a bio +from spanning multiple chunks. Otherwise we can see problems. If the raid0 +chunksize is 1152K and thin-pool chunksize is 256K I see the following +md/raid0 error (with extra debug tracing added to thin_endio) when +mkfs.xfs is executed against the thin device: + +md/raid0:md99: make_request bug: can't convert block across chunks or bigger than 1152k 6688 127 +device-mapper: thin: bio sector=2080 err=-5 bi_size=130560 bi_rw=17 bi_vcnt=32 bi_idx=0 + +This extra DM debugging shows that the failing bio is spanning across +the first and second logical 1152K chunk (sector 2080 + 255 takes the +bio beyond the first chunk's boundary of sector 2304). So the bio +splitting that DM is doing clearly isn't respecting the MD limits. + +max_hw_sectors_kb is 127 for both the thin-pool and thin device +(queue_max_hw_sectors returns 255 so we'll excuse sysfs's lack of +precision). So this explains why bi_size is 130560. + +But the thin device's max_hw_sectors_kb should be 4 (PAGE_SIZE) given +that it doesn't have a .merge function (for bio_add_page to consult +indirectly via dm_merge_bvec) yet the thin-pool does sit above an MD +device that has a compulsory merge_bvec_fn. This scenario is exactly +why DM must resort to sending single PAGE_SIZE bios to the underlying +layer. Some additional context for this is available in the header for +commit 8cbeb67a ("dm: avoid unsupported spanning of md stripe boundaries"). + +Long story short, the reason a thin device doesn't properly get +configured to have a max_hw_sectors_kb of 4 (PAGE_SIZE) is that +thin_io_hints() is blindly copying the queue limits from the thin-pool +device directly to the thin device's queue limits. + +Fix this by eliminating thin_io_hints. Doing so is safe because the +block layer's queue limits stacking already enables the upper level thin +device to inherit the thin-pool device's discard and minimum_io_size and +optimal_io_size limits that get set in pool_io_hints. But avoiding the +queue limits copy allows the thin and thin-pool limits to be different +where it is important, namely max_hw_sectors_kb. + +Reported-by: Daniel Browning +Signed-off-by: Mike Snitzer +Cc: stable@vger.kernel.org +Signed-off-by: Alasdair G Kergon +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-thin.c | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +--- a/drivers/md/dm-thin.c ++++ b/drivers/md/dm-thin.c +@@ -2766,19 +2766,9 @@ static int thin_iterate_devices(struct d + return 0; + } + +-/* +- * A thin device always inherits its queue limits from its pool. +- */ +-static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) +-{ +- struct thin_c *tc = ti->private; +- +- *limits = bdev_get_queue(tc->pool_dev->bdev)->limits; +-} +- + static struct target_type thin_target = { + .name = "thin", +- .version = {1, 5, 0}, ++ .version = {1, 5, 1}, + .module = THIS_MODULE, + .ctr = thin_ctr, + .dtr = thin_dtr, +@@ -2787,7 +2777,6 @@ static struct target_type thin_target = + .postsuspend = thin_postsuspend, + .status = thin_status, + .iterate_devices = thin_iterate_devices, +- .io_hints = thin_io_hints, + }; + + /*----------------------------------------------------------------*/ diff --git a/queue-3.7/media-pwc-if-must-check-vb2_queue_init-success.patch b/queue-3.7/media-pwc-if-must-check-vb2_queue_init-success.patch new file mode 100644 index 00000000000..11025c4b454 --- /dev/null +++ b/queue-3.7/media-pwc-if-must-check-vb2_queue_init-success.patch @@ -0,0 +1,38 @@ +From eda94710d6502672c5ee7de198fa78a63ddfae3a Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Sat, 27 Oct 2012 14:26:25 -0300 +Subject: media: pwc-if: must check vb2_queue_init() success + +From: Mauro Carvalho Chehab + +commit eda94710d6502672c5ee7de198fa78a63ddfae3a upstream. + +drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe': +drivers/media/usb/pwc/pwc-if.c:1003:16: warning: ignoring return value of 'vb2_queue_init', declared with attribute warn_unused_result [-Wunused-result] +In the past, it used to have a logic there at queue init that would +BUG() on errors. This logic got removed. Drivers are now required +to explicitly handle the queue initialization errors, or very bad +things may happen. + +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Paul Bolle + +--- + drivers/media/usb/pwc/pwc-if.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/media/usb/pwc/pwc-if.c ++++ b/drivers/media/usb/pwc/pwc-if.c +@@ -1000,7 +1000,11 @@ static int usb_pwc_probe(struct usb_inte + pdev->vb_queue.buf_struct_size = sizeof(struct pwc_frame_buf); + pdev->vb_queue.ops = &pwc_vb_queue_ops; + pdev->vb_queue.mem_ops = &vb2_vmalloc_memops; +- vb2_queue_init(&pdev->vb_queue); ++ rc = vb2_queue_init(&pdev->vb_queue); ++ if (rc < 0) { ++ PWC_ERROR("Oops, could not initialize vb2 queue.\n"); ++ goto err_free_mem; ++ } + + /* Init video_device structure */ + memcpy(&pdev->vdev, &pwc_template, sizeof(pwc_template)); diff --git a/queue-3.7/mfd-db8500-prcmu-fix-irqdomain-usage.patch b/queue-3.7/mfd-db8500-prcmu-fix-irqdomain-usage.patch new file mode 100644 index 00000000000..8bc101807bb --- /dev/null +++ b/queue-3.7/mfd-db8500-prcmu-fix-irqdomain-usage.patch @@ -0,0 +1,52 @@ +From 89d9b1c99374997d68910ba49d5b7df80e7f2061 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Thu, 20 Dec 2012 10:20:15 +0100 +Subject: mfd: db8500-prcmu: Fix irqdomain usage + +From: Linus Walleij + +commit 89d9b1c99374997d68910ba49d5b7df80e7f2061 upstream. + +This fixes two issues with the DB8500 PRCMU irqdomain: +- You have to state the irq base 0 to get a linear domain + for the DT case from irq_domain_add_simple() +- The irqdomain was not used to translate the initial irq + request using irq_create_mapping() making the linear + case fail as it was lacking a proper descriptor. + +I took this opportunity to fix two lines of whitespace +errors in related code as I was anyway messing around with +it. + +Acked-by Lee Jones +Signed-off-by: Linus Walleij +Signed-off-by: Samuel Ortiz +Signed-off-by: CAI Qian +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/db8500-prcmu.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/mfd/db8500-prcmu.c ++++ b/drivers/mfd/db8500-prcmu.c +@@ -2478,7 +2478,7 @@ static bool read_mailbox_0(void) + + for (n = 0; n < NUM_PRCMU_WAKEUPS; n++) { + if (ev & prcmu_irq_bit[n]) +- generic_handle_irq(IRQ_PRCMU_BASE + n); ++ generic_handle_irq(irq_find_mapping(db8500_irq_domain, n)); + } + r = true; + break; +@@ -2706,6 +2706,10 @@ static int db8500_irq_init(struct device + return -ENOSYS; + } + ++ /* All wakeups will be used, so create mappings for all */ ++ for (i = 0; i < NUM_PRCMU_WAKEUPS; i++) ++ irq_create_mapping(db8500_irq_domain, i); ++ + return 0; + } + diff --git a/queue-3.7/series b/queue-3.7/series index ce102a1391e..e5c8fa39f7e 100644 --- a/queue-3.7/series +++ b/queue-3.7/series @@ -10,3 +10,7 @@ revert-iwlwifi-fix-the-reclaimed-packet-tracking-upon-flush-queue.patch can-c_can-set-reserved-bit-in-ifx_mask2-to-1-on-write.patch mwifiex-fix-incomplete-scan-in-case-of-ie-parsing-error.patch e1000e-enable-ecc-on-i217-i218-to-catch-packet-buffer-memory-errors.patch +media-pwc-if-must-check-vb2_queue_init-success.patch +ath9k_hw-fix-calibration-issues-on-chainmask-that-don-t-include-chain-0.patch +mfd-db8500-prcmu-fix-irqdomain-usage.patch +dm-thin-fix-queue-limits-stacking.patch -- 2.47.3