static int rts51x_polling_thread(void *__chip) { struct rts51x_chip *chip = (struct rts51x_chip *)__chip; #ifdef SCSI_SCAN_DELAY wait_timeout((delay_use + 5) * HZ); #endif for (;;) { wait_timeout(POLLING_INTERVAL); if (test_bit(FLIDX_DISCONNECTING, &chip->usb->dflags)) { RTS51X_DEBUGP("-- exiting from rts51x-polling\n"); break; } #ifdef CONFIG_PM if (RTS51X_CHK_STAT(chip, STAT_SS) || RTS51X_CHK_STAT(chip, STAT_SS_PRE) || RTS51X_CHK_STAT(chip, STAT_SUSPEND)) { continue; } if (ss_en) { if (RTS51X_CHK_STAT(chip, STAT_IDLE)) { if (chip->ss_counter < (ss_delay * 1000 / POLLING_INTERVAL)) { chip->ss_counter++; } else { RTS51X_SET_STAT(chip, STAT_SS_PRE); rts51x_try_to_enter_ss(chip); continue; } } else { chip->ss_counter = 0; } } #endif mspro_polling_format_status(chip); mutex_lock(&(chip->usb->dev_mutex)); rts51x_polling_func(chip); mutex_unlock(&chip->usb->dev_mutex); } complete(&chip->usb->polling_exit); return 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 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); }