Linux block layer
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jens Axboe <axboe@kernel.dk>, Laurent Vivier <lvivier@redhat.com>,
	linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v2 08/10] block/swim: Check drive type
Date: Wed, 11 Apr 2018 20:50:14 -0400 (EDT)	[thread overview]
Message-ID: <bd4e42a4e661ced92849d33bdc3ebf8d4f283dc8.1523493475.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1523493475.git.fthain@telegraphics.com.au>

The SWIM chip is compatible with GCR-mode Sony 400K/800K drives but
this driver only supports MFM mode. Therefore only Sony FDHD drives
are supported. Skip incompatible drives.

Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: stable@vger.kernel.org # v4.14+
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Laurent Vivier <lvivier@redhat.com>
---
 drivers/block/swim.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index d1ee4670666a..c8c8b9da3edd 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -829,10 +829,12 @@ static int swim_floppy_init(struct swim_priv *swd)
 	/* scan floppy drives */
 
 	swim_drive(base, INTERNAL_DRIVE);
-	if (swim_readbit(base, DRIVE_PRESENT))
+	if (swim_readbit(base, DRIVE_PRESENT) &&
+	    !swim_readbit(base, ONEMEG_DRIVE))
 		swim_add_floppy(swd, INTERNAL_DRIVE);
 	swim_drive(base, EXTERNAL_DRIVE);
-	if (swim_readbit(base, DRIVE_PRESENT))
+	if (swim_readbit(base, DRIVE_PRESENT) &&
+	    !swim_readbit(base, ONEMEG_DRIVE))
 		swim_add_floppy(swd, EXTERNAL_DRIVE);
 
 	/* register floppy drives */
-- 
2.16.1

  parent reply	other threads:[~2018-04-12  0:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  0:50 [PATCH v2 00/10] SWIM driver fixes Finn Thain
2018-04-12  0:50 ` [PATCH v2 03/10] m68k/mac: Don't remap SWIM MMIO region Finn Thain
2018-04-12  0:50 ` [PATCH v2 06/10] block/swim: Don't log an error message for an invalid ioctl Finn Thain
2018-04-12  0:50 ` Finn Thain [this message]
2018-04-12  0:50 ` [PATCH v2 04/10] block/swim: Fix array bounds check Finn Thain
2018-04-12  0:50 ` [PATCH v2 01/10] m68k/mac: Revisit floppy disc controller base addresses Finn Thain
2018-04-12  0:50 ` [PATCH v2 07/10] block/swim: Rename macros to avoid inconsistent inverted logic Finn Thain
2018-04-12  0:50 ` [PATCH v2 09/10] block/swim: Fix IO error at end of medium Finn Thain
2018-04-12  0:50 ` [PATCH v2 05/10] block/swim: Remove extra put_disk() call from error path Finn Thain
2018-04-12  0:50 ` [PATCH v2 02/10] m68k/mac: Fix SWIM memory resource end address Finn Thain
2018-04-18  8:08   ` Geert Uytterhoeven
2018-04-12  0:50 ` [PATCH v2 10/10] block/swim: Select appropriate drive on device open Finn Thain
2018-04-16 23:27 ` [PATCH v2 00/10] SWIM driver fixes Finn Thain
2018-04-17  3:50   ` Jens Axboe
2018-04-18  0:05   ` Finn Thain

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=bd4e42a4e661ced92849d33bdc3ebf8d4f283dc8.1523493475.git.fthain@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=axboe@kernel.dk \
    --cc=geert@linux-m68k.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=lvivier@redhat.com \
    --cc=stable@vger.kernel.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