All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Linux MMC List" <linux-mmc@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Subject: Re: [RFC PATCH 2/2] mmc: renesas_sdhi: prevent overflow for max_req_size
Date: Fri, 15 Mar 2019 12:01:31 +0100	[thread overview]
Message-ID: <20190315110130.GA2148@kunai> (raw)
In-Reply-To: <CAMuHMdUmNSk3n1EEaYQpXV-Pwa3d9O8UDARx+zF5c_BYqrR5rg@mail.gmail.com>


> My worry here is that if several drivers would do
> 
>        .max_blk_count  = UINT_MAX / DRIVER_SPECIFIC_MAX_BLK_SIZE,
> 
> Those drivers can safely calculate "max_blk_size * max_blk_count".
> People may start assuming this is always safe. while the core cannot do
> "GLOBAL_MAX_BLK_SIZE * max_blk_count" using 32-bit arithmetic, as the
> latter may still overflow, depending on the driver.

The core will not do this calculation. This is why the variable
max_req_size exists. It will just use this variable which shall be setup
by the driver which may impose other restrictions, too (And there can't
be a GLOBAL_MAX_BLK_SIZE anyhow)

So, when calculating max_req_size, it is the duty of the driver not to
overflow. Or?


  reply	other threads:[~2019-03-15 11:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 22:31 [RFC PATCH 0/2] mmc: renesas_sdhi: prevent overflow for max_req_size Wolfram Sang
2019-03-14 22:31 ` [RFC PATCH 1/2] mmc: tmio: introduce macro for max block size Wolfram Sang
2019-03-25 13:26   ` Ulf Hansson
2019-03-14 22:31 ` [RFC PATCH 2/2] mmc: renesas_sdhi: prevent overflow for max_req_size Wolfram Sang
2019-03-15  7:46   ` Geert Uytterhoeven
2019-03-15  8:29     ` Wolfram Sang
2019-03-15  8:49       ` Geert Uytterhoeven
2019-03-15  9:28         ` Wolfram Sang
2019-03-15  9:35           ` Geert Uytterhoeven
2019-03-15  9:39             ` Wolfram Sang
2019-03-15  9:46               ` Geert Uytterhoeven
2019-03-15 11:01                 ` Wolfram Sang [this message]
2019-03-25 13:26   ` Ulf Hansson

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=20190315110130.GA2148@kunai \
    --to=wsa@the-dreams.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yamada.masahiro@socionext.com \
    --cc=yoshihiro.shimoda.uh@renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.