]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up a pci patch for 4.14 and 4.9
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 07:05:45 +0000 (09:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 07:05:45 +0000 (09:05 +0200)
queue-4.14/pci-of-fix-i-o-space-page-leak.patch
queue-4.9/pci-of-fix-i-o-space-page-leak.patch

index 2132eb98f1bda44ae1758c18bf15440138ead37d..cbb577faca0dd2f1997d9646879778e641ebc9cf 100644 (file)
@@ -73,9 +73,10 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 ---
  drivers/pci/host/pci-host-common.c |    2 -
+ drivers/pci/host/pcie-rcar.c       |    2 -
  drivers/pci/pci.c                  |   38 +++++++++++++++++++++++++++++++++++++
  include/linux/pci.h                |    2 +
3 files changed, 41 insertions(+), 1 deletion(-)
4 files changed, 42 insertions(+), 2 deletions(-)
 
 --- a/drivers/pci/host/pci-host-common.c
 +++ b/drivers/pci/host/pci-host-common.c
@@ -84,6 +85,17 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
                switch (resource_type(res)) {
                case IORESOURCE_IO:
 -                      err = pci_remap_iospace(res, iobase);
++                      err = devm_pci_remap_iospace(dev, res, iobase);
+                       if (err) {
+                               dev_warn(dev, "error %d: failed to map resource %pR\n",
+                                        err, res);
+--- a/drivers/pci/host/pcie-rcar.c
++++ b/drivers/pci/host/pcie-rcar.c
+@@ -1105,7 +1105,7 @@ static int rcar_pcie_parse_request_of_pc
+               struct resource *res = win->res;
+               if (resource_type(res) == IORESOURCE_IO) {
+-                      err = pci_remap_iospace(res, iobase);
 +                      err = devm_pci_remap_iospace(dev, res, iobase);
                        if (err) {
                                dev_warn(dev, "error %d: failed to map resource %pR\n",
index 66deae4aff3f974679a16d297cb92829f7c4cf71..03d2823f1de84fb08d7bd7e1d35779e7e0c2977d 100644 (file)
@@ -73,9 +73,10 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 ---
  drivers/pci/host/pci-host-common.c |    2 -
+ drivers/pci/host/pcie-rcar.c       |    2 -
  drivers/pci/pci.c                  |   38 +++++++++++++++++++++++++++++++++++++
  include/linux/pci.h                |    2 +
3 files changed, 41 insertions(+), 1 deletion(-)
4 files changed, 42 insertions(+), 2 deletions(-)
 
 --- a/drivers/pci/host/pci-host-common.c
 +++ b/drivers/pci/host/pci-host-common.c
@@ -84,15 +85,26 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
                switch (resource_type(res)) {
                case IORESOURCE_IO:
 -                      err = pci_remap_iospace(res, iobase);
++                      err = devm_pci_remap_iospace(dev, res, iobase);
+                       if (err) {
+                               dev_warn(dev, "error %d: failed to map resource %pR\n",
+                                        err, res);
+--- a/drivers/pci/host/pcie-rcar.c
++++ b/drivers/pci/host/pcie-rcar.c
+@@ -1102,7 +1102,7 @@ static int rcar_pcie_parse_request_of_pc
+               struct resource *res = win->res;
+               if (resource_type(res) == IORESOURCE_IO) {
+-                      err = pci_remap_iospace(res, iobase);
 +                      err = devm_pci_remap_iospace(dev, res, iobase);
                        if (err) {
                                dev_warn(dev, "error %d: failed to map resource %pR\n",
                                         err, res);
 --- a/drivers/pci/pci.c
 +++ b/drivers/pci/pci.c
-@@ -3575,6 +3575,44 @@ int pci_try_set_mwi(struct pci_dev *dev)
+@@ -3407,6 +3407,44 @@ void pci_unmap_iospace(struct resource *
+ #endif
  }
- EXPORT_SYMBOL(pci_try_set_mwi);
  
 +static void devm_pci_unmap_iospace(struct device *dev, void *ptr)
 +{
@@ -132,9 +144,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +}
 +EXPORT_SYMBOL(devm_pci_remap_iospace);
 +
- /**
-  * pci_clear_mwi - disables Memory-Write-Invalidate for device dev
-  * @dev: the PCI device to disable
+ static void __pci_set_master(struct pci_dev *dev, bool enable)
+ {
+       u16 old_cmd, cmd;
 --- a/include/linux/pci.h
 +++ b/include/linux/pci.h
 @@ -1190,6 +1190,8 @@ int pci_register_io_range(phys_addr_t ad