From patchwork Mon Nov 5 20:45:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10669107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5771B15E9 for ; Mon, 5 Nov 2018 20:45:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B98629ECA for ; Mon, 5 Nov 2018 20:45:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FB7129ECF; Mon, 5 Nov 2018 20:45:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D70A329ECA for ; Mon, 5 Nov 2018 20:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730320AbeKFGGc (ORCPT ); Tue, 6 Nov 2018 01:06:32 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46780 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbeKFGGb (ORCPT ); Tue, 6 Nov 2018 01:06:31 -0500 Received: by mail-qt1-f194.google.com with SMTP id c16-v6so195056qtj.13 for ; Mon, 05 Nov 2018 12:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W8Vc2+YtQUyOVlZNPknB2FNIZjEuSAnPCA2X4hMTs98=; b=SKcpykmFhgy0YIuRiE0DnXWIMRKRbSWqNlBeFLLMlUs/uLUUSa/nmv1Tb/Rtcer2vj IL21JRxkWZO+Qzys19dJQcrGwxnzb/pzCNokNWxhl9tTDznCGxwBudI+uBekHfUDS6U+ R3N7+AAGRwaCOksKzJiUOTmzp2L2av2LZ3ADHP0TLt9YyEd5eLhfQl+SLHjdbmpSGWhp OQ1ZsVDow3n8tM0xcOqQVuyhiksXbQbgHN7eTEmmjXgdIeSKIyFD+SD3m5SMxQ441r5K 9J+MhacudG97xoelH+g83hzCsiOozfamoqobIt6ZDiuTr61IcU2cJrvD5LfSYnT1/6ZO WlTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W8Vc2+YtQUyOVlZNPknB2FNIZjEuSAnPCA2X4hMTs98=; b=Y0GCEuE17hgIEhs9vbrF8irijsVFbZkS6hF32iZS9Bvp0MUb6qG7bsOtaZcFwhwqz3 giSd0GJF6mR73k5EmEV9Oh+XKjTDm2eBBhj7XEa7vBFOBHOU8Ij9fvY2SRlNTdmSArc+ sHcxAhktWhIpA1mniorMwihXwrl2qcLWa2bURf3qUcubnLOfovBylf0IDEmiK4HX1k3C qEaZC0DBHUs1A5vduFbggNYrDUxyWTaFq2OqdSjYZrG7uRmK6HF2G7A2/z5AdrfaguT9 KxL6Db/I9pjliameNlBjAD09P8zQDXZa4FUZSJSjL/uu3vnEKpvEIj4n9q8h8jrVD/TZ sj7Q== X-Gm-Message-State: AGRZ1gLFLeCoGWYkIuTAEjIthJ9k6ShtmclXSyVYD97cjD7qx8/lS7Jq IGi88+2FgAZNxvEMYT9FWqQ= X-Google-Smtp-Source: AJdET5f6bGRsy2VPXdyWdzByCglS8pTuzgaxNJpCH1d/KEFajoLSJJP6VX6rZCHe5kfv98d8o3VIvw== X-Received: by 2002:a0c:f184:: with SMTP id m4mr17242046qvl.178.1541450701429; Mon, 05 Nov 2018 12:45:01 -0800 (PST) Received: from localhost.localdomain ([201.82.144.36]) by smtp.gmail.com with ESMTPSA id 5sm10167968qkv.93.2018.11.05.12.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 12:45:00 -0800 (PST) From: Fabio Estevam To: p.zabel@pengutronix.de Cc: mchehab@kernel.org, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH v2 2/3] media: imx-pxp: Check for pxp_soft_reset() error Date: Mon, 5 Nov 2018 18:45:15 -0200 Message-Id: <1541450716-25523-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541450716-25523-1-git-send-email-festevam@gmail.com> References: <1541450716-25523-1-git-send-email-festevam@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pxp_soft_reset() may fail with a timeout, so it is better to propagate the error in this case. Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel --- Changes since v1: - None drivers/media/platform/imx-pxp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c index 27780f1..b3700b8 100644 --- a/drivers/media/platform/imx-pxp.c +++ b/drivers/media/platform/imx-pxp.c @@ -1607,7 +1607,7 @@ static const struct v4l2_m2m_ops m2m_ops = { .job_abort = pxp_job_abort, }; -static void pxp_soft_reset(struct pxp_dev *dev) +static int pxp_soft_reset(struct pxp_dev *dev) { int ret; u32 val; @@ -1619,11 +1619,15 @@ static void pxp_soft_reset(struct pxp_dev *dev) ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val, val & BM_PXP_CTRL_CLKGATE, 0, 100); - if (ret < 0) + if (ret < 0) { pr_err("PXP reset timeout\n"); + return ret; + } writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR); writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR); + + return 0; } static int pxp_probe(struct platform_device *pdev) @@ -1670,7 +1674,9 @@ static int pxp_probe(struct platform_device *pdev) if (ret < 0) return ret; - pxp_soft_reset(dev); + ret = pxp_soft_reset(dev); + if (ret < 0) + return ret; spin_lock_init(&dev->irqlock);