diff options
author | venki <none@none> | 2005-08-17 14:22:32 -0700 |
---|---|---|
committer | venki <none@none> | 2005-08-17 14:22:32 -0700 |
commit | d619c1b841dc484317f6c06b2392a6b2ae991810 (patch) | |
tree | ef50519419ecf73d2726d607800517fde1d6083c | |
parent | 779fc935796a940997d18b31d64a9fec9c6b40f6 (diff) | |
download | illumos-joyent-d619c1b841dc484317f6c06b2392a6b2ae991810.tar.gz |
6305938 pic driver modification needed due to change in PIC fw
6311869 missing mutex_exit in pic16f747 driver code
-rw-r--r-- | usr/src/uts/sun4u/io/pic16f747.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/usr/src/uts/sun4u/io/pic16f747.c b/usr/src/uts/sun4u/io/pic16f747.c index f58f9730b8..6fada509bf 100644 --- a/usr/src/uts/sun4u/io/pic16f747.c +++ b/usr/src/uts/sun4u/io/pic16f747.c @@ -344,10 +344,8 @@ pic_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp) { int inst; int node; - int ntries; struct pic_softc *softc; uint8_t in_command; - uint8_t status; int16_t tempr; inst = PIC_MINOR_TO_INST(getminor(dev)); @@ -368,35 +366,6 @@ pic_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp) return (ENXIO); } - /* Check status register */ - for (ntries = 0; ntries < MAX_RETRIES; ntries++) { - status = ddi_get8(softc->cmd_handle, - (uint8_t *)softc->cmd_reg + RF_STATUS); - - if (status == 0xff) { - mutex_exit(&softc->mutex); - return (EIO); - } - - if ((cmd == PIC_GET_STATUS) || (((status & ST_ENV_BUSY) == 0) && - ((status & ST_STALE_ADT_DATA) == 0) && - ((status & ST_STALE_LM_DATA) == 0))) { - break; - } - - /* - * We need 5us delay between 2 register reads - * this give enough time for the pic to be updated. - * we are waiting 10us to give us some breathing room. - */ - drv_usecwait(10); - } - - if (ntries == MAX_RETRIES) { - mutex_exit(&softc->mutex); - return (EBUSY); - } - switch (cmd) { case PIC_GET_TEMPERATURE: drv_usecwait(10); @@ -455,7 +424,8 @@ pic_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp) case PIC_GET_STATUS: mutex_exit(&softc->mutex); - in_command = status; + /* we don't read the status reg anymore */ + in_command = 0; (void) ddi_copyout(&in_command, (caddr_t)arg, 1, mode); return (0); @@ -482,6 +452,7 @@ pic_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp) case PIC_SET_ESTAR_MODE: (void) ddi_put8(softc->cmd_handle, (uint8_t *)softc->cmd_reg + RF_COMMAND, CMD_TO_ESTAR); + mutex_exit(&softc->mutex); return (0); default: |