Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753616AbcC1GHW (ORCPT ); Mon, 28 Mar 2016 02:07:22 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:31104 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbcC1GHS (ORCPT ); Mon, 28 Mar 2016 02:07:18 -0400 X-AuditID: cbfec7f4-f796c6d000001486-01-56f8ca127aaa Subject: Re: Warnings for invalid VDD (sdhci-s3c) To: Adrian Hunter , Jisheng Zhang , Jaehoon Chung References: <20160324155840.50474b98@xhacker> <56F3A0B7.4050509@samsung.com> <20160324162449.29c9cf78@xhacker> <56F3A88F.50603@samsung.com> <56F3E77D.7030201@intel.com> <56F3E9EB.3090207@intel.com> Cc: Ulf Hansson , ludovic.desroches@atmel.com, "Ivan T. Ivanov" , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org From: Krzysztof Kozlowski Message-id: <56F8CA0C.2080908@samsung.com> Date: Mon, 28 Mar 2016 15:07:08 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-version: 1.0 In-reply-to: <56F3E9EB.3090207@intel.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsVy+t/xa7pCp36EGUx/qWBx8skaNovL82ey W9z41cZq8e74bhaL1y8MLS7vmsNmceR/P6PFjPP7mCwOzUy2OL423IHLY8GvrSwei/e8ZPK4 c20Pm8fkhReZPfq2rGL0+LxJLoAtissmJTUnsyy1SN8ugSvjSNtp9oLz4hU7Z0k3ME4T7mLk 5JAQMJG4cec8O4QtJnHh3nq2LkYuDiGBpYwSFxd1MUI4TxklmvYvYwapEhYwlOidfocRxBYR qJI4MOMsO0TRJCaJhr2PwdqZBS4wSry+cAasg03AWGLz8iVsIDavgJbE/rvHwLpZBFQlJjQ/ YAKxRQUiJJ7MPckIUSMo8WPyPRYQm1NAU2Lxue9ANgfQUD2J+xe1QMLMAvISm9e8ZZ7AKDAL SccshKpZSKoWMDKvYhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAiJgy87GBcfszrEKMDBqMTD m2H5I0yINbGsuDL3EKMEB7OSCG/BNqAQb0piZVVqUX58UWlOavEhRmkOFiVx3rm73ocICaQn lqRmp6YWpBbBZJk4OKUaGFPnvIvKXJLlJx7PG+pQ8tZB2GP6SfYtv5boPt8Qc2vSX17Rxble oW3ufF8PHopTiFO7J3GzKu/6DMPur4cNHu/dYv9B4pirVJLtmlu8q3gyvFK25uWurny8vfTY nYxuzrjtArUnH0wSFSyREl/x0cWvOP/DG5G8xOWXBGZNivH/V6m24HbMayWW4oxEQy3mouJE AMZUhEZ/AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2939 Lines: 82 On 24.03.2016 22:21, Adrian Hunter wrote: > On 24/03/16 15:11, Adrian Hunter wrote: >> On 24/03/16 10:42, Krzysztof Kozlowski wrote: >>> On 24.03.2016 17:24, Jisheng Zhang wrote: >>>> Hi, >>>> >>>> On Thu, 24 Mar 2016 17:09:27 +0900 Jaehoon Chung wrote: >>>> >>>>> Hi, >>>>> >>>>> On 03/24/2016 04:58 PM, Jisheng Zhang wrote: >>>>>> Hi, >>>>>> >>>>>> On Thu, 24 Mar 2016 16:28:56 +0900 Krzysztof Kozlowski wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> After 918f4cbd4340 ("mmc: sdhci: restore behavior when setting VDD via >>>>>>> external regulator") On Trats2 board I see warnings for invalid VDD >>>>>>> value (2.8V): >>>>>>> >>>>>>> [ 3.119656] ------------[ cut here ]------------ >>>>>>> [ 3.119666] WARNING: CPU: 3 PID: 90 at >>>>>>> ../drivers/mmc/host/sdhci.c:1234 sdhci_do_set_ios+0x4cc/0x5e0 >>>>>>> [ 3.119669] mmc0: Invalid vdd 0x10 >>>>>> >>>>>> Per my understanding, the wrong vdd indicates a wrong ocr, what's the voltage of >>>>>> this host's vmmc regulator? >>>>> >>>>> As i know, it's fixed-voltage with gpio on trats2. It's 2.8V. >>>>> I didn't check this entirely..need to check ocr value. >>>>> >>>> >>>> I may know the reason. the vmmc is 2.8v, then mmc_regulator_get_supply() convert >>>> the value to a ocr as 0x10. The key here is that the 2.8v is invalid in SDHCI >>>> case and isn't accepted by current sdhci driver. >>> >>> Yeah, I already wrote that. It is the part of the warning and my email. >>> Our regulator is fixed at 2.8 which is 0x10. :) >>> >>>> I dunno the elegant solution to handle this case, let's wait for sdhci maintainers >>>> idea. >>> >>> Hmm... >> >> I haven't tested it, but what about this: > > And now with checkpatch complaints fixed: > > From: Adrian Hunter > Date: Thu, 24 Mar 2016 14:29:24 +0200 > Subject: [PATCH V2] mmc: sdhci: Fix regression setting power on Trats2 board > > Several commits relating to setting power have been introducing > problems by putting driver-specific rules into generic SDHCI code. > > Fix by adding a 'set_power' callback and restoring the default > behaviour prior to commit 918f4cbd4340 ("mmc: sdhci: restore > behavior when setting VDD via external regulator"). The desired s/behavior/behaviour/ > behaviour of that commit is gotten by having sdhci-pxav3 provide > its own set_power callback. > > Reported-by: Krzysztof Kozlowski > Fixes: 918f4cbd4340 ("mmc: sdhci: restore behavior when setting VDD...) > Signed-off-by: Adrian Hunter > Cc: stable@vger.kernel.org # v4.5+ > --- > drivers/mmc/host/sdhci-pxav3.c | 17 +++++++++++++++++ > drivers/mmc/host/sdhci.c | 38 ++++++++++++++++++++++++++++++-------- > drivers/mmc/host/sdhci.h | 4 ++++ > 3 files changed, 51 insertions(+), 8 deletions(-) > Works for me (sdhci-s3c, Exynos4412 on Trats2 board): Tested-by: Krzysztof Kozlowski Best regards, Krzysztof