From patchwork Mon Mar 11 05:05:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 2246621 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9ECC93FC8F for ; Mon, 11 Mar 2013 05:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751929Ab3CKFGZ (ORCPT ); Mon, 11 Mar 2013 01:06:25 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:45347 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305Ab3CKFGW (ORCPT ); Mon, 11 Mar 2013 01:06:22 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2B56GUb020760; Mon, 11 Mar 2013 00:06:16 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2B56DZf008065; Mon, 11 Mar 2013 10:36:15 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Mon, 11 Mar 2013 10:36:13 +0530 Received: from a0131933lt.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2B56BMU012019; Mon, 11 Mar 2013 10:36:13 +0530 From: Lokesh Vutla To: , , CC: , , Lokesh Vutla Subject: [PATCH 1/8] memory: emif: Correct the lpmode timeout calculation Date: Mon, 11 Mar 2013 10:35:58 +0530 Message-ID: <1362978365-5593-2-git-send-email-lokeshvutla@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1362978365-5593-1-git-send-email-lokeshvutla@ti.com> References: <1362978365-5593-1-git-send-email-lokeshvutla@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The driver tries to round up the specified timeout cycles to the next power of 2 value. But this is done wrongly. Correcting this here. Reported-by: Nishanth Menon Signed-off-by: Lokesh Vutla Acked-by: Santosh Shilimkar --- drivers/memory/emif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index df08736..622638c 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -732,9 +732,9 @@ static u32 get_pwr_mgmt_ctrl(u32 freq, struct emif_data *emif, u32 ip_rev) if (timeout < 16) { timeout = 0; } else { - timeout = __fls(timeout) - 3; if (timeout & (timeout - 1)) - timeout++; + timeout <<= 1; + timeout = __fls(timeout) - 3; } switch (lpmode) {