]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2012 17:28:31 +0000 (10:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2012 17:28:31 +0000 (10:28 -0700)
added patches:
xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch

queue-3.4/revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch
queue-3.4/series
queue-3.4/xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch [new file with mode: 0644]

index ba0de9a48f3e300eb5270f79dd87a4d93f051d07..c5f9e144239670af46bf61929babcee6ecf2d2f8 100644 (file)
@@ -15,26 +15,26 @@ Cc: Sascha Hauer <s.hauer@pengutronix.de>
 Cc: Vinod Koul <vinod.koul@linux.intel.com>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
---- b/drivers/dma/imx-dma.c
-+++ a/drivers/dma/imx-dma.c
-@@ -172,8 +172,7 @@
+---
+ drivers/dma/imx-dma.c |   36 +++++++++++-------------------------
+ 1 file changed, 11 insertions(+), 25 deletions(-)
+
+--- a/drivers/dma/imx-dma.c
++++ b/drivers/dma/imx-dma.c
+@@ -172,8 +172,7 @@ struct imxdma_engine {
        struct device_dma_parameters    dma_parms;
        struct dma_device               dma_device;
        void __iomem                    *base;
-+      struct clk                      *dma_clk;
 -      struct clk                      *dma_ahb;
 -      struct clk                      *dma_ipg;
++      struct clk                      *dma_clk;
        spinlock_t                      lock;
        struct imx_dma_2d_config        slots_2d[IMX_DMA_2D_SLOTS];
        struct imxdma_channel           channel[IMX_DMA_CHANNELS];
-@@ -977,20 +976,10 @@
+@@ -977,20 +976,10 @@ static int __init imxdma_probe(struct pl
                return 0;
        }
  
-+      imxdma->dma_clk = clk_get(NULL, "dma");
-+      if (IS_ERR(imxdma->dma_clk))
-+              return PTR_ERR(imxdma->dma_clk);
-+      clk_enable(imxdma->dma_clk);
 -      imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg");
 -      if (IS_ERR(imxdma->dma_ipg)) {
 -              ret = PTR_ERR(imxdma->dma_ipg);
@@ -49,48 +49,52 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -
 -      clk_prepare_enable(imxdma->dma_ipg);
 -      clk_prepare_enable(imxdma->dma_ahb);
++      imxdma->dma_clk = clk_get(NULL, "dma");
++      if (IS_ERR(imxdma->dma_clk))
++              return PTR_ERR(imxdma->dma_clk);
++      clk_enable(imxdma->dma_clk);
  
        /* reset DMA module */
        imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
-@@ -999,14 +988,16 @@
+@@ -999,14 +988,16 @@ static int __init imxdma_probe(struct pl
                ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", imxdma);
                if (ret) {
                        dev_warn(imxdma->dev, "Can't register IRQ for DMA\n");
+-                      goto err_enable;
 +                      kfree(imxdma);
 +                      return ret;
--                      goto err_enable;
                }
  
                ret = request_irq(MX1_DMA_ERR, imxdma_err_handler, 0, "DMA", imxdma);
                if (ret) {
                        dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n");
                        free_irq(MX1_DMA_INT, NULL);
+-                      goto err_enable;
 +                      kfree(imxdma);
 +                      return ret;
--                      goto err_enable;
                }
        }
  
-@@ -1103,10 +1094,7 @@
+@@ -1103,10 +1094,7 @@ err_init:
                free_irq(MX1_DMA_INT, NULL);
                free_irq(MX1_DMA_ERR, NULL);
        }
-+
 -err_enable:
 -      clk_disable_unprepare(imxdma->dma_ipg);
 -      clk_disable_unprepare(imxdma->dma_ahb);
 -err_clk:
++
        kfree(imxdma);
        return ret;
  }
-@@ -1126,9 +1114,7 @@
+@@ -1126,9 +1114,7 @@ static int __exit imxdma_remove(struct p
                free_irq(MX1_DMA_ERR, NULL);
        }
  
-+        kfree(imxdma);
 -      clk_disable_unprepare(imxdma->dma_ipg);
 -      clk_disable_unprepare(imxdma->dma_ahb);
 -      kfree(imxdma);
++        kfree(imxdma);
  
          return 0;
  }
index bdabbbf20ce748b6935b6bafcd962d84c3597046..000d1c7c7d0b718376d5d26fd44f45a665effb88 100644 (file)
@@ -9,3 +9,4 @@ arm-omap2-fix-dmtimer-set-source-clock-failure.patch
 arm-s3c24xx-add-missing-dmach_dt_prop.patch
 arm-s3c24xx-fix-s3c2410_dma_enqueue-parameters.patch
 revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch
+xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch
diff --git a/queue-3.4/xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch b/queue-3.4/xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch
new file mode 100644 (file)
index 0000000..dd5c5f0
--- /dev/null
@@ -0,0 +1,59 @@
+From c96aae1f7f393387d160211f60398d58463a7e65 Mon Sep 17 00:00:00 2001
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Fri, 17 Aug 2012 16:43:28 -0400
+Subject: xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M.
+
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+
+commit c96aae1f7f393387d160211f60398d58463a7e65 upstream.
+
+When we are finished with return PFNs to the hypervisor, then
+populate it back, and also mark the E820 MMIO and E820 gaps
+as IDENTITY_FRAMEs, we then call P2M to set areas that can
+be used for ballooning. We were off by one, and ended up
+over-writting a P2M entry that most likely was an IDENTITY_FRAME.
+For example:
+
+1-1 mapping on 40000->40200
+1-1 mapping on bc558->bc5ac
+1-1 mapping on bc5b4->bc8c5
+1-1 mapping on bc8c6->bcb7c
+1-1 mapping on bcd00->100000
+Released 614 pages of unused memory
+Set 277889 page(s) to 1-1 mapping
+Populating 40200-40466 pfn range: 614 pages added
+
+=> here we set from 40466 up to bc559 P2M tree to be
+INVALID_P2M_ENTRY. We should have done it up to bc558.
+
+The end result is that if anybody is trying to construct
+a PTE for PFN bc558 they end up with ~PAGE_PRESENT.
+
+Reported-by-and-Tested-by: Andre Przywara <andre.przywara@amd.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/xen/setup.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/xen/setup.c
++++ b/arch/x86/xen/setup.c
+@@ -79,9 +79,16 @@ static void __init xen_add_extra_mem(u64
+       memblock_reserve(start, size);
+       xen_max_p2m_pfn = PFN_DOWN(start + size);
++      for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) {
++              unsigned long mfn = pfn_to_mfn(pfn);
++
++              if (WARN(mfn == pfn, "Trying to over-write 1-1 mapping (pfn: %lx)\n", pfn))
++                      continue;
++              WARN(mfn != INVALID_P2M_ENTRY, "Trying to remove %lx which has %lx mfn!\n",
++                      pfn, mfn);
+-      for (pfn = PFN_DOWN(start); pfn <= xen_max_p2m_pfn; pfn++)
+               __set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
++      }
+ }
+ static unsigned long __init xen_release_chunk(unsigned long start,