if ((dev->host_hw_state & H_IS) == H_IS) {
/* acknowledge interrupt and stop interupts */
- heci_set_csr_register(dev);
+ heci_csr_clear_his(dev);
}
dev->recvd_msg = 0;
DBG("reset in start the heci device.\n");
dev->host_hw_state &= ~H_RST;
dev->host_hw_state |= H_IG;
- write_heci_register(dev, H_CSR, dev->host_hw_state);
+ heci_set_csr_register(dev);
DBG("currently saved host_hw_state = 0x%08x.\n",
dev->host_hw_state);
/**
- * heci_set_csr_register - write H_CSR register to the heci device
+ * heci_set_csr_register - write H_CSR register to the heci device,
+ * and ignore the H_IS bit for it is write-one-to-zero.
*
* @dev: device object for our driver
*/
void heci_set_csr_register(struct iamt_heci_device *dev)
{
+ if ((dev->host_hw_state & H_IS) == H_IS)
+ dev->host_hw_state &= ~H_IS;
write_heci_register(dev, H_CSR, dev->host_hw_state);
dev->host_hw_state = read_heci_register(dev, H_CSR);
}
heci_set_csr_register(dev);
}
+/**
+ * heci_csr_clear_his - clear H_IS bit in H_CSR
+ *
+ * @dev: device object for our driver
+ */
+void heci_csr_clear_his(struct iamt_heci_device *dev)
+{
+ write_heci_register(dev, H_CSR, dev->host_hw_state);
+ dev->host_hw_state = read_heci_register(dev, H_CSR);
+}
/**
* _host_get_filled_slots - get number of device filled buffer slots
}
dev->host_hw_state |= H_IG;
- write_heci_register(dev, H_CSR, dev->host_hw_state);
+ heci_set_csr_register(dev);
dev->me_hw_state = read_heci_register(dev, ME_CSR_HA);
if ((dev->me_hw_state & ME_RDY_HRA) != ME_RDY_HRA)
return 0;
void heci_set_csr_register(struct iamt_heci_device *dev);
void heci_csr_enable_interrupts(struct iamt_heci_device *dev);
void heci_csr_disable_interrupts(struct iamt_heci_device *dev);
+void heci_csr_clear_his(struct iamt_heci_device *dev);
void heci_read_slots(struct iamt_heci_device *dev,
unsigned char *buffer, unsigned long buffer_length);
/* disable interrupts */
heci_csr_disable_interrupts(dev);
+ /* clear H_IS bit in H_CSR */
+ heci_csr_clear_his(dev);
+
/*
* Our device interrupted, schedule work the heci_bh_handler
* to handle the interrupt processing. This needs to be a
/* acknowledge interrupt and disable interrupts */
heci_csr_disable_interrupts(dev);
+ /* clear H_IS bit in H_CSR */
+ heci_csr_clear_his(dev);
+
PREPARE_WORK(&dev->work, heci_bh_handler);
DBG("schedule work the heci_bh_handler.\n");
rets = schedule_work(&dev->work);