Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933889AbdCXLQr (ORCPT ); Fri, 24 Mar 2017 07:16:47 -0400 Received: from mailout.micron.com ([137.201.242.129]:38114 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbdCXLQk (ORCPT ); Fri, 24 Mar 2017 07:16:40 -0400 From: "Bean Huo (beanhuo)" To: Ulf Hansson CC: "linus.walleij@linaro.org" , "shawn.lin@rock-chips.com" , "adrian.hunter@intel.com" , "axboe@fb.com" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Zoltan Szubbocsev (zszubbocsev)" Subject: RE: [PATCH V1] mmc: core: fix still flush cache when eMMC cache off Thread-Topic: [PATCH V1] mmc: core: fix still flush cache when eMMC cache off Thread-Index: AdKgSamlhWApZZtqQbCIj/To+FnQDgDL/0KAABEUQrD//6uXAP/+Jx4w Date: Fri, 24 Mar 2017 11:16:30 +0000 Message-ID: References: <4e7d0b4b8df1430698e822b1a36bcc11@SIWEX5A.sing.micron.com> <3a0f2112746a4f0fbaa73906c606a340@SIWEX5A.sing.micron.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.160.29.124] x-tm-as-product-ver: SMEX-12.0.0.1464-8.100.1062-22962.005 x-tm-as-result: No--15.310700-0.000000-31 x-tm-as-matchedid: 150567-701625-704425-700685-139010-700724-851106-700075-7 05861-703788-701618-700756-702039-709185-700163-708712-701284-704473-863828 -703712-700648-701702-707800-700807-702020-702358-701837-113289-106230-7084 54-707163-700433-703376-710207-711432-701111-709584-187067-121210-709908-70 1021-707663-705178-701461-709009-704689-708325-863174-703747-700970-701319- 121132-704980-188019-700108-700074-700476-704820-703523-700057-139704-14800 4-148133-20043-42000-42003 x-tm-as-user-approved-sender: Yes x-tm-as-user-blocked-sender: No x-mt-checkinternalsenderrule: True Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v2OBGoUI003919 Content-Length: 2969 Lines: 67 Hi, Uffe >>>On 19 March 2017 at 01:45, Bean Huo (beanhuo) >wrote: >>>> This patch fixes the issue that mmc_blk_issue_rq still flushes cache >>>> when eMMC cache has already been off through user space tool, such >>>> as mmc-utils. >>>> The reason is that card->ext_csd.cache_ctrl isn't reset. >>> >>>First, why do you want to turn of the cache ctrl? Is the eMMC device >>>having issues with it? Then we should invent a card quirk instead. >> >> >> Why I turn off it? because I did power loss testing and validation, I should >switch it off and on. >> When I do some performance and power loss case validation on several >> Linux release versions, I need to switch off or on cache through user space tool. >> I can't confirm every user that likes me, But I think at least it is >> not reasonable to flush eMMC cache, when internal eMMC cache is off. > >Ah, I see. Your use-case seems reasonable while validating robustness of the >eMMC! > >> >>>Second, what errors do you encounter when the mmc core tries to flush >>>the cache when it has been turned off? Can you please elaborate on this? >> >> >> No error found, but firstly, please think about overhead introduced by >> useless flush cache, Unless you Don't care this tiny time. second, >> under the condition of cache off, additional flush cache request still has impact >>on Internal eMMC logic. I don't know What and how impact, but at least it is >>really exist. > >Got it! > >However I still don't like the mmc ioctls API to compensate and deal with all >"crazy-ness" that user-space may cause. Cache-ctrl is only one case out of many. Question is that not every Linux-mmc user really understand that shouldn't use "mmc ioctls API to compensate and deal with all crazy-ness that user-space may cause ". no matter we like or dislike, Issue is already there; I think that most of eMMC user is now configuring eMMC through mmc-utils and mmc ioctls. This is a real condition. Some automotive applications, Cache would not be enabled. Maybe I am shallow, mmc ioctls likes backdoor that let user access and configure eMMC some feature, Even not too often. I still suggest to fix this in mmc ioctls, unless mmc iotcls being deleted, and mmc-utils doesn't support Cache off/on. Because eMMC internal cache has been disabled, but Linux-mmc still issue flush cache request, this is indeed Not reasonable. It definitely increases system level overhead. >I see two viable options to solve your problem. >1) Extend mmc_test with a new test(s) for cache ctrl and perhaps suspend/resume. >Isn't this actually exactly what you want? >2) Extend debugfs to be able to turn cache ctrl on/off. I can try, but this patch is just to fix mmc ctrls backdoor on eMMC flush cache. >[...] > >Kind regards >Uffe >-- >To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of >a message to majordomo@vger.kernel.org More majordomo info at >http://vger.kernel.org/majordomo-info.html