From patchwork Thu Aug 31 09:29:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 111365 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp2267834qge; Thu, 31 Aug 2017 02:30:10 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7Iz5WngY1QtYSNtzLoyDvhhvW2F9Ziao8qiuRKektKJPJGEZE38Q9gG+lAV7KbjYPUMhFC X-Received: by 10.99.125.91 with SMTP id m27mr1671850pgn.258.1504171810766; Thu, 31 Aug 2017 02:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504171810; cv=none; d=google.com; s=arc-20160816; b=odPPErDJsiXp6aNvN4WLW+qB1nuzfxlaCarRWHs7MGQ72N/IOm7vIyElIrEigTWzCA tJeBRtCMRlKVo0HZ5a4wQ0h+VQKVmITLqxJLSZXWHVePwhZj7S4KjGNpQ1NDfD5A9Ar7 5AvLQ48zTkBp4XTpqiC78o1mctjOwtY6+M4+yGR7tZ/1DwsyRPIJY58exr6h0F9UEZq5 6Rywg/5OA+OkSdsyRU3Dhu6riFkO6xOomldK24alDhP8HrovDkH1md6H0QM0Pfl1lbA6 3pB0WqJZmA6JA7I5yELP+gCDMKcyL0HQ80o0zwz5b+hM2+VKDmyhhDgwnFaOW/Sfo8tm bObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=DCwkui3N7GfHoD8Es9ycQuCdVGRvSsQSj+fukTzb5GQ=; b=DbIBo1O15nH8EeuLQm0BHYmUWG3+Vxf5tcoPEH9Oh8Dqy4M7DQ8sUgDHYaqOmzcAgH Xo5FAeEJoICNeuuO/pTiKrWOj62Dxsuwk3XnHCiWHLA8/BlrPDEB36AfwUEhFWS3jVEe 5wR5Ed4D6G2/yxGbLfgXE9Umiizepg4qkUfa0EkQkd7ARRqe50xSdK9olRkq/9afEV0o HgFhdilAg7edGsFckKtn9jdVw2dCw1L48kKjluVgfq7x73w+8cEUCF2HQwAgTqGrpQFL xw/QIn2DO2Ogw0b/8W0Z5plYIg2fcJOgMW4rOh4aqzPUnxtxFykddabTLAw70M92Ec33 FPKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=nFjU4j4X; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si6307511pgo.600.2017.08.31.02.30.09; Thu, 31 Aug 2017 02:30:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=nFjU4j4X; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbdHaJaH (ORCPT + 6 others); Thu, 31 Aug 2017 05:30:07 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36741 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbdHaJaE (ORCPT ); Thu, 31 Aug 2017 05:30:04 -0400 Received: by mail-wm0-f41.google.com with SMTP id f127so879391wmf.1 for ; Thu, 31 Aug 2017 02:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UsMAAleqj5gLgOMuOWdTQr+fsvj/JHlXcfSONX1Rolc=; b=nFjU4j4XRfJ8XlOd9CPntCNM3uRJPLOjVEZlJYFJYnJ+HqzPSOsRRcg27fQGV4dRQ9 mJJdo6K6xDic4uTFtbKw9UOpWJmoFaCKvyYGHYYFu1v59bRyQQQXfjbozuae/Ljn2Y9z TzD7jc0KPOCnREaGJY4StiB6zN5UZMEmzd4fvYEKSWbuS9L/Kr/clnn5V9o+M2SZVWhg WSfhtpdAJZDvS6bnahYANMatu21PIht0dn+ti+FVStdYnEXBcN9xRZCCquQm0xoXGohq U6NdZTGnjzCNw24dZdn8U/R1mALU9COYisWlpnppDodsJuRMDy9wAwKT8oNvEqUOoyDw 1JCg== 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=UsMAAleqj5gLgOMuOWdTQr+fsvj/JHlXcfSONX1Rolc=; b=g0rucIkF0iEHG17YnJS7nqGBauSoF4E6p1ZXwYfWLOFztc6k/ZAIsNhp+kux0OAFwG QBxGkkHr9T4GmaSDZWDKCHkJZiHw4Ssdb+avFMTa/P550d77eQgodhWQ5/KiqxtoPcCS To8F/HKJOTwVI2+AsnpOR5GmzDW5cKB6XxURPE1wjyM9eKsfR+QkWd4X9X6Y9BRDPSto kw/PoTJTOWP5WPEuK0Z7wgkS4YKboZQI/t2B2puVLGfHmepXYKI46DFcAH4AX0x0bGg0 WeP/6bwHnpSxJBVbAKK0g4Fed6XB2qVLiq8gnbPRuSRfpJf5LkDZf3V/Is87oFlPlEdS gCGw== X-Gm-Message-State: AHYfb5j7umAOyDuaQ8VsVIwUdKRfMfJ4Bww4pzV63bZXOq/YQPldbnIz KrSTUAQO/z8GPNfV X-Received: by 10.28.99.7 with SMTP id x7mr106503wmb.30.1504171802801; Thu, 31 Aug 2017 02:30:02 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id g15sm1825622wrb.79.2017.08.31.02.30.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Aug 2017 02:30:02 -0700 (PDT) From: Jerome Brunet To: Ulf Hansson Cc: Jerome Brunet , linux-mmc@vger.kernel.org, Kevin Hilman , linux-amlogic@lists.infradead.org Subject: [PATCH] mmc: meson-gx: fix __ffsdi2 undefined on arm32 Date: Thu, 31 Aug 2017 11:29:58 +0200 Message-Id: <20170831092958.31948-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <201708310823.lfxGt2Kh%fengguang.wu@intel.com> References: <201708310823.lfxGt2Kh%fengguang.wu@intel.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Using __bf_shf does not compile on arm 32 architecture. This has gone unnoticed till now cause the driver is only used on arm64. In addition, __bf_shf was already used in the driver without any issue. It was used on a constant value, so the call was probably optimized away. Replace __bf_shf by __ffs fixes the problem Signed-off-by: Jerome Brunet --- Hi Ulf, Sorry for not catching this earlier. If you still intend to keep the series applied in next, here is a fixup patch to squash with the offending commit during your rebase. Regards Jerome drivers/mmc/host/meson-gx-mmc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 2fa18faa7f0f..7d7aa2389b7c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -201,13 +201,13 @@ static int meson_mmc_clk_get_phase(struct clk_hw *hw) u32 val; val = readl(mmc->reg); - p = (val & mmc->phase_mask) >> __bf_shf(mmc->phase_mask); + p = (val & mmc->phase_mask) >> __ffs(mmc->phase_mask); degrees = p * 360 / phase_num; if (mmc->delay_mask) { period_ps = DIV_ROUND_UP((unsigned long)NSEC_PER_SEC * 1000, clk_get_rate(hw->clk)); - d = (val & mmc->delay_mask) >> __bf_shf(mmc->delay_mask); + d = (val & mmc->delay_mask) >> __ffs(mmc->delay_mask); degrees += d * mmc->delay_step_ps * 360 / period_ps; degrees %= 360; } @@ -223,11 +223,11 @@ static void meson_mmc_apply_phase_delay(struct meson_mmc_phase *mmc, val = readl(mmc->reg); val &= ~mmc->phase_mask; - val |= phase << __bf_shf(mmc->phase_mask); + val |= phase << __ffs(mmc->phase_mask); if (mmc->delay_mask) { val &= ~mmc->delay_mask; - val |= delay << __bf_shf(mmc->delay_mask); + val |= delay << __ffs(mmc->delay_mask); } writel(val, mmc->reg); @@ -254,7 +254,7 @@ static int meson_mmc_clk_set_phase(struct clk_hw *hw, int degrees) r = do_div(p, 360 / phase_num); d = DIV_ROUND_CLOSEST(r * period_ps, 360 * mmc->delay_step_ps); - d = min(d, mmc->delay_mask >> __bf_shf(mmc->delay_mask)); + d = min(d, mmc->delay_mask >> __ffs(mmc->delay_mask)); } meson_mmc_apply_phase_delay(mmc, p, d); @@ -518,7 +518,7 @@ static int meson_mmc_clk_init(struct meson_host *host) init.num_parents = MUX_CLK_NUM_PARENTS; mux->reg = host->regs + SD_EMMC_CLOCK; - mux->shift = __bf_shf(CLK_SRC_MASK); + mux->shift = __ffs(CLK_SRC_MASK); mux->mask = CLK_SRC_MASK >> mux->shift; mux->hw.init = &init; @@ -540,7 +540,7 @@ static int meson_mmc_clk_init(struct meson_host *host) init.num_parents = 1; div->reg = host->regs + SD_EMMC_CLOCK; - div->shift = __bf_shf(CLK_DIV_MASK); + div->shift = __ffs(CLK_DIV_MASK); div->width = __builtin_popcountl(CLK_DIV_MASK); div->hw.init = &init; div->flags = (CLK_DIVIDER_ONE_BASED |