linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	npiggin@gmail.com, hch@lst.de
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v2 02/12] powerpc/ps3: replace __ioremap() by ioremap_prot()
Date: Tue, 20 Aug 2019 14:07:10 +0000 (UTC)	[thread overview]
Message-ID: <36bff5d875ff562889c5e12dab63e5d7c5d1fbd8.1566309262.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1566309262.git.christophe.leroy@c-s.fr>

__ioremap() is similar to ioremap_prot() except that ioremap_prot()
does a few sanity changes in addition.

The flags used by PS3 are not impacted by those changes so for
PS3 both functions are equivalent.

At the same time, drop parts of the comment that have been invalid
since commit e58e87adc8bf ("powerpc/mm: Update _PAGE_KERNEL_RO")

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/platforms/ps3/spu.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index bdaeaecdc06b..1193c294b8d0 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -184,10 +184,7 @@ static void spu_unmap(struct spu *spu)
  * setup_areas - Map the spu regions into the address space.
  *
  * The current HV requires the spu shadow regs to be mapped with the
- * PTE page protection bits set as read-only (PP=3).  This implementation
- * uses the low level __ioremap() to bypass the page protection settings
- * inforced by ioremap_prot() to get the needed PTE bits set for the
- * shadow regs.
+ * PTE page protection bits set as read-only.
  */
 
 static int __init setup_areas(struct spu *spu)
@@ -195,9 +192,8 @@ static int __init setup_areas(struct spu *spu)
 	struct table {char* name; unsigned long addr; unsigned long size;};
 	unsigned long shadow_flags = pgprot_val(pgprot_noncached_wc(PAGE_KERNEL_RO));
 
-	spu_pdata(spu)->shadow = __ioremap(spu_pdata(spu)->shadow_addr,
-					   sizeof(struct spe_shadow),
-					   shadow_flags);
+	spu_pdata(spu)->shadow = ioremap_prot(spu_pdata(spu)->shadow_addr,
+					      sizeof(struct spe_shadow), shadow_flags);
 	if (!spu_pdata(spu)->shadow) {
 		pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__);
 		goto fail_ioremap;
-- 
2.13.3


  parent reply	other threads:[~2019-08-20 14:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 14:07 [PATCH v2 00/12] powerpc/mm: cleanup and refactoring in ioremap Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 01/12] powerpc: remove the ppc44x ocm.c file Christophe Leroy
2019-08-28  4:24   ` Michael Ellerman
2019-08-20 14:07 ` Christophe Leroy [this message]
2019-08-20 22:24   ` [PATCH v2 02/12] powerpc/ps3: replace __ioremap() by ioremap_prot() Christoph Hellwig
2019-08-20 14:07 ` [PATCH v2 03/12] powerpc/mm: drop ppc_md.iounmap() and __iounmap() Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 04/12] powerpc/mm: drop function __ioremap() Christophe Leroy
2019-08-20 22:24   ` Christoph Hellwig
2019-08-20 14:07 ` [PATCH v2 05/12] powerpc/mm: rework io-workaround invocation Christophe Leroy
2019-08-20 22:28   ` Christoph Hellwig
2019-08-21  0:42     ` Benjamin Herrenschmidt
2019-08-20 14:07 ` [PATCH v2 06/12] powerpc/mm: move common 32/64 bits ioremap functions into ioremap.c Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 07/12] powerpc/mm: move ioremap_prot() " Christophe Leroy
2019-08-20 22:28   ` Christoph Hellwig
2019-08-20 14:07 ` [PATCH v2 08/12] powerpc/mm: make ioremap_bot common to all Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 09/12] powerpc/mm: Move ioremap functions out of pgtable_32/64.c Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 10/12] powerpc/mm: refactor ioremap_range() and use ioremap_page_range() Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 11/12] powerpc/mm: refactor ioremap vm area setup Christophe Leroy
2019-08-20 14:07 ` [PATCH v2 12/12] powerpc/mm: split out early ioremap path Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36bff5d875ff562889c5e12dab63e5d7c5d1fbd8.1566309262.git.christophe.leroy@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=benh@kernel.crashing.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).