Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9092147pxu; Mon, 28 Dec 2020 06:26:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1JTMEzHOK15orfFuKdfzNsee1Q+kyvim28dLukpRoGsc35u91heODC4rd/dUQOzioGywN X-Received: by 2002:a05:6402:1d18:: with SMTP id dg24mr41666682edb.221.1609165613833; Mon, 28 Dec 2020 06:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165613; cv=none; d=google.com; s=arc-20160816; b=ZgBVCFmotmGw4vZOlk0VlUG1SCwF1SUsgIgXel8gFeoFpreRxSRs6vZ8uvRqj1Ei81 uSZpxUw7U/MlQvOikJJw7kgBj6rkQSm6y6q8zQbro31QOPGuDqH3EEtDSFbeXi7hQjb1 l58ZlnULoVkx9X49Qt0dNqQVpwlINAVP8VyV2O8u6D4ezZ21ruT98MDFBc767y20pPpx KTy6MxXh5yfDS4n7qgh+CesWsPW539vs62wDvSjOkM6e0oG/gFdMga68hiVrSOC31Vi4 A1+XM5Xhiwaz2UoUMKQql82SWCG/yeG+pcwNoz7x/f7iTu8Lnms6izkWtSQzbgNNBKxH aXgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tsTPgQ4PVZHzevLSbM04UesNoiC1ANCsho/Amia0IRU=; b=gKMpOrRqPLwL3Y14Sj25AcT0Iz0SEAxLPhpnN2c6J4N66qmT3fixTygzrjyOiooOGi srfpGn51FBW0bjMLlz5z7yGR74P3NzdQJp1usnQjUQF2qIhoXRW7IQkXFbR3JrKUbr0n r8GH0X4RWkfhdpyUzCYQRKOilqCdztndaSIwSJPvr7ODgf3ZKxyGJttvth74oP8SbgTr tqe6pfatq+Tl55z9wmgUulcP/myOmzc507EBltHJgmsBEr+UqQ4eCQgM9a6UWQC5zBr4 ZrSgpPvpmI+DEmJiPsEd/1kbvpDyW8XGUx9kfO+JBPemyM39hH81oR5LPdV3tC0syCxk FP+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ivxmf7F3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si18829459eja.188.2020.12.28.06.26.31; Mon, 28 Dec 2020 06:26:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ivxmf7F3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503011AbgL1OYT (ORCPT + 99 others); Mon, 28 Dec 2020 09:24:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:60340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502985AbgL1OYS (ORCPT ); Mon, 28 Dec 2020 09:24:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A03A620731; Mon, 28 Dec 2020 14:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165418; bh=vCOB+yZm0TelJQlcxu+qc+WbuvPbgkkebbfpT6S6mas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ivxmf7F3ijGkEkvGuRnHbZNCKACK1mYIvaNf5EWe2VagoP8kN2D8S2LevLT7VTAC2 RE/EnbieoCMKX7IaubTaX8YVh04ogBf2SiIB0JaK/rA5Lv6A7N8nF3fpxtFwFSnIHS lmWlr7Zhf52PUK4H3Tcmq/9rilfPnW+1htFXvHrA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tsuchiya Yuto , Sakari Ailus , Laurent Pinchart , Bingbu Cao , Andy Shevchenko , Mauro Carvalho Chehab Subject: [PATCH 5.10 525/717] media: ipu3-cio2: Return actual subdev format Date: Mon, 28 Dec 2020 13:48:43 +0100 Message-Id: <20201228125046.115479846@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sakari Ailus commit 8160e86702e0807bd36d40f82648f9f9820b9d5a upstream. Return actual subdev format on ipu3-cio2 subdev pads. The earlier implementation was based on an infinite recursion that exhausted the stack. Reported-by: Tsuchiya Yuto Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Reviewed-by: Bingbu Cao Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org # v4.16 and up Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1233,29 +1233,11 @@ static int cio2_subdev_get_fmt(struct v4 struct v4l2_subdev_format *fmt) { struct cio2_queue *q = container_of(sd, struct cio2_queue, subdev); - struct v4l2_subdev_format format; - int ret; - if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { + if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad); - return 0; - } - - if (fmt->pad == CIO2_PAD_SINK) { - format.which = V4L2_SUBDEV_FORMAT_ACTIVE; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, - &format); - - if (ret) - return ret; - /* update colorspace etc */ - q->subdev_fmt.colorspace = format.format.colorspace; - q->subdev_fmt.ycbcr_enc = format.format.ycbcr_enc; - q->subdev_fmt.quantization = format.format.quantization; - q->subdev_fmt.xfer_func = format.format.xfer_func; - } - - fmt->format = q->subdev_fmt; + else + fmt->format = q->subdev_fmt; return 0; }