Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9434485pxu; Mon, 28 Dec 2020 16:25:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3u4zo7XW181J0I2F4F318UDit+rX7t5ZHAMzYil9GURFBpVoucfX/GlCqV8oL8fOySN8k X-Received: by 2002:a17:906:ce21:: with SMTP id sd1mr42632910ejb.396.1609201523893; Mon, 28 Dec 2020 16:25:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609201523; cv=none; d=google.com; s=arc-20160816; b=w4kalRli2IsHjSxpP8dEs5Blg/MGytnVGydHgXbReMtKR1IAFJQ2wKn09KTDvs395U +Jz/6FHpgA569hjYBszymhby4uHSyZR/VH2S/GssIn1uJynkPk9vODMxDJAvu0emey5c w//qaSdrGUT/e+vn7mzD7joIGtnlVJrE1zy123BIgrJs4zbjIeBAqVFeYWMhnIfVdUL+ 7o5q8H5vyoPPSpgANu64EzRDFK6E2cUU0qkiyrffaoZjVETMi+XUupEez3birSrpANsN zdTM61J3ecdgSLSs9jTPVxD2tlDFCZzDMtIgXYn6iw+W70gbEntBq4ilxBG5DSFQtC7f agPA== 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=GmL+h2V4zcwLYLlpbnqCvA5TYayvdm9gIEdw42WAeUM=; b=MXD8yHSETjrH0MzhNxwIWFepWKJwghFcZZQhLMBsHlmrqCDK2DKw948EcKsq92OcmR GoqfOeLDOhIe9kGJ8g60+OCEcfTDsQFRizmvpGiNQypgfv8dGC/eshLLtOVI4GLzkE/2 UPEr4oI6SmnXMWm68WFtUXnrrB4NAatEWGdsLpvhvDtpwtjolX1QfZWCdShhwKOiQ3xb YaEgNh5NgRM6AnnsFie3UUWHm+5MzdevTxEpCdP4mlNf7JNP6IbBWpG2zC/IWqJIOUGp /3X9+swGuJs8z2mVE6k/vJbutuNH3FWQhrep80jssM328qJB43CG7+Bu/XeXjx60gqc1 eyZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eZZX8rtg; 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 ca22si18438502ejb.688.2020.12.28.16.25.02; Mon, 28 Dec 2020 16:25:23 -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=eZZX8rtg; 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 S2408614AbgL1PfT (ORCPT + 99 others); Mon, 28 Dec 2020 10:35:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:55046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407277AbgL1NxN (ORCPT ); Mon, 28 Dec 2020 08:53:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 83CBA2072C; Mon, 28 Dec 2020 13:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163552; bh=+CvkO08wiDcRQXFR4yilABAA2C9YPLcojWICzMjdGdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eZZX8rtgp2lT7DNBt5A0APBLLRhzwYB0X90Q2ARtXsx+pEgyS2WYrRNLmVyoYXsbV MI/Sxhzm2HH1cGPaPQYRakexz3fWejcNfnedHj5LEEyClcQVC1nm1gnQuBkDhb/Uwo 1Q6QRoSge/nHh1E43Zxc9L9cYaFMceH9u86r5CtQ= 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.4 325/453] media: ipu3-cio2: Return actual subdev format Date: Mon, 28 Dec 2020 13:49:21 +0100 Message-Id: <20201228124952.849449166@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@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 @@ -1244,29 +1244,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; }