From: Jens Axboe <axboe@kernel.dk>
To: "René Rebe" <rene@exactco.de>
Cc: linux-block@vger.kernel.org, efremov@linux.com
Subject: Re: [PATCH] fix floppy for PAGE_SIZE != 4KB
Date: Fri, 14 Nov 2025 10:39:21 -0700 [thread overview]
Message-ID: <fec67c88-53f5-4482-aeef-86e1213d187e@kernel.dk> (raw)
In-Reply-To: <20251114.172543.20704181754788128.rene@exactco.de>
On 11/14/25 9:25 AM, Ren? Rebe wrote:
> From: Jens Axboe <axboe@kernel.dk>
>
>> On 11/14/25 6:41 AM, Rene Rebe wrote:
>>> For years I wondered why the floppy driver does not just work on
>>> sparc64, e.g:
>>>
>>> root@SUNW_375_0066:# disktype /dev/fd0
>>> --- /dev/fd0
>>> disktype: Can't open /dev/fd0: No such device or address
>>>
>>> [ 525.341906] disktype: attempt to access beyond end of device
>>> fd0: rw=0, sector=0, nr_sectors = 16 limit=8
>>> [ 525.341991] floppy: error 10 while reading block 0
>>>
>>> Turns out floppy.c __floppy_read_block_0 tries to read one page for
>>> the first test read to determine the disk size and thus fails if that
>>> is greater than 4k. Adjust minimum MAX_DISK_SIZE to PAGE_SIZE to fix
>>> floppy on sparc64 and likely all other PAGE_SIZE != 4KB configs.
>>
>> 16k seem like a lot to read from a floppy, no? Why isn't it just
>> reading a single 512b sector? Or just cap it at 4k rather than do
>> a full page, at least?
>
> Well, on my sparc64.config it is just 8k and I did not feel like
> changing this vintage code more than was necessiary to write a floppy
> for a Firmware update of another systems while my Ultra10 was the only
> system with a floppy drive in my office. But even 16k or 64k is not
> that much of a 1.44mb disk.
64k is 4% of a floppy disk! But I hear you, works for you.
> But if someone wants to refactor this code some more, ... I'm happy to
> test it, too ;-)
I don't think refactoring would be required here, it's probably just
capping that probe read to something constant irrespective of hardware
page sizes.
--
Jens Axboe
next prev parent reply other threads:[~2025-11-14 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 13:41 [PATCH] fix floppy for PAGE_SIZE != 4KB Rene Rebe
2025-11-14 16:11 ` Jens Axboe
2025-11-14 16:25 ` René Rebe
2025-11-14 17:39 ` Jens Axboe [this message]
2025-11-14 18:21 ` René Rebe
2025-11-17 9:56 ` René Rebe
2025-11-17 13:23 ` Jens Axboe
2025-11-17 13:57 ` René Rebe
2025-11-17 15:23 ` Jens Axboe
2025-11-19 9:00 ` John Paul Adrian Glaubitz
2025-11-19 9:12 ` René Rebe
2025-11-19 9:22 ` John Paul Adrian Glaubitz
2025-11-19 9:24 ` René Rebe
2025-11-19 9:39 ` John Paul Adrian Glaubitz
2025-11-19 15:00 ` Jens Axboe
2025-11-19 8:58 ` John Paul Adrian Glaubitz
2025-11-17 15:23 ` Jens Axboe
2025-11-22 10:28 ` Gregor Riepl
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=fec67c88-53f5-4482-aeef-86e1213d187e@kernel.dk \
--to=axboe@kernel.dk \
--cc=efremov@linux.com \
--cc=linux-block@vger.kernel.org \
--cc=rene@exactco.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