Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1546999ybv; Fri, 14 Feb 2020 01:37:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyHPD6Zd/xJHfwHRHuIaJQ9drwSRZcfU0AV1CJAvOwnJCHrgdE39uGqGL7l9GVGAGms6reY X-Received: by 2002:a9d:7586:: with SMTP id s6mr1498019otk.342.1581673042589; Fri, 14 Feb 2020 01:37:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581673042; cv=none; d=google.com; s=arc-20160816; b=ACzTGlivHULi5pn6T4rlS2zOoCouG5Y8VR9TiXYx8kmx9fZwtHJMWybyq7eMaX9nt7 OELKgnY4n/rMMXgi8GHwR/ADzq+hcF6nuB/0TtvW6GnenWIdrBAiL9ZcgA4EuzT3ynDs cHMeRdMd3YT6FmgTrHWj2oGmUkUvb1TmV/H1Yc+efO1lFWupH+XF0OGH1vPSxypsR2l2 4zBGir9U2DZq0sL+xRa9b3mQWpEqrKaBKp9xCbJiGaP3pYmtWoQ2ZLP8IMwZ5G4VkH5e cx1ANF+yioRrQEONUzXhP0knSoXMVaAiYRRR4aliQ87hvWpE4gDoSe79sXA7VjJlV10r MkbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5AfLEWxBfNqD1QkilGzCQL+klQ2n6nhzMgLjS7kpjJM=; b=oioG/FuEVRWxWfKuu2U0IXP4meNlveiCig3HPIxtaLBcWijcZdCD8ToU4oD5xN1Rx6 QSjpr/i356TkgP8UnFF0t3LgOytR7GGdfa2WUoJeJBcizkdL7QcilZ940q5MSyI2SUZ0 ho+4dDi32r6xUIkOtyT/zpHbFezKuGc+VhZw5XzGD3sJfEYRNl991d+S4DHeD6aobsPN x4kk4jAa6tFdNj95rCD5ryi/auPosoTc3aUdNmveaLbbSmwEJ5BbFycziyo+szsGYXmz cBpW2rk8nLabqhVQ3WmxsST0CTDNlulccM8p0yTc2JfiQB5ABYPy7BsmCddxxpG5Wgpg pQ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GoEjXRGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si2578198oti.316.2020.02.14.01.37.10; Fri, 14 Feb 2020 01:37:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GoEjXRGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729113AbgBNJfM (ORCPT + 99 others); Fri, 14 Feb 2020 04:35:12 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43475 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729074AbgBNJfM (ORCPT ); Fri, 14 Feb 2020 04:35:12 -0500 Received: by mail-pg1-f193.google.com with SMTP id u12so4310663pgb.10 for ; Fri, 14 Feb 2020 01:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5AfLEWxBfNqD1QkilGzCQL+klQ2n6nhzMgLjS7kpjJM=; b=GoEjXRGHToaAgFkeLpViY1gsJSUIEVFtb8QW+MOKy9T8+kP7xEFTsFYvjUW6MSs7gy o28Rzuk0lUdIq/2gWktTi8aG6FVSe5Fp1qD6uMY3WpVJREQ0h3/avtmmbfeIwMUFGd43 5rx0TuSgzQZHI3TlPFC52tzrHGnYIgDgvMgvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5AfLEWxBfNqD1QkilGzCQL+klQ2n6nhzMgLjS7kpjJM=; b=hlo3ssfzwntxYP15PdJ7GDyC+HeBKrQazwRO03Vi2n0ieJhJwsuAa5pjp+NbdKBUJV z7FJslmnDFvPbcQqWGjbEpqnieH2JCIa9Oeh/ivvMTjioncLPj9+6la7NctaTeVGzTFd wzUxIxv4xgDpQ7p3wEfjk1X6s1l8IjttEP4AuEnZmGRl/cFQTgZ57s0fv0P5AAZP87SA nz2sMBem4J4cU/UvO1jQTvGL5OnX53hkGitdefJNt5TKz3l3rvfNU6itQGtk/+WM7QRK 1S3dIpBxnPxUkaDfEixju+Nyc8ZXUWYA5W2krN7MnW68jybdpAFQzyEgQVW0UsWTazwJ BIYg== X-Gm-Message-State: APjAAAVKcfTSnxVA91XziaIIGF0ArAEc/KCcYG/ISjmB9FoCtgJHfChK 0aeRDP9eYvZTJVarFvZF6CPQ2A== X-Received: by 2002:a65:4486:: with SMTP id l6mr2326605pgq.1.1581672911556; Fri, 14 Feb 2020 01:35:11 -0800 (PST) Received: from chromium.org ([2401:fa00:8f:203:f5fe:2a5e:f953:c0ed]) by smtp.gmail.com with ESMTPSA id w11sm6067926pgh.5.2020.02.14.01.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 01:35:10 -0800 (PST) Date: Fri, 14 Feb 2020 18:35:06 +0900 From: Tomasz Figa To: Xia Jiang Cc: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Marek Szyprowski , srv_heupstream@mediatek.com Subject: Re: [PATCH v6 1/5] media: platform: Fix jpeg dec driver bug and improve code quality Message-ID: <20200214093506.GA193786@chromium.org> References: <20200121095320.32258-1-xia.jiang@mediatek.com> <20200121095320.32258-2-xia.jiang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200121095320.32258-2-xia.jiang@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xia, On Tue, Jan 21, 2020 at 05:53:17PM +0800, Xia Jiang wrote: > Fix v4l2-compliance test bug and improve code quality of jpeg decode > driver, because the jpeg encode driver will base on it. > > Signed-off-by: Xia Jiang > --- > v6: alignment 'MTK_JPEG_DCTSIZE' match open parenthesis. > > v5: Use clamp()to replace mtk_jpeg_bound_align_image() and round_up() > to replace mtk_jpeg_align(). > Get correct compose value in mtk_jpeg_selection(). > Cancel spin lock and unlock operation in device run function. > Change register offset hex numberals from upercase to lowercase. > > v4: new add patch for v4l2-compliance test bug fix. Thanks for the patch. The changes look good to me, but each of the unrelated changes should be split into its own patch, with proper explanation in its commit message. Especially the ones that introduce behavior changes, such as the S_SELECTION or locking change. Also please see one comment inline. [snip] > @@ -801,7 +778,6 @@ static void mtk_jpeg_device_run(void *priv) > struct mtk_jpeg_dev *jpeg = ctx->jpeg; > struct vb2_v4l2_buffer *src_buf, *dst_buf; > enum vb2_buffer_state buf_state = VB2_BUF_STATE_ERROR; > - unsigned long flags; > struct mtk_jpeg_src_buf *jpeg_src_buf; > struct mtk_jpeg_bs bs; > struct mtk_jpeg_fb fb; > @@ -829,13 +805,11 @@ static void mtk_jpeg_device_run(void *priv) > if (mtk_jpeg_set_dec_dst(ctx, &jpeg_src_buf->dec_param, &dst_buf->vb2_buf, &fb)) > goto dec_end; > > - spin_lock_irqsave(&jpeg->hw_lock, flags); Why is it safe to remove the locking here? > mtk_jpeg_dec_reset(jpeg->dec_reg_base); > mtk_jpeg_dec_set_config(jpeg->dec_reg_base, > &jpeg_src_buf->dec_param, &bs, &fb); > > mtk_jpeg_dec_start(jpeg->dec_reg_base); > - spin_unlock_irqrestore(&jpeg->hw_lock, flags); > return; > > dec_end: Best regards, Tomasz