Possible solution for LSI chip problems

Juergen Dankoweit Juergen.Dankoweit at t-online.de
Fri Aug 3 18:32:19 UTC 2007


Hello to the list.

As written in PR 114597
(http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/114597) and PR 88315
(http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/88315) there are some
problems with the LSI SCSI chips on some systems.

The third problem is that switching of the LSI chip over the machine
setup does not affect FreeBSD because the it scans the PCI bus and finds
the LSI device. That isn't a funny situation if you what to use an other
HBA like Adaptec or so.

My idea is to implement the following lines 

if (resource_disabled("sym", dev->unit))
   return (ENXIO);

in the following two functions in the sym_hpd.c code:

line 8459:
static int sym_pci_probe(device_t dev) { ... };
line 8476:
static int sym_pci_attach(device_t dev) {... };

After this it is possible to disable the sym driver in the device.hints:
hint.sym.x.disabled="1" (x = 0,1,...)

In my opinion this would make it possible to use FreeBSD on systems
where it hangs during boot time.

Best regards

Jürgen Dankoweit

PS: My code suggestion:

static int
sym_pci_probe(device_t dev)
{
	struct	sym_pci_chip *chip;

	/* hint.sym.x.disabled="1" */
	if (resource_disabled("sym", dev->unit))
		return (ENXIO);

	chip = sym_find_pci_chip(dev);
	if (chip && sym_find_firmware(chip)) {
		device_set_desc(dev, chip->name);
		return (chip->lp_probe_bit & SYM_SETUP_LP_PROBE_MAP)? 
		  BUS_PROBE_LOW_PRIORITY : BUS_PROBE_DEFAULT;
	}
	return ENXIO;
}

/*
 *  Attach a sym53c8xx device.
 */
static int
sym_pci_attach(device_t dev)
{
	struct	sym_pci_chip *chip;
	u_short	command;
	u_char	cachelnsz;
	struct	sym_hcb *np = 0;
	struct	sym_nvram nvram;
	struct	sym_fw *fw = 0;
	int 	i;
	bus_dma_tag_t	bus_dmat;

	/* hint.sym.x.disabled="1" */
	if (resource_disabled("sym", dev->unit))
		return (ENXIO);

	bus_dmat = bus_get_dma_tag(dev);

	/*
	 *  Only probed devices should be attached.
	 *  We just enjoy being paranoid. :)
	 */
	chip = sym_find_pci_chip(dev);
	if (chip == NULL || (fw = sym_find_firmware(chip)) == NULL)
		return (ENXIO);

[ and so on ]



More information about the freebsd-scsi mailing list