MIPS: Fix errata for some 1074K cores.
PATCH 1/1 MIPS: Fix errata for some 1074K cores.
From: Leonid Yegoshin <[email protected]>
Fixes errata E16 for some problems on 1074K cores.
--- arch/mips/mm/c-r4k.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/mips/mm/c-r4k.c +6 -6
@@ -786,12 +786,12 @@ static inline void alias_74k_erratum(struct cpuinfo_mips *c)* aliases. In this case it is better to treat the cache as always * having aliases. */ -if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (2 ,4 ,0 )) - c->dcache.flags |=MIPS_CACHE_VTAG ; -if ((c->processor_id &0xff ) ==PRID_REV_ENCODE_332 (2 ,4 ,0 )) -write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); -if (((c->processor_id &0xff00 ) ==PRID_IMP_1074K ) && - ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (1 ,1 ,0 ))) { +if ((c->processor_id &0xff00 ) !=PRID_IMP_1074K ) { +if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (2 ,4 ,0 )) + c->dcache.flags |=MIPS_CACHE_VTAG ; +if ((c->processor_id &0xff ) ==PRID_REV_ENCODE_332 (2 ,4 ,0 )) +write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); + }else if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (1 ,1 ,0 )) { c->dcache.flags |=MIPS_CACHE_VTAG ;write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); }
Signature · 1 line
1.7.9.5
Could you expand on that please? What is errata E16, what are "some problems" and how does this fix those problems? The commit message is somewhat lacking...
Paul
Quoted 33 lines · Steven J. Hill
From: Leonid Yegoshin <[email protected]>
Fixes errata E16 for some problems on 1074K cores.
Signed-off-by Leonid Yegoshin <[email protected]>Signed-off-by Steven J. Hill <[email protected]>--- arch/mips/mm/c-r4k.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)arch/mips/mm/c-r4k.c +6
-6@@ -786,12 +786,12 @@ static inline void alias_74k_erratum(struct cpuinfo_mips *c)* aliases. In this case it is better to treat the cache as always * having aliases. */ -if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (2 ,4 ,0 )) - c->dcache.flags |=MIPS_CACHE_VTAG ; -if ((c->processor_id &0xff ) ==PRID_REV_ENCODE_332 (2 ,4 ,0 )) -write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); -if (((c->processor_id &0xff00 ) ==PRID_IMP_1074K ) && - ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (1 ,1 ,0 ))) { +if ((c->processor_id &0xff00 ) !=PRID_IMP_1074K ) { +if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (2 ,4 ,0 )) + c->dcache.flags |=MIPS_CACHE_VTAG ; +if ((c->processor_id &0xff ) ==PRID_REV_ENCODE_332 (2 ,4 ,0 )) +write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); + }else if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (1 ,1 ,0 )) { c->dcache.flags |=MIPS_CACHE_VTAG ;write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); }
Treat it as is.
It is a dirty laundry of HW engineers and you may need to communicate with them or read Errata docs on CPU.
If it is about a way how it is written - ask Steven, initially it was in mainland probe code but he think it should be a separate function. I just corrected him, pointing that erratas on 74K and 1074K are different. But because he insist on having the same CPU_74K for both, so...
- Leonid.
PS. If you think the code is bad, please be specific beyond broad blame.
Paul Burton <[email protected]> wrote:
Could you expand on that please? What is errata E16, what are "some problems" and how does this fix those problems? The commit message is somewhat lacking...
Paul
Quoted 33 lines · Steven J. Hill
From: Leonid Yegoshin <[email protected]>
Fixes errata E16 for some problems on 1074K cores.
Signed-off-by Leonid Yegoshin <[email protected]>Signed-off-by Steven J. Hill <[email protected]>--- arch/mips/mm/c-r4k.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)arch/mips/mm/c-r4k.c +6
-6@@ -786,12 +786,12 @@ static inline void alias_74k_erratum(struct cpuinfo_mips *c)* aliases. In this case it is better to treat the cache as always * having aliases. */ -if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (2 ,4 ,0 )) - c->dcache.flags |=MIPS_CACHE_VTAG ; -if ((c->processor_id &0xff ) ==PRID_REV_ENCODE_332 (2 ,4 ,0 )) -write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); -if (((c->processor_id &0xff00 ) ==PRID_IMP_1074K ) && - ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (1 ,1 ,0 ))) { +if ((c->processor_id &0xff00 ) !=PRID_IMP_1074K ) { +if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (2 ,4 ,0 )) + c->dcache.flags |=MIPS_CACHE_VTAG ; +if ((c->processor_id &0xff ) ==PRID_REV_ENCODE_332 (2 ,4 ,0 )) +write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); + }else if ((c->processor_id &0xff ) <=PRID_REV_ENCODE_332 (1 ,1 ,0 )) { c->dcache.flags |=MIPS_CACHE_VTAG ;write_c0_config6 (read_c0_config6 () |MIPS_CONF6_SYND ); }
2013/9/12 Leonid Yegoshin <[email protected]>:
Quoted 5 lines
Treat it as is.
It is a dirty laundry of HW engineers and you may need to communicate with them or read Errata docs on CPU.
If it is about a way how it is written - ask Steven, initially it was in mainland probe code but he think it should be a separate function. I just corrected him, pointing that erratas on 74K and 1074K are different. But because he insist on having the same
CPU_74Kfor both, so...
If you take a look at another CPU company such as ARM, they provide lengthy explanations for their various Erratas:
config PJ4B_ERRATA_4742
bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the
CPU Core to Cease Operation"
depends on CPU_PJ4B && MACH_ARMADA_370
default y
help
When coming out of either a Wait for Interrupt (WFI) or a Wait for Event (WFE) IDLE states, a specific timing sensitivity exists between the retiring WFI/WFE instructions and the newly issued subsequent instructions. This sensitivity can result in a CPU hang scenario. Workaround:
The software must insert either a Data Synchronization Barrier (DSB) or Data Memory Barrier (DMB) command immediately after the WFI/WFE instruction
I really think that you should aim for the same level of information so that people know whether this is relevant for their platform, whether they have the ECO applied etc...
Signature · 1 line
Florian
Well, if you read an errata text, you probably have a big chance to stare at it trying to understand it. At least I don't and I just put that was said to me by HW team. There is no sense in discussion here because it is a part of specific core tuneup.
Florian Fainelli <[email protected]> wrote:
2013/9/12 Leonid Yegoshin <[email protected]>:
Quoted 5 lines
Treat it as is.
It is a dirty laundry of HW engineers and you may need to communicate with them or read Errata docs on CPU.
If it is about a way how it is written - ask Steven, initially it was in mainland probe code but he think it should be a separate function. I just corrected him, pointing that erratas on 74K and 1074K are different. But because he insist on having the same
CPU_74Kfor both, so...
If you take a look at another CPU company such as ARM, they provide lengthy explanations for their various Erratas:
config PJ4B_ERRATA_4742
bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the
CPU Core to Cease Operation"
depends on CPU_PJ4B && MACH_ARMADA_370
default y
help
When coming out of either a Wait for Interrupt (WFI) or a Wait for Event (WFE) IDLE states, a specific timing sensitivity exists between the retiring WFI/WFE instructions and the newly issued subsequent instructions. This sensitivity can result in a CPU hang scenario. Workaround:
The software must insert either a Data Synchronization Barrier (DSB) or Data Memory Barrier (DMB) command immediately after the WFI/WFE instruction
I really think that you should aim for the same level of information so that people know whether this is relevant for their platform, whether they have the ECO applied etc...
--
Florian
Agreed, my point is not about your code but your commit message. If I'm reading a commit which works around CPU errata I should not have to go and ask the hardware engineers or even read an errata document in order to know what you're doing. Your commit message should explain the errata, its effects and how your patch works around the problem.
Paul
Quoted 27 lines · Florian Fainelli
2013/9/12 Leonid Yegoshin <[email protected]>:
Quoted 5 lines
Treat it as is.
It is a dirty laundry of HW engineers and you may need to communicate with them or read Errata docs on CPU.
If it is about a way how it is written - ask Steven, initially it was in mainland probe code but he think it should be a separate function. I just corrected him, pointing that erratas on 74K and 1074K are different. But because he insist on having the same
CPU_74Kfor both, so...If you take a look at another CPU company such as ARM, they provide lengthy explanations for their various Erratas:
config
PJ4B_ERRATA_4742
bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the
CPU Core to Cease Operation"
depends onCPU_PJ4B&&MACH_ARMADA_370
default y
help
When coming out of either a Wait for Interrupt (WFI) or a Wait for Event (WFE) IDLE states, a specific timing sensitivity exists between the retiring WFI/WFE instructions and the newly issued subsequent instructions. This sensitivity can result in a CPU hang scenario. Workaround:
The software must insert either a Data Synchronization Barrier (DSB) or Data Memory Barrier (DMB) command immediately after the WFI/WFE instructionI really think that you should aim for the same level of information so that people know whether this is relevant for their platform, whether they have the ECO applied etc...
It is not mine, I just fixed an existent code which applies a wrong errata to 1074K. Errata fix did exist before me.
- Leonid.
Quoted 39 lines · Paul Burton
Agreed, my point is not about your code but your commit message. If I'm reading a commit which works around CPU errata I should not have to go and ask the hardware engineers or even read an errata document in order to know what you're doing. Your commit message should explain the errata, its effects and how your patch works around the problem.
Paul
Quoted 33 lines · Florian Fainelli
2013/9/12 Leonid Yegoshin <[email protected]>:
Quoted 5 lines
Treat it as is.
It is a dirty laundry of HW engineers and you may need to communicate with them or read Errata docs on CPU.
If it is about a way how it is written - ask Steven, initially it was in mainland probe code but he think it should be a separate function. I just corrected him, pointing that erratas on 74K and 1074K are different. But because he insist on having the same
CPU_74Kfor both, so...If you take a look at another CPU company such as ARM, they provide lengthy explanations for their various Erratas:
config
PJ4B_ERRATA_4742
bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the
CPU Core to Cease Operation"
depends onCPU_PJ4B&&MACH_ARMADA_370
default y
help
When coming out of either a Wait for Interrupt (WFI) or a
Wait for
Event (WFE) IDLE states, a specific timing sensitivity
exists between
the retiring WFI/WFE instructions and the newly issued
subsequent
instructions. This sensitivity can result in a CPU hang
scenario.
Workaround:
The software must insert either a Data Synchronization
Barrier (DSB)
or Data Memory Barrier (DMB) command immediately after the
WFI/WFE
instructionI really think that you should aim for the same level of information so that people know whether this is relevant for their platform, whether they have the ECO applied etc...
Hello,
2013/9/12 Leonid Yegoshin <[email protected]>:
Quoted 3 lines
It is not mine, I just fixed an existent code which applies a wrong errata to 1074K.
Errata fix did exist before me.
Are there any reasons why you cannot quote an internal note about this errata which would give a better idea of what this code is about? Sorry but the diff really does not help understand what is happening without a proper explanation of why this is required. At first glance it would like some revisions of the CPU are affected by some D$ bug?
Quoted 60 lines
- Leonid.
Quoted 52 lines · Paul Burton
Agreed, my point is not about your code but your commit message. If I'm reading a commit which works around CPU errata I should not have to go and ask the hardware engineers or even read an errata document in order to know what you're doing. Your commit message should explain the errata, its effects and how your patch works around the problem.
Paul
Quoted 40 lines · Florian Fainelli
2013/9/12 Leonid Yegoshin <[email protected]>:
Quoted 10 lines
Treat it as is.
It is a dirty laundry of HW engineers and you may need to communicate with them or read Errata docs on CPU.
If it is about a way how it is written - ask Steven, initially it was in mainland probe code but he think it should be a separate function. I just corrected him, pointing that erratas on 74K and 1074K are different. But because he insist on having the same
CPU_74Kfor both, so...If you take a look at another CPU company such as ARM, they provide lengthy explanations for their various Erratas:
config
PJ4B_ERRATA_4742
bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the
CPU Core to Cease Operation"
depends onCPU_PJ4B&&MACH_ARMADA_370
default y
help
When coming out of either a Wait for Interrupt (WFI) or a Wait
for
Event (WFE) IDLE states, a specific timing sensitivity exists
between
the retiring WFI/WFE instructions and the newly issued
subsequent
instructions. This sensitivity can result in a CPU hang
scenario.
Workaround:
The software must insert either a Data Synchronization Barrier
(DSB)
or Data Memory Barrier (DMB) command immediately after the
WFI/WFE
instructionI really think that you should aim for the same level of information so that people know whether this is relevant for their platform, whether they have the ECO applied etc...
Signature · 1 line
Florian
Quoted 7 lines · Florian Fainelli
Are there any reasons why you cannot quote an internal note about this errata which would give a better idea of what this code is about? Sorry but the diff really does not help understand what is happening without a proper explanation of why this is required. At first glance it would like some revisions of the CPU are affected by some D$ bug?
Okaaay. How about we just stop here. I posted a poor quality patch that did not have enough information. I will post a second version that will have the details of what E16 is and what is being fixed. This will involve me talking to hardware engineers to get something I can put in the patch. My sincere apologies to everyone. I will go crawl back under my rock and finish my work for this week. You should see the corrected version the first part of next week. Cheers.
Steve