Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753465AbcDSJt1 (ORCPT ); Tue, 19 Apr 2016 05:49:27 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:39339 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbcDSJtY (ORCPT ); Tue, 19 Apr 2016 05:49:24 -0400 X-AuditID: cbfee68d-f79e86d0000012da-85-5715ff1b9a65 Message-id: <5715FF1B.80402@samsung.com> Date: Tue, 19 Apr 2016 18:49:15 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Olliver Schinagl , Ulf Hansson Cc: Maxime Ripard , Chen-Yu Tsai , Venu Byravarasu , Adrian Hunter , Michal Hocko , Lars-Peter Clausen , Sudeep Holla , Sergei Shtylyov , Wolfram Sang , Wenkai Du , Chaotian Jing , Kuninori Morimoto , Hans de Goede , Michal Suchanek , linux-mmc , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree References: <1461049934-12848-1-git-send-email-oliver@schinagl.nl> <1461049934-12848-2-git-send-email-oliver@schinagl.nl> <5715FD6B.5000809@schinagl.nl> In-reply-to: <5715FD6B.5000809@schinagl.nl> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Sf0yMcRzHfe/50VMcTz+Or6PRmUmIqytfYxZ/8PjDan61+SdXHpf10/NU 82OmUUNTOlezHXNa0eE4XShN6JHd+iWG6HLn6loW/ZDNqYVzT5fx33ufz+v7fr+/24fCgnSE nDqYmcNymep0BRmAm0JUh1Yt8MgS14y1xKKWfhOJumwGEg1ZL0pQ3R0cfX7WAFCVzkAgi6uL QK8bLpOo2XMeoPuWRgx9LIlDgxd6CdR+0+aHqlvrcWS9nYj6BC2GOt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ltUghNS85PyUzL91WyTs43jne1MzAUNfQ0sJcSSEvMTfV VsnFJ0DXLTMH6G0lhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGENY8brjhWM BV1KFd/O32BsYDwu2cXIySEhYCIx++56FghbTOLCvfVsXYxcHEICSxklrt99C+U8YJT4MauB EaSKV0BDYsniTnYQm0VAVWLS6d9gcTYBHYnt344zgdiiAmESD9btZYWoF5T4Mfke2AYRAX+J Q2+WMYEMZRaYwCax8fRENpCEsECwxN3HP1kgtj1mlPh+qh0swSmgLfH+yGqgDRxAHeoSU6bk goSZBeQlNq95yzyBUWAWkh2zEKpmIalawMi8ilEitSC5oDgpPdcoL7Vcrzgxt7g0L10vOT93 EyM4dT2T3sF4eJf7IUYBDkYlHt4VRaLhQqyJZcWVuYcYJTiYlUR47/4CCvGmJFZWpRblxxeV 5qQWH2I0BQbCRGYp0eR8YFrNK4k3NDYxM7I0Mje0MDI2VxLnffx/XZiQQHpiSWp2ampBahFM HxMHp1QDYwrzxaiPmcyn/0du6I4PEdYp2rr2gOWkQ38Lp6lte+kipLX93qGTVfc/fcj9s0nn 6vSl+09eqGg/Puf6bc5cw1MMtx5tlGdbHXanKkF2H8fNwj5mztut246e2tkqMdEy9/Ot1r8b jll9rj3fFudiujmc5axN1y+t9+GLnIqE3l5t6X8mVsh7b58SS3FGoqEWc1FxIgAcxEoqcwMA AA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4261 Lines: 99 Hi On 04/19/2016 06:42 PM, Olliver Schinagl wrote: > Hi Ulf, > > On 19-04-16 11:29, Ulf Hansson wrote: >> On 19 April 2016 at 09:12, Olliver Schinagl wrote: >>> In patch 81f8a7be66 Hans de Goede added a patch to allow marking an mmc >>> device as to having an broken HPI implementation. After talking some >>> with Hans, we now think it is actually the mmc controller that can be >>> broken and not support broken HPI's. >> I don't want us to invent a DT binding for something you *think* is a >> HW controller issue. >> >> Have you really excluded that this isn't a software issue? Me >> personally haven't been using HPI that much so I can't really tell >> about the code robustness from the mmc core (mmc protocol point of >> view). > Well this patch goes hand in hand so to speak with the broken-hpi patch introduced by him, he did most of the investigation. We just discussed how to handle it and asked me to cook up the patch. I didn't understand why add this property. Is this same patch? commit 81f8a7be6642b4c26ab681b2e0f4c4120a6de1b0 Author: Hans de Goede Date: Wed Apr 1 17:26:23 2015 +0200 mmc: Add support for marking hpi as broken through devicetree The eMMC on a tablet I've will stop working / communicating as soon as the kernel executes: mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HPI_MGMT, 1, card->ext_csd.generic_cmd6_time); There seems to be no way to reliable identify eMMC-s which have a broken hpi implementation, but at least for eMMC's which are soldered onto a board we can work around this by specifying that hpi is broken in devicetree. > > @hans, what do you think? >> >> Kind regards >> Uffe >> >>> This patch adds a new capability, mmc-broken-hpi, which allows us to >>> mark a broken hpi implementation on the host level. >>> >>> Signed-off-by: Olliver Schinagl >>> --- >>> drivers/mmc/core/host.c | 2 ++ >>> drivers/mmc/core/mmc.c | 2 +- >>> include/linux/mmc/host.h | 1 + >>> 3 files changed, 4 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c >>> index 6e4c55a..9b63b36 100644 >>> --- a/drivers/mmc/core/host.c >>> +++ b/drivers/mmc/core/host.c >>> @@ -270,6 +270,8 @@ int mmc_of_parse(struct mmc_host *host) >>> host->caps |= MMC_CAP_HW_RESET; >>> if (of_property_read_bool(np, "cap-sdio-irq")) >>> host->caps |= MMC_CAP_SDIO_IRQ; >>> + if (of_property_read_bool(np, "mmc-broken-hpi")) >>> + host->caps |= MMC_CAP_BROKEN_HPI; >>> if (of_property_read_bool(np, "full-pwr-cycle")) >>> host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE; >>> if (of_property_read_bool(np, "keep-power-in-suspend")) >>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c >>> index 4dbe3df..9a19562 100644 >>> --- a/drivers/mmc/core/mmc.c >>> +++ b/drivers/mmc/core/mmc.c >>> @@ -1592,7 +1592,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, >>> /* >>> * Enable HPI feature (if supported) >>> */ >>> - if (card->ext_csd.hpi) { >>> + if (card->ext_csd.hpi && !(host->caps & MMC_CAP_BROKEN_HPI)) { >>> err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, >>> EXT_CSD_HPI_MGMT, 1, >>> card->ext_csd.generic_cmd6_time); >>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h >>> index 8dd4d29..20f758e 100644 >>> --- a/include/linux/mmc/host.h >>> +++ b/include/linux/mmc/host.h >>> @@ -264,6 +264,7 @@ struct mmc_host { >>> #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ >>> #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ >>> #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ >>> +#define MMC_CAP_BROKEN_HPI (1 << 29) /* Host support for HPI is broken */ >>> #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ >>> #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ >>> >>> -- >>> 2.8.0.rc3 >>> > > >