Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3055211rdb; Tue, 13 Feb 2024 05:48:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXd6ad9J2DNj0BnJPpoGID/AKGatABhzENaMK8dcnZBByptwzDLywej4kYSxDvOSqRwSWdf78n2By8hHssyEfNOqrhZLe3FDsr0gd4GKQ== X-Google-Smtp-Source: AGHT+IEpbVC+wnlgJ+OEsaMLt2ezZNhhhSOelV0YNEJIG69h33AFP29mc7o32kR7tT3ZrmZclil/ X-Received: by 2002:a05:6808:a08:b0:3c0:433b:7d3f with SMTP id n8-20020a0568080a0800b003c0433b7d3fmr2182650oij.21.1707832114023; Tue, 13 Feb 2024 05:48:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707832113; cv=pass; d=google.com; s=arc-20160816; b=FQgKfarhNxcSpKKx3PKpnZ+H/GXBiSupXCv8wbl+oCozJMUgdP5/FcoUyu6WNTr/Gp f0hfI+q7bgf+nnzF2kk/WFGoydqal+GhL30DPT9lhnhH6c04LYeDcWO3md62JUYFwCZi npdy83eCopXJ+i1FyEBiUMQ7iBfLAyBkBa14ogzVQukMJC6jiTRSN4vZogprkBZQQAUj iO8v1VTvEvo2S3BB0aGOPWZOdG1ZaHPVzdXFdowMHitHbFBE0xsNn89nJWoR3MoekUvY +V6BnNF1IDToHZcSJ7m8Py/Dazs6u+XtM7tLFawuF1hOzkTA+i7U71qU2aWVrlPzdtJX phsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=4xe8mU2KZmRLJOOECoWVGST1YreTbv6JoA64gXkH3kg=; fh=iuky2xrNmNp9A4+KjayQWL+Uj2cPLjti+4tyojPJ8+U=; b=E63IE2AnT1etxsv868NvN8TJPey0iCRpXffsHY3NVo2e1UKQL1MDvNBgym8J9Q7flO 4S2yhzcGuMWCqgtnGY1lNa1r4X4eaJRBHq5ougjZluGrXLV442hZvY9hRiCxUgge4Bmq 1FEOJvbZCr5hc2P8GXmjf/PbPMuMtZrPrIwVDslTfb00TjSqhnsKoyIdxSwfglIStYkr pJSxpDX5TcmFvY9ADTqyptAH1rhXa747RS5o+nmN04BIEM0TtS0wQ/G47UyAL0JnspLN plORLb4fxLjzrcFaP5mzct1BoDz1klLX//mWKaGm/IwyeW+VWYWwQXtMArlBU8B9KI+q hRjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-63598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCVpjVP68gXWy/WJo4++qgqx5Z2MmpGUsyWt1YWaM8ZNAt7nJ/QulV5io/O+XGboKhQz+57I6IL2BaoFh/7v3fy0eD4bvzfL+pK/k0iBgA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e26-20020a65689a000000b005d8b8ca425esi2082854pgt.308.2024.02.13.05.48.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 05:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-63598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 864F3B228F1 for ; Tue, 13 Feb 2024 13:35:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49E7456469; Tue, 13 Feb 2024 13:35:09 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FB5956444; Tue, 13 Feb 2024 13:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707831308; cv=none; b=uTHdBg/77H24H5R/qEXVNgQEy04TzWR//79SPFRlNvQUPN3mlbNhjH2Yh/ijXu5jK7EX94gjSbJ3qQJq0lmObspUgDD2t6vizFPwqjhvp7fLwPWSYg3Tuqa4gH5wM84XB4aM4fZzIwgJbk0B0Y7aWsotbuMzcOjN7WFUks5Jh8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707831308; c=relaxed/simple; bh=0fLC0KnFKKogrD8BSsniO+ZMxs8BKJuQFY0rr2JzJhE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jHk3WMLkmnF+861gRNJUWyxgPhyw9Us+jcMuUZqTvqghm3Mc5+2JDVaZhfRkpuY0oPBO1cdv2hKTBFVB5riz07eH4dKMRKdEeoLC0yN+ywoBLO+Bc0fSBAo0Yq4poTzFv59Trc/E1JVAlm5prq/t9suFrHVhGe9HzR+c7nkxUts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1071DDA7; Tue, 13 Feb 2024 05:35:47 -0800 (PST) Received: from [10.1.30.52] (e133047.arm.com [10.1.30.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5AC373F762; Tue, 13 Feb 2024 05:35:03 -0800 (PST) Message-ID: <94199ff4-1511-4f67-9794-b93195f8bac9@arm.com> Date: Tue, 13 Feb 2024 13:35:01 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mmc: sd: Add a variable to check a faulty device Content-Language: en-US To: =?UTF-8?B?7J207Iq57Z2s?= , 'Avri Altman' , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, gregkh@linuxfoundation.org Cc: grant.jung@samsung.com, jt77.jang@samsung.com, dh0421.hwang@samsung.com, junwoo80.lee@samsung.com, jangsub.yi@samsung.com, cw9316.lee@samsung.com, sh8267.baek@samsung.com, wkon.kim@samsung.com References: <20240213051716.6596-1-sh043.lee@samsung.com> <000101da5e61$f97e8cf0$ec7ba6d0$@samsung.com> From: Christian Loehle In-Reply-To: <000101da5e61$f97e8cf0$ec7ba6d0$@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 13/02/2024 09:49, 이승희 wrote: > > >> -----Original Message----- >> From: Avri Altman >> Sent: Tuesday, February 13, 2024 5:42 PM >> To: Seunghui Lee ; linux-mmc@vger.kernel.org; >> linux-kernel@vger.kernel.org; ulf.hansson@linaro.org; >> gregkh@linuxfoundation.org >> Cc: grant.jung@samsung.com; jt77.jang@samsung.com; >> dh0421.hwang@samsung.com; junwoo80.lee@samsung.com; jangsub.yi@samsung.com; >> cw9316.lee@samsung.com; sh8267.baek@samsung.com; wkon.kim@samsung.com >> Subject: RE: [PATCH] mmc: sd: Add a variable to check a faulty device >> >>> In mobile devices, suspend/resume situations are frequent. >>> In the case of a defective SD card in which initialization fails, >>> unnecessary initialization time is consumed for each resume. >>> A field is needed to check that SD card initialization has failed on >>> the host. It could be used to remove unnecessary initialization. >> I don't see where you are using this new init_failed field? >> Maybe instead, elaborate the logic to free_card: to detect a broken sd. >> e.g. instead of just if (!oldcard), if (!oldcard || ! mmc_sd_alive(host)) >> or something. >> >> Thanks, >> Avri >> > Thank you for your suggestion. > I'm going to use it in mmc_rescan as below. > > e.g. > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index a8c17b4cd737..461cd75dc7ab 100644 > --- a/drivers/mmc/core/core.c > +++ b/drivers/mmc/core/core.c > @@ -2210,7 +2210,7 @@ void mmc_rescan(struct work_struct *work) > container_of(work, struct mmc_host, detect.work); > int i; > > - if (host->rescan_disable) > + if (host->rescan_disable || host->init_failed) > return; I've seen SD cards that fail the first initialization attempt for both 'valid' reasons (e.g. weird insertion timing) and things like out-of-spec initialization time from the card, outright disabling these on the first fail is a bit too much IMO. Kind Regards, Christian