Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp932981imm; Fri, 13 Jul 2018 08:41:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeHzAgrscttY+5LcYxBe8PNtN5NgExaH9rFQGfG9KGnwuxJK3TTOs9ptzfGqTJpQaeFV+2R X-Received: by 2002:a63:9d87:: with SMTP id i129-v6mr6331522pgd.395.1531496462781; Fri, 13 Jul 2018 08:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531496462; cv=none; d=google.com; s=arc-20160816; b=kx/MvQP/VPW1hFHCGznY9Y74oODNoSBVIdoos/0DhmUPwk4ljM2tueQvd7QWWkDW5g ENI8qITHwIhVKDPcJsv6xLKkIANz3GOdziIR2SP52hrEOgsXNHF4/DscHiDPYIjSm6lo 07Lz2a8Hn3GNvuw/QCQOpqP023X0pkpbkPzdhLx2TDjFr1q6i5Aok7sdBepAns8HMfMR AIFIfcqQE4NJfEzgUy2golSzDRVu4ZrYv2JtW4kN9s9rVgCbJLcMnWb8KLZoLbMoyNqY tRIYJJfrSeWA5BzJo5Fuu4iUvDU3q/RhAyQFhXat+zxTUPNil8GlYEpy8v0uqF0shzld L5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Appa/0kMU2RES0LFhNkl71k+0qEGEd0X6Gx7qSMgVGU=; b=WWLZi8WaHLYGR9r3e+3yeGb1xAaZY6kYtYnrW2CogoZwZSxI/5lvw5NGv/pOzvWOHN dtgHYstLs24cEdEXXw0NN3uH0HIIwZZEy3pZLdv8qJxo9MB/XTj7OokFhnK2V0gt/cmo FAd6YH2f5qUTikOSrn57pi1e+Q9uOjuJLeBiGjkapyGhNHziPlzGof1QoSoQ27MEmfV3 zEBvbtepDc4Xnm2jWVMPdfPf/iU4cnfvqNEzDRS9SR4qbttL8NX7ipN7KKsQiVPvvnMp bQ9ueQWMf9+kFiBjw29Nc9aylsL0R2FrsS8HyHn8nWVW65gyBMwQFz9cTsiY1P8a4V2s 5UQQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n24-v6si23849158pgb.665.2018.07.13.08.40.48; Fri, 13 Jul 2018 08:41:02 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732723AbeGMPyn (ORCPT + 99 others); Fri, 13 Jul 2018 11:54:43 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7284 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729771AbeGMPym (ORCPT ); Fri, 13 Jul 2018 11:54:42 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1, AES128-SHA) id ; Fri, 13 Jul 2018 08:39:30 -0700 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 13 Jul 2018 08:39:34 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 13 Jul 2018 08:39:34 -0700 Received: from dhcp-10-21-25-168 (10.21.25.201) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 13 Jul 2018 15:39:31 +0000 Date: Fri, 13 Jul 2018 18:39:25 +0300 From: Aapo Vienamo To: Jon Hunter CC: Ulf Hansson , Adrian Hunter , Thierry Reding , Marcel Ziswiler , , , Subject: Re: [PATCH] mmc: tegra: Add and use tegra_sdhci_get_max_clock() Message-ID: <20180713183925.67d7d5f4@dhcp-10-21-25-168> In-Reply-To: <6af41450-4770-3b2d-05b8-914f90743a7e@nvidia.com> References: <1531487865-17427-1-git-send-email-avienamo@nvidia.com> <6af41450-4770-3b2d-05b8-914f90743a7e@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.21.25.201] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To HQMAIL101.nvidia.com (172.20.187.10) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Jul 2018 15:01:21 +0100 Jon Hunter wrote: > On 13/07/18 14:17, Aapo Vienamo wrote: > > Implement and use tegra_sdhci_get_max_clock() which returns the true > > maximum host clock rate. The issue with tegra_sdhci_get_max_clock() is > > Don't you mean sdhci_pltfm_clk_get_max_clock above? Does this function > need fixing then? Or at least should there be another variant added > because there is nothing Tegra specific we are doing below? There are several drivers which use sdhci_pltfm_clk_get_max_clock() in its current state and changing it could have unforeseen side-effects on drivers which I'm unable to test. Adding another variant of sdhci_pltfm_clk_get_max_clock() would probably be a more feasible approach. > > that it returns the current clock rate of the host instead of the > > maximum one, which can lead to unnecessarily small clock rates. > > > > This differs from the previous implementation of > > tegra_sdhci_get_max_clock() in that it doesn't divide the result by two. > > Why? As far as I can tell the original tegra_sdhci_get_max_clock() was implemented this way in order to force sdhci_calc_clk() to always set the SDHCI clock divider to two on sdhci_set_clock(). The requirement to configure the SDHCI divider to two is specific to DDR50/52 modes on Tegra. The .get_max_clock() callback retuning half of the actual maximum will result in HS200 and HS400 modes not being able to run at full speed. Another mechanism to enforce the divider requirement has to be figured out in order to enable DDR50/52 modes on Tegra SoCs. -Aapo