Skip to content

Remove isa_unchecked_dma and some more GFP_DMAs in the mid layer v2

Andi Kleen linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 of 21 patches 7 repliesIn review

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

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21Add new sense_buffer_mask host template fieldDocumentation/scsi/scsi_mid_low_api.txt drivers/scsi/hosts.c drivers/scsi/scsi.c +1 more+25 -20 replies
2/21Remove unchecked_isa in BusLogicdrivers/scsi/BusLogic.c+59 -180 replies
3/21Remove unchecked_isa_dma in advansys.cdrivers/scsi/advansys.c+166 -654 replies
4/21Remove unchecked_isa_dma in gdthdrivers/scsi/gdth.c+62 -190 replies
5/21Remove unchecked_isa_dma in eata.cdrivers/scsi/eata.c+39 -150 replies
6/21Remove unchecked_isa_dma in aha1542drivers/scsi/aha1542.c+30 -100 replies
7/21Remove 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/21Remove 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/21Add blk_kmalloc/blk_alloc_pagesblock/blk-settings.c include/linux/blkdev.h+25 -00 replies
11/21Remove unchecked_isa_dma support for hostdatadrivers/scsi/hosts.c+0 -30 replies
12/21Remove unchecked_isa_dma checks in sg.cdrivers/scsi/sg.c+12 -350 replies
13/21Use blk_kmalloc in scsi_scandrivers/scsi/scsi_scan.c+6 -70 replies
14/21Don't disable direct_io for unchecked_isa_dma in st.cdrivers/scsi/st.c+1 -10 replies
15/21Remove automatic block layer bouncing for unchecked_isa_dmadrivers/scsi/scsi_lib.c+0 -20 replies
16/21Convert sr driver over the blk_kmallocdrivers/scsi/sr.c drivers/scsi/sr_ioctl.c drivers/scsi/sr_vendor.c+19 -230 replies
17/21Remove unchecked_isa_dma from sysfsdrivers/scsi/scsi_sysfs.c+0 -20 replies
18/21Switch to a single SCSI command pooldrivers/scsi/scsi.c+24 -230 replies
19/21Finally remove unchecked_isa_dma support for Cmndsdrivers/scsi/scsi.c+1 -20 replies
20/21Finally kill unchecked_isa_dmaDocumentation/scsi/scsi_mid_low_api.txt drivers/scsi/hosts.c include/scsi/scsi_host.h+0 -100 replies
21/21Convert 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/21] Remove isa_unchecked_dma and some more GFP_DMAs in the mid layer v2

This is v2 of the patchkit. I believe I addressed all review feedback and did some more improvements. In particular the drivers all use dma_alloc_coherent now (but with NULL devices) and scsi scan etc. will not do any unnecessary bouncing. This is done by extending the block layer to export two new allocation functions for non bouncy memory. That is why you're in Cc, Jens.

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.

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