Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2945406pxb; Mon, 25 Jan 2021 02:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhm4MZZWDI03draT6idFUy93JqytrHk4G2wbt4DQDrWzZ1MgBPnahXZVsk70zQdDRw6BFA X-Received: by 2002:aa7:c0cd:: with SMTP id j13mr850295edp.217.1611572213861; Mon, 25 Jan 2021 02:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611572213; cv=none; d=google.com; s=arc-20160816; b=VmWLmYHzi0aD4XoquvHp3rIiYT2EyYpUzzpxL7GjUpdnT5lMhBWTsSqxo/JFUGrN1U TW/ajD+Qi65+449KRK7zBihF21hZ5+TJ5FCEljr1dhJD/w/1cU/qsomWOgqn3KEcquvl W6rxI08pEVKPbkK2jGdb9lOS/oRkxI85m2+LDc4dnTl/3DluZSC6c0r4g4jnqKRHxZbc 7nSEcDz+y0xhPtRdYU31ynzjATy6Lm4asEUhdlzL3hcyGdvz3Gm4LQfSWKk4LKgQ0GlR fp6WjlWTJKqRkHXynvyA05+GyVFOo9+9TIOr5dD6Dvo6T90wnuGGL0UMfxQz0KKV4PHW yg3g== 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=43PJHRr7+l80ZYDB7hOC3rOmJdG1RReABy3AisRh4fg=; b=Hps84jUXgd1fWFYBzNY+JrUx0JLIbtsYWY1bPRXKN83YY/6PncMJ5/JEE2w44mOzRu M7FUhVpWYeSu5SbTEWK3dY9X16xfgirpQdlarjOOlnb1FxcFT/s3pbQ+TXpZGq390PNG tRCWgwP03TnowRWtcNOSZ4DFkU98hiZQWBifA1BcEA2D8R89RZqho+mboUBTfGx8Ouze ZDGdpI+XGPNu9IkxUzsNJZr0FZSktMCCjyAAHX9TLP0959MUo8navKURMIuMbVJuIXi2 QzNa3n+/En1WvCdnFuC8JnPGvux30a+dBxHKDYOVzyKHrBHWHiDkhU4ShlcK+Yx1SQG3 wpqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XAyh9KY5; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr24si3641157ejb.92.2021.01.25.02.56.30; Mon, 25 Jan 2021 02:56:53 -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=@gmail.com header.s=20161025 header.b=XAyh9KY5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727671AbhAYKvm (ORCPT + 99 others); Mon, 25 Jan 2021 05:51:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727647AbhAYKr6 (ORCPT ); Mon, 25 Jan 2021 05:47:58 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42244C06174A; Mon, 25 Jan 2021 02:47:12 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id u11so14647981ljo.13; Mon, 25 Jan 2021 02:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=43PJHRr7+l80ZYDB7hOC3rOmJdG1RReABy3AisRh4fg=; b=XAyh9KY5g7j86h4QR6NEPrWSuHJRAeiIMTwMyGz9JXe5QcXte2sa4883HQhF/p2S4C VIiBFkKTPRKdFid5tJo/1NRDnlk0ur/xIz8cNmxTJafPpLsYTHvQ+xlkv2mqULzh5peW BFYK/0Bul0/4k6zlrnDvUE43VgUrtMqKGgomeGT56Jpl7Bsbm5zrurXg1nZvPSAIJb00 PkK2PoDJil8NHdh4pK9osiiLiBq6UeD7EGJVdYC4C1E+d0sM3QNzioB91h2wk4gF06ff GWkGmK0Iok3dBFKxO/IqLwLIpsjbPok1D+vJDmS2z9jKHunE3ZQWcf5Lyc6RihH+3kSX xnzA== 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=43PJHRr7+l80ZYDB7hOC3rOmJdG1RReABy3AisRh4fg=; b=gtkc6JgMAtKgYBv1oiL9fENcsx2OExFq8o6QbLD4YkwJm7LCv31F8hfmoTU9DSYyG+ TivKiUUsL0juA/eXYVkjaDWUbRjM3dGhyIba9aNzDHnx39+koCAA9mPweqrRKpv/xp2p HP+JpF3F/LjbVNxGCkkhNTQAoCSkv31BcC7+33aNOBhmrolTUWtUzffbTA28w79F6kTK nw0za8m6bpaYMApF+Dx2ycmYOYdGMov/KvmfmTnsRUoOkAWCzNJzOIAsRrLHgAXlLOQD Q+p3fUgU5vwtkuW53UK2GMVjJmyIFTrBamy5vqSRRAr10Np6REMT6RCQNW7yLBLdK0uQ TtHA== X-Gm-Message-State: AOAM531j+EMqXUPNredkLmoJERtx6cPJ4Qkw1vIds/O4jCeNYwE7XkFO EYKPl+Wiz4N2yow8Ih7wgqrnjSOa7GJwmEkeA+A= X-Received: by 2002:a2e:8416:: with SMTP id z22mr1013328ljg.347.1611571630612; Mon, 25 Jan 2021 02:47:10 -0800 (PST) MIME-Version: 1.0 References: <20210118042717.2549123-1-xiaolei.wang@windriver.com> In-Reply-To: From: Fabio Estevam Date: Mon, 25 Jan 2021 07:46:59 -0300 Message-ID: Subject: Re: [PATCH] mmc: core: Apply trim broken quirk to R1J57L To: Ulf Hansson Cc: "Wang, Xiaolei" , Haibo Chen , =?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 Hi Haibo, Could you please take a look? Thanks On Thu, Jan 21, 2021 at 10:26 AM Ulf Hansson wrote= : > > + Fabio, Haibo > > On Thu, 21 Jan 2021 at 10:54, Wang, Xiaolei = wrote: > > > > 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 imx= 8qxp board, > > because mkfs.f2fs will use secdiscard first, when entering mmc_blk_issu= e_secdiscard_rq erase, > > once the parameters are passed into MMC_SECURE_TRIM1_ARG, this function= will 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 dir= ectly 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 diffe= rent commands and parameters sent by the host as a bus. > > I did not see the description of trim in the data sheet. Could the hos= t 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 = wrote: > > > > > > 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_bl= k_fixups[] =3D { > > > MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), > > > MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_qu= irk_mmc, > > > MMC_QUIRK_SEC_ERASE_TRIM_BROKEN), > > > + MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_qui= rk_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_= fixups[] =3D { > > > MMC_QUIRK_TRIM_BROKEN), > > > MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_q= uirk_mmc, > > > MMC_QUIRK_TRIM_BROKEN), > > > + MMC_FIXUP("R1J57L", CID_MANFID_MICRON, CID_OEMID_ANY, add_qui= rk_mmc, > > > + MMC_QUIRK_TRIM_BROKEN), > > > > > > END_FIXUP > > > }; > > > -- > > > 2.25.1 > > >