1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Change ahc_update_pending_scbs() so that it safe to be called

even if the controller is not paused.  This prevents SCB list
corruption that was introduced in the last checkin.
This commit is contained in:
Justin T. Gibbs 2001-04-01 00:00:09 +00:00
parent 853f677e4d
commit b5f51cd7b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75048

View File

@ -1922,6 +1922,7 @@ ahc_update_pending_scbs(struct ahc_softc *ahc)
struct scb *pending_scb;
int pending_scb_count;
int i;
int paused;
u_int saved_scbptr;
/*
@ -1956,6 +1957,13 @@ ahc_update_pending_scbs(struct ahc_softc *ahc)
if (pending_scb_count == 0)
return;
if (ahc_is_paused(ahc)) {
paused = 1;
} else {
paused = 0;
ahc_pause(ahc);
}
saved_scbptr = ahc_inb(ahc, SCBPTR);
/* Ensure that the hscbs down on the card match the new information */
for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
@ -1978,6 +1986,9 @@ ahc_update_pending_scbs(struct ahc_softc *ahc)
ahc_outb(ahc, SCB_SCSIOFFSET, pending_hscb->scsioffset);
}
ahc_outb(ahc, SCBPTR, saved_scbptr);
if (paused == 0)
ahc_unpause(ahc);
}
/**************************** Pathing Information *****************************/