From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8982319601 for ; Mon, 17 Aug 2026 01:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786931689; cv=none; b=XSTiKXVsShLWFWi7h3vxwe2rGzFGs6lNagqihuIFSz2pxCbWWOk+/xwml9MvY4k0FIJ61wrjPMKS+CJ+ucpeMCgpqQJ1QkcKM5jnWyMQkuhoAybsucCgHxJo5idUHpauhXjw5/Q/Q0GOQCrWwLsgu87Y5weAfDMxJvyvSLiOKFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786931689; c=relaxed/simple; bh=TRCASMM7eelgWS4DcL5aA99Epa/8OLjxiXSiA4njPe0=; h=To:Cc:Message-ID:In-Reply-To:References:From:Subject:Date; b=YouKioQyeyRsXtEkF4hUJ6q0tqoViUonX4ogBWT/1/jt5Lp59oLZ8BjkjCi191jvJQCkkNQm2DZyXzHnjNGlfwtyNNDoqG6Tpwd/rzRx6Y0UAkHu0krQb0jowcPa39tCoYxhkUYv1lHV9E4kJhqoYAwDv1/LVc6pt07mIsoJqQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dchVLJ/m; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dchVLJ/m" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 11A19EC0218; Sun, 16 Aug 2026 21:54:47 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 16 Aug 2026 21:54:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1786931687; x= 1787018087; bh=RppOGoUsMSAGAcgwd3QV2Wk6AOZv4y+7OKDIjYynE4A=; b=d chVLJ/mUha6YoQvZLZ9zIiASkesdKXZbl2YPDTUjSUPeo+HXy82VCHwi3Kn2e2fB vWaOm389zaHBmAG1fUQFwyNXeHdBCs0N9DkUZ0LdFPhPi6elYIkTYcyGU8pmTdGf h8fVAC+JNa3xiM+fU7TYzzPeTtl5yJGCyEHg8KobJ+EW7Asc1+m9YVwH56zhdJ/4 wdFKQ6kmvH1+S2zqegEAZIcTg5c/36FF+Da3pfllnJmGWBGtZOCmD9BYoK9IQU95 M04v1851GlHh03s3AkNCPgnTHkYgPM4jXI1Zums/KRNzD8YUAx2NgvDL3qWPG33n 8s1KGTNni1xBYpVxwluqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTE4hc50xdhPXg/illULTp+C8DYFyqEdlu6WRFncsb6QnuuT/gcUnwV28CSittpzBY CanXMgLJ3D2f99+6fhcgPhKU62j4D/361qP39o0jreF8A1XJd9tbHbTT3THo+0Ngxn+KIR xmSykI00CRbwgNWRv8pmFJk9w9o4Guyae/9OdRSlW4+G/cXS4TLBuEOOa7VrQ1zx7uzt0k aiRQ8f78TROqGsNBFEeFBQ0S+1oq+UQzE0LFPz+xu5GHoHcx5q9+AQ38+8xzR6IOKHtWR9 dd2Vu8AeIxRK7b1SVEdgm5fqxWGAl0hW++r8vV0P6QNaTx9jFo8LB1mZXd3D6ux6m/Q5me THjWiT+VMA1Ltq4sOgLLJoLEWYhvba+VQFstjRHuyHcmohW5XCOM5uwMnpQff78cE2NPG2 opFKy+ubeYWiVqVNcl/2wuI16WaAjkHJP3OTQXXM74hsSZU9UxJm5+xr2wgubPkQJR8jpN MFEsb3RNYAyQ5Y7Ys72DCWbkEXLyPWim2XHdlcHXCezDqJndO8W//Rht5Q9aVBxKaGK1hp O/7i5tu0GCWcYwnSyrmamVekAMEqP6U+NNsgpqUiOETDqK8plaGtvkdYbzH96kHTbXLb1B 0jT2QYcA7FQPdJe9BAOfGDSCDL9x3t/HcwWa/LjKYrrv/+3uw8BWHWzyTw6A X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 16 Aug 2026 21:54:44 -0400 (EDT) To: Jens Axboe , Laurent Vivier Cc: Geert Uytterhoeven , Joshua Thompson , linux-block@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-ID: <4e4872708c26a128962a9a2e08fd364b5a8319cf.1786929430.git.fthain@linux-m68k.org> In-Reply-To: References: From: Finn Thain Subject: [PATCH v2 03/32] swim: Enable the drive when probing Date: Mon, 17 Aug 2026 11:17:10 +1000 Precedence: bulk X-Mailing-List: linux-m68k@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 --- 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 4721e073a874..4ddb87977fe1 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -154,8 +154,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 { @@ -311,9 +312,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); } } @@ -447,6 +454,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 gendisk *disk, blk_mode_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) if (fs->ref_count == 0) { swim_drive(base, fs->location); swim_motor(base, OFF); + swim_drive(base, NO_DRIVE); } mutex_unlock(&swim_mutex); } @@ -804,6 +815,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.52.0