From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754852AbcFTOHQ (ORCPT ); Mon, 20 Jun 2016 10:07:16 -0400 Received: from mail-bl2on0066.outbound.protection.outlook.com ([65.55.169.66]:18352 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751970AbcFTOHJ (ORCPT ); Mon, 20 Jun 2016 10:07:09 -0400 X-Greylist: delayed 1106 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 Jun 2016 10:07:08 EDT From: Alex Lemberg To: Shawn Lin , Ulf Hansson CC: Adrian Hunter , Jaehoon Chung , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Doug Anderson , "linux-rockchip@lists.infradead.org" Subject: Re: [PATCH] mmc: core: add auto bkops support Thread-Topic: [PATCH] mmc: core: add auto bkops support Thread-Index: AQHRv6CfUecJptXFn0uOY9vptpBOzJ/f3B8AgAUz6ICADZOsAA== Date: Mon, 20 Jun 2016 13:33:30 +0000 Message-ID: <7078F2B9-63B6-4170-BFA1-5AC370F0D4DD@sandisk.com> References: <1465182439-27963-1-git-send-email-shawn.lin@rock-chips.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/f.16.0.160506 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alex.Lemberg@sandisk.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [212.25.79.133] x-ms-office365-filtering-correlation-id: 88812a89-fe4b-4a9c-2408-08d3990f7813 x-microsoft-exchange-diagnostics: 1;BL2PR02MB2020;20:MbQp+9tueQWMpB30NlBGQG8lBs3REZrEIbl+SeegWlFhjboqmPH2e7gGGeEBt95VYrSK8haBmjlFgWKzDUCQ3zt8z3S+3FMjwj+hbofcrxJs4IYJM4mDC9sgfWE+TT0wbXUkD+e1bSfQAo5UWTLqKRIC60aQJKiYNP0pUlYAnIrinvGvYVJEPPYdVsN+mEhzQZTyFVGyxxE0ZVhskE/uJ9T9K3aJozYWC/ybl1pFhYAYUY2D5sKp4nv3K5f530Aw x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR02MB2020; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:BL2PR02MB2020;BCL:0;PCL:0;RULEID:;SRVR:BL2PR02MB2020; x-forefront-prvs: 09796A1B83 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(3280700002)(2906002)(4326007)(3846002)(102836003)(6116002)(2900100001)(2950100001)(82746002)(36756003)(83716003)(83506001)(5002640100001)(3660700001)(4001350100001)(33656002)(68736007)(92566002)(10400500002)(11100500001)(97736004)(122556002)(8936002)(87936001)(586003)(189998001)(54356999)(76176999)(77096005)(101416001)(50986999)(105586002)(81156014)(106116001)(106356001)(5001770100001)(81166006)(8676002)(66066001)(99286002)(86362001)(5004730100002)(7846002)(104396002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR02MB2020;H:BL2PR02MB2020.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;CAT:NONE;LANG:en;CAT:NONE; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <24FB7E168B311C4C806FBE03E87CD017@namprd02.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2016 13:33:30.6201 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR02MB2020 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 u5KE7Mkh024543 Hi Shawn, […] >>> + >>> +static int mmc_stop_auto_bkops(struct mmc_card *card) >>> +{ >>> + int err = 0; >>> + >>> + if (!card->ext_csd.auto_bkops_en) >>> + return 0; >>> + >> >> Shouldn’t the BKOPS_STATUS be checked prior to disabling the BKOPS activity of the device? >> > >Hrmm.. I read the whole section of spec for it, and I did find this >requirement for manul bkops but not for the auto one. So what should we >do if using the auto one? > In case of AUTO BKOPS, the eMMC Device should perform internal GC in the same way as in case of MANUAL BKOPS. The only difference is a host awareness. Although there is no requirement in the spec, I think the driver can give some time to the device to perform/complete its internal GC during the idle time. Thus I think we can check the BKOPS_STATUS on Runtime suspend. […] Thanks, Alex