diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index db0d6b91be70..d73dd50e2f1d 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -162,12 +162,14 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()
 	unsigned int rawCount = 0;
 	unsigned int yuvCount = 0;
 	Size maxYuvSize;
+	Size maxRawSize;
 
 	for (const StreamConfiguration &cfg : config_) {
 		const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);
 
 		if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) {
 			rawCount++;
+			maxRawSize.expandTo(cfg.size);
 		} else {
 			yuvCount++;
 			maxYuvSize.expandTo(cfg.size);
@@ -190,11 +192,16 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()
 	 * commit message of the patch that introduced this comment for more
 	 * failure examples).
 	 *
-	 * Until the sensor frame size calculation criteria are clarified,
-	 * always use the largest possible one which guarantees better results
-	 * at the expense of the frame rate and CSI-2 bus bandwidth.
+	 * Until the sensor frame size calculation criteria are clarified, when
+	 * capturing from ImgU always use the largest possible size which
+	 * guarantees better results at the expense of the frame rate and CSI-2
+	 * bus bandwidth. When only a raw stream is requested use the requested
+	 * size instead, as the ImgU is not involved.
 	 */
-	cio2Configuration_ = data_->cio2_.generateConfiguration({});
+	if (!yuvCount)
+		cio2Configuration_ = data_->cio2_.generateConfiguration(maxRawSize);
+	else
+		cio2Configuration_ = data_->cio2_.generateConfiguration({});
 	if (!cio2Configuration_.pixelFormat.isValid())
 		return Invalid;
 
