Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795060725; b=e6XdR0eu/r4J1Aua3xyZxl7KwIylcka6ghSa5HKPBUprgPuYQHv1e32KkNVbjv+x8ZXo /rtHNcmd2q2aujsnWYPkZd1QgeiihayPeMsJMcl37eXA0wVBXjiQVZYaxS3487Z3lZWDs su7uKGkciy8HzZHlASbq6dSfjsgCjGCXvbMznzfcq7PHJ91nrkQFuwlwtbQsCLmz6/cgv eOZE/eE5fy3F0pwgWEKQTSd0zxo2MIJWhqBLwxC+yjsnL89eyX7OIxgFv55Bj38pIQ2Aw onFo8gGEnFiUl+0XiTLacMoKRxLQ2NvrZVLJFcHmu45dIYH7PY8TEBVgUHzZ9/3Y6Rg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795060725; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Ww5gZqNubFE/h4mro7v07bBzLN3kdfI6xZx4dqG/l+M=; b=HwZl8sfTMmOAj8Ae7OXlIYIi7orWN21Ip9ZoPxKKsa4ruK6PSDjppxoEPi0/kMvWcNJB 7qsLm0QtflT+bWwZkRqFw60HCOUQGFKwUpZ1H9I4nnkEOp/s65tbjIjaeVHb8DEtbS6OJ tD1G/XcN9ZWFiTjjh+u7APYKjD2fqzKfT1fh6OvuoSeFx84yFNILYdo6uVX1EJaflomYk E+XACujiu0BqRSaB2YQnz1+DgE0WuCF3cf3yxtLfLBOM5xTQ/qaBNLq3ds1+gGQYXl30U kMib9UTK62JThRinkQS0zIiHTpNw+tc6ZiueOctKchPFm1yaRMt51eOppsi5qc4UfuA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=sIlqZeke; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3A53606A325; Thu, 19 Nov 2026 03:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=sIlqZeke Received: by smtp.kernel.org (Postfix) with ESMTPSA id 012691F000C4; Thu, 19 Nov 2026 03:58:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795060725; bh=Ww5gZqNubFE/h4mro7v07bBzLN3kdfI6xZx4dqG/l+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sIlqZeke/Wcf7arD1Ptg+2TyyPStwnvqZ0Gv/qoeTQdOgpoX6VpR7UnkDP7/Hlp0Z L3Vm+BFStboAgBJZ0sxi2wLzEkRi2YUtYe10+b/evQfMQIyOiMLbeAUMbUJgUArOLr DDvo52xK3UvyQF4KkhUJUpHrlHPmYqFHjT80PfoY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Laurent Vivier , Finn Thain , Stan Johnson , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 1303/1848] swim: Enable the drive when probing Date: Wed, 18 Nov 2026 15:55:41 +0100 Message-ID: <20261118150014.044294328@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118145911.150052362@linuxfoundation.org> References: <20261118145911.150052362@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Finn Thain [ Upstream commit 57d88c8f4ea34a4dd7c5351bd026e225c7283f3f ] According to the ISM spec, the MOTON bit "causes the Enable 1 and Enable 2 signals to be turned on to the drive." It doesn't actually turn on the motor. When selecting a drive, enable MOTON. Disable it upon eject or release. This fixes detection of the Sony FDHD drive. Reviewed-by: Laurent Vivier Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support") Signed-off-by: Finn Thain Tested-by: Stan Johnson Link: https://patch.msgid.link/f5bf5b596a33a801faaaaa6dc2844c30d3ee82b2.1788513996.git.fthain@linux-m68k.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/swim.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 49fa12f2d97c4..b65e781a2bda6 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -153,8 +153,9 @@ struct iwm { /*----------------------------------------------------------------------------*/ enum drive_location { - INTERNAL_DRIVE = 0x02, - EXTERNAL_DRIVE = 0x04, + NO_DRIVE = 0, + INTERNAL_DRIVE = BIT(1), + EXTERNAL_DRIVE = BIT(2), }; enum media_type { @@ -309,9 +310,15 @@ static inline void swim_drive(struct swim __iomem *base, if (location == INTERNAL_DRIVE) { swim_write(base, mode0, EXTERNAL_DRIVE); /* clear drive 1 bit */ swim_write(base, mode1, INTERNAL_DRIVE); /* set drive 0 bit */ + swim_write(base, mode1, MOTON); } else if (location == EXTERNAL_DRIVE) { swim_write(base, mode0, INTERNAL_DRIVE); /* clear drive 0 bit */ swim_write(base, mode1, EXTERNAL_DRIVE); /* set drive 1 bit */ + swim_write(base, mode1, MOTON); + } else { + swim_write(base, mode0, INTERNAL_DRIVE); + swim_write(base, mode0, EXTERNAL_DRIVE); + swim_write(base, mode0, MOTON); } } @@ -445,6 +452,7 @@ static int floppy_eject(struct floppy_state *fs) swim_drive(base, fs->location); swim_motor(base, OFF); swim_eject(base); + swim_drive(base, NO_DRIVE); fs->disk_in = 0; fs->ejected = 1; @@ -652,8 +660,10 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) else if (fs->ref_count > 0) --fs->ref_count; - if (fs->ref_count == 0) + if (fs->ref_count == 0) { swim_motor(base, OFF); + swim_drive(base, NO_DRIVE); + } return err; } @@ -682,6 +692,7 @@ static void floppy_release(struct gendisk *disk, fmode_t mode) if (fs->ref_count == 0) { swim_drive(base, fs->location); swim_motor(base, OFF); + swim_drive(base, NO_DRIVE); } mutex_unlock(&swim_mutex); } @@ -799,6 +810,7 @@ static int swim_floppy_init(struct swim_priv *swd) if (swim_readbit(base, DRIVE_PRESENT) && !swim_readbit(base, ONEMEG_DRIVE)) swim_add_floppy(swd, EXTERNAL_DRIVE); + swim_drive(base, NO_DRIVE); /* register floppy drives */ -- 2.53.0