public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olexa Bilaniuk <obilaniu@gmail.com>
To: keita.aihara@sony.com
Cc: Masaya.Takahashi@sony.com, Shingo.Takeuchi@sony.com,
	Tim.Bird@sony.com, jonathan@raspberrypi.com,
	linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
	ulf.hansson@linaro.org
Subject: [PATCH] mmc: core: apply SD quirks earlier during probe
Date: Wed, 18 Sep 2024 10:51:33 -0400	[thread overview]
Message-ID: <20240918145133.18480-1-obilaniu@gmail.com> (raw)
In-Reply-To: <20240802032121.GA4019194@sony.com>

> diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
> index cca71867bc4a..92905fc46436 100644
> --- a/drivers/mmc/core/quirks.h
> +++ b/drivers/mmc/core/quirks.h
> @@ -15,6 +15,19 @@
> 
>  #include "card.h"
> 
> +static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
> +	/*
> +	 * Kingston Canvas Go! Plus microSD cards never finish SD cache flush.
> +	 * This has so far only been observed on cards from 11/2019, while new
> +	 * cards from 2023/05 do not exhibit this behavior.
> +	 */
> +	_FIXUP_EXT("SD64G", CID_MANFID_KINGSTON_SD, 0x5449, 2019, 11,
> +		   0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
> +		   MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
> +
> +	END_FIXUP
> +};
> +

By happenstance I have just such a Kingston Canvas Go! Plus card, but
in standard SD form-factor and not microSD, and dating from *08/2021*.
I had heretofore-inexplicable filesystem corruption problems with this
card that may well be attributable to a failure to flush the cache.
Despite diligence in issuing an explicit "sync" before ejecting, the
filesystem would reliably appear corrupt after reconnecting it, and
would require a "fsck", but no bad blocks could be identified.

The vitals of my card are:

  type:   SD
  name:   SD64G
  date:   08/2021
  manfid: 0x00009f (Kingston)
  oemid:  0x5449
  fwrev:  0x1
  hwrev:  0x6
  csd:    400e00325b590001cf9f7f800a400001
  ocr:    0x00300000

I think the quirk here can be safely broadened to all variants of
this card and to the date range 11/2019 - 08/2021 inclusive.


Sincerely,
Olexa Bilaniuk

      parent reply	other threads:[~2024-09-18 14:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02  3:21 [PATCH] mmc: core: apply SD quirks earlier during probe Keita Aihara
2024-08-02  6:53 ` Avri Altman
2024-08-05 10:14 ` Ulf Hansson
2024-08-06  1:36   ` Keita Aihara
2024-08-20 10:10     ` Ulf Hansson
2024-08-20 23:18       ` Keita Aihara
2024-09-18 14:51 ` Olexa Bilaniuk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240918145133.18480-1-obilaniu@gmail.com \
    --to=obilaniu@gmail.com \
    --cc=Masaya.Takahashi@sony.com \
    --cc=Shingo.Takeuchi@sony.com \
    --cc=Tim.Bird@sony.com \
    --cc=jonathan@raspberrypi.com \
    --cc=keita.aihara@sony.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox