From patchwork Wed Aug 7 19:23:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11082573 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 204FF14DB for ; Wed, 7 Aug 2019 19:23:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E0EE205F8 for ; Wed, 7 Aug 2019 19:23:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01B7328A44; Wed, 7 Aug 2019 19:23:48 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C8D228A01 for ; Wed, 7 Aug 2019 19:23:48 +0000 (UTC) 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:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Yiuw6WFDCzLhF6JEC+LvtDVmzkByb2hags6xZmUWVeY=; b=ez68RbUOdxvt22 bfi7081CShlV658d41csyA0mFafrxb0MYywgiYrCivfXPgU7C0+qeWT/pm4YhvXZwWtQmd6ygBPOh YMtcoDXxjkSvLzusT7qhNI6LMtRR8eI3gg9hJ1W8wTQnuhCHbsXVdXfNSL6es2DbsWOiABb8K9ppi wi9qvhXTST8RZHRUKeBx2dpaYywkdeF/Ay7zvfX63sAznSf5cR1nHyCvI9S9iWxorT3nFJR4tD5tS Ka3O+gTTj6dCn2hEDDSf3Lkaj0jOsL0D0JBKLcreyDaBlaSMyQ/gKbDS5IQBGk68bqhysrgOVfvRx 4ZKS3JCjXCLyuGEHpsxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvRXG-00052t-RQ; Wed, 07 Aug 2019 19:23:46 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvRXD-00052S-Ad; Wed, 07 Aug 2019 19:23:45 +0000 Received: by mail-wm1-x344.google.com with SMTP id s3so11957wms.2; Wed, 07 Aug 2019 12:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZKsoxc607/oVG4FUuBA6pIcOKMffd677oTtTK5nzkwQ=; b=hAbyL2kbAFr/v1igXbo/LxpM6rdjv8gVdpmorEKD5FUrB1ZYcimF1qaQyLZMb6TYhW QzjkRAErG1RegaWbCDdgGVUKwymrAJ/l+pGyRNvoPbXDKXge8tgQSb/geI+cOWjnRCmF 7S+MdI3tJIe3MxAgCLb1JPFwc7Iw0cXhq+bepW2li//lnMzfGH0Xze2qLht+6u85znTJ b9RL7RNC9Ed/4MNuYeQ6PkUu8BWDc32Q97oGYvVmVAdzCrr6ofUU9a39FOw7h1OGyn1n +sByh2bvE5LGEsst6gBAnGXTGpX7uyB2s6FVWLRXQJYOabz+3oz+SyUV5D9QlPrf8+2j A9cg== 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:mime-version :content-transfer-encoding; bh=ZKsoxc607/oVG4FUuBA6pIcOKMffd677oTtTK5nzkwQ=; b=sDtFcinfUjmNmXqj5xrnm8AFTOg77P1Up6Qzv4YYjChuCT1ZaVdrWczVniuu3MutPy dV0nLojcLJGgAeadf0H1wsC9Y3fbBcZv8nUapy6luOlfqZ1oXgSFmFWcXBvXZyz/64Ra M7RAtrD7lI5xnGdKrcTe84xgImXuC6KTSnNkt1HVFrKktlUfwkeb408UorBYJLb98DTm 3nJHeZzur0MAB9co9TzusMi5NFPl6AveHZ/2/1CJgQsV8vJiH2xj+4Q3W+Z9sbCNh/gN 2uGgV2PYH5jSPeMOYAJxGcD0lAJJKQJG7aO2s8pfHY7ec/w/7iae5nNaAbZ2ArXwYXlT rKZg== X-Gm-Message-State: APjAAAVgUA3JYHrit8VmH1yY7NzZufbCuVRxg1sJ7F9gs/rHUcr2uKvM ftuW5lMEWM7TpEy8t8HgrhI= X-Google-Smtp-Source: APXvYqzrB/Ac6gK6PxwJ5f0X0aWnErXK6rJNnENn30REBvhx246EotYXNh2vR//dxdH43icmi3BPGw== X-Received: by 2002:a1c:f415:: with SMTP id z21mr21203wma.34.1565205821315; Wed, 07 Aug 2019 12:23:41 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id t13sm109820555wrr.0.2019.08.07.12.23.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 12:23:40 -0700 (PDT) From: Nathan Chancellor To: Kishon Vijay Abraham I , Heiko Stuebner Subject: [PATCH] phy-rockchip-inno-hdmi: Fix RK3328_TERM_RESISTOR_CALIB_SPEED_7_0's third value Date: Wed, 7 Aug 2019 12:23:05 -0700 Message-Id: <20190807192305.6604-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190807_122343_395696_22ED8173 X-CRM114-Status: GOOD ( 11.67 ) 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: "kernelci . org bot" , Andrzej Hajda , Naresh Kamboju , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nathan Chancellor , Robin Murphy , Guenter Roeck Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP After commit "linux/bits.h: Add compile time sanity check of GENMASK inputs" [1], arm64 defconfig builds started failing: In file included from ../include/linux/bits.h:22, from ../include/linux/bitops.h:5, from ../include/linux/kernel.h:12, from ../include/linux/clk.h:13, from ../drivers/phy/rockchip/phy-rockchip-inno-hdmi.c:9: ../drivers/phy/rockchip/phy-rockchip-inno-hdmi.c: In function 'inno_hdmi_phy_rk3328_power_on': ../include/linux/build_bug.h:16:45: error: negative width in bit-field '' 16 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); })) | ^ ../include/linux/bits.h:24:18: note: in expansion of macro 'BUILD_BUG_ON_ZERO' 24 | ((unsigned long)BUILD_BUG_ON_ZERO(__builtin_choose_expr( \ | ^~~~~~~~~~~~~~~~~ ../include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK' 39 | (GENMASK_INPUT_CHECK(high, low) + __GENMASK(high, low)) | ^~~~~~~~~~~~~~~~~~~ ../drivers/phy/rockchip/phy-rockchip-inno-hdmi.c:24:42: note: in expansion of macro 'GENMASK' 24 | #define UPDATE(x, h, l) (((x) << (l)) & GENMASK((h), (l))) | ^~~~~~~ ../drivers/phy/rockchip/phy-rockchip-inno-hdmi.c:201:50: note: in expansion of macro 'UPDATE' 201 | #define RK3328_TERM_RESISTOR_CALIB_SPEED_7_0(x) UPDATE(x, 7, 9) | ^~~~~~ ../drivers/phy/rockchip/phy-rockchip-inno-hdmi.c:1046:26: note: in expansion of macro 'RK3328_TERM_RESISTOR_CALIB_SPEED_7_0' 1046 | inno_write(inno, 0xc6, RK3328_TERM_RESISTOR_CALIB_SPEED_7_0(v)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As pointed out by Robin and Guenter, inno_write's val argument is an 8-bit value so having a mask larger than that doesn't make sense. This also matches the rest of the *_7_0 macros in this driver. [1]: https://lore.kernel.org/lkml/20190801230358.4193-2-rikard.falkeborn@gmail.com/ Reported-by: Andrzej Hajda Reported-by: Guenter Roeck Reported-by: kernelci.org bot Reported-by: Naresh Kamboju Suggested-by: Guenter Roeck Suggested-by: Robin Murphy Signed-off-by: Nathan Chancellor Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner --- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c index b10a84cab4a7..2b97fb1185a0 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c @@ -198,7 +198,7 @@ #define RK3328_BYPASS_TERM_RESISTOR_CALIB BIT(7) #define RK3328_TERM_RESISTOR_CALIB_SPEED_14_8(x) UPDATE((x) >> 8, 6, 0) /* REG:0xc6 */ -#define RK3328_TERM_RESISTOR_CALIB_SPEED_7_0(x) UPDATE(x, 7, 9) +#define RK3328_TERM_RESISTOR_CALIB_SPEED_7_0(x) UPDATE(x, 7, 0) /* REG:0xc7 */ #define RK3328_TERM_RESISTOR_50 UPDATE(0, 2, 1) #define RK3328_TERM_RESISTOR_62_5 UPDATE(1, 2, 1)