Commit caddf53a authored by Justin T. Gibbs's avatar Justin T. Gibbs Committed by James Bottomley

[PATCH] fix aci7xxx locking problem

> On Thu, May 01, 2003 at 04:28:12PM -0600, Justin T. Gibbs wrote:
>> Folks,
>>
>> I've just uploaded version 1.3.8 of the aic79xx driver and version
>> 6.2.33 of the aic7xxx driver.  Both are available for 2.4.X and
>> 2.5.X kernels in either bk send format or as a tarball from here:
>>
>> http://people.FreeBSD.org/~gibbs/linux/SRC/
>
> Hi Justin,
>
> I've just tested it and I still have the deadlock on SMP. I also tried with
> noapic, but it didn't change. I have reduced the TCQ from 253 to 32, and I
> had the impression that it was more difficult to trigger, although I cannot
> be certain. With 32, I could boot and go to about half the 'make -j 8 dep',
> while it hanged during init script with 253. I may retest by the week-end, but
> now I'm going to sleep. Now I'm back to 6.2.28 and everything's OK.

Can you try with this patch?  It seems I forgot to pull part of a change
from the aic79xx driver into the aic7xxx driver.  This could easily cause
a lock order reversal. <sigh>
parent a3cd35fe
......@@ -670,7 +670,6 @@ ahd_linux_run_complete_queue(struct ahd_softc *ahd)
TAILQ_REMOVE(&ahd->platform_data->completeq,
acmd, acmd_links.tqe);
cmd = &acmd_scsi_cmd(acmd);
acmd = TAILQ_NEXT(acmd, acmd_links.tqe);
cmd->host_scribble = NULL;
if (ahd_cmd_get_transaction_status(cmd) != DID_OK
|| (cmd->result & 0xFF) != SCSI_STATUS_OK)
......@@ -1756,9 +1755,11 @@ ahd_runq_tasklet(unsigned long data)
TAILQ_REMOVE(&ahd->platform_data->device_runq, dev, links);
dev->flags &= ~AHD_DEV_ON_RUN_LIST;
ahd_linux_check_device_queue(ahd, dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
/* Yeild to our interrupt handler */
ahd_unlock(ahd, &flags);
ahd_lock(ahd, &flags);
#endif
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
ahd_unlock(ahd, &flags);
......
......@@ -664,7 +664,6 @@ ahc_linux_run_complete_queue(struct ahc_softc *ahc)
TAILQ_REMOVE(&ahc->platform_data->completeq,
acmd, acmd_links.tqe);
cmd = &acmd_scsi_cmd(acmd);
acmd = TAILQ_NEXT(acmd, acmd_links.tqe);
cmd->host_scribble = NULL;
if (ahc_cmd_get_transaction_status(cmd) != DID_OK
|| (cmd->result & 0xFF) != SCSI_STATUS_OK)
......@@ -1385,9 +1384,11 @@ ahc_runq_tasklet(unsigned long data)
TAILQ_REMOVE(&ahc->platform_data->device_runq, dev, links);
dev->flags &= ~AHC_DEV_ON_RUN_LIST;
ahc_linux_check_device_queue(ahc, dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
/* Yeild to our interrupt handler */
ahc_unlock(ahc, &flags);
ahc_lock(ahc, &flags);
#endif
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
ahc_unlock(ahc, &flags);
......
......@@ -737,7 +737,8 @@ ahc_midlayer_entrypoint_lock(struct ahc_softc *ahc, unsigned long *flags)
* trade the io_request_lock for our per-softc lock.
*/
#if AHC_SCSI_HAS_HOST_LOCK == 0
ahc_lock(ahc, flags);
spin_unlock(&io_request_lock);
spin_lock(&ahc->platform_data->spin_lock);
#endif
}
......@@ -745,7 +746,8 @@ static __inline void
ahc_midlayer_entrypoint_unlock(struct ahc_softc *ahc, unsigned long *flags)
{
#if AHC_SCSI_HAS_HOST_LOCK == 0
ahc_unlock(ahc, flags);
spin_unlock(&ahd->platform_data->spin_lock);
spin_lock(&io_request_lock);
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment