From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78F02C43603 for ; Tue, 10 Dec 2019 20:37:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4DAB72073B for ; Tue, 10 Dec 2019 20:37:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kVWjrVWn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DAB72073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oGVzGNhgHmehugwTo+k4FJHn34/X0J6uvGL3Et/ApDY=; b=kVWjrVWnq50R63 pDIBCC3y5kzOch0YB5yHD14H5iB3luU8nxXi3iJF34MLfMzJ9E5GooRkxt2ENTciWU5dkkCt6IoCV VkaiySj4PiG3hkudZWuWdf2vZewF75Kqt2oh2vthkFZ+w7+T/hXHDhWP1xGfri87P9AJ4sESPk8vW XDpOLvPxAZT/diO6IdAR8j+fUqvJfZyqsHasRqXH/iSULHZc2nZUcJ1o/fcKNULRsWYav+Ja/pyGK PAbzNzyhMFOVcScYyPe0xE052RUBst4/tXdUkuJC9iJeyXxAyK4iSXBHHcfnaYTcO1PZBSheyuPom NyOt9kBuIJUK1wqPcvUg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemG3-0004zK-PE; Tue, 10 Dec 2019 20:37:23 +0000 Received: from asavdk3.altibox.net ([109.247.116.14]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemG0-0004yy-BE for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2019 20:37:22 +0000 Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id 3FF1320066; Tue, 10 Dec 2019 21:37:18 +0100 (CET) Date: Tue, 10 Dec 2019 21:37:16 +0100 From: Sam Ravnborg To: Claudiu Beznea Subject: Re: [PATCH 3/5] mfd: atmel-hlcdc: return in case of error Message-ID: <20191210203716.GC24756@ravnborg.org> References: <1575984287-26787-1-git-send-email-claudiu.beznea@microchip.com> <1575984287-26787-4-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1575984287-26787-4-git-send-email-claudiu.beznea@microchip.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=eMA9ckh1 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=XYAwZIGsAAAA:8 a=kaM4bpze9TPPYBSW8_oA:9 a=CjuIK1q_8ugA:10 a=E8ToXWR_bxluHZ7gmE-Z:22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_123720_570032_E2424120 X-CRM114-Status: GOOD ( 18.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, bbrezillon@kernel.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, daniel@ffwll.ch, lee.jones@linaro.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Claudiu. On Tue, Dec 10, 2019 at 03:24:45PM +0200, Claudiu Beznea wrote: > For HLCDC timing engine configurations bit ATMEL_HLCDC_SIP of > ATMEL_HLCDC_SR needs to checked if it is equal with zero before applying > new configuration to timing engine. In case of timeout there is no > indicator about this, so, return with error in case of timeout in > regmap_atmel_hlcdc_reg_write() and also print a message about this. > > Signed-off-by: Claudiu Beznea > --- > drivers/mfd/atmel-hlcdc.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c > index 64013c57a920..19f1dbeb8bcd 100644 > --- a/drivers/mfd/atmel-hlcdc.c > +++ b/drivers/mfd/atmel-hlcdc.c > @@ -39,10 +39,16 @@ static int regmap_atmel_hlcdc_reg_write(void *context, unsigned int reg, > > if (reg <= ATMEL_HLCDC_DIS) { > u32 status; > - > - readl_poll_timeout_atomic(hregmap->regs + ATMEL_HLCDC_SR, > - status, !(status & ATMEL_HLCDC_SIP), > - 1, 100); > + int ret; > + > + ret = readl_poll_timeout_atomic(hregmap->regs + ATMEL_HLCDC_SR, > + status, > + !(status & ATMEL_HLCDC_SIP), > + 1, 100); > + if (ret) { > + pr_err("Timeout waiting for ATMEL_HLCDC_SIP\n"); > + return ret; Consider adding device * to atmel_hlcdc_regmap - so you can use dev_err() here. This makes it obvious what device this comes from. Sam > + } > } > > writel(val, hregmap->regs + reg); > -- > 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel