--- /dev/null
+From 4a8f199508d79ff8a7d1e22f47b912baaf225336 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@openwrt.org>
+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 <nbd@openwrt.org>
+
+commit 4a8f199508d79ff8a7d1e22f47b912baaf225336 upstream.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: CAI Qian <caiqian@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
--- /dev/null
+From 0f640dca08330dfc7820d610578e5935b5e654b2 Mon Sep 17 00:00:00 2001
+From: Mike Snitzer <snitzer@redhat.com>
+Date: Thu, 31 Jan 2013 14:11:14 +0000
+Subject: dm thin: fix queue limits stacking
+
+From: Mike Snitzer <snitzer@redhat.com>
+
+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 <db@kavod.com>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Alasdair G Kergon <agk@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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,
+ };
+
+ /*----------------------------------------------------------------*/
--- /dev/null
+From eda94710d6502672c5ee7de198fa78a63ddfae3a Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mchehab@redhat.com>
+Date: Sat, 27 Oct 2012 14:26:25 -0300
+Subject: media: pwc-if: must check vb2_queue_init() success
+
+From: Mauro Carvalho Chehab <mchehab@redhat.com>
+
+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 <mchehab@redhat.com>
+Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
+
+---
+ 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));
--- /dev/null
+From 89d9b1c99374997d68910ba49d5b7df80e7f2061 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Thu, 20 Dec 2012 10:20:15 +0100
+Subject: mfd: db8500-prcmu: Fix irqdomain usage
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+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 <lee.jones@linaro.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: CAI Qian <caiqian@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+ }
+
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