Skip to contentSkip to conversation

staging: vc04_services: preserve bcm2835_audio_write errors

PATCH In review Lucas Jeffrey 2 participants 2 messages Aug 3 – Sep 1

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vc04_services: preserve bcm2835_audio_write errors

When sending audio data in multiple packets, a successful later packet could overwrite an earlier failure in status. This caused the function to report success even if one packet was not queued.

Stop sending packets after the first failure to preserve the error.

---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +3 -0
index 3156cb8392f4..5ac23cfa7983 100644
@@ -365,6 +365,9 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
 
 			status = vchiq_queue_kernel_message(vchiq_instance,
 							    instance->service_handle, src, bytes);
+			if (status)
+				break;
+
 			src += bytes;
 			count -= bytes;
 		}
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 29 lines · Lucas Jeffrey

When sending audio data in multiple packets, a successful later packet could overwrite an earlier failure in status. This caused the function to report success even if one packet was not queued.

Stop sending packets after the first failure to preserve the error.

---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +3 -0
index 3156cb8392f4..5ac23cfa7983 100644
@@ -365,6 +365,9 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
 
 			status = vchiq_queue_kernel_message(vchiq_instance,
 							    instance->service_handle, src, bytes);
+			if (status)
+				break;
+
 			src += bytes;
 			count -= bytes;
 		}
Signature · 1 line
2.43.0

Was this tested on the real hardware?

thanks,

greg k-h