Skip to contentSkip to conversation

fsl: add register read-back to set_law()

PATCH New Timur Tabi 2 participants 4 messages Sep 4, 2009 – Sep 5, 2009 Char and misc drivers

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 2/2 fsl: add register read-back to set_law()

After programming a new LAW, we should read-back the LAWAR register so that we sync the writes. Otherwise, code that attempts to use the new LAW-mapped memory might fail.

---
 drivers/misc/fsl_law.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/misc/fsl_law.c +2 -1
index 147fe0a..7bdd355 100644
@@ -58,7 +58,8 @@ void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 	out_be32(lawbar, addr >> 12);
 	out_be32(lawar, LAWAR_EN | ((u32)id << 20) | (u32)sz);
 
-	return ;
+	/* Read back so that we sync the writes */
+	in_be32(lawar);
 }
 
 int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
Signature · 1 line
1.6.0.6
author
#1 lore raw

PATCH 2/2 fsl: add register read-back to set_law()

Quoted 5 lines · Timur Tabi

After programming a new LAW, we should read-back the LAWAR register so that we sync the writes. ?Otherwise, code that attempts to use the new LAW-mapped memory might fail.

Just FYI, there is no [PATCH 1/2].

Kumar, this changed appears to fix a real problem on the P4080.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#2 lore raw

PATCH 2/2 fsl: add register read-back to set_law()

In reply to Timur Tabi
Quoted 3 lines · Timur Tabi

After programming a new LAW, we should read-back the LAWAR register so that we sync the writes. ?Otherwise, code that attempts to use the new LAW-mapped memory might fail.

This should say, "code that attempts to use the new LAW-mapped memory right away might fail."

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
Applied
#3 lore raw

PATCH 2/2 fsl: add register read-back to set_law()

In reply to Timur Tabi
Quoted 10 lines · Timur Tabi

After programming a new LAW, we should read-back the LAWAR register so that
we sync the writes. Otherwise, code that attempts to use the new LAW-mapped
memory might fail.

---
drivers/misc/fsl_law.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)

Fixed commit wording.

applied to 85xx

- k