Re: [PATCH 08/31] swim: Don't start motor until medium is present
Laurent Vivier <[email protected]> Mon, 20 Jul 2026 21:02:24 +0200
| Newsgroups | org.kernel.vger.linux-m68k,org.kernel.vger.linux-block,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Le 16/07/2026 =C3=A0 12:02, Finn Thain a =C3=A9crit=C2=A0:
> The spindle motor should not be running when a disk is to be inserted.
> Don't start the motor while the drive is empty.
>=20
> Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
> Signed-off-by: Finn Thain <[email protected]>
> ---
> drivers/block/swim.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Laurent Vivier <[email protected]>
> diff --git a/drivers/block/swim.c b/drivers/block/swim.c
> index c49e584cd663..03a89916d4ed 100644
> --- a/drivers/block/swim.c
> +++ b/drivers/block/swim.c
> @@ -630,8 +630,7 @@ static int floppy_open(struct gendisk *disk, blk_mod=
e_t mode)
> fs->ref_count++;
> =20
> swim_drive(base, fs->location);
> - swim_motor(base, ON);
> - swim_action(base, SETMFM);
> +
> if (fs->ejected)
> setup_medium(fs);
> if (!fs->disk_in) {
> @@ -639,6 +638,9 @@ static int floppy_open(struct gendisk *disk, blk_mod=
e_t mode)
> goto out;
> }
> =20
> + swim_motor(base, ON);
> + swim_action(base, SETMFM);
> +
> set_capacity(fs->disk, fs->total_secs);
> =20
> if (mode & BLK_OPEN_NDELAY)