Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp277011pxb; Thu, 21 Jan 2021 06:58:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJymzNitf+U8YAzK5y+AydAvl0xWSirrDZ0mthMrtZHUnQ4fU5/T2qyCOUmMNrLha4SfNK05 X-Received: by 2002:a05:6402:1a57:: with SMTP id bf23mr9062882edb.183.1611241086530; Thu, 21 Jan 2021 06:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611241086; cv=none; d=google.com; s=arc-20160816; b=seYXrhKMGWC4KfOpfaF5g8tKT18im3DsOgc2k5P+UUujvh25rreE6EExB+9yf5RfIF BxU486nfDB55LHnDnsaGUhDP5hcOoPH03EiHWkBPnCFw+n/VDa0ymKVGec3C/pkfU8Sm ozdngHHKg+p9/rTwOXcqttaHVhP8cLZpHKkl9UtpYhpKvDBiYulSO8rxrixOGcb2+pKL jSqKb2vBpghM+GZaCMcMrJL2ta2BjBEgQj9PysEhPZf3uYXNEJzCO4VBHqdSfIxQhaEo YSnLbQQfvJNcAr9E8wbIrVnNIhILcLvsLabe2Xdb/F849oD6Tucco06tAdGRcZGDp5rh s/iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Rf1qKfSAnHAbgFgODbsvDUcmat4RodOPJkqQcCf2Woo=; b=bZdck9gBgw4PI0gLw/7wQE5wqFTtCBHV9euo9Qxm/zglw/w1C8kRs/nbngWCRoIkGk e3eTwlusjI8PEBiiK0Pmp2UkymMs+iO4GuGeHd/M66qHaRZ1iSOFvOvDmq01pZrPo96U 8EYABOz17rCbpmGZbmnyDGa3f6WXm5H8FB8iGT+trYM7b00aa2o2Lbr97XaVAB4okSC0 LGGiAqpf15pDqj/Jf+Kn5u/O/YsBmaXULYToeuYyLEVuLkf82CUoWy6yDqH+tGKFT7Gt QnlF8p60sgBiUHvtDjbv80Um4SNTPnPN15t/HO5S4atj6mHGvok7W1AO5BHmUFVg8zuF 1nvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T97ehu1r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si1837691ejc.551.2021.01.21.06.57.41; Thu, 21 Jan 2021 06:58:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T97ehu1r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732046AbhAUNas (ORCPT + 99 others); Thu, 21 Jan 2021 08:30:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730933AbhAUN2P (ORCPT ); Thu, 21 Jan 2021 08:28:15 -0500 Received: from mail-vk1-xa29.google.com (mail-vk1-xa29.google.com [IPv6:2607:f8b0:4864:20::a29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D4EEC0613ED for ; Thu, 21 Jan 2021 05:26:29 -0800 (PST) Received: by mail-vk1-xa29.google.com with SMTP id d23so503820vkf.3 for ; Thu, 21 Jan 2021 05:26:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Rf1qKfSAnHAbgFgODbsvDUcmat4RodOPJkqQcCf2Woo=; b=T97ehu1rk5uA0WZ+CdJ0MAe4iMMeCR0gBWgjDQVjb8wLOrxE1kEuX0B7y0udkEwOfH ievh1lJbEOcF5tomDF2bAWCnTYAThZjJay4CXcJ0bds9Z5u6vzMLdlx/9hQTlHoVIpRn FhhfGFJedS1swKUrQcU0ZeDOuIuH+jAuAaaqjqKbsa6Yg1NVrO1bJKCam8IMxOxGdsQR Rj/Nj1PkVlW+djkp8KtIMIO25Q+lVIxSYkBwEJ60XQOrjfiZk/E0X/2CUQP3EdmFu110 W6fT6f/VJITSZ/vkt9qvl9mDGZqPOVQBMt1nk/ssLGwySkaeWF6pLQ+TBp7ZSNKlinPq +HRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Rf1qKfSAnHAbgFgODbsvDUcmat4RodOPJkqQcCf2Woo=; b=eXYnzAQNzU9nqdTIN2BeTQzDeextK2k+6flTvJI7INr+lL3Z1zBF/9LUzWZr43toGB D56pvUn4bjxRmUDUmSlmT8D88QR3fTzj+ZJUkYkUDZdUGm/0xdq1WLSy0FZS25CQKxoW L6hBETeiIfUBkPKaoCdSlUyv4aSMF8ufctjFTBSYIwzfCLghj2F0cYYa+2vNjWOqDU29 AbCPEvHri1fWuTUeuFsxqbMsSn9EMCa05SRIpI3VDmgRei8EhcsIyNCr3Wdqqj4j9itY ab9GflsEEFiXMtN1loOBaiOr9wpjm7S5Ypua3w4uF0vgmIWexjFCgof2oWD+xpHz7hKx fCHg== X-Gm-Message-State: AOAM532mx518pb9gAo8dhlMIIBJjhWd6yQ862j2Z1YeoJdAfw8UQlZRc F/ejo8RYtNJD+rTHn+FCtofavxcHJHh2sO9DmejtM5DXsva0LzMQ X-Received: by 2002:a1f:aecb:: with SMTP id x194mr870066vke.6.1611235588136; Thu, 21 Jan 2021 05:26:28 -0800 (PST) MIME-Version: 1.0 References: <20210118042717.2549123-1-xiaolei.wang@windriver.com> In-Reply-To: From: Ulf Hansson Date: Thu, 21 Jan 2021 14:25:51 +0100 Message-ID: Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L To: "Wang, Xiaolei" , Fabio Estevam , Haibo Chen Cc: =?UTF-8?Q?Pali_Roh=C3=A1r?= , Lee Jones , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Fabio, Haibo On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei wr= ote: > > Hi > > >Are you sure this is an eMMC problem and not a mmc host driver issue? > > >Can you elaborate more what happens? > > When I use the mkfs.f2fs tool to format the eMMC file system on the imx8q= xp board, > because mkfs.f2fs will use secdiscard first, when entering mmc_blk_issue_= secdiscard_rq erase, > once the parameters are passed into MMC_SECURE_TRIM1_ARG, this function w= ill take a long time to return . > The program has not ended, has been in TASK_UNINTERRUPTIBLE state. > > I compared the mkfs.ext4 tool to format the file system. Because it direc= tly uses mmc_blk_issue_discard_rq, > this is a normal formatting phenomenon. > > mmc_blk_issue_secdiscard_rq and mmc_blk_issue_discard_rq are just differe= nt commands and parameters sent by the host as a bus. > I did not see the description of trim in the data sheet. Could the host = driver cause this problem? Yes, it can - and we have had issues like these before. So before adding a card quirk, I think we need to make sure this isn't the case. When using MMC_SECURE_TRIM1_ARG, it's very likely that the request takes longer to complete. The mmc host is responsible for either dealing with busy detection with the help of its HW/controller - or if that can't be supported, the mmc core falls back to polling the card for busy with a CMD13. See mmc_do_erase() in /drivers/mmc/core/core.c > > Note: > The host driver I use is sdhci-esdhc-imx.c Alright, I have looped in Fabio and Haibo that knows this driver, let's see if they can help. > > Thanks > Xiaolei Kind regards Uffe > > -----Original Message----- > From: Ulf Hansson > Sent: Wednesday, January 20, 2021 9:41 PM > To: Wang, Xiaolei > Cc: Pali Roh=C3=A1r ; Lee Jones ; = linux-mmc@vger.kernel.org; Linux Kernel Mailing List > Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L > > [Please note this e-mail is from an EXTERNAL e-mail address] > > On Mon, 18 Jan 2021 at 05:27, Xiaolei Wang w= rote: > > > > R1J57L mmc chip hw capibility indicates that it supports trim > > function, but this function does not work properly, the SDIO bus does > > not respond, and the IO has been waiting so set quirks to skip trim > > Are you sure this is an eMMC problem and not a mmc host driver issue? > > Can you elaborate more what happens? > > Kind regards > Uffe > > > > > Signed-off-by: Xiaolei Wang > > --- > > drivers/mmc/core/quirks.h | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h > > index d68e6e513a4f..63e02391c133 100644 > > --- a/drivers/mmc/core/quirks.h > > +++ b/drivers/mmc/core/quirks.h > > @@ -89,6 +89,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_= fixups[] =3D { > > MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), > > MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quir= k_mmc, > > MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), > > + MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk= _mmc, > > + MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), > > > > /* > > * On Some Kingston eMMCs, performing trim can result in @@ > > -98,6 +100,8 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fi= xups[] =3D { > > MMC_QUIRK_TRIM_BROKEN), > > MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_qui= rk_mmc, > > MMC_QUIRK_TRIM_BROKEN), > > + MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_quirk= _mmc, > > + MMC_QUIRK_TRIM_BROKEN), > > > > END_FIXUP > > }; > > -- > > 2.25.1 > >