Skip to content

More fixes, cleanup and modernization for NCR5380 drivers

Finn Thain linux-arm-kernel linux-m68k linux-scsi lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest78 patches 15 repliesIn review
  2. v377 patches 78 repliesSuperseded
  3. v272 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v171 patches110 repliesSuperseded

Changes in v4 from the cover letter

- Patch 67 removes another redundant comment.
- Patch 68 was split into two patches as requested.
- Latest Tested-By and Reviewed-By tags were added.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/78atari_scsi: Fix SCSI host ID settingdrivers/scsi/atari_scsi.c+1 -10 replies
2/78ncr5380: Remove redundant static variable initializersdrivers/scsi/NCR5380.c drivers/scsi/dtc.c drivers/scsi/g_NCR5380.c +3 more+16 -160 replies
3/78ncr5380: Eliminate PDEBUG*, TDEBUG* and DTCDEBUG* macrosdrivers/scsi/dtc.c drivers/scsi/dtc.h drivers/scsi/pas16.c +3 more+19 -970 replies
4/78ncr5380: Remove more pointless macrosdrivers/scsi/NCR5380.h drivers/scsi/g_NCR5380.c drivers/scsi/g_NCR5380.h +3 more+14 -480 replies
5/78ncr5380: Remove NCR5380_local_declare and NCR5380_setup macrosdrivers/scsi/NCR5380.c drivers/scsi/arm/cumana_1.c drivers/scsi/arm/oak.c +10 more+77 -1610 replies
6/78ncr5380: Remove NCR5380_instance_name macrodrivers/scsi/NCR5380.c drivers/scsi/g_NCR5380.c drivers/scsi/g_NCR5380.h+5 -60 replies
7/78ncr5380: Split NCR5380_init() into two functionsdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/arm/cumana_1.c +6 more+35 -140 replies
8/78ncr5380: Move NCR53C400-specific codedrivers/scsi/NCR5380.c drivers/scsi/g_NCR5380.c drivers/scsi/g_NCR5380.h+18 -270 replies
9/78atari_NCR5380: Reset bus on driver initialization if requireddrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+134 -120 replies
10/78atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOTdrivers/scsi/Kconfig drivers/scsi/NCR5380.c drivers/scsi/NCR5380.h +4 more+51 -1780 replies
11/78ncr5380: Simplify bus reset handlersdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+23 -270 replies
12/78ncr5380: Remove unused hostdata->aborted flagdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+0 -50 replies
13/78ncr5380: Remove redundant register writesdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+0 -50 replies
14/78ncr5380: Use return instead of goto in NCR5380_select()drivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+11 -250 replies
15/78ncr5380: Always escalate bad target time-out in NCR5380_select()drivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+0 -320 replies
16/78ncr5380: Proceed with next command after NCR5380_select() calls scsi_donedrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+10 -60 replies
17/78ncr5380: Keep BSY asserted when entering SELECTION phasedrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+11 -40 replies
18/78ncr5380: Eliminate USLEEP_WAITLONG delaydrivers/scsi/NCR5380.c drivers/scsi/g_NCR5380.c+5 -150 replies
19/78ncr5380: Cleanup bogus {request,release}_region() callsdrivers/scsi/arm/cumana_1.c drivers/scsi/dtc.c drivers/scsi/pas16.c +1 more+0 -120 replies
20/78ncr5380: Introduce unbound workqueuedrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/arm/cumana_1.c +10 more+96 -410 replies
21/78ncr5380: Sleep when polling, if possibledrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+94 -530 replies
22/78ncr5380: Eliminate selecting statedrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+29 -960 replies
23/78ncr5380: Always retry arbitration and selectiondrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+2 -20 replies
24/78ncr5380: Implement NCR5380_dma_xfer_len and remove LIMIT_TRANSFERSIZE macrodrivers/scsi/NCR5380.c drivers/scsi/arm/cumana_1.c drivers/scsi/arm/oak.c +8 more+55 -300 replies
25/78ncr5380: Rework disconnect versus poll logicdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c +1 more+15 -1610 replies
26/78ncr5380: Fix NCR5380_transfer_pio() resultdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+15 -80 replies
27/78ncr5380: Add missing lock in eh_abort_handlerdrivers/scsi/NCR5380.c+8 -10 replies
28/78ncr5380: Drop DEF_SCSI_QCMD macrodrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+16 -160 replies
29/78ncr5380: Remove references to linked commandsdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+0 -1020 replies
30/78ncr5380: Add missing break after case MESSAGE_REJECTdrivers/scsi/NCR5380.c+1 -00 replies
31/78ncr5380: Fix !REQ timeout in do_abort()drivers/scsi/NCR5380.c+5 -50 replies
32/78ncr5380: Fix bus phase in do_abort()drivers/scsi/NCR5380.c+2 -20 replies
33/78atari_NCR5380: Set do_abort() timeoutsdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+34 -260 replies
34/78atari_NCR5380: Use arbitration timeoutdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+49 -527 replies
35/78ncr5380: Dont wait for BUS FREE after disconnectdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+0 -180 replies
36/78ncr5380: Use work_struct instead of delayed_workdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h+5 -80 replies
37/78ncr5380: Standardize work queueing algorithmdrivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+6 -750 replies
38/78ncr5380: Remove UNSAFE macrodrivers/scsi/NCR5380.c drivers/scsi/dtc.c drivers/scsi/pas16.c+0 -180 replies
39/78ncr5380: Standardize interrupt handlingdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c drivers/scsi/dtc.c +1 more+180 -1730 replies
40/78ncr5380: Introduce NCR5380_poll_politely2drivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+75 -530 replies
41/78ncr5380: Replace redundant flags with FLAG_NO_DMA_FIXUPdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/dtc.c +1 more+25 -530 replies
42/78ncr5380: Replace READ_OVERRUNS macro with FLAG_NO_DMA_FIXUPSdrivers/scsi/NCR5380.c+11 -170 replies
43/78ncr5380: Standardize reselection handlingdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+93 -720 replies
44/78ncr5380: Fix off-by-one bug in extended_msg[] bounds checkdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+4 -30 replies
45/78ncr5380: Cleanup #include directivesdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/arm/cumana_1.c +9 more+7 -340 replies
46/78ncr5380: Fix NDEBUG_NO_DATAOUT flagdrivers/scsi/NCR5380.c+1 -10 replies
47/78ncr5380: Fix and cleanup scsi_host_template initializersdrivers/scsi/atari_scsi.c drivers/scsi/dmx3191d.c drivers/scsi/dtc.c +9 more+82 -1110 replies
48/78atari_NCR5380: Fix queue_size limitdrivers/scsi/atari_NCR5380.c+2 -120 replies
49/78ncr5380: Remove redundant ICR_ARBITRATION_LOST test and eliminate FLAG_DTC3181Edrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c +2 more+3 -250 replies
50/78ncr5380: Change instance->host_lock to hostdata->lockdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+109 -1090 replies
51/78ncr5380: Remove command list debug codedrivers/scsi/NCR5380.c drivers/scsi/arm/oak.c drivers/scsi/atari_NCR5380.c +3 more+9 -1620 replies
52/78ncr5380: Remove H_NO macro and introduce dsprintkdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+38 -300 replies
53/78ncr5380: Use shost_priv helperdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+17 -260 replies
54/78ncr5380: Use dsprintk() for queue debuggingdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+47 -320 replies
55/78ncr5380: Remove LIST and REMOVE macrosdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+0 -510 replies
56/78ncr5380: Remove redundant volatile qualifiersdrivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+7 -70 replies
57/78ncr5380: Use standard list data structuredrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/arm/cumana_1.c +10 more+106 -4210 replies
58/78ncr5380: Refactor command completiondrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+55 -220 replies
59/78ncr5380: Fix autosense bugsdrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+249 -1860 replies
60/78ncr5380: Implement new eh_abort_handlerdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+282 -300 replies
61/78ncr5380: Fix EH during arbitration and selectiondrivers/scsi/NCR5380.c drivers/scsi/NCR5380.h drivers/scsi/atari_NCR5380.c+119 -430 replies
62/78ncr5380: Implement new eh_bus_reset_handlerdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+72 -170 replies
63/78atari_NCR5380: Remove HOSTNO macro from printk() and seq_printf() callsdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+18 -220 replies
64/78atari_NCR5380: Eliminate HOSTNO macrodrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+84 -890 replies
65/78atari_scsi, sun3_scsi: Remove global Scsi_Host pointerdrivers/scsi/atari_NCR5380.c drivers/scsi/atari_scsi.c drivers/scsi/sun3_scsi.c+36 -700 replies
66/78ncr5380: Fix soft lockupsdrivers/scsi/NCR5380.c drivers/scsi/arm/cumana_1.c drivers/scsi/arm/oak.c +7 more+16 -40 replies
67/78ncr5380: Cleanup commentsdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+53 -2240 replies
68/78ncr5380: Fix trailing whitespace using regexpdrivers/scsi/NCR5380.c+186 -1860 replies
69/78ncr5380: Fix whitespace in comments using regexpdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+157 -1577 replies
70/78ncr5380: Merge changes from atari_NCR5380.cdrivers/scsi/NCR5380.c+87 -680 replies
71/78atari_NCR5380: Merge changes from NCR5380.cdrivers/scsi/atari_NCR5380.c+52 -320 replies
72/78ncr5380: Cleanup whitespace and parenthesesdrivers/scsi/NCR5380.c drivers/scsi/atari_NCR5380.c+32 -240 replies
73/78ncr5380: Fix pseudo DMA transfers on 53C400drivers/scsi/g_NCR5380.c+4 -00 replies
74/78ncr5380: Use runtime register mappingdrivers/scsi/NCR5380.h drivers/scsi/g_NCR5380.c drivers/scsi/g_NCR5380.h+49 -640 replies
75/78ncr5380: Enable PDMA for NCR53C400Adrivers/scsi/g_NCR5380.c+19 -40 replies
76/78ncr5380: Enable PDMA for DTC chipsdrivers/scsi/g_NCR5380.c drivers/scsi/g_NCR5380.h+33 -80 replies
77/78ncr5380: Fix wait for 53C80 registers registers after PDMAdrivers/scsi/g_NCR5380.c+6 -310 replies
78/78ncr5380: Add support for HP C2502drivers/scsi/g_NCR5380.c drivers/scsi/g_NCR5380.h+59 -160 replies

Reviews trailers per patch

All 78 patches have a Reviewed-by or Acked-by.

PatchHannes ReineckeMichael SchmitzOndrej Zary
1/78R-b T-b
2/78R-b T-b
3/78R-b
4/78R-b T-b
5/78R-b T-b
6/78R-b T-b
7/78R-b T-b
8/78R-b T-b
9/78R-b T-b T-b
10/78R-b T-b T-b
11/78R-b T-b T-b
12/78R-b T-b T-b
13/78R-b T-b T-b
14/78R-b T-b T-b
15/78R-b T-b T-b
16/78R-b T-b T-b
17/78R-b T-b T-b
18/78R-b T-b
19/78R-b
20/78R-b T-b T-b
21/78R-b T-b T-b
22/78R-b T-b T-b
23/78R-b T-b T-b
24/78R-b T-b T-b
25/78R-b T-b T-b
26/78R-b T-b T-b
27/78R-b T-b
28/78R-b T-b T-b
29/78R-b T-b T-b
30/78R-b T-b
31/78R-b T-b
32/78R-b T-b
33/78R-b T-b T-b
34/78R-b T-b T-b
35/78R-b T-b T-b
36/78R-b T-b
37/78R-b T-b
38/78R-b T-b
39/78R-b T-b T-b
40/78R-b T-b T-b
41/78R-b T-b
42/78R-b T-b
43/78R-b T-b T-b
44/78R-b T-b T-b
45/78R-b T-b T-b
46/78R-b T-b
47/78R-b T-b T-b
48/78R-b T-b
49/78R-b T-b T-b
50/78R-b T-b T-b
51/78R-b T-b T-b
52/78R-b T-b T-b
53/78R-b T-b T-b
54/78R-b T-b T-b
55/78R-b T-b T-b
56/78R-b T-b T-b
57/78R-b T-b T-b
58/78R-b T-b T-b
59/78R-b T-b T-b
60/78R-b T-b T-b
61/78R-b T-b T-b
62/78R-b T-b T-b
63/78R-b T-b T-b
64/78R-b T-b T-b
65/78R-b T-b
66/78R-b T-b T-b
67/78R-b T-b T-b
68/78R-b T-b T-b
69/78R-b T-b T-b
70/78R-b T-b
71/78R-b T-b
72/78R-b T-b T-b
73/78R-b
74/78R-b
75/78R-b
76/78R-b
77/78R-b
78/78R-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 v4 thread

Cover letter [PATCH v4 00/78] More fixes, cleanup and modernization for NCR5380 drivers

Like my previous work on the NCR5380 drivers, this patch series has bug fixes, code cleanup and modernization. These drivers suffer from mistakes, poor style and neglect and this long series addresses the worst of it, covering all ten wrapper drivers and both of the core driver forks. The combined size of the drivers is reduced by over 700 LoC.

This series continues to reduce divergence between the two core driver forks, often by copying a bug fix from one to the other. Most patches are larger for having to keep the two forks in sync. Making the same change to both is churn if one of them is to be removed but neither can be as yet. By the end of this series the diff between the two forks is minimal, so it becomes clear what caused the fork and what can be done about it.

This patch series did benefit from scripts/checkpatch.pl but not too much. Decades ago, these drivers started out with 4-space tabs and if the 80 column limit were to be strictly enforced now, it would require adding new functions and shortening identifiers. I would defer this sort of activity until after the fork has been resolved.

All patches to all NCR5380 drivers (x86, ARM, m68k) have been compile- tested. The mac_scsi, dmx3191d, g_NCR5380 and atari_scsi modules were regression tested on suitable hardware.

Changes since v1:
- Patch 8 omits a pointless assignment.
- Patch 10 gets a better error message.
- Patch 20 drops the WQ_CPU_INTENSIVE flag.
- Patch 21 adds timing calibration for the register polling loop.
- Patch 49 is replaced by a new one that removes FLAG_DTC3181E.
- Patch 72 by Ondrej Zary was added to fix pseudo DMA on 53C400.

Changes since v2:
- Patch 21 has better calibration with low HZ values.
- Patch 57 no longer attempts to dereference a NULL pointer on Atari.
- Patch 66 initializes max_sectors in the host templates.
- Patches 73 thru 77 by Ondrej Zary were added with additional fixes for 53C400-compatible cards.

Changes since v3:
- Patch 67 removes another redundant comment.
- Patch 68 was split into two patches as requested.
- Latest Tested-By and Reviewed-By tags were added.

---
 drivers/scsi/Kconfig         |   17 
 drivers/scsi/NCR5380.c       | 2876 +++++++++++++++++++------------------------
 drivers/scsi/NCR5380.h       |   87 -
 drivers/scsi/arm/cumana_1.c  |   31 
 drivers/scsi/arm/oak.c       |   27 
 drivers/scsi/atari_NCR5380.c | 2280 +++++++++++++++-------------------
 drivers/scsi/atari_scsi.c    |  102 -
 drivers/scsi/dmx3191d.c      |   33 
 drivers/scsi/dtc.c           |  115 -
 drivers/scsi/dtc.h           |   45 
 drivers/scsi/g_NCR5380.c     |  408 +++---
 drivers/scsi/g_NCR5380.h     |   66 
 drivers/scsi/mac_scsi.c      |  117 -
 drivers/scsi/pas16.c         |  116 -
 drivers/scsi/pas16.h         |   40 
 drivers/scsi/sun3_scsi.c     |  141 --
 drivers/scsi/t128.c          |  102 -
 drivers/scsi/t128.h          |   39 
 18 files changed, 2947 insertions(+), 3695 deletions(-)