Received: by 10.192.165.148 with SMTP id m20csp442183imm; Wed, 2 May 2018 03:04:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrq7sE12fjDwiAPRZF5QekzKYY231qCs5pok2EuPHPaj8Q5ThgKls6bUbWkvKATM8QgUUOs X-Received: by 2002:a17:902:7288:: with SMTP id d8-v6mr1673812pll.218.1525255454268; Wed, 02 May 2018 03:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525255454; cv=none; d=google.com; s=arc-20160816; b=LI7tb/EpsEu1QScFLoTlzwDJbMcxrSpg5zRddc/JDT0sXMV3d1q+yFXWs/oTUNijvx CyUuA0ALGp4oai7+ezw/L0tyPBlJzmvzcAtk8bhqOem7mqp1FhkLpMFDPzlqQsVcxFII qv6E1ARDlEIQrPwKQvWJaLI/RareigQMdPMDxLteY+s0GKssTm+Dqp7d0YOLEm8lrtAK tyzdm5DOtmOFKiUzzIfHCKipurXFwNII30S1ISC4b6TQiaJTgwke3GVnW1uAw7ZPTGi/ fk+DvGrZ8Nqva3GSejEXx5290HkN7+8rHT1KOsfnrAvoolDE0PfLAVh0m7HjozMq6zl6 CaOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:mime-version:in-reply-to:user-agent :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=Iyw15SfsvsaBWWCLQI5526+T5rv0KGQ69mFNnSyQNOo=; b=lFQzHGYa8vVKDjwh5dG2EYCu636JBT2+sS5g50buLZzkg3aTcP8KNMNOX/ZCRR2J0N oljeZ26B53DANVzTEv8B+tEMN5Pf3GKC7gK0cOGtf8tDUZ5xArDOHQn7EBg0cIc0BnlA YU1X2Z5mpgTqFL5pG1lveLD9+HZs8BLAJrXS61tpV5RdrC+dtkQUKSjlviz6o6+ssUWZ EAVA10oCaR6t+qm+j7R4EfBqzf2iPZ4jCOG7YHFMPtq++LTgXZY4fpw2GHWMs19uIi5q 0zkm90202OSuvjBawKd/9PF2ogiGrko/R4xnogAbP5f1KvZeSygxfzk8uxFyPIVjVrTV HHbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=SCB+GsVn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si11130856pfi.147.2018.05.02.03.03.59; Wed, 02 May 2018 03:04:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=SCB+GsVn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbeEBKDu (ORCPT + 99 others); Wed, 2 May 2018 06:03:50 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39659 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbeEBKDs (ORCPT ); Wed, 2 May 2018 06:03:48 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180502100346euoutp01cae6ba6d31ae48eae59b7bc1c8a17b76~qy7qcWicq2272222722euoutp01O; Wed, 2 May 2018 10:03:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180502100346euoutp01cae6ba6d31ae48eae59b7bc1c8a17b76~qy7qcWicq2272222722euoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525255426; bh=Iyw15SfsvsaBWWCLQI5526+T5rv0KGQ69mFNnSyQNOo=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=SCB+GsVnSwJyNnyWvGmHMwxEQrxFzxTr+Z4Hzsb52cjlO3LkTK7zIzkxA61iwVIPh ldhyVdJ0izYmxwv3NlpbLdhkxTT7JZhH2CI2jQhgboRVsMQ+tuq7PByJEyv7x3Xanx Pbr40BU0jVPRtqpMuG2vh3GE+UR1HiQcU+pualNU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180502100345eucas1p1655229c755d192901f105676733bddea~qy7qG7UPT0376903769eucas1p1c; Wed, 2 May 2018 10:03:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id D0.30.10409.10D89EA5; Wed, 2 May 2018 11:03:45 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180502100345eucas1p27280d10571f3e9d7c5b5a62a364dd439~qy7pbe_rv1405314053eucas1p2i; Wed, 2 May 2018 10:03:45 +0000 (GMT) X-AuditID: cbfec7f5-b5fff700000028a9-c2-5ae98d01d677 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AD.41.04183.10D89EA5; Wed, 2 May 2018 11:03:45 +0100 (BST) Received: from amdc3058.localnet ([106.120.53.102]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P83001WAIM8FF90@eusync4.samsung.com>; Wed, 02 May 2018 11:03:44 +0100 (BST) From: Bartlomiej Zolnierkiewicz To: Daniel Lezcano Cc: Eduardo Valentin , Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 16/18] thermal: exynos: cleanup code for enabling threshold interrupts Date: Wed, 02 May 2018 12:03:44 +0200 Message-id: <17338828.V5XOYeIB5l@amdc3058> User-Agent: KMail/4.13.3 (Linux/3.13.0-96-generic; KDE/4.13.3; x86_64; ; ) In-reply-to: <20180501110239.GM27619@mai> MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset="us-ascii" X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRmVeSWpSXmKPExsWy7djP87qMvS+jDDZ/l7OY91nWYv6Va6wW l3fNYbP43HuE0WLG+X1MFk8e9rE5sHnsnHWX3WPxnpdMHneu7WHz+LxJLoAlissmJTUnsyy1 SN8ugSvj8IKPbAVHpCtOX+tgb2DsEeti5OCQEDCRmD45tIuRi0NIYAWjxPaDS1ghnM+MEg++ fWOHKbqw2wAivoxR4s+nTcwQzm9GicbtjWxdjJwcbAJWEhPbVzGC2CICehKN79uYQIqYBVYx SvR/escEkhAWiJE4cvUdWBGLgKrEnfkvweK8AloSs9qnsYDYogJeElv2tYPFOQU0JdrXnGeF qBGU+DH5HlgNs4C8xL79U1khbB2Js8fWgc2UEFjDJnGrKRjiaheJzt3BEGFhiVfHt7BD2DIS lyd3s4DcJiHQzCjxbcceZojEBEaJPeuFIGxricPHL0LN55OYtG06M8RMXomONqgSD4n5X/ZD zXSU6F3YwQYPlHuf57FMYJSdheTsWUjOnoXk7AWMzKsYxVNLi3PTU4uN81LL9YoTc4tL89L1 kvNzNzEC08Hpf8e/7mDc9yfpEKMAB6MSD69B3osoIdbEsuLK3EOMEhzMSiK8KzueRQnxpiRW VqUW5ccXleakFh9ilOZgURLnjdOoixISSE8sSc1OTS1ILYLJMnFwSjUw2muaGUzP8FIqYa+W fFHRbjnt24MDWsn7DLXf/uCU+nvhrUWxXJeh3/KoI7y9IU2d3GIOukrNRgWbw3bGXOlIi9Ht V5xzcq9myQxxjtXXWm3WNjjJX3h4ReGs8dvlxbZn2kPW3WTbN3fRHtl7E7/xpn65sPPKo9n8 n8uSTN/dd5F/fnOL3NNeJZbijERDLeai4kQAE+pRdgMDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xa7qMvS+jDLb0MFvM+yxrMf/KNVaL y7vmsFl87j3CaDHj/D4miycP+9gc2Dx2zrrL7rF4z0smjzvX9rB5fN4kF8ASxWWTkpqTWZZa pG+XwJVxeMFHtoIj0hWnr3WwNzD2iHUxcnBICJhIXNht0MXIxSEksIRRYt3eu0xdjJxAzl9G ie3vLUFsNgEriYntqxhBbBEBPYnG921MIA3MAqsYJVa29jKDJIQFYiSuTp4DVsQioCpxZ/5L sEG8AloSs9qnsYDYogJeElv2tYPFOQU0JdrXnGeF2LycUeL2q5uMEA2CEj8m3wNrYBaQl9i3 fyorhK0lsX7ncaYJjPyzkJTNQlI2C0nZAkbmVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIFh u+3Yzy07GLveBR9iFOBgVOLhNch7ESXEmlhWXJl7iFGCg1lJhHdlx7MoId6UxMqq1KL8+KLS nNTiQ4zSHCxK4rznDSqjhATSE0tSs1NTC1KLYLJMHJxSDYynciK+Bt0xyWSo3vKM08fou+2D tsqZ+Z8VTx26HPskYtHytye1TU7xW3w5oxvIVZI+2+LHREsXz60/d4R/t1eL33aF02jC/TXh GjMuWtpfiw6reqB4ncHhSZKQn4TFj7n9Txx7ZpXOP3yg+MolVTnHiY/M7vGdSro7Q2+vzs/3 oo+3G7dcblVVYinOSDTUYi4qTgQAMrRVLlcCAAA= X-CMS-MailID: 20180502100345eucas1p27280d10571f3e9d7c5b5a62a364dd439 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180502100345eucas1p27280d10571f3e9d7c5b5a62a364dd439 X-RootMTR: 20180502100345eucas1p27280d10571f3e9d7c5b5a62a364dd439 References: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> <1524743493-28113-17-git-send-email-b.zolnierkie@samsung.com> <20180501110239.GM27619@mai> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, May 01, 2018 01:02:39 PM Daniel Lezcano wrote: > On Thu, Apr 26, 2018 at 01:51:31PM +0200, Bartlomiej Zolnierkiewicz wrote: > > Cleanup code for enabling threshold interrupts in ->tmu_control > > method implementations. > > > > There should be no functional changes caused by this patch. > > > > Signed-off-by: Bartlomiej Zolnierkiewicz > > --- > > drivers/thermal/samsung/exynos_tmu.c | 101 ++++++++++++----------------------- > > 1 file changed, 34 insertions(+), 67 deletions(-) > > > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > > index abe0737..9639acf 100644 > > --- a/drivers/thermal/samsung/exynos_tmu.c > > +++ b/drivers/thermal/samsung/exynos_tmu.c > > @@ -76,9 +76,6 @@ > > #define EXYNOS_TMU_THERM_TRIP_EN_SHIFT 12 > > > > #define EXYNOS_TMU_INTEN_RISE0_SHIFT 0 > > -#define EXYNOS_TMU_INTEN_RISE1_SHIFT 4 > > -#define EXYNOS_TMU_INTEN_RISE2_SHIFT 8 > > -#define EXYNOS_TMU_INTEN_RISE3_SHIFT 12 > > #define EXYNOS_TMU_INTEN_FALL0_SHIFT 16 > > > > #define EXYNOS_EMUL_TIME 0x57F0 > > @@ -136,13 +133,6 @@ > > #define EXYNOS7_TMU_TEMP_MASK 0x1ff > > #define EXYNOS7_PD_DET_EN_SHIFT 23 > > #define EXYNOS7_TMU_INTEN_RISE0_SHIFT 0 > > -#define EXYNOS7_TMU_INTEN_RISE1_SHIFT 1 > > -#define EXYNOS7_TMU_INTEN_RISE2_SHIFT 2 > > -#define EXYNOS7_TMU_INTEN_RISE3_SHIFT 3 > > -#define EXYNOS7_TMU_INTEN_RISE4_SHIFT 4 > > -#define EXYNOS7_TMU_INTEN_RISE5_SHIFT 5 > > -#define EXYNOS7_TMU_INTEN_RISE6_SHIFT 6 > > -#define EXYNOS7_TMU_INTEN_RISE7_SHIFT 7 > > #define EXYNOS7_EMUL_DATA_SHIFT 7 > > #define EXYNOS7_EMUL_DATA_MASK 0x1ff > > > > @@ -615,29 +605,27 @@ static void exynos4210_tmu_control(struct platform_device *pdev, bool on) > > { > > struct exynos_tmu_data *data = platform_get_drvdata(pdev); > > struct thermal_zone_device *tz = data->tzd; > > - unsigned int con, interrupt_en; > > + unsigned int con, interrupt_en = 0, i; > > > > con = get_con_reg(data, readl(data->base + EXYNOS_TMU_REG_CONTROL)); > > > > if (on) { > > - con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT); > > - interrupt_en = > > - (of_thermal_is_trip_valid(tz, 3) > > - << EXYNOS_TMU_INTEN_RISE3_SHIFT) | > > - (of_thermal_is_trip_valid(tz, 2) > > - << EXYNOS_TMU_INTEN_RISE2_SHIFT) | > > - (of_thermal_is_trip_valid(tz, 1) > > - << EXYNOS_TMU_INTEN_RISE1_SHIFT) | > > - (of_thermal_is_trip_valid(tz, 0) > > - << EXYNOS_TMU_INTEN_RISE0_SHIFT); > > + for (i = 0; i < data->ntrip; i++) { > > + if (!of_thermal_is_trip_valid(tz, i)) > > + continue; > > + > > + interrupt_en |= > > + (1 << (EXYNOS_TMU_INTEN_RISE0_SHIFT + i * 4)); > > + } > > As EXYNOS_TMU_INTEN_RISE0_SHIFT is equal to zero, may be you can replace this > by BITS(i * 4) ? > > Same comments for exynos5433 and exynos7 below. Good point, I will replace it by using BIT() macro. > I don't know which one was intended : The one that doesn't change the driver behavior as stated in the patch description. > ((EXYNOS_TMU_INTEN_RISE0_SHIFT + i) * 4) or > (EXYNOS_TMU_INTEN_RISE0_SHIFT + (i * 4)) > > but if it is the former it is lucky it works because the macro is zero. > > Is it possible to have the registers layout, that would facilitate the review. I'm sorry but Exynos TMU documentation is not publicly available. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics