From: John Snow <jsnow@redhat.com>
To: "Hervé Poussineau" <hpoussin@reactos.org>,
"Alexander Bulekov" <alxndr@bu.edu>,
qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
"open list:Floppy" <qemu-block@nongnu.org>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH] floppy: remove unused function fdctrl_format_sector
Date: Tue, 27 Apr 2021 14:13:34 -0400 [thread overview]
Message-ID: <e2f6a706-7f2e-65b2-5c0d-4c717b0b3baf@redhat.com> (raw)
In-Reply-To: <453fb830-673e-d2eb-47b6-41c8ed7bad42@reactos.org>
On 3/14/21 3:53 AM, Hervé Poussineau wrote:
> Le 12/03/2021 à 07:45, John Snow a écrit :
>> On 1/8/21 6:01 PM, Alexander Bulekov wrote:
>>> fdctrl_format_sector was added in
>>> baca51faff ("updated floppy driver: formatting code, disk geometry
>>> auto detect (Jocelyn Mayer)")
>>>
>>> The single callsite is guarded by a check:
>>> fdctrl->data_state & FD_STATE_FORMAT
>>>
>>> However, the only place where the FD_STATE_FORMAT flag is set (in
>>> fdctrl_handle_format_track) is closely followed by the same flag being
>>> unset, with no possibility to call fdctrl_format_sector in between.
>>>
>>
>> Hm, was this code *ever* used? It's hard to tell when we go back into
>> the old SVN history.
>>
>> Does this mean that fdctrl_handle_format_track is also basically an
>> incomplete stub method?
>>
>> I'm in favor of deleting bitrotted code, but I wonder if we should
>> take a bigger bite.
>>
>> --js
>
> The fdctrl_format_sector has been added in SVN revision 671
> (baca51faff03df59386c95d9478ede18b5be5ec8), along with
> FD_STATE_FORMAT/FD_FORMAT_CMD.
> As with current code, the only place where the FD_STATE_FORMAT flag was
> set (in fdctrl_handle_format_track) is closely followed by the same flag
> being unset, with no possibility to call fdctrl_format_sector in between.
>
> I can however see the following comment:
> /* Bochs BIOS is buggy and don't send format informations
> * for each sector. So, pretend all's done right now...
> */
> fdctrl->data_state &= ~FD_STATE_FORMAT;
>
> which was changed in SVN revision 2295
> (b92090309e5ff7154e4c131438ee2d540e233955) to:
> /* TODO: implement format using DMA expected by the Bochs BIOS
> * and Linux fdformat (read 3 bytes per sector via DMA and fill
> * the sector with the specified fill byte
> */
>
> This probably means that code may have worked without DMA (to be
> confirmed), but was disabled since its introduction due to a problem
> with Bochs BIOS.
> Later, fdformat was also tested and not working.
>
> Since then, lots of work has also been done in DMA handling. I
> especially think at bb8f32c0318cb6c6e13e09ec0f35e21eff246413, which
> fixed a similar problem with floppy drives on IBM 40p machine.
> What happens when this flag unsetting is removed? Does fdformat now works?
>
> I think that we should either fix the code, or remove more code
> (everything related to fdctrl_format_sector, FD_STATE_FORMAT,
> FD_FORMAT_CMD, maybe even fdctrl_handle_format_track).
>
> Regards,
>
> Hervé
>
Alex, do you want to respin this following Hervé's suggestion for
additional deletions?
I doubt anyone has the time or interest to actually FIX this code, so we
may as well remove misleading code.
--js
prev parent reply other threads:[~2021-04-27 18:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 23:01 [PATCH] floppy: remove unused function fdctrl_format_sector Alexander Bulekov
2021-03-12 6:45 ` John Snow
2021-03-14 7:53 ` Hervé Poussineau
2021-04-27 18:13 ` John Snow [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=e2f6a706-7f2e-65b2-5c0d-4c717b0b3baf@redhat.com \
--to=jsnow@redhat.com \
--cc=alxndr@bu.edu \
--cc=hpoussin@reactos.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).