Re: [RESEND PATCH v3 2/2] phy: Group vendor specific phy drivers

2017-03-14 Thread Jaehoon Chung
On 03/14/2017 03:22 PM, Vivek Gautam wrote:
> Adding vendor specific directories in phy to group
> phy drivers under their respective vendor umbrella.
> 
> Also updated the MAINTAINERS file to reflect the correct
> directory structure for phy drivers.
> 
> Signed-off-by: Vivek Gautam <vivek.gau...@codeaurora.org>
> Acked-by: Heiko Stuebner <he...@sntech.de>
> Acked-by: Viresh Kumar <viresh.ku...@linaro.org>
> Cc: Kishon Vijay Abraham I <kis...@ti.com>
> Cc: David S. Miller <da...@davemloft.net>
> Cc: Geert Uytterhoeven <geert+rene...@glider.be>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> Cc: Guenter Roeck <li...@roeck-us.net>
> Cc: Heiko Stuebner <he...@sntech.de>
> Cc: Viresh Kumar <viresh.ku...@linaro.org>
> Cc: Maxime Ripard <maxime.rip...@free-electrons.com>
> Cc: Chen-Yu Tsai <w...@csie.org>
> Cc: Sylwester Nawrocki <s.nawro...@samsung.com>
> Cc: Krzysztof Kozlowski <k...@kernel.org>
> Cc: Jaehoon Chung <jh80.ch...@samsung.com>
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-arm-...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org
> Cc: linux-o...@vger.kernel.org
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: linux-rockc...@lists.infradead.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: linux-...@vger.kernel.org

Reviewed-by: Jaehoon Chung <jh80.ch...@samsung.com>

[..snip..]

> ---



Re: [PATCH v3 1/6] mmc: add define for R1 response without CRC

2016-09-21 Thread Jaehoon Chung
On 09/21/2016 03:00 PM, Wolfram Sang wrote:
> On Tue, Sep 20, 2016 at 06:25:37PM +0900, Jaehoon Chung wrote:
>> Hi Wolfram,
>>
>> On 09/20/2016 05:57 AM, Wolfram Sang wrote:
>>> The core uses it for polling. Give drivers a proper define handle this
>>> case like for other response types.
>>>
>>> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
>>> ---
>>>  include/linux/mmc/core.h | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>>> index b01e77de1a74de..4caee099b63a28 100644
>>> --- a/include/linux/mmc/core.h
>>> +++ b/include/linux/mmc/core.h
>>> @@ -55,6 +55,9 @@ struct mmc_command {
>>>  #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
>>>  #define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
>>>  
>>> +/* Can be used by core to poll after switch to MMC HS mode */
>>> +#define MMC_RSP_R1_NO_CRC  (MMC_RSP_PRESENT|MMC_RSP_OPCODE)
>>
>> MMC_RSP_RQ_NO_CRC is described at Specification?
> 
> Yes. JEDEC eMMC Spec v5.1, chapter 6.6.2, in the note:
> 
> "NOTE While the actual timing change is done, the behavior of any
> command sent (like CMD13) cannot be guaranteed due to the asynchronous
> operation. Therefore it is not recommended to use CMD13 to check the
> busy completion of the timing change indication. In case CMD13 is used
> the host must ignore CRC errors, if appear."

Thanks for noticing this. I read the spec again.

Best Regards,
Jaehoon Chung

> 
> And the MMC core does that. In mmc_ops.c:
> 
> 70 if (ignore_crc)
> 71 cmd.flags &= ~MMC_RSP_CRC;
> 
> And ignore_crc is used in mmc.c (last 'true' parameter):
> 
> 1023 err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> 1024EXT_CSD_HS_TIMING, EXT_CSD_TIMING_HS,
> 1025card->ext_csd.generic_cmd6_time,
> 1026true, false, true);
> 
> This is why I put the comment above the define.
> 



Re: [PATCH v3 4/6] mmc: tmio: add eMMC support

2016-09-20 Thread Jaehoon Chung
On 09/20/2016 05:57 AM, Wolfram Sang wrote:
> We need to add R1 without CRC support, refactor the bus width routine a
> little and extend a quirk check. To support "non-removable;" we need a
> workaround which will be hopefully removed when reworking PM soon.
> 
> Signed-off-by: Wolfram Sang 
> ---
>  drivers/mmc/host/tmio_mmc.h |  3 +++
>  drivers/mmc/host/tmio_mmc_pio.c | 38 ++
>  2 files changed, 29 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> index 4b501f2d529f6e..637581faf756b1 100644
> --- a/drivers/mmc/host/tmio_mmc.h
> +++ b/drivers/mmc/host/tmio_mmc.h
> @@ -79,6 +79,9 @@
>  #define  CLK_CTL_DIV_MASK0xff
>  #define  CLK_CTL_SCLKEN  BIT(8)
>  
> +#define CARD_OPT_WIDTH8  BIT(13)
> +#define CARD_OPT_WIDTH   BIT(15)

Just confusing whether CARD_OPT_WIDTH is 4bit or 1bit?

> +
>  #define TMIO_BBS 512 /* Boot block size */
>  
>  /* Definitions for values the CTRL_SDIO_STATUS register can take. */
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index 46b5a456243b84..a0f05eb4f34490 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -340,7 +340,9 @@ static int tmio_mmc_start_command(struct tmio_mmc_host 
> *host, struct mmc_command
>  
>   switch (mmc_resp_type(cmd)) {
>   case MMC_RSP_NONE: c |= RESP_NONE; break;
> - case MMC_RSP_R1:   c |= RESP_R1;   break;
> + case MMC_RSP_R1:
> + case MMC_RSP_R1_NO_CRC:
> +c |= RESP_R1;   break;

Just wonder..It there case that hit "case MMC_RSP_R1_NO_CRC" ?

>   case MMC_RSP_R1B:  c |= RESP_R1B;  break;
>   case MMC_RSP_R2:   c |= RESP_R2;   break;
>   case MMC_RSP_R3:   c |= RESP_R3;   break;
> @@ -737,12 +739,13 @@ static int tmio_mmc_start_data(struct tmio_mmc_host 
> *host,
>   pr_debug("setup data transfer: blocksize %08x  nr_blocks %d\n",
>data->blksz, data->blocks);
>  
> - /* Some hardware cannot perform 2 byte requests in 4 bit mode */
> - if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) {
> + /* Some hardware cannot perform 2 byte requests in 4/8 bit mode */
> + if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4 ||
> + host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) {
>   int blksz_2bytes = pdata->flags & TMIO_MMC_BLKSZ_2BYTES;
>  
>   if (data->blksz < 2 || (data->blksz < 4 && !blksz_2bytes)) {
> - pr_err("%s: %d byte block unsupported in 4 bit mode\n",
> + pr_err("%s: %d byte block unsupported in 4/8 bit 
> mode\n",
>  mmc_hostname(host->mmc), data->blksz);
>   return -EINVAL;
>   }
> @@ -922,14 +925,16 @@ static void tmio_mmc_power_off(struct tmio_mmc_host 
> *host)
>  static void tmio_mmc_set_bus_width(struct tmio_mmc_host *host,
>   unsigned char bus_width)
>  {
> - switch (bus_width) {
> - case MMC_BUS_WIDTH_1:
> - sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, 0x80e0);
> - break;
> - case MMC_BUS_WIDTH_4:
> - sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, 0x00e0);
> - break;
> - }
> + u16 reg = sd_ctrl_read16(host, CTL_SD_MEM_CARD_OPT)
> + & ~(CARD_OPT_WIDTH | CARD_OPT_WIDTH8);
> +
> + /* reg now applies to MMC_BUS_WIDTH_4 */
> + if (bus_width == MMC_BUS_WIDTH_1)
> + reg |= CARD_OPT_WIDTH;
> + else if (bus_width == MMC_BUS_WIDTH_8)
> + reg |= CARD_OPT_WIDTH8;
> +
> + sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, reg);
>  }
>  
>  /* Set MMC clock / power.
> @@ -1149,6 +1154,15 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
> !mmc_card_is_removable(mmc) ||
> mmc->slot.cd_irq >= 0);
>  
> + /*
> +  * On Gen2+, eMMC with NONREMOVABLE currently fails because native
> +  * hotplug gets disabled. It seems RuntimePM related yet we need further
> +  * research. Since we are planning a PM overhaul anyway, let's enforce
> +  * for now the device being active by enabling native hotplug always.
> +  */
> + if (pdata->flags & TMIO_MMC_MIN_RCAR2)
> + _host->native_hotplug = true;
> +
>   if (tmio_mmc_clk_enable(_host) < 0) {
>   mmc->f_max = pdata->hclk;
>   mmc->f_min = mmc->f_max / 512;
> 



Re: [PATCH v3 2/6] mmc: rtsx_pci: use new macro for R1 without CRC

2016-09-20 Thread Jaehoon Chung
Hi Wolfram,

Add the commit message.

On 09/20/2016 05:57 AM, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang 
> ---
>  drivers/mmc/host/rtsx_pci_sdmmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c 
> b/drivers/mmc/host/rtsx_pci_sdmmc.c
> index 396c9b7e4121b0..3ccaa1415f33b2 100644
> --- a/drivers/mmc/host/rtsx_pci_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
> @@ -126,7 +126,7 @@ static int sd_response_type(struct mmc_command *cmd)
>   return SD_RSP_TYPE_R0;
>   case MMC_RSP_R1:
>   return SD_RSP_TYPE_R1;
> - case MMC_RSP_R1 & ~MMC_RSP_CRC:
> + case MMC_RSP_R1_NO_CRC:
>   return SD_RSP_TYPE_R1 | SD_NO_CHECK_CRC7;
>   case MMC_RSP_R1B:
>   return SD_RSP_TYPE_R1b;
> 



Re: [PATCH v3 1/6] mmc: add define for R1 response without CRC

2016-09-20 Thread Jaehoon Chung
Hi Wolfram,

On 09/20/2016 05:57 AM, Wolfram Sang wrote:
> The core uses it for polling. Give drivers a proper define handle this
> case like for other response types.
> 
> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
> ---
>  include/linux/mmc/core.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index b01e77de1a74de..4caee099b63a28 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -55,6 +55,9 @@ struct mmc_command {
>  #define MMC_RSP_R6   (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
>  #define MMC_RSP_R7   (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
>  
> +/* Can be used by core to poll after switch to MMC HS mode */
> +#define MMC_RSP_R1_NO_CRC(MMC_RSP_PRESENT|MMC_RSP_OPCODE)

MMC_RSP_RQ_NO_CRC is described at Specification?

Best Regards,
Jaehoon Chung

> +
>  #define mmc_resp_type(cmd)   ((cmd)->flags & 
> (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))
>  
>  /*
>