Skip to content

Remove isa_unchecked_dma and some more GFP_DMAs in the mid layer v3

Andi Kleen linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest19 of 20 patches 30 repliesIn review

19 of 20 patches are in this archive. The cover letter announces 20.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20Add sense_buffer_isa to host templateDocumentation/scsi/scsi_mid_low_api.txt drivers/scsi/hosts.c drivers/scsi/scsi.c +1 more+12 -10 replies
2/20Remove unchecked_isa in BusLogicdrivers/scsi/BusLogic.c+59 -180 replies
3/20Remove unchecked_isa_dma in advansys.cdrivers/scsi/advansys.c+103 -590 replies
4/20Remove unchecked_isa_dma in gdthdrivers/scsi/gdth.c+62 -190 replies
5/20Remove unchecked_isa_dma in eata.cdrivers/scsi/eata.c+39 -150 replies
6/20Remove unchecked_isa_dma in aha1542drivers/scsi/aha1542.c+30 -100 replies
7/20Remove unchecked_isa_dma in aha152x/wd7000/sym53c416/u14-34f/NCR53c406adrivers/scsi/NCR53c406a.c drivers/scsi/aha152x.c drivers/scsi/sym53c416.c +3 more+124 -370 replies
8/20Remove random noop unchecked_isa_dma usersdrivers/scsi/arm/acornscsi.c drivers/scsi/arm/cumana_1.c drivers/scsi/dc395x.c +5 more+0 -90 replies
9/20Add blk_kmalloc/blk_alloc_pagesblock/blk-settings.c include/linux/blkdev.h+26 -019 replies
11/20Remove unchecked_isa_dma support for hostdatadrivers/scsi/hosts.c+0 -30 replies
12/20Remove unchecked_isa_dma checks in sg.cdrivers/scsi/sg.c+12 -350 replies
13/20Use blk_kmalloc in scsi_scandrivers/scsi/scsi_scan.c+6 -70 replies
14/20Don't disable direct_io for unchecked_isa_dma in st.cdrivers/scsi/st.c+1 -19 replies
15/20Remove automatic block layer bouncing for unchecked_isa_dmadrivers/scsi/scsi_lib.c+0 -20 replies
16/20Convert sr driver over the blk_kmallocdrivers/scsi/sr.c drivers/scsi/sr_ioctl.c drivers/scsi/sr_vendor.c+19 -230 replies
17/20Remove unchecked_isa_dma from sysfsdrivers/scsi/scsi_sysfs.c+0 -20 replies
18/20Switch to a single SCSI command pooldrivers/scsi/scsi.c+26 -260 replies
19/20Finally kill unchecked_isa_dmaDocumentation/scsi/scsi_mid_low_api.txt drivers/scsi/hosts.c include/scsi/scsi_host.h+0 -100 replies
20/20Convert DMA buffers in ch.c to allocate via the block layerdrivers/scsi/ch.c+7 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH] [0/20] Remove isa_unchecked_dma and some more GFP_DMAs in the mid layer v3

v2: various cleanups, use dma_alloc_coherent instead of naked GFP_DMA
add blk_* allocators to avoid bouncing in SCSI scan
v3: Remove cmnd/sense buffer bouncing in advansys.
Replace sense_buffer_mask with a single bit

Original description:

This patchkit fixes all existing drivers that used isa_unchecked_dma to not need that anymore. I have some upcoming infrastructure changes for DMA memory management and isa_unchecked_dma was in the way.

Enabling isa_unchecked_dma had several effects:
- All incoming scsi_cmnds were in GFP_DMA memory.
Only one driver relied on that actually (advansys), the others all accessed the scsi_cmnds only with the CPU.
- scsi hostdata is allocated with GFP_DMA
A lot of drivers relied on that. I converted them all to allocate hostdata in a separate buffer linked to rom the scsi host structure.
- Enabling block layer bouncing for all data. That's the most important one. I changed all drivers to do that directly instead of relying on the mid layer for it.
- sense_buffer is allocated with GFP_DMA. That was also commonly required and not easy to fix so I created a separate host template field that enables sense_buffer bouncing.

Also while I was it I removed also a lot of GFP_DMAs in the frontend drivers which are not needed anymore because the block layer does the bouncing for all data anyways. Or rather we ask the block layer now to bounce.

The main problem of the patchkit is that is that I wasn't able to test the drivers because I don't have any of the hardware. All changes (except perhaps advansys) were relatively simple and straight forward so I don't expect many problems though.

If anybody has any of these ISA SCSI adapters and would be willing to test them with these patches that would be appreciated.
I suspect actually that some of the ISA drivers are actually already bitrotted independently of these changes. Hopefully they won't make anything worse though.

Patches against 2.6.25rc4

These are a lot of patches. I can set up a git tree if that makes merging easier. Please let me now if I should do that.

-Andi