Received: by 10.213.65.68 with SMTP id h4csp224236imn; Fri, 23 Mar 2018 03:17:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELsKLQqsqIk0r80s3qrfSi6Lb78IkxiBuz/znQjTOlHyaYnlxySnR/N/CkNTbnXXTz1LLBz/ X-Received: by 2002:a17:902:8c93:: with SMTP id t19-v6mr12981126plo.301.1521800238513; Fri, 23 Mar 2018 03:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521800238; cv=none; d=google.com; s=arc-20160816; b=wbKrlo7DbEfAzIdVGGH7fGK3EaZRfU3rrGWpwCcTOA0WGS49zxuPcavOfPR/haIk+m 6zZX5hv0v71XSeU3HRN94WLu6nz5z/FYMCMx6WNzrwj/2eFGa/++ffRybjT9HGmXInj4 4fV4y+jH72JvB33/RHUttZYCg6QUysZvh80hZtbeoE95c1LJXw5DOYXxDArqEnLtZUy6 8XU70PLcF1CYRk7JuYlGAKYwm+jD0JN6EsCgkxtJy93Mh9A1Jrbw/jeK95W4laejgvb7 h9zLhGNOk+h0WkotZWgkN+SgR7JBKfFVjhxzkftOdgW+fBUBaz964s78H1Z4YX0nXLMA i0Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wdb4YuCSoOznzY9YyxGaq68f1edZJ9hmUldyNOwy1Yo=; b=sO2TVzLwF4DQZTHNt1t8QMuNWXuYg12a3HU09Z9FDtW1l/ysscA0VEoWt1IARAxh3L zpuxpDiBncyU0Dg6eQF92difdHrGgRsG/7reNT1VQbbLfuQV/d/3saB3RVEOVtgYQxhK Q5gfsIy5o3eNAXKnx2TiPB2QLL5HMA0PPy6/0K/u3Pzh7KQZitT167S58Pvg6jFG58Q6 lvSLAYHBrcDC2yHj3L3M4ag7DCQtvwgRU6g9t5w1RGA5/kRmI81SLRlaxNeCWXnoiAhr 1XNXwIe2PXE2dB3JqP+nGpWuqY/RUmTcD37rZ9pWXWIvrj6+lIL1cTiIDwWbRgywKfxC vTKA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si5761831pgc.717.2018.03.23.03.17.03; Fri, 23 Mar 2018 03:17:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933568AbeCWKP6 (ORCPT + 99 others); Fri, 23 Mar 2018 06:15:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46494 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933234AbeCWKPz (ORCPT ); Fri, 23 Mar 2018 06:15:55 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A8A2D37; Fri, 23 Mar 2018 10:15:54 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yangbo Lu , Adrian Hunter , Ulf Hansson , Sasha Levin Subject: [PATCH 4.4 55/97] mmc: sdhci-of-esdhc: limit SD clock for ls1012a/ls1046a Date: Fri, 23 Mar 2018 10:54:42 +0100 Message-Id: <20180323094200.742771593@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: yangbo lu [ Upstream commit a627f025eb0534052ff451427c16750b3530634c ] The ls1046a datasheet specified that the max SD clock frequency for eSDHC SDR104/HS200 was 167MHz, and the ls1012a datasheet specified it's 125MHz for ls1012a. So this patch is to add the limitation. Signed-off-by: Yangbo Lu Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-of-esdhc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -418,6 +418,20 @@ static void esdhc_of_set_clock(struct sd if (esdhc->vendor_ver < VENDOR_V_23) pre_div = 2; + /* + * Limit SD clock to 167MHz for ls1046a according to its datasheet + */ + if (clock > 167000000 && + of_find_compatible_node(NULL, NULL, "fsl,ls1046a-esdhc")) + clock = 167000000; + + /* + * Limit SD clock to 125MHz for ls1012a according to its datasheet + */ + if (clock > 125000000 && + of_find_compatible_node(NULL, NULL, "fsl,ls1012a-esdhc")) + clock = 125000000; + /* Workaround to reduce the clock frequency for p1010 esdhc */ if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) { if (clock > 20000000)