Skip to content

block/swim: Fixes and improvements

Finn Thain linux-block linux-m68k lkml 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest33 patches 2 repliesApplied
  2. v232 patches 3 repliesSuperseded
  3. v131 patches 37 repliesSuperseded

Changes in v3 from the cover letter

- Reviewed-by tags were dropped from patches 1/32, 9/32, 13/32 and 16/32 because of unreviewed changes.
- Better assembly code in patch 13/32.
- Patch 23/32 improved upon to reduce excessive interrupt latency when medium errors are encountered.
- Patch 7/32 was split in two, and readability was improved as requested by Geert.
- Geert's acked-by tag was added.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/33swim: Assert strobe with stable outputsdrivers/block/swim.c+31 -310 replies
2/33swim: Select appropriate drive once onlydrivers/block/swim.c+3 -30 replies
3/33swim: Enable the drive when probingdrivers/block/swim.c+15 -30 replies
4/33swim: Don't disable drive after every sectordrivers/block/swim.c+0 -40 replies
5/33swim: Perform ISM/IWM mode switching according to specsdrivers/block/swim.c+7 -30 replies
6/33swim: Configure parameter memorydrivers/block/swim.c+13 -00 replies
7/33swim: Refactor SWIM setupdrivers/block/swim.c+3 -20 replies
8/33swim: Enable clock divider only where appropriatearch/m68k/mac/config.c drivers/block/swim.c+36 -40 replies
9/33swim: Don't start motor until medium is presentdrivers/block/swim.c+4 -20 replies
10/33swim: Recalibrate when drive is probeddrivers/block/swim.c+17 -200 replies
11/33swim: Add track zero recalibration delaydrivers/block/swim.c+4 -50 replies
12/33swim: Handle FIFO timeout errordrivers/block/swim_asm.S+1 -20 replies
13/33swim: Simplify return value initializationdrivers/block/swim_asm.S+3 -80 replies
14/33swim: Check for CRC errorsdrivers/block/swim_asm.S+10 -00 replies
15/33swim: Check error register during sector readdrivers/block/swim.c drivers/block/swim_asm.S+7 -140 replies
16/33swim: Don't use the mark register to read datadrivers/block/swim_asm.S+11 -100 replies
17/33swim: Fix buffer overflowdrivers/block/swim_asm.S+9 -70 replies
18/33swim: Convert to blocking queuedrivers/block/swim.c+3 -80 replies
19/33swim: Remove redundant RELAX actionsdrivers/block/swim.c+1 -70 replies
20/33swim: Deduplicate polling loopsdrivers/block/swim.c+8 -310 replies
21/33swim: Check drive ready bitdrivers/block/swim.c+22 -70 replies
22/33swim: Revisit delaysdrivers/block/swim.c+5 -10 replies
23/33swim: Remove pointless mode0 register writedrivers/block/swim.c+0 -10 replies
24/33swim: Don't needlessly re-read sectorsdrivers/block/swim.c drivers/block/swim_asm.S+65 -460 replies
25/33swim: Don't search beyond the first data markdrivers/block/swim_asm.S+40 -330 replies
26/33swim: Remove pointless specifiersdrivers/block/swim.c+10 -100 replies
27/33swim: Move swd initializationdrivers/block/swim.c+1 -20 replies
28/33swim: Add some helpful referencesdrivers/block/swim.c+8 -00 replies
29/33swim: Remove unused macro definitionsdrivers/block/swim.c+0 -140 replies
30/33swim: Clean up whitespacedrivers/block/swim.c drivers/block/swim_asm.S+27 -330 replies
31/33swim: Define macros for constantsdrivers/block/swim.c+5 -20 replies
32/33swim: Define symbols for constantsdrivers/block/swim_asm.S+14 -100 replies
33/33swim: Unexport global symbolsdrivers/block/swim_asm.S+112 -1060 replies

Reviews trailers per patch

26 of 33 patches have a Reviewed-by or Acked-by.

PatchLaurent VivierGeert UytterhoevenStan Johnson
SeriesT-b
1/33
2/33R-b
3/33R-b
4/33R-b
5/33R-b
6/33R-b
7/33
8/33R-b A-b
9/33R-b
10/33
11/33R-b
12/33R-b
13/33R-b
14/33
15/33R-b
16/33R-b
17/33
18/33R-b
19/33R-b
20/33R-b
21/33R-b
22/33R-b
23/33R-b
24/33
25/33
26/33R-b
27/33R-b
28/33R-b
29/33R-b
30/33R-b
31/33R-b
32/33R-b
33/33R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/33] block/swim: Fixes and improvements

I recently had a need for the 'swim' driver but found that it was too buggy to be useful for my purposes. I had two aims in mind--

Firstly, I needed this driver to help me test my new BMoW Floppy Emu for emulation correctness. Being that Linux is open source and MacOS is not, this driver should be ideal for that.

Secondly, I needed to realign the heads in some disk drives. The swim driver has most of the code needed for a feedback loop for manual re-alignment, so I wrote the remaining code and pushed it to a repo here:
https://github.com/fthain/linux/commits/swim/

These patches fix all the bugs I found. They improve stability, compatibility and performance. Additional patches improve source code quality by removing redundant code and cleaning up a bit.

This patch series was successfully tested on the following systems.

Mac Quadra 650 - SWIM 2 with Mitsubishi FDD
Mac LC III - SWIM 2 with Mitsubishi FDD and Sony FDD
Mac Quadra 700 - SWIM with Sony FDD
Mac IIvx - SWIM with Sony FDD

---

Changed since v1:
- Patches 1/31, 19/31, 23/31 were revised as per Laurent's remarks.
- Some minor improvements to patches 9/31, 13/31 and 16/31.
- Added patch 24/32 to fix a bug causing silent IO corruption instead of an IO error.

Changed since v2:
- Reviewed-by tags were dropped from patches 1/32, 9/32, 13/32 and 16/32 because of unreviewed changes.
- Better assembly code in patch 13/32.
- Patch 23/32 improved upon to reduce excessive interrupt latency when medium errors are encountered.
- Patch 7/32 was split in two, and readability was improved as requested by Geert.
- Geert's acked-by tag was added.

---

Finn Thain (33):
swim: Assert strobe with stable outputs
swim: Select appropriate drive once only
swim: Enable the drive when probing
swim: Don't disable drive after every sector
swim: Perform ISM/IWM mode switching according to specs
swim: Configure parameter memory
swim: Refactor SWIM setup
swim: Enable clock divider only where appropriate
swim: Don't start motor until medium is present
swim: Recalibrate when drive is probed
swim: Add track zero recalibration delay
swim: Handle FIFO timeout error
swim: Simplify return value initialization
swim: Check for CRC errors
swim: Check error register during sector read
swim: Don't use the mark register to read data
swim: Fix buffer overflow
swim: Convert to blocking queue
swim: Remove redundant RELAX actions
swim: Deduplicate polling loops
swim: Check drive ready bit
swim: Revisit delays
swim: Remove pointless mode0 register write
swim: Don't needlessly re-read sectors
swim: Don't search beyond the first data mark
swim: Remove pointless specifiers
swim: Move swd initialization
swim: Add some helpful references
swim: Remove unused macro definitions
swim: Clean up whitespace
swim: Define macros for constants
swim: Define symbols for constants
swim: Unexport global symbols

 arch/m68k/mac/config.c   |  31 ++-
 drivers/block/swim.c     | 451 ++++++++++++++++++++-------------------
 drivers/block/swim_asm.S | 356 +++++++++++++++---------------
 3 files changed, 452 insertions(+), 386 deletions(-)
Signature · 1 line
2.52.0