static int controller_queue_rb_irq(struct hw_controller *controller, unsigned char chipnr) { int ret = 0, timeout = 0; if(chipnr != NAND_CHIP_UNDEFINE){ //skip dma operation controller->select_chip(controller, chipnr); } init_completion(&controller_rb_completion); controller_open_interrupt(); NFC_SEND_CMD_IDLE(controller->chip_selected, NAND_TWB_TIME_CYCLE); controller->cmd_ctrl(controller, NAND_CMD_STATUS, NAND_CTRL_CLE); NFC_SEND_CMD_IDLE(controller->chip_selected, NAND_TWB_TIME_CYCLE); smp_rmb(); smp_wmb(); NFC_SEND_CMD_RB_IRQ(18); //NFC_SEND_CMD_IDLE(controller->chip_selected, NAND_TWB_TIME_CYCLE); timeout = wait_for_completion_timeout(&controller_rb_completion, 200); if(timeout == 0){ aml_nand_msg("***nand irq timeout here"); ret = -NAND_BUSY_FAILURE; } controller_close_interrupt(); return ret; }
static int controller_queue_rb_irq(struct hw_controller *controller, unsigned char chipnr) { int ret = 0, timeout = 0; if (chipnr != NAND_CHIP_UNDEFINE)/* skip dma operation */ controller->select_chip(controller, chipnr); reinit_completion(&rb_complete); controller_open_interrupt(controller); NFC_SEND_CMD_IDLE(controller, NAND_TWB_TIME_CYCLE); controller->cmd_ctrl(controller, NAND_CMD_STATUS, NAND_CTRL_CLE); NFC_SEND_CMD_IDLE(controller, NAND_TWB_TIME_CYCLE); /* */ smp_rmb(); /* */ smp_wmb(); NFC_SEND_CMD_RB_IRQ(controller, 18); /* NFC_SEND_CMD_IDLE(controller, NAND_TWB_TIME_CYCLE); */ timeout = wait_for_completion_timeout(&rb_complete, 800); if (timeout == 0) { aml_nand_msg("***[nand] rb irq timeout"); ret = -NAND_BUSY_FAILURE; } controller_close_interrupt(controller); return ret; }