Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/491172/?format=api
{ "id": 491172, "url": "http://patchwork.ozlabs.org/api/patches/491172/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20150703181709.GD7021@wotan.suse.de/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20150703181709.GD7021@wotan.suse.de>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20150703181709.GD7021@wotan.suse.de/", "date": "2015-07-03T18:17:09", "name": "RFC: default ioremap_*() variant defintions", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "4d9624420ecdd2e34a89e702c346172da447f3e6", "submitter": { "id": 61160, "url": "http://patchwork.ozlabs.org/api/people/61160/?format=api", "name": "Luis R. Rodriguez", "email": "mcgrof@suse.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20150703181709.GD7021@wotan.suse.de/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/491172/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/491172/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id C3FB51402AA\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 4 Jul 2015 11:00:06 +1000 (AEST)", "from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id AA0861A115C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 4 Jul 2015 11:00:06 +1000 (AEST)", "from mx2.suse.de (cantor2.suse.de [195.135.220.15])\n\t(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 377751A0037\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat, 4 Jul 2015 04:17:20 +1000 (AEST)", "from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx2.suse.de (Postfix) with ESMTP id 3B821ADB7;\n\tFri, 3 Jul 2015 18:17:13 +0000 (UTC)" ], "X-Virus-Scanned": "by amavisd-new at test-mx.suse.de", "Date": "Fri, 3 Jul 2015 20:17:09 +0200", "From": "\"Luis R. Rodriguez\" <mcgrof@suse.com>", "To": "linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinuxppc-dev@lists.ozlabs.org, x86@kernel.org", "Subject": "RFC: default ioremap_*() variant defintions", "Message-ID": "<20150703181709.GD7021@wotan.suse.de>", "MIME-Version": "1.0", "Content-Disposition": "inline", "User-Agent": "Mutt/1.5.21 (2010-09-15)", "X-Mailman-Approved-At": "Sat, 04 Jul 2015 10:59:12 +1000", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.20", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Toshi Kani <toshi.kani@hp.com>, Arnd Bergmann <arnd@arndb.de>,\n\t\"Luis R. Rodriguez\" <mcgrof@do-not-panic.com>,\n\tVille =?iso-8859-1?Q?Syrj=E4l=E4?= <syrjala@sci.fi>,\n\tBorislav Petkov <bp@suse.de>, Ingo Molnar <mingo@kernel.org>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "The 0-day build bot detected a build issue on a patch not upstream yet that\nmakes a driver use iorempa_uc(), this call is now upstream but we have no\ndrivers yet using it, the patch in question makes the atyfb framebuffer driver\nuse it. The build issue was the lack of the ioremap_uc() call being implemented\non some non-x86 architectures. I *thought* I had added boiler plate code to map\nthe ioremap_uc() call to ioremap_nocache() for archs that do not already define\ntheir own iorempa_uc() call, but upon further investigation it seems that was\nnot the case but found that this may be a bit different issue altogether.\n\nThe way include/asm-generic/io.h works for ioremap() calls and its variants is:\n\n#ifndef CONFIG_MMU \n#ifndef ioremap \n#define ioremap ioremap \nstatic inline void __iomem *ioremap(phys_addr_t offset, size_t size) \n{ \n return (void __iomem *)(unsigned long)offset; \n} \n#endif \n...\n#define iounmap iounmap \n \nstatic inline void iounmap(void __iomem *addr) \n{ \n} \n#endif \n#endif /* CONFIG_MMU */ \n\nThat's the gist of it, but the catch here is the ioremap_*() variants and where\nthey are defined. The first variant is ioremap_nocache() and then all other\nvariants by default map to this one. We've been stuffing the variant definitions\nwithin the #ifndef CONFIG_MMU and I don't think we should be as otherwise each\nand everyone's archs will have to add their own variant default map to the\ndefault ioremap_nocache() or whatever. That's exaclty what we have to day, and\nfrom what I gather the purpose of the variant boiler plate is lost. I think\nwe should keep the ioremap() and ioreunmap() tucked under the CONFIG_MMU\nbut not the variants. For instance to address the build issue for ioremap_uc()\nwe either define ioremap_uc() for all archs or do something like this:\n\n\nThis builds on x86 and other archs now and I can verify that the default\nboilerplate code is not used on x86. One small caveat:\n\nI have no idea why its not picking up asm-generic ioremap_uc() for x86,\nalthough this is the right thing to do the guard should not work as we never\ndefine ioremap_uc() as a macro but we do as an exported symbol. The way\narchs do their ioremap calls is they define externs and then they include\nasm-generic to pick up the things they don't define. In the extern calls\nfor ioremap_uc() we never add a define there. Adding a simple one line\n#define right after the extern declaration to itself should suffice to\nfix paranoia but curious why this does work as-is right now.\n\nI'd like review and consensus from other architecture folks if this is\nthe Right Thing To Do (TM) and if it is decide how we want to fix this.\nFor instance my preference would be to just add this fix as-is after\nwe've figured out the guard thing above, and then define these variants\nin the documentation on the asm-generic file as safe to not have, and\nsafe to map to the default ioremap call. If you don't have a safe call\nlike this we should set out different expectations, for instance having\nit depend on Kconfig symbol and then drivers depend on it, archs then\nimplement the symbols and can HAVE_ARCH_FOO. If everyone agrees with\nthis then there is quite a bit of cleanup possible as tons of archs do\ntons of their own variant mapping definitions.\n\n Luis", "diff": "diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h\nindex f56094cfdeff..6e5e80d5dd0c 100644\n--- a/include/asm-generic/io.h\n+++ b/include/asm-generic/io.h\n@@ -769,14 +769,6 @@ static inline void __iomem *ioremap_nocache(phys_addr_t offset, size_t size)\n }\n #endif\n \n-#ifndef ioremap_uc\n-#define ioremap_uc ioremap_uc\n-static inline void __iomem *ioremap_uc(phys_addr_t offset, size_t size)\n-{\n-\treturn ioremap_nocache(offset, size);\n-}\n-#endif\n-\n #ifndef ioremap_wc\n #define ioremap_wc ioremap_wc\n static inline void __iomem *ioremap_wc(phys_addr_t offset, size_t size)\n@@ -802,6 +794,14 @@ static inline void iounmap(void __iomem *addr)\n #endif\n #endif /* CONFIG_MMU */\n \n+#ifndef ioremap_uc\n+#define ioremap_uc ioremap_uc\n+static inline void __iomem *ioremap_uc(phys_addr_t offset, size_t size)\n+{\n+\treturn ioremap_nocache(offset, size);\n+}\n+#endif\n+\n #ifdef CONFIG_HAS_IOPORT_MAP\n #ifndef CONFIG_GENERIC_IOMAP\n #ifndef ioport_map\n", "prefixes": [] }