Skip to contentSkip to conversation

ARM diagnostic register across suspend/resume

DISCUSSION Shawn Guo 3 participants 11 messages Jun 17, 2014

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

Hi Will, Catalin,

The CP15 diagnostic register holds some bits for ARM errata workaround. Since core gets power gated across suspend/resume cycle, these bits will get lost along the way. Is it okay for errata workaround to continue working after suspend, or do we have to save/restore diagnostic register to keep workaround effective?

Shawn

#1 lore raw
Quoted 7 lines · Shawn Guo

Hi Will, Catalin,

The CP15 diagnostic register holds some bits for ARM errata workaround. Since core gets power gated across suspend/resume cycle, these bits will get lost along the way. Is it okay for errata workaround to continue working after suspend, or do we have to save/restore diagnostic register to keep workaround effective?

I'm not sure that saving/restoring the diagnostic register on A9 actually works at all (I seem to remember some bits always read as zero?).

Anyway, I'd expect the state could be lost, so you'd need to reprogram the diagnostic register rather than save/restore its value.

Will

#2 lore raw
Quoted 11 lines · Will Deacon
Quoted 7 lines · Shawn Guo

Hi Will, Catalin,

The CP15 diagnostic register holds some bits for ARM errata workaround. Since core gets power gated across suspend/resume cycle, these bits will get lost along the way. Is it okay for errata workaround to continue working after suspend, or do we have to save/restore diagnostic register to keep workaround effective?

I'm not sure that saving/restoring the diagnostic register on A9 actually works at all (I seem to remember some bits always read as zero?).

If that's true, then we have a problem. We always read-modify-write this register when enabling work-arounds. If it always reads as zero, then enabling a subsequent work-around will disable the previous work-around.

Signature · 2 lines
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
#3 lore raw
Quoted 10 lines · Russell King - ARM Linux
Quoted 9 lines · Will Deacon
Quoted 7 lines · Shawn Guo

Hi Will, Catalin,

The CP15 diagnostic register holds some bits for ARM errata workaround. Since core gets power gated across suspend/resume cycle, these bits will get lost along the way. Is it okay for errata workaround to continue working after suspend, or do we have to save/restore diagnostic register to keep workaround effective?

Quoted 7 lines
Quoted 2 lines

I'm not sure that saving/restoring the diagnostic register on A9 actually works at all (I seem to remember some bits always read as zero?).

If that's true, then we have a problem. We always read-modify-write this register when enabling work-arounds. If it always reads as zero, then enabling a subsequent work-around will disable the previous work-around.

I think that actually works ok, because writing zeroes doesn't actually do anything as far as I understand. The problem with suspend/resume is that the suspend/resume cycle could well clear the internal state and writing zeroes won't re-enable the workaround bits.

I'll double-check this with the hardware guys, since this register really is undocumented.

Will

#4 lore raw
Quoted 7 lines · Will Deacon

I think that actually works ok, because writing zeroes doesn't actually do anything as far as I understand. The problem with suspend/resume is that the suspend/resume cycle could well clear the internal state and writing zeroes won't re-enable the workaround bits.

I'll double-check this with the hardware guys, since this register really is undocumented.

Are you saying that it is write one to set, and writing zero is ignored? If that's true, we should simplify the work-around code to get rid of the read-modify-write.

Signature · 2 lines
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
#5 lore raw
Quoted 6 lines · Russell King - ARM Linux
Quoted 5 lines · Will Deacon

I think that actually works ok, because writing zeroes doesn't actually do anything as far as I understand. The problem with suspend/resume is that the suspend/resume cycle could well clear the internal state and writing zeroes won't re-enable the workaround bits.

Quoted 6 lines
Quoted 2 lines

I'll double-check this with the hardware guys, since this register really is undocumented.

Are you saying that it is write one to set, and writing zero is ignored? If that's true, we should simplify the work-around code to get rid of the read-modify-write.

That's my understanding for the diagnostic register, but I've asked for clarification internally.

Will

author
#6 lore raw
Quoted 10 lines · Will Deacon
Quoted 9 lines · Russell King - ARM Linux
Quoted 7 lines · Will Deacon

I think that actually works ok, because writing zeroes doesn't actually do anything as far as I understand. The problem with suspend/resume is that the suspend/resume cycle could well clear the internal state and writing zeroes won't re-enable the workaround bits.

I'll double-check this with the hardware guys, since this register really is undocumented.

Quoted 6 lines
Quoted 3 lines

Are you saying that it is write one to set, and writing zero is ignored? If that's true, we should simplify the work-around code to get rid of the read-modify-write.

That's my understanding for the diagnostic register, but I've asked for clarification internally.

Hmm, I'm not sure that's the case. On imx6q, I can read out diagnostic register as 0x00200850 which matches the errata we enable.

Shawn

author
#9 lore raw
In reply to Will Deacon
Quoted 9 lines · Will Deacon
Quoted 7 lines · Shawn Guo

Hi Will, Catalin,

The CP15 diagnostic register holds some bits for ARM errata workaround. Since core gets power gated across suspend/resume cycle, these bits will get lost along the way. Is it okay for errata workaround to continue working after suspend, or do we have to save/restore diagnostic register to keep workaround effective?

Quoted 5 lines

I'm not sure that saving/restoring the diagnostic register on A9 actually works at all (I seem to remember some bits always read as zero?).

Anyway, I'd expect the state could be lost, so you'd need to reprogram the diagnostic register rather than save/restore its value.

Yes, we observed that diagnostic state gets lost after suspend. But per my testing I can see the effectiveness of errata workaround preserves. Is this expected somehow or something wrong in my testing?

Shawn

author
#10 lore raw
Quoted 13 lines · Shawn Guo
Quoted 12 lines · Will Deacon
Quoted 7 lines · Shawn Guo

Hi Will, Catalin,

The CP15 diagnostic register holds some bits for ARM errata workaround. Since core gets power gated across suspend/resume cycle, these bits will get lost along the way. Is it okay for errata workaround to continue working after suspend, or do we have to save/restore diagnostic register to keep workaround effective?

I'm not sure that saving/restoring the diagnostic register on A9 actually works at all (I seem to remember some bits always read as zero?).

Quoted 6 lines
Quoted 2 lines

Anyway, I'd expect the state could be lost, so you'd need to reprogram the diagnostic register rather than save/restore its value.

Yes, we observed that diagnostic state gets lost after suspend. But per my testing I can see the effectiveness of errata workaround preserves. Is this expected somehow or something wrong in my testing?

It is something wrong in my testing. The effectiveness of errata workaround goes off together with diagnostic register state.

Shawn

#7 lore raw
In reply to Shawn Guo
Quoted 15 lines · Shawn Guo
Quoted 14 lines · Will Deacon
Quoted 12 lines · Russell King - ARM Linux
Quoted 7 lines · Will Deacon

I think that actually works ok, because writing zeroes doesn't actually do anything as far as I understand. The problem with suspend/resume is that the suspend/resume cycle could well clear the internal state and writing zeroes won't re-enable the workaround bits.

I'll double-check this with the hardware guys, since this register really is undocumented.

Are you saying that it is write one to set, and writing zero is ignored? If that's true, we should simplify the work-around code to get rid of the read-modify-write.

Quoted 5 lines
Quoted 2 lines

That's my understanding for the diagnostic register, but I've asked for clarification internally.

Hmm, I'm not sure that's the case. On imx6q, I can read out diagnostic register as 0x00200850 which matches the errata we enable.

The hardware guys got back to me, and I was mistaken (in fact, confused by another register). So the diagnostic register on A9 *does* read back with the value written to it. You still need to save/restore it across suspend, but read-modify-write is the right thing to do everywhere else.

Will

author
#8 lore raw
Quoted 4 lines · Will Deacon

The hardware guys got back to me, and I was mistaken (in fact, confused by another register). So the diagnostic register on A9 *does* read back with the value written to it. You still need to save/restore it across suspend, but read-modify-write is the right thing to do everywhere else.

Thanks for the confirmation, Will.

Shawn