Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbdFUIAa (ORCPT ); Wed, 21 Jun 2017 04:00:30 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:62755 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbdFUIA2 (ORCPT ); Wed, 21 Jun 2017 04:00:28 -0400 X-AuditID: cbfec7ef-f796a6d00000373c-33-594a279b4740 Subject: Re: [PATCH v2 1/6] [media] s5p-jpeg: Reset the Codec before doing a soft reset To: Thierry Escande , Jacek Anaszewski , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org From: Andrzej Pietrasiewicz Message-id: Date: Wed, 21 Jun 2017 10:00:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-version: 1.0 In-reply-to: <1497287605-20074-2-git-send-email-thierry.escande@collabora.com> Content-type: text/plain; charset=utf-8; format=flowed Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLKsWRmVeSWpSXmKPExsWy7djPc7qz1b0iDXoWyFjc3rqBxeLyrjls Fj0btrJaLNv0h8mi/+olNgdWjx13lzB67Jx1l91j06pONo/Pm+QCWKK4bFJSczLLUov07RK4 MtYdfcdW8JW34suuBtYGxqPcXYycHBICJhKrpn1khrDFJC7cW8/WxcjFISSwjFFiwpOd7BDO Z0aJyXMPssF0dL+7yQJXNf/nNaiWF4wSnRtPsIBUCQtESiy8sYgRJCEiMIFR4sA2kFmcHMwC thIdhzrBitgEjCX2HuxgBLF5BewkJrx7CWazCKhK/Gw6DVYjKhAhsWjSRHaIGkGJH5PvgcU5 BfwkJky6zgQx00ri2b9WVghbXKK59SYLhC0vsXnNW2aQIyQEFrFL/D63DMjhAHJkJTYdgHra RWLX3cVQtrDEq+Nb2CFsGYnLk7tZIHonM0psuPkBytnOKLH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GxhYW5kZGSOO/UD1fChQTSE0tSs1NT C1KLYPqYODilGhgXN13uscuO5rw4w7JuJ99EPtU3ryfdmv/2vwdnu3hwzm++T9rcF7watnBH p2yJFw2Jb0+PdpQOCZgZe8KnaZJcIquxzvrd8/+fYV3O6fqo7NTPfYzMS5zZ2FkniXkeWjDP QfQy457PDod7VFNeR88QV5xprta0T+Bp5cst1ic4g94FHl4z7YUSS3FGoqEWc1FxIgAexuor zgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170621080024eucas1p2a66186f87ef06061ea73a9d325fb65fc X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBQaWV0cmFzaWV3aWN6G1NSUE9MLUtlcm5lbCAo?= =?UTF-8?B?VFApG+yCvOyEseyghOyekBtTZW5pb3IgU29mdHdhcmUgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBUb21hc3ogUGlldHJhc2lld2ljehtTUlBPTC1L?= =?UTF-8?B?ZXJuZWwgKFRQKRtTYW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2Fy?= =?UTF-8?B?ZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170612171341epcas3p1da64f6bb1c5917de115ad841d54baed4 X-RootMTR: 20170612171341epcas3p1da64f6bb1c5917de115ad841d54baed4 References: <1497287605-20074-1-git-send-email-thierry.escande@collabora.com> <1497287605-20074-2-git-send-email-thierry.escande@collabora.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1737 Lines: 44 Hi Thierry, W dniu 12.06.2017 o 19:13, Thierry Escande pisze: > From: Abhilash Kesavan > > This patch resets the encoding and decoding register bits before doing a > soft reset. Here are my thoughts after consulting the documentation: > > Signed-off-by: Tony K Nadackal > Signed-off-by: Thierry Escande > --- > drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > index a1d823a..9ad8f6d 100644 > --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > @@ -21,6 +21,10 @@ void exynos4_jpeg_sw_reset(void __iomem *base) > unsigned int reg; > > reg = readl(base + EXYNOS4_JPEG_CNTL_REG); > + writel(reg & ~(EXYNOS4_DEC_MODE | EXYNOS4_ENC_MODE), > + base + EXYNOS4_JPEG_CNTL_REG); Indeed, if encoding/decoding "back-to-back", the bits this patch touches should be reset. The doc also says, that "Soft reset is asserted to all registers of JPEG except soft reset bit itself", so, theoretically speaking, the changes in this patch are redundant. Instead, the doc says, these bits have to be reset after servicing the interrupt for current image and before programming the hardware to perform the next en/decoding. And indeed, the first thing that both ENCODE and DECODE paths of exynos4_jpeg_device_run() do is calling sw reset. If, however, you can show that the changes in the patch discussed here are in fact necessary (that's the very difference between theory and practise...), I will readily ack it. Andrzej