From 3dc7dba078e2759ed9e1841ebf5b76ba109ca243 Mon Sep 17 00:00:00 2001 From: bouyer Date: Sat, 4 May 2002 18:11:06 +0000 Subject: [PATCH] It seems that the 1010-33 has a bug: it sometimes generate spurious SCSI gross errors for narrow transfers after a reselect. FreeBSD sym driver has a comment about this, but their workaround (disable SCSI gross error reports) doesn't work for me. Instead dissallow disconnect if the target is not wide (FreeBSD doens't allow disconnect until the target has been fully probed, which is why they may not have noticed my problem). --- sys/dev/ic/siop_common.c | 21 ++++++++++++++++++--- sys/dev/ic/siopvar_common.h | 3 ++- sys/dev/pci/siop_pci_common.c | 6 ++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/sys/dev/ic/siop_common.c b/sys/dev/ic/siop_common.c index c0bee3c4502f..3a659f9ca899 100644 --- a/sys/dev/ic/siop_common.c +++ b/sys/dev/ic/siop_common.c @@ -1,4 +1,4 @@ -/* $NetBSD: siop_common.c,v 1.25 2002/04/29 15:45:05 bouyer Exp $ */ +/* $NetBSD: siop_common.c,v 1.26 2002/05/04 18:11:06 bouyer Exp $ */ /* * Copyright (c) 2000, 2002 Manuel Bouyer. @@ -33,7 +33,7 @@ /* SYM53c7/8xx PCI-SCSI I/O Processors driver */ #include -__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.25 2002/04/29 15:45:05 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.26 2002/05/04 18:11:06 bouyer Exp $"); #include #include @@ -229,7 +229,6 @@ siop_common_reset(sc) /* reset SCNTL4 */ bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_SCNTL4, 0); } - sc->sc_reset(sc); } @@ -251,6 +250,17 @@ siop_setuptables(siop_cmd) /* request sense doesn't disconnect */ if (xs->xs_control & XS_CTL_REQSENSE) siop_cmd->siop_tables->msg_out[0] = MSG_IDENTIFY(lun, 0); + else if ((sc->features & SF_CHIP_GEBUG) && + (sc->targets[target]->flags & TARF_ISWIDE) == 0) + /* + * 1010 bug: it seems that the 1010 has problems with reselect + * when not in wide mode (generate false SCSI gross error). + * The FreeBSD sym driver has comments about it but their + * workaround (disable SCSI gross error reporting) doesn't + * work with my adapter. So disable disconnect when not + * wide. + */ + siop_cmd->siop_tables->msg_out[0] = MSG_IDENTIFY(lun, 0); else siop_cmd->siop_tables->msg_out[0] = MSG_IDENTIFY(lun, 1); if (xs->xs_tag_type != 0) { @@ -878,6 +888,11 @@ siop_update_xfer_mode(sc, target) xm.xm_period = 0; xm.xm_offset = 0; + /* 1010 workaround: can't do disconnect if not wide, so can't do tag */ + if ((sc->features & SF_CHIP_GEBUG) && + (sc->targets[target]->flags & TARF_ISWIDE) == 0) + siop_target->flags &= ~TARF_TAG; + if (siop_target->flags & TARF_ISWIDE) xm.xm_mode |= PERIPH_CAP_WIDE16; if (siop_target->period) { diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h index 763ca7e150cc..d0bbd8beb080 100644 --- a/sys/dev/ic/siopvar_common.h +++ b/sys/dev/ic/siopvar_common.h @@ -1,4 +1,4 @@ -/* $NetBSD: siopvar_common.h,v 1.19 2002/04/23 20:41:16 bouyer Exp $ */ +/* $NetBSD: siopvar_common.h,v 1.20 2002/05/04 18:11:06 bouyer Exp $ */ /* * Copyright (c) 2000 Manuel Bouyer. @@ -170,6 +170,7 @@ struct siop_common_softc { #define SF_CHIP_10REGS 0x00010000 /* 10 scratch registers */ #define SF_CHIP_DFBC 0x00020000 /* Use DFBC register */ #define SF_CHIP_DT 0x00040000 /* DT clocking */ +#define SF_CHIP_GEBUG 0x00080000 /* SCSI gross error bug */ #define SF_PCI_RL 0x01000000 /* PCI read line */ #define SF_PCI_RM 0x02000000 /* PCI read multiple */ diff --git a/sys/dev/pci/siop_pci_common.c b/sys/dev/pci/siop_pci_common.c index 1eeb04c9b649..57d7beb2a5a7 100644 --- a/sys/dev/pci/siop_pci_common.c +++ b/sys/dev/pci/siop_pci_common.c @@ -1,4 +1,4 @@ -/* $NetBSD: siop_pci_common.c,v 1.16 2002/04/26 19:44:52 thorpej Exp $ */ +/* $NetBSD: siop_pci_common.c,v 1.17 2002/05/04 18:11:06 bouyer Exp $ */ /* * Copyright (c) 2000 Manuel Bouyer. @@ -32,7 +32,7 @@ /* SYM53c8xx PCI-SCSI I/O Processors driver: PCI front-end */ #include -__KERNEL_RCSID(0, "$NetBSD: siop_pci_common.c,v 1.16 2002/04/26 19:44:52 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siop_pci_common.c,v 1.17 2002/05/04 18:11:06 bouyer Exp $"); #include #include @@ -170,6 +170,7 @@ const struct siop_product_desc siop_products[] = { SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_LEDC | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_LS | SF_CHIP_10REGS | SF_CHIP_DFBC | SF_CHIP_DBLR | + SF_CHIP_GEBUG | SF_BUS_ULTRA3 | SF_BUS_WIDE, 7, 31, 0, 62, 8192 }, @@ -179,6 +180,7 @@ const struct siop_product_desc siop_products[] = { SF_PCI_RL | SF_PCI_CLS | SF_PCI_WRI | SF_PCI_RM | SF_CHIP_LEDC | SF_CHIP_FIFO | SF_CHIP_PF | SF_CHIP_RAM | SF_CHIP_LS | SF_CHIP_10REGS | SF_CHIP_DFBC | SF_CHIP_DBLR | SF_CHIP_DT | + SF_CHIP_GEBUG | SF_BUS_ULTRA3 | SF_BUS_WIDE, 7, 62, 0, 62, 8192 },