summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ami.c
AgeCommit message (Collapse)Author
2007-03-22split userland & kernel struct sensor/sensordev so that the additionTheo de Raadt
of new fields in the future is less disruptive. This is done similar to how struct proc is handled for ps(1). ok jmc (man page changes) tested fkr simon, and more suggestions from millert
2007-01-27convert to our locks to rwlocks.David Gwynne
2006-12-23adapt to new two-level sensor api; Constantine A. MureninTheo de Raadt
2006-11-28give scsi controllers a real attach args to fill in when attaching scsibus.David Gwynne
ok miod@ marco@ deraadt@
2006-08-28bzero() the sensor memory after allocating it.Kenneth R Westerback
ok marco@
2006-08-03always call scsi_done at splbio. issue found by pedro@David Gwynne
while here try to avoid nesting splbio calls when dealing with the runqueue.
2006-06-28rewrite how the sensors are created. previously they would wait for io toDavid Gwynne
be done on the logical disks so ami_scsi_cmd can stash the name of the device doing the io. we now walk the device tree after the logical disks are attached and use the names of ami's child devices. ok marco@
2006-06-28put proto where it is because dlg says he is a dodoTheo de Raadt
2006-06-27unbreak builds without BIO by moving the sensor setup back under its ifdef.David Gwynne
i could move the shared code that the sensor and bio paths use, but this would add bloat i think. found by _mx, fix by deraadt@
2006-06-27we can do the sensors without BIODavid Gwynne
2006-06-27we cant do bioctl or sensors on broken controllers since they dont have theDavid Gwynne
spare ccbs for it and they dont understand the megaraid commands we use in those paths. initially found by jared rr spiegel
2006-06-09Simplify ami_disk by chaging some ifs around.Marco Peereboom
2006-06-09Add percentages for BGI and Rebuild. Example:Marco Peereboom
# bioctl -h ami0 Volume Status Size Device ami0 0 Rebuild 1000M sd1 RAID5 8% done
2006-05-28Remove dead code; free commit on behalf of dlg@Uwe Stuehler
2006-05-26Add dlg to copyright.Marco Peereboom
2006-05-21move the allocation of ccb out of ami_attach into a function of its ownDavid Gwynne
(aptly called ami_alloc_ccbs). allocate the ccbs after the firmware has been queried, but still for the full number of AMI_MAXCMDS. ok krw@
2006-05-21move variable declarations at the start of a block in ami_attach to the topDavid Gwynne
of the function and unindent that block. ok krw@
2006-05-21during attach use a static, spartan ccb with ami_poll to query to firmareDavid Gwynne
for its params. this means we can ask it how many ccbs it can deal with before we allocate them. ok krw@
2006-05-21the maximum possible number of ccbs that a megaraid can use (126 of them)David Gwynne
is preallocated in the softc, even if the driver is only ever going to use one of them when running. this allocates them separately during attach as a first step toward having the driver only allocate as many ccbs as the firmware can support. ok krw@
2006-05-21remove a chunk of code that was ifdefed out due to compat issues withDavid Gwynne
older firmwares. it was stagnating and now completely broken. if we need it back then we can poke around in cvs for it.
2006-05-21The SCSI command on the passthrough bus is handed to the firmware via aDavid Gwynne
structure not included in the MegaRAID command, so it needs to be synced before we submit it. Previously this was done only when the SCSI command had an associated data buffer. The syncing of the passthrough command is now done unconditionally. ok krw@ marco@
2006-05-12Fix a misreporting bug after bioctl -H is used to create a hotspare. This wasMarco Peereboom
reported by several people. What happens is that the firmware sometimes misreports what SCSI type a device is. The driver was only allowing a create hotspare function when the type was set to hard disk. Since the firmware will, obviously, not allow the driver to create a hotspare on any other type of device the driver doesn't need these smarts and now will ignore the type. Tested by henning todd and Ben Lovett. ok dlg
2006-04-26it turns out that a drivers interrupt handler is called at the spl it wasDavid Gwynne
established at. this means we dont need splbio() calls in ami_intr because its already been raised. this diff removes unneeded splbio calls from the interrupt handler path. it also sets it up so the completion paths are all called at splbio, so i can get rid of the spl calls inside those functions too. neither marco or pedro could see anything wrong with it
2006-04-25the error path for teh sync cache command should return, not try to blunderDavid Gwynne
on with the second half of the command.
2006-04-23Fix an embarrassing pasto that triggered a panic. Reported by henning.Marco Peereboom
ok dlg
2006-04-22Henning reported a crash I can't explain while using the new sensor code.Marco Peereboom
Disable until diagnosed and fixed.
2006-04-21remove the ami_inquire prototype. the function doesnt exist and its notDavid Gwynne
used anywhere. thanks lint. thint.
2006-04-20return after goto wont be reached, so remove it. found by lint.David Gwynne
2006-04-20get rid of the ccb list typedef. while here switch to TAILQ_HEAD insteadDavid Gwynne
of TAILQ_TAIL when pulling ccbs off the free list since it does less "interesting" things with pointers. changes prompted by lint bitching.
2006-04-20remove some useless code found by lint.David Gwynne
2006-04-20this is the proper fix for krws bug. i feel kinda bad taking the commitDavid Gwynne
from him since he did most of the hard work on it. when marco added the sensor for logical disks he added some extra bits to the softc, but inside an #if NBIO > 0 block. NBIO is set by "bio.h" which was included in ami.c, but not in ami_pci.c which is what is actually responsible for getting the softc allocated. because of this the softc in the rest of the system was smaller than what ami.c needed, so technically it was using unallocated memory. in krws case that unallocated space was filled with garbage, hence his panic. the moral of this story is do NOT put #if inside structs that are passed between different source files. its too easy to have this kind of screwup happen.
2006-04-19Make sure sc_first_poll is initialized to 0 so sensor_task_threadKenneth R Westerback
doesn't blow up on first call to ami_refresh(). There's probably a better fix, but this stops the crashes while that fix is found. ok dlg@
2006-04-18Make output in sysctl pretier.Marco Peereboom
2006-04-18Display logical disk status in sysctl. Now one can use sensorsd toMarco Peereboom
monitor disks on ami. Ex.: hw.sensors.0=sd2, logical disk, WARNING, drive, degraded Requested deraadt@ ok dlg@
2006-04-06the synchronise cache path is unique in ami in that it uses two megaraidDavid Gwynne
commands to emulated one scsi command. i reuse the ccb and pushed it along the scsi setup path twice. when we do this for asynchronous cache syncs this happens with the timeout: timeout_set, timeout_add, timeout_set, timeout_del. from the looks of the timeout code the repeat of the timeout_set/add part can do really interesting things with the linked list holding all the timeouts. this adds a timeout_del in the middle of the two set/adds so the lists are kept sane.
2006-04-06kudos to djm for finding an embarrassing bug. using the same variableDavid Gwynne
as a counter for both an inner and outer loop is not good(tm). ok marco@
2006-04-05reintroduce ami_complete, a replacement for ami_poll that is built on topDavid Gwynne
of the async exec and done commands. ami_poll uses a special command id that isnt needed for normal commands. on top of this we should drain the runq before using ami_poll. using ami_complete means that we can poll with commands still on the card.
2006-04-03Move scsi_done back under splbio.Marco Peereboom
ok dlg
2006-04-03Since we have a run-queue now lets check it in the isr and get io ontoMarco Peereboom
the card if there is any still pending. ok dlg
2006-04-03Silly dlg hz/500 isnt a whole lot. Also removed busy-wait inMarco Peereboom
ami_quartz_exec. This fixes interactivity issues that we saw when running iogen. This is possible due to the new run-queue model for io. ok dlg@
2006-03-29we never use what the ccb completion functions return, so make them allDavid Gwynne
return void instead.
2006-03-29fix the sync_cache scsi command up so it can run asynchronously using theDavid Gwynne
callback bits for completions. also do the AMI_SYSFLUSH command as well as AMI_FLUSH.
2006-03-20remove kernel printfs that say "unable to allocate memory" just beforeDavid Gwynne
returning ENOMEM and the like. userland can say that for us while keeping our dmesg clean.
2006-03-20finer grained use of splbio in the ioctl paths. only use it when dealingDavid Gwynne
with the ccb queues rather than over the whole ioctl. also get rid of the CMD_WAIT flag which is used to restrict the ioctl to only one caller at a time. this is actually protecting from overuse of ccbs for management tasks (like bioctl) by making sure the scsi paths will always have their ccbs. replace the flag with a real lock so that callers can sleep till the mgmt ccb is free, rather than returning EBUSY
2006-03-20shrink the ccb even more. instead of having a "wakeup" member to say whenDavid Gwynne
the ioctl paths can wake up, check the state of the ccb instead. when the ccb becomes READY again then the command has completed.
2006-03-20remove the bits in the ccb for generalised handling of dmaable memory.David Gwynne
now that each code path that puts commands on the hardware has specific completion routines, we dont have to deal with the memory magic in a generic fashion.
2006-03-20switch the mgmt ioctl path to use the ioctl completion function.David Gwynne
2006-03-20move the drv_inq ioctl path to its own completion routine. all the cleanupDavid Gwynne
of the dmammem is now done in the ioctl, the completion routing simply wakes it up.
2006-03-20get rid of the CCB_READY check in ami_start, it is subtly broken and slowsDavid Gwynne
things down. this path is easy to verify without this code so im just dropping it.
2006-03-20the command queues are important so wrap them up in splbioDavid Gwynne