static int rtsx_polling_thread(void *__dev) { struct rtsx_dev *dev = (struct rtsx_dev *)__dev; struct rtsx_chip *chip = dev->chip; struct Scsi_Host *host = rtsx_to_host(dev); struct sd_info *sd_card = &(chip->sd_card); struct xd_info *xd_card = &(chip->xd_card); struct ms_info *ms_card = &(chip->ms_card); sd_card->cleanup_counter = 0; xd_card->cleanup_counter = 0; ms_card->cleanup_counter = 0; /* Wait until SCSI scan finished */ wait_timeout((delay_use + 5) * 1000); for (;;) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(POLLING_INTERVAL); /* lock the device pointers */ mutex_lock(&(dev->dev_mutex)); /* if the device has disconnected, we are free to exit */ if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) { printk(KERN_INFO "-- rtsx-polling exiting\n"); mutex_unlock(&dev->dev_mutex); break; } mutex_unlock(&dev->dev_mutex); mspro_polling_format_status(chip); /* lock the device pointers */ mutex_lock(&(dev->dev_mutex)); rtsx_polling_func(chip); /* unlock the device pointers */ mutex_unlock(&dev->dev_mutex); } scsi_host_put(host); complete_and_exit(&threads_gone, 0); }
static int rtsx_polling_thread(void *__dev) { struct rtsx_dev *dev = __dev; struct rtsx_chip *chip = dev->chip; struct sd_info *sd_card = &chip->sd_card; struct xd_info *xd_card = &chip->xd_card; struct ms_info *ms_card = &chip->ms_card; sd_card->cleanup_counter = 0; xd_card->cleanup_counter = 0; ms_card->cleanup_counter = 0; /* Wait until SCSI scan finished */ wait_timeout((delay_use + 5) * 1000); for (;;) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(msecs_to_jiffies(POLLING_INTERVAL)); /* lock the device pointers */ mutex_lock(&dev->dev_mutex); /* if the device has disconnected, we are free to exit */ if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) { dev_info(&dev->pci->dev, "-- rtsx-polling exiting\n"); mutex_unlock(&dev->dev_mutex); break; } mutex_unlock(&dev->dev_mutex); mspro_polling_format_status(chip); /* lock the device pointers */ mutex_lock(&dev->dev_mutex); rtsx_polling_func(chip); /* unlock the device pointers */ mutex_unlock(&dev->dev_mutex); } complete_and_exit(&dev->polling_exit, 0); }
static int rtsx_polling_thread(void * __dev) { struct rtsx_dev *dev = (struct rtsx_dev *)__dev; struct rtsx_chip *chip = dev->chip; struct Scsi_Host *host = rtsx_to_host(dev); struct sd_info *sd_card = &(chip->sd_card); struct xd_info *xd_card = &(chip->xd_card); struct ms_info *ms_card = &(chip->ms_card); sd_card->cleanup_counter = 0; xd_card->cleanup_counter = 0; ms_card->cleanup_counter = 0; wait_timeout((delay_use + 5) * 1000); for(;;) { wait_timeout(POLLING_INTERVAL); mutex_lock(&(dev->dev_mutex)); if (rtsx_chk_stat(chip, RTSX_STAT_DISCONNECT)) { printk(KERN_INFO "-- rtsx-polling exiting\n"); mutex_unlock(&dev->dev_mutex); break; } mutex_unlock(&dev->dev_mutex); mspro_polling_format_status(chip); mutex_lock(&(dev->dev_mutex)); rtsx_polling_func(chip); mutex_unlock(&dev->dev_mutex); } scsi_host_put(host); complete_and_exit(&threads_gone, 0); }