Skip to contentSkip to conversation

Revert "drm/amd/display: Remove unused temp variable"

PATCH In review Alex Deucher 2 participants 2 messages Feb 23, 2022

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 Revert "drm/amd/display: Remove unused temp variable"

This reverts commit b1f0ab445ec609f9b58e0969c5d052b52d9a54e7.

This patch is not valid. The driver needs to actually read the entries in the ring buffer. Add a comment to make this clear.

---
 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +8 -1
index d3088836d4e4..cb92ab4c8b98 100644
@@ -2918,8 +2918,15 @@ static inline void dmub_rb_flush_pending(const struct dmub_rb *rb)
 	while (rptr != wptr) {
 		uint64_t volatile *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr);
 		//uint64_t volatile *p = (uint64_t volatile *)data;
+		uint64_t temp;
+		uint8_t i;
 
-		*data += DMUB_RB_CMD_SIZE / sizeof(uint64_t);
+		/* Don't remove this.
+		 * The contents need to actually be read from the ring buffer
+		 * for this function to be effective.
+		 */
+		for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++)
+			temp = *data++;
 
 		rptr += DMUB_RB_CMD_SIZE;
 		if (rptr >= rb->capacity)
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Alex Deucher

This reverts commit b1f0ab445ec609f9b58e0969c5d052b52d9a54e7.

This patch is not valid. The driver needs to actually read the entries in the ring buffer. Add a comment to make this clear.

Harry

Quoted 25 lines
---
 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +8 -1
index d3088836d4e4..cb92ab4c8b98 100644
@@ -2918,8 +2918,15 @@ static inline void dmub_rb_flush_pending(const struct dmub_rb *rb)
 	while (rptr != wptr) {
 		uint64_t volatile *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr);
 		//uint64_t volatile *p = (uint64_t volatile *)data;
+		uint64_t temp;
+		uint8_t i;
 
-		*data += DMUB_RB_CMD_SIZE / sizeof(uint64_t);
+		/* Don't remove this.
+		 * The contents need to actually be read from the ring buffer
+		 * for this function to be effective.
+		 */
+		for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++)
+			temp = *data++;
 
 		rptr += DMUB_RB_CMD_SIZE;
 		if (rptr >= rb->capacity)