From: Greg Kroah-Hartman Date: Tue, 13 Jan 2015 03:27:51 +0000 (-0800) Subject: 3.14-stable patches X-Git-Tag: v3.10.65~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=074aff14ae32fa2101270d4861d15ebd5bcf1d6e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: asoc-dwc-ensure-fifos-are-flushed-to-prevent-channel-swap.patch asoc-max98090-fix-ill-defined-sidetone-route.patch asoc-sigmadsp-refuse-to-load-firmware-files-with-a-non-supported-version.patch ath5k-fix-hardware-queue-index-assignment.patch can-peak_usb-fix-cleanup-sequence-order-in-case-of-error-during-init.patch can-peak_usb-fix-memset-usage.patch iwlwifi-mvm-update-values-for-smart-fifo.patch swiotlb-xen-call-xen_dma_sync_single_for_device-when-appropriate.patch swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unmap_single.patch swiotlb-xen-pass-dev_addr-to-xen_dma_unmap_page-and-xen_dma_sync_single_for_cpu.patch swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch --- diff --git a/queue-3.14/asoc-dwc-ensure-fifos-are-flushed-to-prevent-channel-swap.patch b/queue-3.14/asoc-dwc-ensure-fifos-are-flushed-to-prevent-channel-swap.patch new file mode 100644 index 00000000000..a491021236c --- /dev/null +++ b/queue-3.14/asoc-dwc-ensure-fifos-are-flushed-to-prevent-channel-swap.patch @@ -0,0 +1,51 @@ +From 3475c3d034d7f276a474c8bd53f44b48c8bf669d Mon Sep 17 00:00:00 2001 +From: Andrew Jackson +Date: Fri, 19 Dec 2014 16:18:05 +0000 +Subject: ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap + +From: Andrew Jackson + +commit 3475c3d034d7f276a474c8bd53f44b48c8bf669d upstream. + +Flush the FIFOs when the stream is prepared for use. This avoids +an inadvertent swapping of the left/right channels if the FIFOs are +not empty at startup. + +Signed-off-by: Andrew Jackson +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/dwc/designware_i2s.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/sound/soc/dwc/designware_i2s.c ++++ b/sound/soc/dwc/designware_i2s.c +@@ -263,6 +263,19 @@ static void dw_i2s_shutdown(struct snd_p + snd_soc_dai_set_dma_data(dai, substream, NULL); + } + ++static int dw_i2s_prepare(struct snd_pcm_substream *substream, ++ struct snd_soc_dai *dai) ++{ ++ struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ i2s_write_reg(dev->i2s_base, TXFFR, 1); ++ else ++ i2s_write_reg(dev->i2s_base, RXFFR, 1); ++ ++ return 0; ++} ++ + static int dw_i2s_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) + { +@@ -294,6 +307,7 @@ static struct snd_soc_dai_ops dw_i2s_dai + .startup = dw_i2s_startup, + .shutdown = dw_i2s_shutdown, + .hw_params = dw_i2s_hw_params, ++ .prepare = dw_i2s_prepare, + .trigger = dw_i2s_trigger, + }; + diff --git a/queue-3.14/asoc-max98090-fix-ill-defined-sidetone-route.patch b/queue-3.14/asoc-max98090-fix-ill-defined-sidetone-route.patch new file mode 100644 index 00000000000..e6e034a1f3f --- /dev/null +++ b/queue-3.14/asoc-max98090-fix-ill-defined-sidetone-route.patch @@ -0,0 +1,44 @@ +From 48826ee590da03e9882922edf96d8d27bdfe9552 Mon Sep 17 00:00:00 2001 +From: Jarkko Nikula +Date: Mon, 24 Nov 2014 15:32:36 +0200 +Subject: ASoC: max98090: Fix ill-defined sidetone route + +From: Jarkko Nikula + +commit 48826ee590da03e9882922edf96d8d27bdfe9552 upstream. + +Commit 5fe5b767dc6f ("ASoC: dapm: Do not pretend to support controls for non +mixer/mux widgets") revealed ill-defined control in a route between +"STENL Mux" and DACs in max98090.c: + +max98090 i2c-193C9890:00: Control not supported for path STENL Mux -> [NULL] -> DACL +max98090 i2c-193C9890:00: ASoC: no dapm match for STENL Mux --> NULL --> DACL +max98090 i2c-193C9890:00: ASoC: Failed to add route STENL Mux -> NULL -> DACL +max98090 i2c-193C9890:00: Control not supported for path STENL Mux -> [NULL] -> DACR +max98090 i2c-193C9890:00: ASoC: no dapm match for STENL Mux --> NULL --> DACR +max98090 i2c-193C9890:00: ASoC: Failed to add route STENL Mux -> NULL -> DACR + +Since there is no control between "STENL Mux" and DACs the control name must +be NULL not "NULL". + +Signed-off-by: Jarkko Nikula +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/max98090.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/soc/codecs/max98090.c ++++ b/sound/soc/codecs/max98090.c +@@ -1378,8 +1378,8 @@ static const struct snd_soc_dapm_route m + {"STENL Mux", "Sidetone Left", "DMICL"}, + {"STENR Mux", "Sidetone Right", "ADCR"}, + {"STENR Mux", "Sidetone Right", "DMICR"}, +- {"DACL", "NULL", "STENL Mux"}, +- {"DACR", "NULL", "STENL Mux"}, ++ {"DACL", NULL, "STENL Mux"}, ++ {"DACR", NULL, "STENL Mux"}, + + {"AIFINL", NULL, "SHDN"}, + {"AIFINR", NULL, "SHDN"}, diff --git a/queue-3.14/asoc-sigmadsp-refuse-to-load-firmware-files-with-a-non-supported-version.patch b/queue-3.14/asoc-sigmadsp-refuse-to-load-firmware-files-with-a-non-supported-version.patch new file mode 100644 index 00000000000..c0fcbf38f04 --- /dev/null +++ b/queue-3.14/asoc-sigmadsp-refuse-to-load-firmware-files-with-a-non-supported-version.patch @@ -0,0 +1,37 @@ +From 50c0f21b42dd4cd02b51f82274f66912d9a7fa32 Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Wed, 19 Nov 2014 18:29:02 +0100 +Subject: ASoC: sigmadsp: Refuse to load firmware files with a non-supported version + +From: Lars-Peter Clausen + +commit 50c0f21b42dd4cd02b51f82274f66912d9a7fa32 upstream. + +Make sure to check the version field of the firmware header to make sure to +not accidentally try to parse a firmware file with a different layout. +Trying to do so can result in loading invalid firmware code to the device. + +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/sigmadsp.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/sound/soc/codecs/sigmadsp.c ++++ b/sound/soc/codecs/sigmadsp.c +@@ -176,6 +176,13 @@ static int _process_sigma_firmware(struc + goto done; + } + ++ if (ssfw_head->version != 1) { ++ dev_err(dev, ++ "Failed to load firmware: Invalid version %d. Supported firmware versions: 1\n", ++ ssfw_head->version); ++ goto done; ++ } ++ + crc = crc32(0, fw->data + sizeof(*ssfw_head), + fw->size - sizeof(*ssfw_head)); + pr_debug("%s: crc=%x\n", __func__, crc); diff --git a/queue-3.14/ath5k-fix-hardware-queue-index-assignment.patch b/queue-3.14/ath5k-fix-hardware-queue-index-assignment.patch new file mode 100644 index 00000000000..248cc6c7de3 --- /dev/null +++ b/queue-3.14/ath5k-fix-hardware-queue-index-assignment.patch @@ -0,0 +1,38 @@ +From 9e4982f6a51a2442f1bb588fee42521b44b4531c Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 30 Nov 2014 21:52:57 +0100 +Subject: ath5k: fix hardware queue index assignment + +From: Felix Fietkau + +commit 9e4982f6a51a2442f1bb588fee42521b44b4531c upstream. + +Like with ath9k, ath5k queues also need to be ordered by priority. +queue_info->tqi_subtype already contains the correct index, so use it +instead of relying on the order of ath5k_hw_setup_tx_queue calls. + +Signed-off-by: Felix Fietkau +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath5k/qcu.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/net/wireless/ath/ath5k/qcu.c ++++ b/drivers/net/wireless/ath/ath5k/qcu.c +@@ -225,13 +225,7 @@ ath5k_hw_setup_tx_queue(struct ath5k_hw + } else { + switch (queue_type) { + case AR5K_TX_QUEUE_DATA: +- for (queue = AR5K_TX_QUEUE_ID_DATA_MIN; +- ah->ah_txq[queue].tqi_type != +- AR5K_TX_QUEUE_INACTIVE; queue++) { +- +- if (queue > AR5K_TX_QUEUE_ID_DATA_MAX) +- return -EINVAL; +- } ++ queue = queue_info->tqi_subtype; + break; + case AR5K_TX_QUEUE_UAPSD: + queue = AR5K_TX_QUEUE_ID_UAPSD; diff --git a/queue-3.14/can-peak_usb-fix-cleanup-sequence-order-in-case-of-error-during-init.patch b/queue-3.14/can-peak_usb-fix-cleanup-sequence-order-in-case-of-error-during-init.patch new file mode 100644 index 00000000000..223e35f66e2 --- /dev/null +++ b/queue-3.14/can-peak_usb-fix-cleanup-sequence-order-in-case-of-error-during-init.patch @@ -0,0 +1,77 @@ +From af35d0f1cce7a990286e2b94c260a2c2d2a0e4b0 Mon Sep 17 00:00:00 2001 +From: Stephane Grosjean +Date: Fri, 28 Nov 2014 13:49:10 +0100 +Subject: can: peak_usb: fix cleanup sequence order in case of error during init + +From: Stephane Grosjean + +commit af35d0f1cce7a990286e2b94c260a2c2d2a0e4b0 upstream. + +This patch sets the correct reverse sequence order to the instructions +set to run, when any failure occurs during the initialization steps. +It also adds the missing unregistration call of the can device if the +failure appears after having been registered. + +Signed-off-by: Stephane Grosjean +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/peak_usb/pcan_usb_core.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c ++++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c +@@ -734,7 +734,7 @@ static int peak_usb_create_dev(struct pe + dev->cmd_buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); + if (!dev->cmd_buf) { + err = -ENOMEM; +- goto lbl_set_intf_data; ++ goto lbl_free_candev; + } + + dev->udev = usb_dev; +@@ -773,7 +773,7 @@ static int peak_usb_create_dev(struct pe + err = register_candev(netdev); + if (err) { + dev_err(&intf->dev, "couldn't register CAN device: %d\n", err); +- goto lbl_free_cmd_buf; ++ goto lbl_restore_intf_data; + } + + if (dev->prev_siblings) +@@ -786,14 +786,14 @@ static int peak_usb_create_dev(struct pe + if (dev->adapter->dev_init) { + err = dev->adapter->dev_init(dev); + if (err) +- goto lbl_free_cmd_buf; ++ goto lbl_unregister_candev; + } + + /* set bus off */ + if (dev->adapter->dev_set_bus) { + err = dev->adapter->dev_set_bus(dev, 0); + if (err) +- goto lbl_free_cmd_buf; ++ goto lbl_unregister_candev; + } + + /* get device number early */ +@@ -805,11 +805,14 @@ static int peak_usb_create_dev(struct pe + + return 0; + +-lbl_free_cmd_buf: +- kfree(dev->cmd_buf); ++lbl_unregister_candev: ++ unregister_candev(netdev); + +-lbl_set_intf_data: ++lbl_restore_intf_data: + usb_set_intfdata(intf, dev->prev_siblings); ++ kfree(dev->cmd_buf); ++ ++lbl_free_candev: + free_candev(netdev); + + return err; diff --git a/queue-3.14/can-peak_usb-fix-memset-usage.patch b/queue-3.14/can-peak_usb-fix-memset-usage.patch new file mode 100644 index 00000000000..06529e6111d --- /dev/null +++ b/queue-3.14/can-peak_usb-fix-memset-usage.patch @@ -0,0 +1,43 @@ +From dc50ddcd4c58a5a0226038307d6ef884bec9f8c2 Mon Sep 17 00:00:00 2001 +From: Stephane Grosjean +Date: Fri, 28 Nov 2014 14:08:48 +0100 +Subject: can: peak_usb: fix memset() usage + +From: Stephane Grosjean + +commit dc50ddcd4c58a5a0226038307d6ef884bec9f8c2 upstream. + +This patchs fixes a misplaced call to memset() that fills the request +buffer with 0. The problem was with sending PCAN_USBPRO_REQ_FCT +requests, the content set by the caller was thus lost. + +With this patch, the memory area is zeroed only when requesting info +from the device. + +Signed-off-by: Stephane Grosjean +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c ++++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +@@ -333,8 +333,6 @@ static int pcan_usb_pro_send_req(struct + if (!(dev->state & PCAN_USB_STATE_CONNECTED)) + return 0; + +- memset(req_addr, '\0', req_size); +- + req_type = USB_TYPE_VENDOR | USB_RECIP_OTHER; + + switch (req_id) { +@@ -345,6 +343,7 @@ static int pcan_usb_pro_send_req(struct + default: + p = usb_rcvctrlpipe(dev->udev, 0); + req_type |= USB_DIR_IN; ++ memset(req_addr, '\0', req_size); + break; + } + diff --git a/queue-3.14/iwlwifi-mvm-update-values-for-smart-fifo.patch b/queue-3.14/iwlwifi-mvm-update-values-for-smart-fifo.patch new file mode 100644 index 00000000000..46bf2ddb84d --- /dev/null +++ b/queue-3.14/iwlwifi-mvm-update-values-for-smart-fifo.patch @@ -0,0 +1,33 @@ +From b4c82adcba8cb4b23068a6b800ca98da3bee6888 Mon Sep 17 00:00:00 2001 +From: Emmanuel Grumbach +Date: Mon, 1 Dec 2014 16:44:09 +0200 +Subject: iwlwifi: mvm: update values for Smart Fifo + +From: Emmanuel Grumbach + +commit b4c82adcba8cb4b23068a6b800ca98da3bee6888 upstream. + +Interoperability issues were identified and root caused to +the Smart Fifo watermarks. These issues arose with +NetGear R7000. Fix this. + +Fixes: 1f3b0ff8ecce ("iwlwifi: mvm: Add Smart FIFO support") +Reviewed-by: Johannes Berg +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/iwlwifi/mvm/fw-api.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h ++++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h +@@ -1394,7 +1394,7 @@ enum iwl_sf_scenario { + #define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */ + + /* smart FIFO default values */ +-#define SF_W_MARK_SISO 4096 ++#define SF_W_MARK_SISO 6144 + #define SF_W_MARK_MIMO2 8192 + #define SF_W_MARK_MIMO3 6144 + #define SF_W_MARK_LEGACY 4096 diff --git a/queue-3.14/series b/queue-3.14/series index b03287bf661..f80436e07c7 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -4,3 +4,14 @@ ocfs2-fix-journal-commit-deadlock.patch ocfs2-fix-the-wrong-directory-passed-to-ocfs2_lookup_ino_from_name-when-link-file.patch ath9k_hw-fix-hardware-queue-allocation.patch ath9k-fix-be-bk-queue-order.patch +can-peak_usb-fix-cleanup-sequence-order-in-case-of-error-during-init.patch +can-peak_usb-fix-memset-usage.patch +swiotlb-xen-pass-dev_addr-to-xen_dma_unmap_page-and-xen_dma_sync_single_for_cpu.patch +swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch +swiotlb-xen-call-xen_dma_sync_single_for_device-when-appropriate.patch +swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unmap_single.patch +iwlwifi-mvm-update-values-for-smart-fifo.patch +ath5k-fix-hardware-queue-index-assignment.patch +asoc-sigmadsp-refuse-to-load-firmware-files-with-a-non-supported-version.patch +asoc-max98090-fix-ill-defined-sidetone-route.patch +asoc-dwc-ensure-fifos-are-flushed-to-prevent-channel-swap.patch diff --git a/queue-3.14/swiotlb-xen-call-xen_dma_sync_single_for_device-when-appropriate.patch b/queue-3.14/swiotlb-xen-call-xen_dma_sync_single_for_device-when-appropriate.patch new file mode 100644 index 00000000000..305a2d5f7a0 --- /dev/null +++ b/queue-3.14/swiotlb-xen-call-xen_dma_sync_single_for_device-when-appropriate.patch @@ -0,0 +1,31 @@ +From 9490c6c67e2f41760de8ece4e4f56f75f84ceb9e Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Fri, 21 Nov 2014 16:55:12 +0000 +Subject: swiotlb-xen: call xen_dma_sync_single_for_device when appropriate + +From: Stefano Stabellini + +commit 9490c6c67e2f41760de8ece4e4f56f75f84ceb9e upstream. + +In xen_swiotlb_sync_single we always call xen_dma_sync_single_for_cpu, +even when we should call xen_dma_sync_single_for_device. Fix that. + +Signed-off-by: Stefano Stabellini +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/swiotlb-xen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -500,7 +500,7 @@ xen_swiotlb_sync_single(struct device *h + swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); + + if (target == SYNC_FOR_DEVICE) +- xen_dma_sync_single_for_cpu(hwdev, dev_addr, size, dir); ++ xen_dma_sync_single_for_device(hwdev, dev_addr, size, dir); + + if (dir != DMA_FROM_DEVICE) + return; diff --git a/queue-3.14/swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unmap_single.patch b/queue-3.14/swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unmap_single.patch new file mode 100644 index 00000000000..fc944a4b411 --- /dev/null +++ b/queue-3.14/swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unmap_single.patch @@ -0,0 +1,32 @@ +From 2c3fc8d26dd09b9d7069687eead849ee81c78e46 Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Fri, 21 Nov 2014 16:56:12 +0000 +Subject: swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single + +From: Stefano Stabellini + +commit 2c3fc8d26dd09b9d7069687eead849ee81c78e46 upstream. + +Need to pass the pointer within the swiotlb internal buffer to the +swiotlb library, that in the case of xen_unmap_single is dev_addr, not +paddr. + +Signed-off-by: Stefano Stabellini +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/swiotlb-xen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -449,7 +449,7 @@ static void xen_unmap_single(struct devi + + /* NOTE: We use dev_addr here, not paddr! */ + if (is_xen_swiotlb_buffer(dev_addr)) { +- swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); ++ swiotlb_tbl_unmap_single(hwdev, dev_addr, size, dir); + return; + } + diff --git a/queue-3.14/swiotlb-xen-pass-dev_addr-to-xen_dma_unmap_page-and-xen_dma_sync_single_for_cpu.patch b/queue-3.14/swiotlb-xen-pass-dev_addr-to-xen_dma_unmap_page-and-xen_dma_sync_single_for_cpu.patch new file mode 100644 index 00000000000..99be70ba0cc --- /dev/null +++ b/queue-3.14/swiotlb-xen-pass-dev_addr-to-xen_dma_unmap_page-and-xen_dma_sync_single_for_cpu.patch @@ -0,0 +1,49 @@ +From d6883e6f32e07ef2cc974753ba00927de099e6d7 Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Fri, 21 Nov 2014 11:09:39 +0000 +Subject: swiotlb-xen: pass dev_addr to xen_dma_unmap_page and xen_dma_sync_single_for_cpu + +From: Stefano Stabellini + +commit d6883e6f32e07ef2cc974753ba00927de099e6d7 upstream. + +xen_dma_unmap_page and xen_dma_sync_single_for_cpu take a dma_addr_t +handle as argument, not a physical address. + +Signed-off-by: Stefano Stabellini +Reviewed-by: Catalin Marinas +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/swiotlb-xen.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -447,7 +447,7 @@ static void xen_unmap_single(struct devi + + BUG_ON(dir == DMA_NONE); + +- xen_dma_unmap_page(hwdev, paddr, size, dir, attrs); ++ xen_dma_unmap_page(hwdev, dev_addr, size, dir, attrs); + + /* NOTE: We use dev_addr here, not paddr! */ + if (is_xen_swiotlb_buffer(dev_addr)) { +@@ -495,14 +495,14 @@ xen_swiotlb_sync_single(struct device *h + BUG_ON(dir == DMA_NONE); + + if (target == SYNC_FOR_CPU) +- xen_dma_sync_single_for_cpu(hwdev, paddr, size, dir); ++ xen_dma_sync_single_for_cpu(hwdev, dev_addr, size, dir); + + /* NOTE: We use dev_addr here, not paddr! */ + if (is_xen_swiotlb_buffer(dev_addr)) + swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); + + if (target == SYNC_FOR_DEVICE) +- xen_dma_sync_single_for_cpu(hwdev, paddr, size, dir); ++ xen_dma_sync_single_for_cpu(hwdev, dev_addr, size, dir); + + if (dir != DMA_FROM_DEVICE) + return; diff --git a/queue-3.14/swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch b/queue-3.14/swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch new file mode 100644 index 00000000000..222b01b5bdb --- /dev/null +++ b/queue-3.14/swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch @@ -0,0 +1,37 @@ +From c884227eaae9936f8ecbde6e1387bccdab5f4e90 Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Fri, 21 Nov 2014 11:10:39 +0000 +Subject: swiotlb-xen: remove BUG_ON in xen_bus_to_phys + +From: Stefano Stabellini + +commit c884227eaae9936f8ecbde6e1387bccdab5f4e90 upstream. + +On x86 truncation cannot occur because config XEN depends on X86_64 || +(X86_32 && X86_PAE). + +On ARM truncation can occur without CONFIG_ARM_LPAE, when the dma +operation involves foreign grants. However in that case the physical +address returned by xen_bus_to_phys is actually invalid (there is no mfn +to pfn tracking for foreign grants on ARM) and it is not used. + +Signed-off-by: Stefano Stabellini +Reviewed-by: Catalin Marinas +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/swiotlb-xen.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -96,8 +96,6 @@ static inline phys_addr_t xen_bus_to_phy + dma_addr_t dma = (dma_addr_t)pfn << PAGE_SHIFT; + phys_addr_t paddr = dma; + +- BUG_ON(paddr != dma); /* truncation has occurred, should never happen */ +- + paddr |= baddr & ~PAGE_MASK; + + return paddr;