From patchwork Wed Feb 12 15:19:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Meerwald-Stadler X-Patchwork-Id: 3638451 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2AF33BF13A for ; Wed, 12 Feb 2014 15:20:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CF9120160 for ; Wed, 12 Feb 2014 15:20:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6F652018E for ; Wed, 12 Feb 2014 15:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751592AbaBLPUD (ORCPT ); Wed, 12 Feb 2014 10:20:03 -0500 Received: from ns.pmeerw.net ([87.118.82.44]:39074 "EHLO pmeerw.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751435AbaBLPUB (ORCPT ); Wed, 12 Feb 2014 10:20:01 -0500 Received: by pmeerw.net (Postfix, from userid 1000) id 6ED66C50003; Wed, 12 Feb 2014 16:19:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by pmeerw.net (Postfix) with ESMTP id 56C07C50001; Wed, 12 Feb 2014 16:19:55 +0100 (CET) Date: Wed, 12 Feb 2014 16:19:55 +0100 (CET) From: Peter Meerwald To: Laurent Pinchart cc: linux-media@vger.kernel.org, linux-omap@vger.kernel.org Subject: OMAP3 ISP capabilities, resizer Message-ID: User-Agent: Alpine 2.01 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, some more findings: * the driver bug seen below was observed with kernel 3.7 and is already fixed in more recent kernels, likely with commit 864a121274, [media] v4l: Don't warn during link validation when encountering a V4L2 devnode * there still is a a confusing warning: omap3isp omap3isp: can't find source, failing now which may be addressed by the patch here https://linuxtv.org/patch/15200/, but has not been applied * I have a test program, http://pmeerw.net/scaler.c, which exercises the OMAP3 ISP resizer standalone with the pipeline given below; it crashes the system quite reliably on 3.7 and recent kernels :( the reason for the crash is that the ISP resizer can still be busy and doesn't like to be turned off then; a little sleep before omap3isp_sbl_disable() helps (or waiting for the ISP resize to become idle, see the patch below) I'm not sure what omap3isp_module_sync_idle() is supposed to do, it immediately returns since we are in SINGLESHOT mode and isp_pipeline_ready() is false with below patch I am happily resizing... // snip, RFC From: Peter Meerwald Date: Wed, 12 Feb 2014 15:59:20 +0100 Subject: [PATCH] omap3isp: Wait for resizer to become idle before disabling --- drivers/media/platform/omap3isp/ispresizer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) // snip regards, p. diff --git a/drivers/media/platform/omap3isp/ispresizer.c b/drivers/media/platform/omap3isp/ispresizer.c index d11fb26..fea98f7 100644 --- a/drivers/media/platform/omap3isp/ispresizer.c +++ b/drivers/media/platform/omap3isp/ispresizer.c @@ -1145,6 +1145,7 @@ static int resizer_set_stream(struct v4l2_subdev *sd, int enable) struct isp_video *video_out = &res->video_out; struct isp_device *isp = to_isp_device(res); struct device *dev = to_device(res); + unsigned long timeout = 0; if (res->state == ISP_PIPELINE_STREAM_STOPPED) { if (enable == ISP_PIPELINE_STREAM_STOPPED) @@ -1176,6 +1177,15 @@ static int resizer_set_stream(struct v4l2_subdev *sd, int enable) if (omap3isp_module_sync_idle(&sd->entity, &res->wait, &res->stopping)) dev_dbg(dev, "%s: module stop timeout.\n", sd->name); + + while (omap3isp_resizer_busy(res)) { + if (timeout++ > 1000) { + dev_alert(isp->dev, "ISP resizer does not become idle\n"); + return -ETIMEDOUT; + } + udelay(100); + } + omap3isp_sbl_disable(isp, OMAP3_ISP_SBL_RESIZER_READ | OMAP3_ISP_SBL_RESIZER_WRITE); omap3isp_subclk_disable(isp, OMAP3_ISP_SUBCLK_RESIZER);