public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Lauri Kasanen <cand@gmx.com>
To: Keith Busch <kbusch@kernel.org>
Cc: linux-mips@vger.kernel.org, tsbogend@alpha.franken.de,
	axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH 6/6] block: Add n64 cart driver
Date: Mon, 4 Jan 2021 18:01:15 +0200	[thread overview]
Message-ID: <20210104180115.b1d5438cd4ee21efcd557976@gmx.com> (raw)
In-Reply-To: <20210104154902.GA1024941@dhcp-10-100-145-180.wdc.com>

On Mon, 4 Jan 2021 07:49:02 -0800
Keith Busch <kbusch@kernel.org> wrote:

> On Mon, Jan 04, 2021 at 03:50:31PM +0200, Lauri Kasanen wrote:
> > block folks: rest of the series is on linux-mips. Being a mips-specific driver,
> > not sure which tree it should go to.
>
> Probably through mips.

Thanks.

> > +static blk_status_t get_seg(struct request *req)
> > +{
> > +	u32 bstart = blk_rq_pos(req) * 512;
> > +	u32 len = blk_rq_cur_bytes(req);
> > +	void *dst = bio_data(req->bio);
> > +
> > +	if (bstart + len > size || rq_data_dir(req) == WRITE)
> > +		return BLK_STS_IOERR;
>
> If you don't support writes (is that limitation temporary?), then you
> can prevent such operations from reaching the driver by setting the
> "disk" to read-only during initialization with set_disk_ro(disk, true).

The media is read-only (but not runtime removable).

> > +static int __init n64cart_init(void)
> > +{
> > +	int err;
> > +
> > +	if (!start || !size) {
> > +		pr_err("n64cart: start and size not specified\n");
> > +		return -ENODEV;
> > +	}
>
> Just curious, is it not possible to discover these values from the
> installed cart? Requiring module parameters seems a bit fragile.

No, it's not possible. Even the cart's size is not discoverable, and
where the disk image starts and how long it is could only be scanned if
you knew in advance what FS what used, etc. There is no FS on the cart
itself, it's just raw data.

The bootloader embeds these values into itself when it's built.

- Lauri

  reply	other threads:[~2021-01-04 16:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 13:50 [PATCH 6/6] block: Add n64 cart driver Lauri Kasanen
2021-01-04 15:40 ` Jens Axboe
2021-01-04 15:43   ` Lauri Kasanen
2021-01-04 15:49     ` Jens Axboe
2021-01-04 15:56       ` Lauri Kasanen
2021-01-04 16:07         ` Jens Axboe
2021-01-04 15:49 ` Keith Busch
2021-01-04 16:01   ` Lauri Kasanen [this message]
2021-01-04 16:13     ` Keith Busch
2021-01-04 16:27       ` Lauri Kasanen
2021-01-04 16:28         ` Jens Axboe
2021-01-04 16:42           ` Lauri Kasanen
  -- strict thread matches above, loose matches on Subject: below --
2020-12-25 17:01 Lauri Kasanen

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=20210104180115.b1d5438cd4ee21efcd557976@gmx.com \
    --to=cand@gmx.com \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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