Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Sam Protsenko" <semen.protsenko@linaro.org>
Cc: "Naresh Kamboju" <naresh.kamboju@linaro.org>,
	linux-block <linux-block@vger.kernel.org>,
	lkft-triage@lists.linaro.org,
	"open list" <linux-kernel@vger.kernel.org>,
	"Jens Axboe" <axboe@kernel.dk>, "Christoph Hellwig" <hch@lst.de>,
	"Christian Brauner" <brauner@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Dan Carpenter" <dan.carpenter@linaro.org>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	"jh80.chung" <jh80.chung@samsung.com>,
	"linux-mmc @ vger . kernel . org" <linux-mmc@vger.kernel.org>,
	"Oleksij Rempel" <linux@rempel-privat.de>,
	"Manuel Lauss" <manuel.lauss@gmail.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	yann.gautier@foss.st.com, ludovic.barre@st.com,
	"David Lanzendörfer" <david.lanzendoerfer@o2s.ch>,
	"Chen-Yu Tsai" <wens@csie.org>
Subject: Re: WinLink E850-96: WARNING: at block/blk-settings.c:204 blk_validate_limits
Date: Thu, 07 Mar 2024 16:02:22 +0100	[thread overview]
Message-ID: <f8d42bd5-5a89-49da-8da4-570e26ecc0e3@app.fastmail.com> (raw)
In-Reply-To: <CAPLW+4mVTvPBW0hd9pV6AsSezxPAhwPByq3WmGpprtseTgy-wg@mail.gmail.com>

On Fri, Mar 1, 2024, at 22:18, Sam Protsenko wrote:
> On Fri, Mar 1, 2024 at 2:51 PM Sam Protsenko <semen.protsenko@linaro.org> wrote:
>> On Thu, Feb 29, 2024 at 8:56 AM Arnd Bergmann <arnd@arndb.de> wrote:

>
> Sorry, just noticed I commented on the wrong line. Here is the change I made:
>
> -               mmc->max_seg_size = 0x1000;
> +               mmc->max_seg_size = PAGE_SIZE;

I went over all MMC drivers to see what else sets a max_seg_size
smaller than a page and found these:

drivers/mmc/host/alcor.c:       mmc->max_seg_size = AU6601_MAX_DMA_BLOCK_SIZE; // 0x1000
drivers/mmc/host/au1xmmc.c:             mmc->max_seg_size = AU1100_MMC_DESCRIPTOR_SIZE; // 64K-1
drivers/mmc/host/dw_mmc.c:              mmc->max_seg_size = 0x1000;
drivers/mmc/host/meson-gx-mmc.c:        mmc->max_seg_size = mmc->max_req_size; //  1536 bytes
drivers/mmc/host/mmci_stm32_sdmmc.c:            host->mmc->max_seg_size = host->variant->stm32_idmabsize_mask; //  GENMASK(12, 5),
drivers/mmc/host/sunxi-mmc.c:   mmc->max_seg_size       = (1 << host->cfg->idma_des_size_bits); // 1 << 13, only on arm32
drivers/mmc/host/wmt-sdmmc.c:   .max_seg_size = 65024, 

I've tried to add the maintainers to Cc here, these likely all
need attention to work with large page sizes, in case of
meson-gx-mmc it even seems like the limit is less than a 4KB
page, so it will stop working entirely.

There are also a couple of drivers that look like they have
an off-by-one error and pass a segment size of one less than
a power-off-two number, e.g.:

drivers/mmc/host/davinci_mmc.c: mmc->max_seg_size       = MAX_CCNT * rw_threshold;  // (64k-1) * 32
drivers/mmc/host/atmel-mci.c:           mmc->max_seg_size = mmc->max_blk_size * mmc->max_segs; // 4095*256

I think some of these are intentional, while others are
probably bugs.

     Arnd

      parent reply	other threads:[~2024-03-07 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+G9fYtddf2Fd3be+YShHP6CmSDNcn0ptW8qg+stUKW+Cn0rjQ@mail.gmail.com>
2024-02-29 14:55 ` WinLink E850-96: WARNING: at block/blk-settings.c:204 blk_validate_limits Arnd Bergmann
2024-03-01 20:51   ` Sam Protsenko
2024-03-01 21:18     ` Sam Protsenko
2024-03-06 23:36       ` Sam Protsenko
2024-03-07 15:02       ` Arnd Bergmann [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=f8d42bd5-5a89-49da-8da4-570e26ecc0e3@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=anders.roxell@linaro.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=david.lanzendoerfer@o2s.ch \
    --cc=hch@lst.de \
    --cc=jbrunet@baylibre.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=lkft-triage@lists.linaro.org \
    --cc=ludovic.barre@st.com \
    --cc=manuel.lauss@gmail.com \
    --cc=naresh.kamboju@linaro.org \
    --cc=neil.armstrong@linaro.org \
    --cc=semen.protsenko@linaro.org \
    --cc=ulf.hansson@linaro.org \
    --cc=wens@csie.org \
    --cc=yann.gautier@foss.st.com \
    /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