Re: [PATCH 08/31] swim: Don't start motor until medium is present

Laurent Vivier <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k
Message-ID <[email protected]>
Le 16/07/2026 à 12:02, Finn Thain a écrit :
> The spindle motor should not be running when a disk is to be inserted.
> Don't start the motor while the drive is empty.
> 
> 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_mode_t mode)
>   		fs->ref_count++;
>   
>   	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_mode_t mode)
>   		goto out;
>   	}
>   
> +	swim_motor(base, ON);
> +	swim_action(base, SETMFM);
> +
>   	set_capacity(fs->disk, fs->total_secs);
>   
>   	if (mode & BLK_OPEN_NDELAY)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.