Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933408AbbLXJZV (ORCPT ); Thu, 24 Dec 2015 04:25:21 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:57111 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933368AbbLXJYm convert rfc822-to-8bit (ORCPT ); Thu, 24 Dec 2015 04:24:42 -0500 X-AuditID: cbfee68d-f79646d000001355-94-567bb9d61ed8 MIME-version: 1.0 Content-type: text/plain; charset=euc-kr Content-transfer-encoding: 8BIT Message-id: <567BB9CF.3090301@samsung.com> Date: Thu, 24 Dec 2015 18:24:31 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: =?EUC-KR?B?wOW/tcH4?= , ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: js07.lee@samsung.com, =?EUC-KR?B?J8DMsaTIoyc=?= Subject: Re: [PATCH] Move the judgement of timeout into mmc_switch_status_error() References: <008f01d13e2b$4a2a3150$de7e93f0$@samsung.com> In-reply-to: <008f01d13e2b$4a2a3150$de7e93f0$@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRmVeSWpSXmKPExsWyRsSkSPfazuowg9kveS12njvCbPHo5m9W i8u75rBZHPnfz2hxfG24RdehxawObB53ru1h8+jbsorR4/MmuQDmKC6blNSczLLUIn27BK6M C9O2sBUsEa+4u28PYwPjcf4uRk4OCQETidsNn5khbDGJC/fWs3UxcnEICaxglDj/fAo7TNHJ XeeZIBKzGCU2vdvEBJLgFRCU+DH5HguIzSygIXF36wFWCFtEYv+S41C2tsSyha+ZIZofMEps WPyZEaJZS+LLhiagBAcHi4CqRPvSMJAwm4COxPZvx8HmiwqESTxYtxdsjohAC9Di1kCQcmYB b4nT26RAwsICwRLL3lwGu1NIwFJi5eG3YNM5Bawk9p55zQZx/z52iVvvFUB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Sl5JvKGxiZmRpZG5 oYWRsbmSOG/tpcgwIYH0xJLU7NTUgtQimD4mDk6pBkbjBWbCL6Rm6zdfZa/YtETjxTn3yj8b WiZG5XqF8oY+MFB7zbh5y+G/OVGOyfN22Trx3DERW2l1OKha/5M4i6TIJb4plg/1V+3wWSUu 2bDizdJV91Rmqa5++2Tauy9S+fmJWVkcWw5NdP9wPuDAxAuPDvD5b7yruvDiNqMUU9eU+IXe wgqtc7OUWIozEg21mIuKEwF3yAHy8AIAAA== 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: 3083 Lines: 123 Hi, Before send the patch at mailing list, you need to make the patch as mainline style. Maybe..maintainer should not review this patch. Refer to "Linux kernel coding style" and "submitting Patches". Also set your email environment. (Documentation/email-clients.txt) Best Regards, Jaehoon Chung On 12/24/2015 06:13 PM, ?念?? wrote: >>From bc1e491b29d9199f16c6e002a69f9377677b93af Mon Sep 17 00:00:00 2001 > > From: "yj84.jang" > > Date: Wed, 16 Dec 2015 08:52:47 +0900 > > Subject: [PATCH] Move the judgement of timeout into > mmc_switch_status_error() > > > > __mmc_switch() is possible to misjudge error. > > > > Although jiffies was overed timeout, > > the chance about "R1_CURRENT_STATE(status) != R1_STATE_PRG" is exists. > > In other words, Successful completion of CMD6 with timeout error. > > > > Kernel expects failure of __mmc_switch, > > but card is completed CMD6 in this case. > > It makes mismatch status between mmc subsystem and mmc card. > > > > Especially, in case of partition switch, > > If timeout occurs with normal status of CMD13 response unfortunatley, > > "main_md->curr" will not be set, even card switched successfully. > > > > Checking state of mmc card is needed when judging an timeout error, > > if it is just timeout or timeout with error. > > > > Signed-off-by: yj84.jang > > --- > > drivers/mmc/core/mmc_ops.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c > > index 1f44426..033f475 100644 > > --- a/drivers/mmc/core/mmc_ops.c > > +++ b/drivers/mmc/core/mmc_ops.c > > @@ -456,6 +456,8 @@ int mmc_switch_status_error(struct mmc_host *host, u32 > status) > > if (status & R1_SPI_ILLEGAL_COMMAND) > > return -EBADMSG; > > } else { > > + if (R1_CURRENT_STATE(status) == R1_STATE_PRG) > > + return -ETIMEDOUT; > > if (status & 0xFDFFA000) > > pr_warn("%s: unexpected status %#x after > switch\n", > > mmc_hostname(host), status); > > @@ -568,8 +570,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 > index, u8 value, > > if (time_after(jiffies, timeout)) { > > pr_err("%s: Card stuck in programming state! > %s\n", > > mmc_hostname(host), __func__); > > - err = -ETIMEDOUT; > > - goto out; > > + break; > > } > > } while (R1_CURRENT_STATE(status) == R1_STATE_PRG); > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/