Add support for asynchronous scans to libata
Subsystems (3)
PATCH 1/1 Add support for asynchronous scans to libata
Some of the drivers (AHCI was mentioned to me as a culprit) take a long time to discover all the devices attached to them. Even for ones which are relatively quick, if you put a lot of them in a machine, it will take a long time in aggregate. This can be fixed by adding support for asynchronous scsi scans, which causes the time-consuming portions of initialisation to take place in threads.
drivers/ata/ahci.c +2 -0
@@ -237,6 +237,8 @@ static struct scsi_host_template ahci_sh .dma_boundary = AHCI_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .suspend = ata_scsi_device_suspend, .resume = ata_scsi_device_resume,
drivers/ata/ata_generic.c +2 -0
@@ -116,6 +116,8 @@ static struct scsi_host_template generic .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/ata_piix.c +2 -0
@@ -263,6 +263,8 @@ static struct scsi_host_template piix_sh .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/libata-core.c +55 -43
128 lines not on this page · raw message
drivers/ata/pata_ali.c +2 -0
@@ -346,6 +346,8 @@ static struct scsi_host_template ali_sht .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_amd.c +2 -0
@@ -333,6 +333,8 @@ static struct scsi_host_template amd_sht .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_artop.c +2 -0
@@ -314,6 +314,8 @@ static struct scsi_host_template artop_s .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_atiixp.c +2 -0
@@ -216,6 +216,8 @@ static struct scsi_host_template atiixp_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_cmd64x.c +2 -0
@@ -275,6 +275,8 @@ static struct scsi_host_template cmd64x_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_cs5520.c +2 -0
@@ -166,6 +166,8 @@ static struct scsi_host_template cs5520_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_cs5530.c +2 -0
@@ -180,6 +180,8 @@ static struct scsi_host_template cs5530_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_cs5535.c +2 -0
@@ -184,6 +184,8 @@ static struct scsi_host_template cs5535_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_cypress.c +2 -0
@@ -135,6 +135,8 @@ static struct scsi_host_template cy82c69 .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_efar.c +2 -0
@@ -233,6 +233,8 @@ static struct scsi_host_template efar_sh .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_hpt366.c +2 -0
@@ -329,6 +329,8 @@ static struct scsi_host_template hpt36x_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_hpt37x.c +2 -0
@@ -775,6 +775,8 @@ static struct scsi_host_template hpt37x_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_hpt3x2n.c +2 -0
@@ -341,6 +341,8 @@ static struct scsi_host_template hpt3x2n .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_hpt3x3.c +2 -0
@@ -118,6 +118,8 @@ static struct scsi_host_template hpt3x3_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_isapnp.c +2 -0
@@ -34,6 +34,8 @@ static struct scsi_host_template isapnp_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_it821x.c +2 -0
@@ -675,6 +675,8 @@ static struct scsi_host_template it821x_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_jmicron.c +2 -0
@@ -136,6 +136,8 @@ static struct scsi_host_template jmicron .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, /* Use standard CHS mapping rules */ .bios_param = ata_std_bios_param, };
drivers/ata/pata_legacy.c +2 -0
@@ -135,6 +135,8 @@ static struct scsi_host_template legacy_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_mpiix.c +2 -0
@@ -166,6 +166,8 @@ static struct scsi_host_template mpiix_s .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_netcell.c +2 -0
@@ -62,6 +62,8 @@ static struct scsi_host_template netcell .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, /* Use standard CHS mapping rules */ .bios_param = ata_std_bios_param, };
drivers/ata/pata_ns87410.c +2 -0
@@ -156,6 +156,8 @@ static struct scsi_host_template ns87410 .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_oldpiix.c +2 -0
@@ -231,6 +231,8 @@ static struct scsi_host_template oldpiix .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_opti.c +2 -0
@@ -202,6 +202,8 @@ static struct scsi_host_template opti_sh .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_optidma.c +2 -0
@@ -359,6 +359,8 @@ static struct scsi_host_template optidma .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_pcmcia.c +2 -0
@@ -69,6 +69,8 @@ static struct scsi_host_template pcmcia_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_pdc2027x.c +2 -0
@@ -141,6 +141,8 @@ static struct scsi_host_template pdc2027 .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_pdc202xx_old.c +2 -0
@@ -269,6 +269,8 @@ static struct scsi_host_template pdc_sht .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_qdi.c +2 -0
@@ -164,6 +164,8 @@ static struct scsi_host_template qdi_sht .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_radisys.c +2 -0
@@ -227,6 +227,8 @@ static struct scsi_host_template radisys .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_rz1000.c +2 -0
@@ -90,6 +90,8 @@ static struct scsi_host_template rz1000_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_sc1200.c +2 -0
@@ -193,6 +193,8 @@ static struct scsi_host_template sc1200_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_serverworks.c +2 -0
@@ -325,6 +325,8 @@ static struct scsi_host_template serverw .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_sil680.c +2 -0
@@ -225,6 +225,8 @@ static struct scsi_host_template sil680_ .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_sis.c +2 -0
@@ -545,6 +545,8 @@ static struct scsi_host_template sis_sht .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_sl82c105.c +2 -0
@@ -237,6 +237,8 @@ static struct scsi_host_template sl82c10 .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_triflex.c +2 -0
@@ -192,6 +192,8 @@ static struct scsi_host_template triflex .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_via.c +2 -0
@@ -295,6 +295,8 @@ static struct scsi_host_template via_sht .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pdc_adma.c +2 -0
@@ -152,6 +152,8 @@ static struct scsi_host_template adma_at .dma_boundary = ADMA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_mv.c +2 -0
@@ -390,6 +390,8 @@ static struct scsi_host_template mv_sht .dma_boundary = MV_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_nv.c +2 -0
@@ -157,6 +157,8 @@ static struct scsi_host_template nv_sht .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_promise.c +2 -0
@@ -122,6 +122,8 @@ static struct scsi_host_template pdc_ata .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_qstor.c +2 -0
@@ -143,6 +143,8 @@ static struct scsi_host_template qs_ata_ .dma_boundary = QS_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_sil.c +2 -0
@@ -180,6 +180,8 @@ static struct scsi_host_template sil_sht .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .suspend = ata_scsi_device_suspend, .resume = ata_scsi_device_resume,
drivers/ata/sata_sil24.c +2 -0
@@ -380,6 +380,8 @@ static struct scsi_host_template sil24_s .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .suspend = ata_scsi_device_suspend, .resume = ata_scsi_device_resume,
drivers/ata/sata_sis.c +2 -0
@@ -96,6 +96,8 @@ static struct scsi_host_template sis_sht .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_svw.c +2 -0
@@ -299,6 +299,8 @@ static struct scsi_host_template k2_sata .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished,#ifdef CONFIG_PPC_OF .proc_info = k2_sata_proc_info,#endif
drivers/ata/sata_sx4.c +2 -0
@@ -192,6 +192,8 @@ static struct scsi_host_template pdc_sat .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_uli.c +2 -0
@@ -90,6 +90,8 @@ static struct scsi_host_template uli_sht .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_via.c +2 -0
@@ -106,6 +106,8 @@ static struct scsi_host_template svia_sh .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_vsc.c +2 -0
@@ -279,6 +279,8 @@ static struct scsi_host_template vsc_sat .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
include/linux/libata.h +2 -0
@@ -812,6 +812,8 @@ extern int ata_std_bios_param(struct scs sector_t capacity, int geom[]);extern int ata_scsi_slave_config (struct scsi_device *sdev);extern void ata_scsi_slave_destroy (struct scsi_device *sdev); +extern void ata_scsi_scan_start (struct Scsi_Host *shost); +extern int ata_scsi_scan_finished (struct Scsi_Host *shost,unsigned long time);extern int ata_scsi_change_queue_depth (struct scsi_device *sdev,int queue_depth);extern struct ata_device *ata_dev_pair (struct ata_device *adev);
Quoted 8 lines · Matthew Wilcox
Some of the drivers (AHCI was mentioned to me as a culprit) take a long time to discover all the devices attached to them. Even for ones which are relatively quick, if you put a lot of them in a machine, it will take a long time in aggregate. This can be fixed by adding support for asynchronous scsi scans, which causes the time-consuming portions of initialisation to take place in threads.
Signed-off-by Matthew Wilcox <[email protected]>
The time-consuming portion already takes place in a thread. Do you mean multiple threads? Or, ATA's scan is in one thread, while work continues in other threads?
Patch seems sane, provided that I am educated a bit :)
Jeff
Quoted 5 lines · Jeff Garzik
The time-consuming portion already takes place in a thread. Do you mean multiple threads? Or, ATA's scan is in one thread, while work continues in other threads?
Patch seems sane, provided that I am educated a bit :)
Each host will be scanned in its own thread. So boot-up and initialisation of other devices (eg, USB, networking, PS/2, etc) will continue. Drive ordering and numbering is maintained, and the default configuration right now is to not enable this feature.
We have infrastructure in place to make sure that all discs are found before we try to start init or autorun RAID. If there's anywhere we're missing a call to scsi_complete_async_scans(), it'll affect SCSI as much as it will IDE, and I'm extremely interested in fixing it.
Quoted 10 lines · Matthew Wilcox
Quoted 3 lines · Jeff Garzik
The time-consuming portion already takes place in a thread. Do you mean multiple threads? Or, ATA's scan is in one thread, while work continues in other threads?
Patch seems sane, provided that I am educated a bit :)
Each host will be scanned in its own thread. So boot-up and initialisation of other devices (eg, USB, networking, PS/2, etc) will continue. Drive ordering and numbering is maintained, and the default configuration right now is to not enable this feature.
Quoted 4 lines
We have infrastructure in place to make sure that all discs are found before we try to start init or autorun RAID. If there's anywhere we're missing a call to
scsi_complete_async_scans(), it'll affect SCSI as much as it will IDE, and I'm extremely interested in fixing it.
oh, err, hum.
libata uses one scsihost per port, not one-per-controller, so it won't work like you think.
This will conflict with AHCI's staggered spin-up, at least.
Jeff
Quoted 8 lines · Matthew Wilcox
Some of the drivers (AHCI was mentioned to me as a culprit) take a long time to discover all the devices attached to them. Even for ones which are relatively quick, if you put a lot of them in a machine, it will take a long time in aggregate. This can be fixed by adding support for asynchronous scsi scans, which causes the time-consuming portions of initialisation to take place in threads.
Signed-off-by Matthew Wilcox <[email protected]>
ACK. I tried to apply the patch, but git-applymbox choked on every single file modified. Quite possibly, its due to a whitespace cleanup in Alan territory.
If you would either (a) wait several hours for libata-dev.git#upstream to mirror out, and resend, or (b) supply a git:// URL to pull from, I'll merge.
Jeff
Quoted 7 lines · Jeff Garzik
ACK. I tried to apply the patch, but git-applymbox choked on every single file modified. Quite possibly, its due to a whitespace cleanup in Alan territory.
If you would either (a) wait several hours for libata-dev.git#upstream to mirror out, and resend, or (b) supply a
git://URL to pull from, I'll merge.
Here's a merge against your upstream head. It's perhaps more of a conceptual merge as it adds entries to drivers that have been added since I wrote the patch. I also added a couple of missing slave_destroy methods to the newly-added drivers.
Quoted 9 lines · Matthew Wilcox
Quoted 7 lines · Jeff Garzik
ACK. I tried to apply the patch, but git-applymbox choked on every single file modified. Quite possibly, its due to a whitespace cleanup in Alan territory.
If you would either (a) wait several hours for libata-dev.git#upstream to mirror out, and resend, or (b) supply a
git://URL to pull from, I'll merge.
Quoted 6 lines
Here's a merge against your upstream head. It's perhaps more of a conceptual merge as it adds entries to drivers that have been added since I wrote the patch. I also added a couple of missing
slave_destroymethods to the newly-added drivers.Signed-off-by Matthew Wilcox <[email protected]>
... this time with patch ...
Add support for asynchronous scans to libata
Some of the drivers (AHCI was mentioned to me as a culprit) take a long time to discover all the devices attached to them. Even for ones which are relatively quick, if you put a lot of them in a machine, it will take a long time in aggregate. This can be fixed by adding support for asynchronous scsi scans, which causes the time-consuming portions of initialisation to take place in threads.
drivers/ata/ahci.c +2 -0
@@ -242,6 +242,8 @@ static struct scsi_host_template ahci_sht = { .dma_boundary = AHCI_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .suspend = ata_scsi_device_suspend, .resume = ata_scsi_device_resume,
drivers/ata/ata_generic.c +2 -0
@@ -116,6 +116,8 @@ static struct scsi_host_template generic_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/ata_piix.c +2 -0
@@ -274,6 +274,8 @@ static struct scsi_host_template piix_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/libata-core.c +55 -43
128 lines not on this page · raw message
drivers/ata/pata_ali.c +2 -0
@@ -344,6 +344,8 @@ static struct scsi_host_template ali_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_amd.c +2 -0
@@ -333,6 +333,8 @@ static struct scsi_host_template amd_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_artop.c +2 -0
@@ -314,6 +314,8 @@ static struct scsi_host_template artop_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_atiixp.c +2 -0
@@ -216,6 +216,8 @@ static struct scsi_host_template atiixp_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_cmd64x.c +2 -0
@@ -275,6 +275,8 @@ static struct scsi_host_template cmd64x_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_cs5520.c +2 -0
@@ -166,6 +166,8 @@ static struct scsi_host_template cs5520_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_cs5530.c +2 -0
@@ -180,6 +180,8 @@ static struct scsi_host_template cs5530_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_cs5535.c +2 -0
@@ -184,6 +184,8 @@ static struct scsi_host_template cs5535_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_cypress.c +2 -0
@@ -135,6 +135,8 @@ static struct scsi_host_template cy82c693_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_efar.c +2 -0
@@ -233,6 +233,8 @@ static struct scsi_host_template efar_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_hpt366.c +2 -0
@@ -337,6 +337,8 @@ static struct scsi_host_template hpt36x_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_hpt37x.c +2 -0
@@ -775,6 +775,8 @@ static struct scsi_host_template hpt37x_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_hpt3x2n.c +2 -0
@@ -341,6 +341,8 @@ static struct scsi_host_template hpt3x2n_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_hpt3x3.c +2 -0
@@ -118,6 +118,8 @@ static struct scsi_host_template hpt3x3_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_isapnp.c +2 -0
@@ -34,6 +34,8 @@ static struct scsi_host_template isapnp_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_it8213.c +3 -0
@@ -245,6 +245,9 @@ static struct scsi_host_template it8213_sht = { .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_it821x.c +2 -0
@@ -673,6 +673,8 @@ static struct scsi_host_template it821x_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_ixp4xx_cf.c +2 -0
@@ -117,6 +117,8 @@ static struct scsi_host_template ixp4xx_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_jmicron.c +2 -0
@@ -135,6 +135,8 @@ static struct scsi_host_template jmicron_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, /* Use standard CHS mapping rules */ .bios_param = ata_std_bios_param, };
drivers/ata/pata_legacy.c +2 -0
@@ -135,6 +135,8 @@ static struct scsi_host_template legacy_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_marvell.c +2 -0
@@ -101,6 +101,8 @@ static struct scsi_host_template marvell_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished,/* Use standard CHS mapping rules */ .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume,
drivers/ata/pata_mpc52xx.c +3 -0
@@ -280,6 +280,9 @@ static struct scsi_host_template mpc52xx_ata_sht = { .proc_name = DRV_NAME, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, + .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_mpiix.c +2 -0
@@ -166,6 +166,8 @@ static struct scsi_host_template mpiix_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_netcell.c +2 -0
@@ -61,6 +61,8 @@ static struct scsi_host_template netcell_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished,/* Use standard CHS mapping rules */ .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume,
drivers/ata/pata_ns87410.c +2 -0
@@ -156,6 +156,8 @@ static struct scsi_host_template ns87410_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_oldpiix.c +2 -0
@@ -231,6 +231,8 @@ static struct scsi_host_template oldpiix_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_opti.c +2 -0
@@ -178,6 +178,8 @@ static struct scsi_host_template opti_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_optidma.c +2 -0
@@ -359,6 +359,8 @@ static struct scsi_host_template optidma_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_pcmcia.c +2 -0
@@ -69,6 +69,8 @@ static struct scsi_host_template pcmcia_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_pdc2027x.c +2 -0
@@ -141,6 +141,8 @@ static struct scsi_host_template pdc2027x_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_pdc202xx_old.c +2 -0
@@ -269,6 +269,8 @@ static struct scsi_host_template pdc202xx_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_platform.c +2 -0
@@ -78,6 +78,8 @@ static struct scsi_host_template pata_platform_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_qdi.c +2 -0
@@ -164,6 +164,8 @@ static struct scsi_host_template qdi_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_radisys.c +2 -0
@@ -227,6 +227,8 @@ static struct scsi_host_template radisys_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_rz1000.c +2 -0
@@ -90,6 +90,8 @@ static struct scsi_host_template rz1000_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_sc1200.c +2 -0
@@ -193,6 +193,8 @@ static struct scsi_host_template sc1200_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_serverworks.c +2 -0
@@ -325,6 +325,8 @@ static struct scsi_host_template serverworks_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_sil680.c +2 -0
@@ -225,6 +225,8 @@ static struct scsi_host_template sil680_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_sis.c +2 -0
@@ -545,6 +545,8 @@ static struct scsi_host_template sis_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_sl82c105.c +2 -0
@@ -237,6 +237,8 @@ static struct scsi_host_template sl82c105_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pata_triflex.c +2 -0
@@ -192,6 +192,8 @@ static struct scsi_host_template triflex_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_via.c +2 -0
@@ -297,6 +297,8 @@ static struct scsi_host_template via_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .resume = ata_scsi_device_resume, .suspend = ata_scsi_device_suspend,
drivers/ata/pata_winbond.c +2 -0
@@ -133,6 +133,8 @@ static struct scsi_host_template winbond_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/pdc_adma.c +2 -0
@@ -152,6 +152,8 @@ static struct scsi_host_template adma_ata_sht = { .dma_boundary = ADMA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_mv.c +2 -0
@@ -390,6 +390,8 @@ static struct scsi_host_template mv_sht = { .dma_boundary = MV_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_nv.c +2 -0
@@ -310,6 +310,8 @@ static struct scsi_host_template nv_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_promise.c +2 -0
@@ -129,6 +129,8 @@ static struct scsi_host_template pdc_ata_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_qstor.c +2 -0
@@ -143,6 +143,8 @@ static struct scsi_host_template qs_ata_sht = { .dma_boundary = QS_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_sil.c +2 -0
@@ -180,6 +180,8 @@ static struct scsi_host_template sil_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .suspend = ata_scsi_device_suspend, .resume = ata_scsi_device_resume,
drivers/ata/sata_sil24.c +2 -0
@@ -385,6 +385,8 @@ static struct scsi_host_template sil24_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, .suspend = ata_scsi_device_suspend, .resume = ata_scsi_device_resume,
drivers/ata/sata_sis.c +2 -0
@@ -99,6 +99,8 @@ static struct scsi_host_template sis_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_svw.c +2 -0
@@ -299,6 +299,8 @@ static struct scsi_host_template k2_sata_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished,#ifdef CONFIG_PPC_OF .proc_info = k2_sata_proc_info,#endif
drivers/ata/sata_sx4.c +2 -0
@@ -192,6 +192,8 @@ static struct scsi_host_template pdc_sata_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_uli.c +2 -0
@@ -90,6 +90,8 @@ static struct scsi_host_template uli_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_via.c +2 -0
@@ -106,6 +106,8 @@ static struct scsi_host_template svia_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
drivers/ata/sata_vsc.c +2 -0
@@ -279,6 +279,8 @@ static struct scsi_host_template vsc_sata_sht = { .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .slave_destroy = ata_scsi_slave_destroy, + .scan_start = ata_scsi_scan_start, + .scan_finished = ata_scsi_scan_finished, .bios_param = ata_std_bios_param, };
include/linux/libata.h +2 -0
@@ -822,6 +822,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev, sector_t capacity, int geom[]);extern int ata_scsi_slave_config (struct scsi_device *sdev);extern void ata_scsi_slave_destroy (struct scsi_device *sdev); +extern void ata_scsi_scan_start (struct Scsi_Host *shost); +extern int ata_scsi_scan_finished (struct Scsi_Host *shost,unsigned long time);extern int ata_scsi_change_queue_depth (struct scsi_device *sdev,int queue_depth);extern struct ata_device *ata_dev_pair (struct ata_device *adev);
Matt,
Have your resolved the unload race conditions yet?
We'd like to update lpfc for the async scans, but our testing gets blocked very quickly by the bugs. The bugs are not necessarily specific to lpfc or to FC.
Stack traces are below. Simple ismod/rmmod loop can trigger them....
-- james s
First one is an rmmod while lpfc is active in it's scan_start function. I think we're in a sleep waiting for the board to be ready when the driver is yanked out from underneath us.
Second one is an rmmod while do_scsi_scan_host is in a loop calling scan_finished.
Third one is an rmmod immediately after completion of do_scan_async.
STACK TRACE 1
-------------
BUG: unable to handle kernel paging request at virtual address f8941836 printing eip: f8941836 *pde = 37e59067 Oops: 0000 [#1] SMP Modules linked in: autofs4 hidp rfcomm l2cap bluetooth sunrpc ipv6 dm_mirror dm_mod video sbs i2c_e6 printing eip: f8941836 *pde = 37e59067 chipreg pcspkr tg3 scsi_transport_fc mptspi mptscsih mptbase scsi_transport_spi sd_mod scsi_mod exd CPU: 2 EIP: 0060:[<f8941836>] Not tainted VLI EFLAGS: 00010246 (2.6.20-rc7-jimp #1)
EIP is at 0xf8941836
eax: 00000000 ebx: 00000000 ecx: c1900000 edx: 00000286
esi: f7ab6000 edi: f887158d ebp: f7ab62e8 esp: ecec9f30
ds: 007b es: 007b ss: 0068
Process scsi_scan_6 (pid: 15927, ti=ecec9000 task=f2309000 task.ti=ecec9000)
Stack: c04a2183 f65b6cc4 f8963c80 f8963c80 f71e38d0 ffffffef c04a1cef 00008180
00000008 f6e4aa00 00000000 00000046 00000000 f7ab62e8 f7ab6000 f887158d
f75fa3e0 f7ab62e8 f7ab6000 f887158d f75fa3e0 f894d6dc f89593e4 f7ab6000
Call Trace:
[<c04a2183>] sysfs_dirent_exist+0x20/0x5f
[<c04a1cef>] sysfs_add_file+0x66/0x70
[<f887158d>] do_scan_async+0x0/0x126 [scsi_mod]
[<f887158d>] do_scan_async+0x0/0x126 [scsi_mod]
[<f88713e0>] do_scsi_scan_host+0x30/0x8b [scsi_mod]
[<f88715aa>] do_scan_async+0x1d/0x126 [scsi_mod]
[<c041f7b4>] complete+0x39/0x48
[<f887158d>] do_scan_async+0x0/0x126 [scsi_mod]
[<c0436924>] kthread+0xb0/0xd8
[<c0436874>] kthread+0x0/0xd8
[<c0404977>] kernel_thread_helper+0x7/0x10
=======================
Code: Bad EIP value.
EIP: [<f8941836>] 0xf8941836 SS:ESP 0068:ecec9f30
<0>Oops: 0000 [#2]
SMP
Modules linked in: autofs4 hidp rfcomm l2cap bluetooth sunrpc ipv6 dm_mirror dm_mod video sbs i2c_ed
CPU: 3
EIP: 0060:[<f8941836>] Not tainted VLI
EFLAGS: 00010246 (2.6.20-rc7-jimp #1)EIP is at 0xf8941836
eax: 00000000 ebx: 00000000 ecx: c1902000 edx: 00000286
esi: f74ff000 edi: f887158d ebp: f74ff2e8 esp: ec3c1f30
ds: 007b es: 007b ss: 0068
Process scsi_scan_5 (pid: 15919, ti=ec3c1000 task=f7b92000 task.ti=ec3c1000)
Stack: c04a2183 ece3821c f8963c80 f8963c80 f6b3942c ffffffef c04a1cef 00008180
00000008 f6efea00 00000000 00000046 00000002 f74ff2e8 f74ff000 f887158d
f7897de0 f74ff2e8 f74ff000 f887158d f7897de0 f894d6dc f89593e4 f74ff000
Call Trace:
[<c04a2183>] sysfs_dirent_exist+0x20/0x5f
[<c04a1cef>] sysfs_add_file+0x66/0x70
[<f887158d>] do_scan_async+0x0/0x126 [scsi_mod]
[<f887158d>] do_scan_async+0x0/0x126 [scsi_mod]
[<f88713e0>] do_scsi_scan_host+0x30/0x8b [scsi_mod]
[<f88715aa>] do_scan_async+0x1d/0x126 [scsi_mod]
[<f887158d>] do_scan_async+0x0/0x126 [scsi_mod]
[<c0436924>] kthread+0xb0/0xd8
[<c0436874>] kthread+0x0/0xd8
[<c0404977>] kernel_thread_helper+0x7/0x10
=======================STACK TRACE 2
-------------
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000 printing eip: c0548435 *pde = 00000000 Oops: 0000 [#3] SMP Modules linked in: lpfc autofs4 hidp rfcomm l2cap bluetooth sunrpc ipv6 dm_mirror dm_mod video sbs d CPU: 3 EIP: 0060:[<c0548435>] Not tainted VLI EFLAGS: 00010202 (2.6.20-rc7-jimp #1)
EIP is at make_class_name+0x27/0x7d
eax: 00000000 ebx: ffffffff ecx: ffffffff edx: 0000000b
esi: f887c29a edi: 00000000 ebp: 00000000 esp: edd27ec4
ds: 007b es: 007b ss: 0068
Process fc_wq_7 (pid: 16050, ti=edd27000 task=f68b4550 task.ti=edd27000)
Stack: f65d35f8 f8889e20 f65d35f8 f65d35f0 f8889da0 c0548616 00000000 f65d35f0
f69f0030 f6fdc000 00000000 c054869c f65d3400 f88720f8 f65d3400 f69f0030
f8872152 f65d3400 f69f0000 f88721c9 f6fdc014 f6d1d848 f8872233 f8872247
Call Trace:
[<c0548616>] class_device_del+0x8c/0x10a
[<c054869c>] class_device_unregister+0x8/0x10
[<f88720f8>] __scsi_remove_device+0x1d/0x60 [scsi_mod]
[<f8872152>] scsi_remove_device+0x17/0x20 [scsi_mod]
[<f88721c9>] __scsi_remove_target+0x6e/0xa1 [scsi_mod]
[<f8872233>] __remove_child+0x0/0x18 [scsi_mod]
[<f8872247>] __remove_child+0x14/0x18 [scsi_mod]
[<c0545dc0>] device_for_each_child+0x1a/0x3c
[<f887222a>] scsi_remove_target+0x2e/0x37 [scsi_mod]
[<f88b7ae6>] fc_rport_final_delete+0x51/0x9a [scsi_transport_fc]
[<c04339ff>] run_workqueue+0x85/0x125
[<c042eb72>] do_sigaction+0x10f/0x149
[<f88b7a95>] fc_rport_final_delete+0x0/0x9a [scsi_transport_fc]
[<c0434359>] worker_thread+0xf9/0x124
[<c0421072>] default_wake_function+0x0/0xc
[<c0434260>] worker_thread+0x0/0x124
[<c0436924>] kthread+0xb0/0xd8
[<c0436874>] kthread+0x0/0xd8
[<c0404977>] kernel_thread_helper+0x7/0x10
=======================
Code: 5b 04 5b c3 55 31 ed 57 89 c7 56 89 c6 53 83 cb ff 83 ec 04 89 d9 89 14 24 89 e8 f2 ae f7 d1STACK TRACE 3
-------------
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000 printing eip: 00000000 *pde = 00000000 Oops: 0000 [#1] SMP Modules linked in: lpfc autofs4 hidp rfcomm l2cap bluetooth sunrpc ipv6 dm_mirror dm_mod video sbs d CPU: 0 EIP: 0060:[<00000000>] Not tainted VLI EFLAGS: 00010206 (2.6.20-rc7-jimp #1)
EIP is at _stext+0x3fbffc70/0x14
eax: f64c2830 ebx: f64c2830 ecx: f887181b edx: f6ee1414
esi: f6ee1414 edi: f6ee1414 ebp: c054a70a esp: eb5f4e98
ds: 007b es: 007b ss: 0068
Process vol_id (pid: 32421, ti=eb5f4000 task=e50c1550 task.ti=eb5f4000)
Stack: c054a625 00000000 c04daa3e ec23d4c0 e9fa4000 f6ee1400 f6ee1414 e7df8800
f887184f e7df8a84 f6ee1400 00000286 e7df8800 c0433bc4 f8871a7c f6ee1414
e7df890c c06c44a8 c06c4440 f6ee148c c0433bc4 c0545cc9 ffffffff eb1f8e90
Call Trace:
[<c054a625>] attribute_container_device_trigger+0x33/0xa2
[<c04daa3e>] kobject_cleanup+0x3e/0x5e
[<f887184f>] scsi_target_reap_usercontext+0x34/0x89 [scsi_mod]
[<c0433bc4>] execute_in_process_context+0x16/0x38
[<f8871a7c>] scsi_device_dev_release_usercontext+0x92/0xba [scsi_mod]
[<c0433bc4>] execute_in_process_context+0x16/0x38
[<c0545cc9>] device_release+0x26/0x6b
[<c04daa3e>] kobject_cleanup+0x3e/0x5e
[<c04daa5e>] kobject_release+0x0/0x8
[<c04db507>] kref_put+0x60/0x6d
[<c04860fa>] invalidate_bh_lru+0x26/0x37
[<f886a0ac>] scsi_device_put+0x16/0x2e [scsi_mod]
[<f88322d7>] scsi_disk_put+0x22/0x2e [sd_mod]
[<f8832c19>] sd_release+0x69/0x70 [sd_mod]
[<c04570bb>] truncate_inode_pages+0x17/0x1c
[<c048a4be>] __blkdev_put+0x5b/0x103
[<c046c70f>] __fput+0xa5/0x15b
[<c046a23b>] filp_close+0x51/0x58
[<c046b168>] sys_close+0x6d/0xa3
[<c0403d9c>] syscall_call+0x7/0xb
=======================
Code: Bad EIP value.
EIP: [<00000000>] _stext+0x3fbffc70/0x14 SS:ESP 0068:eb5f4e98