Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2536692pxb; Sun, 15 Nov 2020 08:13:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyS8OI0Uaw0nAew8AO0QPN9DPO2k0pGVOihXzzmotCtn2BeqeLWPpGTH4Jvu9VnsbfaPeAQ X-Received: by 2002:a17:907:1008:: with SMTP id ox8mr10691304ejb.189.1605456812288; Sun, 15 Nov 2020 08:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605456812; cv=none; d=google.com; s=arc-20160816; b=A0Bg8ydpfAkFhEA1lo0jkzVXpyR/TZ5nePGNBTJshV+SVE4x1kAZGGlJDPCoXdW50x +I/mvNNdoEC3tMH5i1CXtroDpKsekEf8MGQIyyFIeeq+q2zTrK/l5rIt7e5+F8e7MxI7 AgjGup9m0xDRiwARRO5Hmvd1Ako1zoG4lItZqrrX2ir+KlafjDuGkcbfsU5i1hN20Ce+ MszvFJ3YXJYoHKcyULjyoNNX6mlkxZpdVqGlSF1Lz+iFzNiOlSjNyjGEM2Iwj188NojX mX97XF3KlkHj7zPMBD16+umImYMoA5azjAHs77FYOPWx4161lCByrra1/bzHRlo3TICe EUow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zFdhVA8G2NZmMJI2N1rcPkjhdPP8TjvzYLF9sKVVkyc=; b=OtjodVZhlIaYVqZrFl5TXlMgvgmYMiXPhB9/2v20RxELSshB4hdzGMTvJFW+i+VIVW DsA04IeE0WQB2DEIrrVnDxme/JjNH/bh6GKP1K9wRhqSJ/jpqulccahoHnCLmrlpBDJ9 IF6i/0rlv2Gb3IQBaRY4spLdhaU5z4JPKtKGShYhl4cBZHY6txsgOGVnp53V71hW89nq J60uczm+3RpmCcVOM+HfCW8pOfqEcvK9LXOHaAz7Qig183UvV+U/5zgUlYqPGGxywBQq cCVtvJuboExe6W0dAP+OkLgXRQvVuWKIFnHQawpy4kbj0dFLD86msUpgV/Rowm1l4HCh 4I3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si11161908edp.196.2020.11.15.08.13.09; Sun, 15 Nov 2020 08:13:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbgKOPcn (ORCPT + 99 others); Sun, 15 Nov 2020 10:32:43 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:42774 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726749AbgKOPcn (ORCPT ); Sun, 15 Nov 2020 10:32:43 -0500 Received: from relay1-d.mail.gandi.net (unknown [217.70.183.193]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 0850B3A9EDC; Sun, 15 Nov 2020 15:24:13 +0000 (UTC) X-Originating-IP: 78.193.40.249 Received: from kb-xps (unknown [78.193.40.249]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 34C82240004; Sun, 15 Nov 2020 15:23:51 +0000 (UTC) Date: Sun, 15 Nov 2020 16:23:49 +0100 From: Kamel Bouhara To: William Breathitt Gray Cc: Alexandre Belloni , jic23@kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] counter: microchip-tcb-capture: Fix CMR value check Message-ID: <20201115152349.GA2233@kb-xps> References: <20201111163807.10201-1-vilhelm.gray@gmail.com> <20201114224827.GQ4556@piout.net> <20201114225113.GR4556@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 14, 2020 at 05:58:28PM -0500, William Breathitt Gray wrote: > On Sat, Nov 14, 2020 at 11:51:13PM +0100, Alexandre Belloni wrote: > > On 14/11/2020 23:48:28+0100, Alexandre Belloni wrote: > > > On 11/11/2020 11:38:07-0500, William Breathitt Gray wrote: > > > > The ATMEL_TC_ETRGEDG_* defines are not masks but rather possible values > > > > for CMR. This patch fixes the action_get() callback to properly check > > > > for these values rather than mask them. > > > > > > > > Fixes: 106b104137fd ("counter: Add microchip TCB capture counter") > > > > Cc: Kamel Bouhara > > > > Signed-off-by: William Breathitt Gray > > > Acked-by: Alexandre Belloni > > > > > > > --- > > > > drivers/counter/microchip-tcb-capture.c | 16 ++++++++++------ > > > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > > > > > diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c > > > > index 039c54a78aa5..142b389fc9db 100644 > > > > --- a/drivers/counter/microchip-tcb-capture.c > > > > +++ b/drivers/counter/microchip-tcb-capture.c > > > > @@ -183,16 +183,20 @@ static int mchp_tc_count_action_get(struct counter_device *counter, > > > > > > > > regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr); > > > > > > > > - *action = MCHP_TC_SYNAPSE_ACTION_NONE; > > > > - > > > > - if (cmr & ATMEL_TC_ETRGEDG_NONE) > > > > + switch (cmr & ATMEL_TC_ETRGEDG_BOTH) { > > > > BTW, this could be simply ATMEL_TC_ETRGEDG which is the mask. > > You're right, let me resubmit this patch with that change since it'll be > much clearer. > > By the way, microchip-tcb-capture.c is missing a MAINTAINERS entry. Is > Kamel the maintainer of this driver? I'd like to get a proper entry > added so we have a point of contact in case of future bugs and changes. > Hello William, Thanks for the patch, indeed Im the maintainer of this driver. Regards, Kamel > Thanks, > > William Breathitt Gray -- Kamel Bouhara, Bootlin Embedded Linux and kernel engineering https://bootlin.com