get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/476451/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 476451,
    "url": "http://patchwork.ozlabs.org/api/patches/476451/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/1432644564-24746-9-git-send-email-hanjun.guo@linaro.org/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api",
        "name": "Linux PCI development",
        "link_name": "linux-pci",
        "list_id": "linux-pci.vger.kernel.org",
        "list_email": "linux-pci@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1432644564-24746-9-git-send-email-hanjun.guo@linaro.org>",
    "list_archive_url": null,
    "date": "2015-05-26T12:49:21",
    "name": "[08/11] x86, pci, ecam: mmconfig_64.c becomes default implementation for ECAM driver.",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "3bd08f2339a4f453014a0702a1a40263c960a9a2",
    "submitter": {
        "id": 47236,
        "url": "http://patchwork.ozlabs.org/api/people/47236/?format=api",
        "name": "Hanjun Guo",
        "email": "hanjun.guo@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/1432644564-24746-9-git-send-email-hanjun.guo@linaro.org/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/476451/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/476451/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-pci-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id EBD88140E0F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 May 2015 23:19:35 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752914AbbEZMww (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tTue, 26 May 2015 08:52:52 -0400",
            "from mail-pa0-f46.google.com ([209.85.220.46]:32802 \"EHLO\n\tmail-pa0-f46.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752886AbbEZMwr (ORCPT\n\t<rfc822; linux-pci@vger.kernel.org>); Tue, 26 May 2015 08:52:47 -0400",
            "by padbw4 with SMTP id bw4so92201400pad.0\n\tfor <linux-pci@vger.kernel.org>; Tue, 26 May 2015 05:50:44 -0700 (PDT)",
            "from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id\n\te12sm13128278pap.40.2015.05.26.05.50.42\n\t(version=TLSv1.2 cipher=RC4-SHA bits=128/128);\n\tTue, 26 May 2015 05:50:43 -0700 (PDT)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=DQuKt0OMH/ky39OQ32AFEkwJAKwQku0Gl82mzeJiMyM=;\n\tb=kDXNlOqtauLq/Uq+cR4//FEIy5HGXHxAbQUIaKP6Eh4J7h4QqZBnqgY/rhEI/EIOOE\n\txQ4fQxWvBJIVilZi5tROF/gqdKbmDz2vy6ok10xamHH6tw4/D/d7Yolw8S7F1D3MC55v\n\toiNVJyrpOIqRbxuYBu/Ypa1cbz8dYXBiypw/pniYDMZPiDSI3P57b1G+rk4RhnIYKP26\n\tpXoVYPLXTWIDIvJLcfYhQrkIxCTby3Cy3nEHeYCMjRD3wCBU/MPirT6eA2dTD28Bt01Y\n\tF6WC3rivlcb6ZDEp7FOWSp8o4WdGvQiBhF58IaVTNhEdq1+PpgBBvIYgXX1ACEvsxX8+\n\t41eQ==",
        "X-Gm-Message-State": "ALoCoQnm9LAMaq9A8uxuMUwydR2O436LbYZ18NYk9Jt5GLCDe177rSWK+nEosFGiwBthk+s0BTLm",
        "X-Received": "by 10.68.136.42 with SMTP id px10mr49052972pbb.19.1432644643940; \n\tTue, 26 May 2015 05:50:43 -0700 (PDT)",
        "From": "Hanjun Guo <hanjun.guo@linaro.org>",
        "To": "Bjorn Helgaas <bhelgaas@google.com>, Arnd Bergmann <arnd@arndb.de>,\n\tCatalin Marinas <catalin.marinas@arm.com>,\n\tWill Deacon <will.deacon@arm.com>,\n\t\"Rafael J. Wysocki\" <rjw@rjwysocki.net>",
        "Cc": "Jiang Liu <jiang.liu@linux.intel.com>, Liviu Dudau <Liviu.Dudau@arm.com>,\n\tThomas Gleixner <tglx@linutronix.de>,\n\tYijing Wang <wangyijing@huawei.com>,\n\tLorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,\n\tTomasz Nowicki <tomasz.nowicki@linaro.org>,\n\tSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,\n\tMark Salter <msalter@redhat.com>, linux-pci@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org,\n\tHanjun Guo <hanjun.guo@linaro.org>",
        "Subject": "[PATCH 08/11] x86, pci,\n\tecam: mmconfig_64.c becomes default implementation for ECAM driver.",
        "Date": "Tue, 26 May 2015 20:49:21 +0800",
        "Message-Id": "<1432644564-24746-9-git-send-email-hanjun.guo@linaro.org>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1432644564-24746-1-git-send-email-hanjun.guo@linaro.org>",
        "References": "<1432644564-24746-1-git-send-email-hanjun.guo@linaro.org>",
        "Sender": "linux-pci-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-pci.vger.kernel.org>",
        "X-Mailing-List": "linux-pci@vger.kernel.org"
    },
    "content": "From: Tomasz Nowicki <tomasz.nowicki@linaro.org>\n\nHost which want to take advantage of ECAM generic goodness\nshould select CONFIG_PCI_ECAM_GENERIC. Otherwise, machines like 32bits x86,\nare obligated to provide own low-level ECAM calls.\n\nSigned-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>\nSigned-off-by: Hanjun Guo <hanjun.guo@linaro.org>\nTested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>\n---\n arch/x86/Kconfig           |   1 +\n arch/x86/pci/Makefile      |   4 +-\n arch/x86/pci/mmconfig_64.c | 127 ---------------------------------------------\n drivers/pci/Kconfig        |   3 ++\n drivers/pci/ecam.c         | 113 ++++++++++++++++++++++++++++++++++++++++\n 5 files changed, 120 insertions(+), 128 deletions(-)\n delete mode 100644 arch/x86/pci/mmconfig_64.c",
    "diff": "diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig\nindex 4e3dcb3..87a6393 100644\n--- a/arch/x86/Kconfig\n+++ b/arch/x86/Kconfig\n@@ -144,6 +144,7 @@ config X86\n \tselect X86_FEATURE_NAMES if PROC_FS\n \tselect SRCU\n \tselect HAVE_PCI_ECAM\n+\tselect GENERIC_PCI_ECAM if X86_64\n \n config INSTRUCTION_DECODER\n \tdef_bool y\ndiff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile\nindex 5c6fc35..efc193d 100644\n--- a/arch/x86/pci/Makefile\n+++ b/arch/x86/pci/Makefile\n@@ -1,7 +1,9 @@\n obj-y\t\t\t\t:= i386.o init.o\n \n obj-$(CONFIG_PCI_BIOS)\t\t+= pcbios.o\n-obj-$(CONFIG_PCI_MMCONFIG)\t+= mmconfig_$(BITS).o direct.o mmconfig-shared.o\n+mmconfig-y\t\t\t:= direct.o mmconfig-shared.o\n+mmconfig-$(CONFIG_X86_32)\t+= mmconfig_32.o\n+obj-$(CONFIG_PCI_MMCONFIG)\t+= $(mmconfig-y)\n obj-$(CONFIG_PCI_DIRECT)\t+= direct.o\n obj-$(CONFIG_PCI_OLPC)\t\t+= olpc.o\n obj-$(CONFIG_PCI_XEN)\t\t+= xen.o\ndiff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c\ndeleted file mode 100644\nindex fd857ea..0000000\n--- a/arch/x86/pci/mmconfig_64.c\n+++ /dev/null\n@@ -1,127 +0,0 @@\n-/*\n- * mmconfig.c - Low-level direct PCI config space access via MMCONFIG\n- *\n- * This is an 64bit optimized version that always keeps the full mmconfig\n- * space mapped. This allows lockless config space operation.\n- */\n-\n-#include <linux/pci.h>\n-#include <linux/init.h>\n-#include <linux/acpi.h>\n-#include <linux/bitmap.h>\n-#include <linux/rcupdate.h>\n-#include <linux/ecam.h>\n-#include <asm/e820.h>\n-#include <asm/pci_x86.h>\n-\n-#define PREFIX \"PCI: \"\n-\n-static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)\n-{\n-\tstruct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus);\n-\n-\tif (cfg && cfg->virt)\n-\t\treturn cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12));\n-\treturn NULL;\n-}\n-\n-int pci_mmcfg_read(unsigned int seg, unsigned int bus,\n-\t\t\t  unsigned int devfn, int reg, int len, u32 *value)\n-{\n-\tchar __iomem *addr;\n-\n-\t/* Why do we have this when nobody checks it. How about a BUG()!? -AK */\n-\tif (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {\n-err:\t\t*value = -1;\n-\t\treturn -EINVAL;\n-\t}\n-\n-\trcu_read_lock();\n-\taddr = pci_dev_base(seg, bus, devfn);\n-\tif (!addr) {\n-\t\trcu_read_unlock();\n-\t\tgoto err;\n-\t}\n-\n-\t*value = pci_mmio_read(len, addr + reg);\n-\trcu_read_unlock();\n-\n-\treturn 0;\n-}\n-\n-int pci_mmcfg_write(unsigned int seg, unsigned int bus,\n-\t\t\t   unsigned int devfn, int reg, int len, u32 value)\n-{\n-\tchar __iomem *addr;\n-\n-\t/* Why do we have this when nobody checks it. How about a BUG()!? -AK */\n-\tif (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))\n-\t\treturn -EINVAL;\n-\n-\trcu_read_lock();\n-\taddr = pci_dev_base(seg, bus, devfn);\n-\tif (!addr) {\n-\t\trcu_read_unlock();\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tpci_mmio_write(len, addr + reg, value);\n-\trcu_read_unlock();\n-\n-\treturn 0;\n-}\n-\n-static void __iomem *mcfg_ioremap(struct pci_mmcfg_region *cfg)\n-{\n-\tvoid __iomem *addr;\n-\tu64 start, size;\n-\tint num_buses;\n-\n-\tstart = cfg->address + PCI_MMCFG_BUS_OFFSET(cfg->start_bus);\n-\tnum_buses = cfg->end_bus - cfg->start_bus + 1;\n-\tsize = PCI_MMCFG_BUS_OFFSET(num_buses);\n-\taddr = ioremap_nocache(start, size);\n-\tif (addr)\n-\t\taddr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus);\n-\treturn addr;\n-}\n-\n-int __init pci_mmcfg_arch_init(void)\n-{\n-\tstruct pci_mmcfg_region *cfg;\n-\n-\tlist_for_each_entry(cfg, &pci_mmcfg_list, list)\n-\t\tif (pci_mmcfg_arch_map(cfg)) {\n-\t\t\tpci_mmcfg_arch_free();\n-\t\t\treturn 0;\n-\t\t}\n-\n-\treturn 1;\n-}\n-\n-void __init pci_mmcfg_arch_free(void)\n-{\n-\tstruct pci_mmcfg_region *cfg;\n-\n-\tlist_for_each_entry(cfg, &pci_mmcfg_list, list)\n-\t\tpci_mmcfg_arch_unmap(cfg);\n-}\n-\n-int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)\n-{\n-\tcfg->virt = mcfg_ioremap(cfg);\n-\tif (!cfg->virt) {\n-\t\tpr_err(PREFIX \"can't map MMCONFIG at %pR\\n\", &cfg->res);\n-\t\treturn -ENOMEM;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg)\n-{\n-\tif (cfg && cfg->virt) {\n-\t\tiounmap(cfg->virt + PCI_MMCFG_BUS_OFFSET(cfg->start_bus));\n-\t\tcfg->virt = NULL;\n-\t}\n-}\ndiff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig\nindex 90a5fb9..fae4aa7 100644\n--- a/drivers/pci/Kconfig\n+++ b/drivers/pci/Kconfig\n@@ -29,6 +29,9 @@ config PCI_ECAM\n config HAVE_PCI_ECAM\n \tbool\n \n+config GENERIC_PCI_ECAM\n+\tbool\n+\n config PCI_DEBUG\n \tbool \"PCI Debugging\"\n \tdepends on PCI && DEBUG_KERNEL\ndiff --git a/drivers/pci/ecam.c b/drivers/pci/ecam.c\nindex c588234..796b6e7 100644\n--- a/drivers/pci/ecam.c\n+++ b/drivers/pci/ecam.c\n@@ -23,6 +23,119 @@ static DEFINE_MUTEX(pci_mmcfg_lock);\n \n LIST_HEAD(pci_mmcfg_list);\n \n+#ifdef CONFIG_GENERIC_PCI_ECAM\n+static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus,\n+\t\t\t\t  unsigned int devfn)\n+{\n+\tstruct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus);\n+\n+\tif (cfg && cfg->virt)\n+\t\treturn cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12));\n+\treturn NULL;\n+}\n+\n+int pci_mmcfg_read(unsigned int seg, unsigned int bus,\n+\t\t\t  unsigned int devfn, int reg, int len, u32 *value)\n+{\n+\tchar __iomem *addr;\n+\n+\t/* Why do we have this when nobody checks it. How about a BUG()!? -AK */\n+\tif (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {\n+err:\t\t*value = -1;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trcu_read_lock();\n+\taddr = pci_dev_base(seg, bus, devfn);\n+\tif (!addr) {\n+\t\trcu_read_unlock();\n+\t\tgoto err;\n+\t}\n+\n+\t*value = pci_mmio_read(len, addr + reg);\n+\trcu_read_unlock();\n+\n+\treturn 0;\n+}\n+\n+int pci_mmcfg_write(unsigned int seg, unsigned int bus,\n+\t\t\t   unsigned int devfn, int reg, int len, u32 value)\n+{\n+\tchar __iomem *addr;\n+\n+\t/* Why do we have this when nobody checks it. How about a BUG()!? -AK */\n+\tif (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))\n+\t\treturn -EINVAL;\n+\n+\trcu_read_lock();\n+\taddr = pci_dev_base(seg, bus, devfn);\n+\tif (!addr) {\n+\t\trcu_read_unlock();\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tpci_mmio_write(len, addr + reg, value);\n+\trcu_read_unlock();\n+\n+\treturn 0;\n+}\n+\n+static void __iomem *mcfg_ioremap(struct pci_mmcfg_region *cfg)\n+{\n+\tvoid __iomem *addr;\n+\tu64 start, size;\n+\tint num_buses;\n+\n+\tstart = cfg->address + PCI_MMCFG_BUS_OFFSET(cfg->start_bus);\n+\tnum_buses = cfg->end_bus - cfg->start_bus + 1;\n+\tsize = PCI_MMCFG_BUS_OFFSET(num_buses);\n+\taddr = ioremap_nocache(start, size);\n+\tif (addr)\n+\t\taddr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus);\n+\treturn addr;\n+}\n+\n+int __init pci_mmcfg_arch_init(void)\n+{\n+\tstruct pci_mmcfg_region *cfg;\n+\n+\tlist_for_each_entry(cfg, &pci_mmcfg_list, list)\n+\t\tif (pci_mmcfg_arch_map(cfg)) {\n+\t\t\tpci_mmcfg_arch_free();\n+\t\t\treturn 0;\n+\t\t}\n+\n+\treturn 1;\n+}\n+\n+void __init pci_mmcfg_arch_free(void)\n+{\n+\tstruct pci_mmcfg_region *cfg;\n+\n+\tlist_for_each_entry(cfg, &pci_mmcfg_list, list)\n+\t\tpci_mmcfg_arch_unmap(cfg);\n+}\n+\n+int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)\n+{\n+\tcfg->virt = mcfg_ioremap(cfg);\n+\tif (!cfg->virt) {\n+\t\tpr_err(PREFIX \"can't map MMCONFIG at %pR\\n\", &cfg->res);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg)\n+{\n+\tif (cfg && cfg->virt) {\n+\t\tiounmap(cfg->virt + PCI_MMCFG_BUS_OFFSET(cfg->start_bus));\n+\t\tcfg->virt = NULL;\n+\t}\n+}\n+#endif\n+\n static u32\n pci_mmconfig_generic_read(int len, void __iomem *addr)\n {\n",
    "prefixes": [
        "08/11"
    ]
}