Skip to contentSkip to conversation

prelim ACPI support for aic7xxx

PATCH In review Nathan Bryant 2 participants 2 messages Jul 23, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prelim ACPI support for aic7xxx

Hi.

This patch (against arjanv's latest kernel, but should apply to 2.6.8-rc) is still a little messy and NOT ready to go into the mainline kernel... Luben hasn't seen it yet (Hi Luben!), so the usual disclaimers apply. But it's time to get some more eyes on it. The good news is it works, the bad news is there is no support for error recovery during those few seconds when the bus is setttling and hard disk is powering up after a resume. (Need suggestions on how best to attack that part, I really don't know anything about SCSI...) It works, after a few residuals if your filesystems are mounted read-only, however. If you are mounted read-write then you will get aborted commands, ext3 will complain, and remount your fs read-only until you reboot. To avoid this, remount read-only, suspend/resume, then remount read-write manually after everything starts working.

One other thing that needs outside eyes to look at is the additional call to ahc_pci_config(), from ahc_pci_resume(). It might do some redundant initializations, I'm not really sure what is needed and did not want to disturb the init order for the normal boot sequence, so I just if'd out the stuff that seemed irrelevant.

Nathan

drivers/scsi/aic7xxx/aic79xx_osm.c +1 -1
diff -ur linux-2.6.7-1.492.backup/drivers/scsi/aic7xxx/aic79xx_osm.c linux-2.6.7-1.492/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2591,7 +2591,7 @@
 	sprintf(current->comm, "ahd_dv_%d", ahd->unit);
 #else
 	daemonize("ahd_dv_%d", ahd->unit);
-	current->flags |= PF_FREEZE;
+	current->flags |= PF_NOFREEZE;
 #endif
 	unlock_kernel();
 
drivers/scsi/aic7xxx/aic7xxx_core.c +3 -0
diff -ur linux-2.6.7-1.492.backup/drivers/scsi/aic7xxx/aic7xxx_core.c linux-2.6.7-1.492/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -605,6 +605,7 @@
 		printf("SXFRCTL0 == 0x%x\n", ahc_inb(ahc, SXFRCTL0));
 		printf("SEQCTL == 0x%x\n", ahc_inb(ahc, SEQCTL));
 		ahc_dump_card_state(ahc);
+		panic("halting to avoid infinite interrupt loop");
 		ahc->msgout_buf[0] = MSG_BUS_DEV_RESET;
 		ahc->msgout_len = 1;
 		ahc->msgout_index = 0;
@@ -4046,6 +4047,7 @@
 
 	ahc = (struct ahc_softc *)arg;
 
+	ahc_intr_enable(ahc, FALSE);
 	/* This will reset most registers to 0, but not all */
 	ahc_reset(ahc, /*reinit*/FALSE);
 	ahc_outb(ahc, SCSISEQ, 0);
@@ -5163,6 +5165,7 @@
 {
 
 	ahc_reset(ahc, /*reinit*/TRUE);
+	//ahc->bus_chip_init(ahc);
 	ahc_intr_enable(ahc, TRUE); 
 	ahc_restart(ahc);
 	return (0);
drivers/scsi/aic7xxx/aic7xxx.h +3 -1
diff -ur linux-2.6.7-1.492.backup/drivers/scsi/aic7xxx/aic7xxx.h linux-2.6.7-1.492/drivers/scsi/aic7xxx/aic7xxx.h
@@ -1109,6 +1109,8 @@
 
 	uint16_t	 	  user_discenable;/* Disconnection allowed  */
 	uint16_t		  user_tagenable;/* Tagged Queuing allowed */
+
+	u32                      PciState[64]; /* save PCI state to this area */
 };
 
 TAILQ_HEAD(ahc_softc_tailq, ahc_softc);
@@ -1169,7 +1171,7 @@
 /***************************** PCI Front End *********************************/
 struct ahc_pci_identity	*ahc_find_pci_device(ahc_dev_softc_t);
 int			 ahc_pci_config(struct ahc_softc *,
-					struct ahc_pci_identity *);
+					struct ahc_pci_identity *, int resume);
 int			 ahc_pci_test_register_access(struct ahc_softc *);
 
 /*************************** EISA/VL Front End ********************************/
drivers/scsi/aic7xxx/aic7xxx_osm.c +1 -1
diff -ur linux-2.6.7-1.492.backup/drivers/scsi/aic7xxx/aic7xxx_osm.c linux-2.6.7-1.492/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -2295,7 +2295,7 @@
 	sprintf(current->comm, "ahc_dv_%d", ahc->unit);
 #else
 	daemonize("ahc_dv_%d", ahc->unit);
-	current->flags |= PF_FREEZE;
+	current->flags |= PF_NOFREEZE;
 #endif
 	unlock_kernel();
 
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +75 -1

100 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_pci.c +181 -173

418 lines not on this page · raw message

#1 lore raw

Hi!

Quoted 5 lines

This patch (against arjanv's latest kernel, but should apply to 2.6.8-rc) is still a little messy and NOT ready to go into the mainline kernel... Luben hasn't seen it yet (Hi Luben!), so the usual disclaimers apply. But it's time to get some more eyes on it. The good news is it works, the bad news is there is no support for error recovery during

Quoted 8 lines

those few seconds when the bus is setttling and hard disk is powering up after a resume. (Need suggestions on how best to attack that part, I really don't know anything about SCSI...) It works, after a few residuals if your filesystems are mounted read-only, however. If you are mounted read-write then you will get aborted commands, ext3 will complain, and remount your fs read-only until you reboot. To avoid this, remount read-only, suspend/resume, then remount read-write manually after everything starts working.

If ou are playing with this kind of stuff, I suggest you to use ext2 (not ext3) or at least fsck *very* often.
Pavel

Signature · 1 line
When do you have heart between your knees?