Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2811638pxp; Mon, 14 Mar 2022 05:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySL6AULz9hVNC89tfelPGkIIwQOLHmrlvhadmjguFi8OFBWLSLs/6O1mqxKooeYfqwDY1C X-Received: by 2002:a17:906:7948:b0:6da:64ed:178e with SMTP id l8-20020a170906794800b006da64ed178emr19247859ejo.523.1647261274119; Mon, 14 Mar 2022 05:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647261274; cv=none; d=google.com; s=arc-20160816; b=AOQ1JWuM8FWkicClxVYspyPguHLaYxGIUrR0lldUdTN3aP0TwOgfiyGVCeSuLOkB8h 0pOea7OW71CGEW07zRj+6Lm58Ai2hE/9WI8gXlxaVwWs11hlg3YO6t/mVEHC0I8VwoIu TKc0jxmY5GwQ6OWeJorfp4klMU1Zob1AMKsbkeJSOWdpPlW2l32CE9FLtgeIstmoKex4 AEbdEbobDrm4DFqNeaGgMj1WJlw8i2C5TLCrmO/Ze1iDu0qM96PHKovLkWIBmdFwetYI 75s/FJ3HiDnimjr5o6DnOzilHCUohaLnwH/YgBnVBonN/OA0y07vbWdjysoCAUb9u22c HSaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=Bvt17cDnDyttHxqrB7MQGG52I9oFT4iOMLcpAeRZa0s=; b=ZCCcvfNsWr0AIxwEHh5gMZlZAsRUL8xUmfS5LBSAlUh2pJBnFGlX6sl5utbUBgIRD8 /yKWW1quvwXHm3mMYXriKAcE1WUhbNf1l33v4ReJjoNBf+liYtwFKeeSvu34Ms9PjiCl l2p12apIXbKmnyMuE5z7kyjd6wIpFc6ApaqaEnoF7UF5945jEYSrbG7ncpKqsJcO+QbC YEFA9e2PH22MbaxeOJI/OD8bWWaKCjaZejLo+9IdY5c88ZqQlGK7iQnpl9D541JLME95 5mEt8WKZ5W2gslik7t8ruR0Wo5i5Ci8cjHs7uS58GcCSksgU87rCr6r+lbb9Tfpk0TR1 CxVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A9UqD0DW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020a056402351300b004186d442a89si3730413edd.159.2022.03.14.05.34.08; Mon, 14 Mar 2022 05:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A9UqD0DW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238541AbiCNKeC (ORCPT + 99 others); Mon, 14 Mar 2022 06:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236630AbiCNKeA (ORCPT ); Mon, 14 Mar 2022 06:34:00 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6751230F; Mon, 14 Mar 2022 03:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647253970; x=1678789970; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=tcH7GGg15JCUBMXBBEr4A+gzUlR4DzpJ44QMDaHKhXo=; b=A9UqD0DW9K+S/CvEXXSZVh2smEJ6SObgjqDf2xwJiJ156wqXF6kdH8Dd IsnXq0g+GAKC5bvUEuEHgnIaEHsHhnc4odPUXkIygMc7+h6oFuC3/MqaH dwGpMF7LIVpWhn53OdS48+pVJK+2h1rTFaCQYyxz7mUM8sitteejWSZhK /gXs8bf5MGq0evoU1A6+lEn25rPbXzsfgWOKTliNK5qwEnrWIHRr62vUB OFHQJ7LViTcDJFwfS5c0RMNoQHEaiFg2xV+x+/msJ4W2N7RYwLeF23Zy3 +sfDKq6Cd+j0Y6swoOvrsCnWhcyWdfTLbF9BNQWrve+mOMV8M+G4Dle8d Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10285"; a="255941815" X-IronPort-AV: E=Sophos;i="5.90,180,1643702400"; d="scan'208";a="255941815" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 03:32:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,180,1643702400"; d="scan'208";a="580067063" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.92]) ([10.237.72.92]) by orsmga001.jf.intel.com with ESMTP; 14 Mar 2022 03:32:45 -0700 Message-ID: <4436fbb9-32fa-82f0-bf99-344b9bfddf78@intel.com> Date: Mon, 14 Mar 2022 12:32:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.0 Subject: Re: [PATCH] mmc: block: enable cache-flushing when mmc cache is on Content-Language: en-US To: Avri Altman , Michael Wu , ulf.hansson@linaro.org, beanhuo@micron.com, porzio@gmail.com Cc: lixiang , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220312044315.7994-1-michael@allwinnertech.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/2022 09:26, Avri Altman wrote: > Hi, >> The mmc core enable cache on default. But it only enables cache-flushing >> when host supports cmd23 and eMMC supports reliable write. >> For hosts which do not support cmd23 or eMMCs which do not support >> reliable write, the cache can not be flushed by `sync` command. >> This may leads to cache data lost. >> This patch enables cache-flushing as long as cache is enabled, no matter host >> supports cmd23 and/or eMMC supports reliable write or not. > I looked in the spec and indeed couldn't find why enabling cache is dependent of cmd23/reliable write. > Nor I was able to find the original commit log. Reliable write was added first, so it might have been an oversight: commit 881d1c25f765938a95def5afe39486ce39f9fc96 Author: Seungwon Jeon Date: Fri Oct 14 14:03:21 2011 +0900 mmc: core: Add cache control for eMMC4.5 device This patch adds cache feature of eMMC4.5 Spec. If device supports cache capability, host can utilize some specific operations. Signed-off-by: Seungwon Jeon Signed-off-by: Jaehoon Chung Signed-off-by: Chris Ball > > Please allow few days to ask internally. > > Thanks, > Avri