skdev             283 drivers/block/skd_main.c static inline u32 skd_reg_read32(struct skd_device *skdev, u32 offset)
skdev             285 drivers/block/skd_main.c 	u32 val = readl(skdev->mem_map[1] + offset);
skdev             287 drivers/block/skd_main.c 	if (unlikely(skdev->dbg_level >= 2))
skdev             288 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "offset %x = %x\n", offset, val);
skdev             292 drivers/block/skd_main.c static inline void skd_reg_write32(struct skd_device *skdev, u32 val,
skdev             295 drivers/block/skd_main.c 	writel(val, skdev->mem_map[1] + offset);
skdev             296 drivers/block/skd_main.c 	if (unlikely(skdev->dbg_level >= 2))
skdev             297 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "offset %x = %x\n", offset, val);
skdev             300 drivers/block/skd_main.c static inline void skd_reg_write64(struct skd_device *skdev, u64 val,
skdev             303 drivers/block/skd_main.c 	writeq(val, skdev->mem_map[1] + offset);
skdev             304 drivers/block/skd_main.c 	if (unlikely(skdev->dbg_level >= 2))
skdev             305 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "offset %x = %016llx\n", offset,
skdev             354 drivers/block/skd_main.c static void skd_destruct(struct skd_device *skdev);
skdev             356 drivers/block/skd_main.c static void skd_send_fitmsg(struct skd_device *skdev,
skdev             358 drivers/block/skd_main.c static void skd_send_special_fitmsg(struct skd_device *skdev,
skdev             360 drivers/block/skd_main.c static bool skd_preop_sg_list(struct skd_device *skdev,
skdev             362 drivers/block/skd_main.c static void skd_postop_sg_list(struct skd_device *skdev,
skdev             365 drivers/block/skd_main.c static void skd_restart_device(struct skd_device *skdev);
skdev             366 drivers/block/skd_main.c static int skd_quiesce_dev(struct skd_device *skdev);
skdev             367 drivers/block/skd_main.c static int skd_unquiesce_dev(struct skd_device *skdev);
skdev             368 drivers/block/skd_main.c static void skd_disable_interrupts(struct skd_device *skdev);
skdev             369 drivers/block/skd_main.c static void skd_isr_fwstate(struct skd_device *skdev);
skdev             370 drivers/block/skd_main.c static void skd_recover_requests(struct skd_device *skdev);
skdev             371 drivers/block/skd_main.c static void skd_soft_reset(struct skd_device *skdev);
skdev             375 drivers/block/skd_main.c static void skd_log_skdev(struct skd_device *skdev, const char *event);
skdev             376 drivers/block/skd_main.c static void skd_log_skreq(struct skd_device *skdev,
skdev             392 drivers/block/skd_main.c static int skd_in_flight(struct skd_device *skdev)
skdev             396 drivers/block/skd_main.c 	blk_mq_tagset_busy_iter(&skdev->tag_set, skd_inc_in_flight, &count);
skdev             445 drivers/block/skd_main.c 	struct skd_device *skdev = q->queuedata;
skdev             447 drivers/block/skd_main.c 	SKD_ASSERT(skdev->state != SKD_DRVR_STATE_ONLINE);
skdev             449 drivers/block/skd_main.c 	skd_log_skdev(skdev, "req_not_online");
skdev             450 drivers/block/skd_main.c 	switch (skdev->state) {
skdev             483 drivers/block/skd_main.c 	struct skd_device *skdev = q->queuedata;
skdev             494 drivers/block/skd_main.c 	if (unlikely(skdev->state != SKD_DRVR_STATE_ONLINE))
skdev             509 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev,
skdev             522 drivers/block/skd_main.c 	if (req->bio && !skd_preop_sg_list(skdev, skreq)) {
skdev             523 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "error Out\n");
skdev             529 drivers/block/skd_main.c 	dma_sync_single_for_device(&skdev->pdev->dev, skreq->sksg_dma_address,
skdev             538 drivers/block/skd_main.c 		spin_lock_irqsave(&skdev->lock, flags);
skdev             539 drivers/block/skd_main.c 		skmsg = skdev->skmsg;
skdev             542 drivers/block/skd_main.c 		skmsg = &skdev->skmsg_table[tag];
skdev             543 drivers/block/skd_main.c 		skdev->skmsg = skmsg;
skdev             581 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "req=0x%x busy=%d\n", skreq->id,
skdev             582 drivers/block/skd_main.c 		skd_in_flight(skdev));
skdev             588 drivers/block/skd_main.c 		skd_send_fitmsg(skdev, skmsg);
skdev             592 drivers/block/skd_main.c 			skd_send_fitmsg(skdev, skmsg);
skdev             593 drivers/block/skd_main.c 			skdev->skmsg = NULL;
skdev             595 drivers/block/skd_main.c 		spin_unlock_irqrestore(&skdev->lock, flags);
skdev             604 drivers/block/skd_main.c 	struct skd_device *skdev = req->q->queuedata;
skdev             606 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "request with tag %#x timed out\n",
skdev             619 drivers/block/skd_main.c static bool skd_preop_sg_list(struct skd_device *skdev,
skdev             632 drivers/block/skd_main.c 	n_sg = blk_rq_map_sg(skdev->queue, req, sgl);
skdev             640 drivers/block/skd_main.c 	n_sg = dma_map_sg(&skdev->pdev->dev, sgl, n_sg, skreq->data_dir);
skdev             644 drivers/block/skd_main.c 	SKD_ASSERT(n_sg <= skdev->sgs_per_request);
skdev             663 drivers/block/skd_main.c 	if (unlikely(skdev->dbg_level > 1)) {
skdev             664 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev             670 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev,
skdev             680 drivers/block/skd_main.c static void skd_postop_sg_list(struct skd_device *skdev,
skdev             690 drivers/block/skd_main.c 	dma_unmap_sg(&skdev->pdev->dev, &skreq->sg[0], skreq->n_sg,
skdev             700 drivers/block/skd_main.c static void skd_timer_tick_not_online(struct skd_device *skdev);
skdev             704 drivers/block/skd_main.c 	struct skd_device *skdev = container_of(work, typeof(*skdev),
skdev             712 drivers/block/skd_main.c 	blk_mq_start_hw_queues(skdev->queue);
skdev             717 drivers/block/skd_main.c 	struct skd_device *skdev = from_timer(skdev, t, timer);
skdev             721 drivers/block/skd_main.c 	if (skdev->state == SKD_DRVR_STATE_FAULT)
skdev             727 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, reqflags);
skdev             729 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_STATUS);
skdev             731 drivers/block/skd_main.c 	if (state != skdev->drive_state)
skdev             732 drivers/block/skd_main.c 		skd_isr_fwstate(skdev);
skdev             734 drivers/block/skd_main.c 	if (skdev->state != SKD_DRVR_STATE_ONLINE)
skdev             735 drivers/block/skd_main.c 		skd_timer_tick_not_online(skdev);
skdev             737 drivers/block/skd_main.c 	mod_timer(&skdev->timer, (jiffies + HZ));
skdev             739 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, reqflags);
skdev             742 drivers/block/skd_main.c static void skd_timer_tick_not_online(struct skd_device *skdev)
skdev             744 drivers/block/skd_main.c 	switch (skdev->state) {
skdev             749 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev             751 drivers/block/skd_main.c 			skdev->drive_state, skdev->state);
skdev             755 drivers/block/skd_main.c 		if (skdev->timer_countdown > 0) {
skdev             756 drivers/block/skd_main.c 			skdev->timer_countdown--;
skdev             759 drivers/block/skd_main.c 		skd_recover_requests(skdev);
skdev             765 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "busy[%x], countdown=%d\n",
skdev             766 drivers/block/skd_main.c 			skdev->state, skdev->timer_countdown);
skdev             767 drivers/block/skd_main.c 		if (skdev->timer_countdown > 0) {
skdev             768 drivers/block/skd_main.c 			skdev->timer_countdown--;
skdev             771 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev             773 drivers/block/skd_main.c 			skdev->state, skdev->timer_countdown);
skdev             774 drivers/block/skd_main.c 		skd_restart_device(skdev);
skdev             779 drivers/block/skd_main.c 		if (skdev->timer_countdown > 0) {
skdev             780 drivers/block/skd_main.c 			skdev->timer_countdown--;
skdev             785 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_FAULT;
skdev             787 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "DriveFault Connect Timeout (%x)\n",
skdev             788 drivers/block/skd_main.c 			skdev->drive_state);
skdev             792 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev             793 drivers/block/skd_main.c 		skdev->gendisk_on = -1;
skdev             794 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev             806 drivers/block/skd_main.c 		if (skdev->timer_countdown > 0) {
skdev             807 drivers/block/skd_main.c 			skdev->timer_countdown--;
skdev             812 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_FAULT;
skdev             813 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev,
skdev             815 drivers/block/skd_main.c 			skdev->drive_state);
skdev             829 drivers/block/skd_main.c 		if ((skdev->drive_state == FIT_SR_DRIVE_SOFT_RESET) ||
skdev             830 drivers/block/skd_main.c 		    (skdev->drive_state == FIT_SR_DRIVE_FAULT) ||
skdev             831 drivers/block/skd_main.c 		    (skdev->drive_state == FIT_SR_DRIVE_STATE_MASK))
skdev             835 drivers/block/skd_main.c 			skd_recover_requests(skdev);
skdev             837 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev, "Disable BusMaster (%x)\n",
skdev             838 drivers/block/skd_main.c 				skdev->drive_state);
skdev             839 drivers/block/skd_main.c 			pci_disable_device(skdev->pdev);
skdev             840 drivers/block/skd_main.c 			skd_disable_interrupts(skdev);
skdev             841 drivers/block/skd_main.c 			skd_recover_requests(skdev);
skdev             846 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev             847 drivers/block/skd_main.c 		skdev->gendisk_on = -1;
skdev             848 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev             861 drivers/block/skd_main.c static int skd_start_timer(struct skd_device *skdev)
skdev             865 drivers/block/skd_main.c 	timer_setup(&skdev->timer, skd_timer_tick, 0);
skdev             867 drivers/block/skd_main.c 	rc = mod_timer(&skdev->timer, (jiffies + HZ));
skdev             869 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "failed to start timer %d\n", rc);
skdev             873 drivers/block/skd_main.c static void skd_kill_timer(struct skd_device *skdev)
skdev             875 drivers/block/skd_main.c 	del_timer_sync(&skdev->timer);
skdev             884 drivers/block/skd_main.c static int skd_format_internal_skspcl(struct skd_device *skdev)
skdev             886 drivers/block/skd_main.c 	struct skd_special_context *skspcl = &skdev->internal_skspcl;
skdev             912 drivers/block/skd_main.c static void skd_send_internal_skspcl(struct skd_device *skdev,
skdev             990 drivers/block/skd_main.c 	skd_send_special_fitmsg(skdev, skspcl);
skdev             993 drivers/block/skd_main.c static void skd_refresh_device_data(struct skd_device *skdev)
skdev             995 drivers/block/skd_main.c 	struct skd_special_context *skspcl = &skdev->internal_skspcl;
skdev             997 drivers/block/skd_main.c 	skd_send_internal_skspcl(skdev, skspcl, TEST_UNIT_READY);
skdev            1000 drivers/block/skd_main.c static int skd_chk_read_buf(struct skd_device *skdev,
skdev            1014 drivers/block/skd_main.c static void skd_log_check_status(struct skd_device *skdev, u8 status, u8 key,
skdev            1020 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev,
skdev            1026 drivers/block/skd_main.c static void skd_complete_internal(struct skd_device *skdev,
skdev            1036 drivers/block/skd_main.c 	lockdep_assert_held(&skdev->lock);
skdev            1038 drivers/block/skd_main.c 	SKD_ASSERT(skspcl == &skdev->internal_skspcl);
skdev            1040 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "complete internal %x\n", scsi->cdb[0]);
skdev            1042 drivers/block/skd_main.c 	dma_sync_single_for_cpu(&skdev->pdev->dev,
skdev            1052 drivers/block/skd_main.c 	skd_log_check_status(skdev, status, skerr->key, skerr->code,
skdev            1058 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl, WRITE_BUFFER);
skdev            1061 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl, WRITE_BUFFER);
skdev            1063 drivers/block/skd_main.c 			if (skdev->state == SKD_DRVR_STATE_STOPPING) {
skdev            1064 drivers/block/skd_main.c 				dev_dbg(&skdev->pdev->dev,
skdev            1066 drivers/block/skd_main.c 					skdev->state);
skdev            1069 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev,
skdev            1071 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl,
skdev            1078 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl, READ_BUFFER);
skdev            1080 drivers/block/skd_main.c 			if (skdev->state == SKD_DRVR_STATE_STOPPING) {
skdev            1081 drivers/block/skd_main.c 				dev_dbg(&skdev->pdev->dev,
skdev            1083 drivers/block/skd_main.c 					skdev->state);
skdev            1086 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev,
skdev            1088 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl,
skdev            1095 drivers/block/skd_main.c 			if (skd_chk_read_buf(skdev, skspcl) == 0)
skdev            1096 drivers/block/skd_main.c 				skd_send_internal_skspcl(skdev, skspcl,
skdev            1099 drivers/block/skd_main.c 				dev_err(&skdev->pdev->dev,
skdev            1101 drivers/block/skd_main.c 					skdev->connect_retries);
skdev            1102 drivers/block/skd_main.c 				if (skdev->connect_retries <
skdev            1104 drivers/block/skd_main.c 					skdev->connect_retries++;
skdev            1105 drivers/block/skd_main.c 					skd_soft_reset(skdev);
skdev            1107 drivers/block/skd_main.c 					dev_err(&skdev->pdev->dev,
skdev            1114 drivers/block/skd_main.c 			if (skdev->state == SKD_DRVR_STATE_STOPPING) {
skdev            1115 drivers/block/skd_main.c 				dev_dbg(&skdev->pdev->dev,
skdev            1117 drivers/block/skd_main.c 					skdev->state);
skdev            1120 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev,
skdev            1122 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl,
skdev            1128 drivers/block/skd_main.c 		skdev->read_cap_is_valid = 0;
skdev            1130 drivers/block/skd_main.c 			skdev->read_cap_last_lba =
skdev            1133 drivers/block/skd_main.c 			skdev->read_cap_blocksize =
skdev            1137 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, "last lba %d, bs %d\n",
skdev            1138 drivers/block/skd_main.c 				skdev->read_cap_last_lba,
skdev            1139 drivers/block/skd_main.c 				skdev->read_cap_blocksize);
skdev            1141 drivers/block/skd_main.c 			set_capacity(skdev->disk, skdev->read_cap_last_lba + 1);
skdev            1143 drivers/block/skd_main.c 			skdev->read_cap_is_valid = 1;
skdev            1145 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl, INQUIRY);
skdev            1148 drivers/block/skd_main.c 			skdev->read_cap_last_lba = ~0;
skdev            1149 drivers/block/skd_main.c 			set_capacity(skdev->disk, skdev->read_cap_last_lba + 1);
skdev            1150 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, "**** MEDIUM ERROR caused READCAP to fail, ignore failure and continue to inquiry\n");
skdev            1151 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl, INQUIRY);
skdev            1153 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, "**** READCAP failed, retry TUR\n");
skdev            1154 drivers/block/skd_main.c 			skd_send_internal_skspcl(skdev, skspcl,
skdev            1160 drivers/block/skd_main.c 		skdev->inquiry_is_valid = 0;
skdev            1162 drivers/block/skd_main.c 			skdev->inquiry_is_valid = 1;
skdev            1165 drivers/block/skd_main.c 				skdev->inq_serial_num[i] = buf[i + 4];
skdev            1166 drivers/block/skd_main.c 			skdev->inq_serial_num[12] = 0;
skdev            1169 drivers/block/skd_main.c 		if (skd_unquiesce_dev(skdev) < 0)
skdev            1170 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, "**** failed, to ONLINE device\n");
skdev            1172 drivers/block/skd_main.c 		skdev->connect_retries = 0;
skdev            1177 drivers/block/skd_main.c 			skdev->sync_done = 1;
skdev            1179 drivers/block/skd_main.c 			skdev->sync_done = -1;
skdev            1180 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev            1194 drivers/block/skd_main.c static void skd_send_fitmsg(struct skd_device *skdev,
skdev            1199 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "dma address %pad, busy=%d\n",
skdev            1200 drivers/block/skd_main.c 		&skmsg->mb_dma_address, skd_in_flight(skdev));
skdev            1201 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "msg_buf %p\n", skmsg->msg_buf);
skdev            1206 drivers/block/skd_main.c 	if (unlikely(skdev->dbg_level > 1)) {
skdev            1210 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, "msg[%2d] %8ph\n", i,
skdev            1231 drivers/block/skd_main.c 	dma_sync_single_for_device(&skdev->pdev->dev, skmsg->mb_dma_address,
skdev            1237 drivers/block/skd_main.c 	SKD_WRITEQ(skdev, qcmd, FIT_Q_COMMAND);
skdev            1240 drivers/block/skd_main.c static void skd_send_special_fitmsg(struct skd_device *skdev,
skdev            1247 drivers/block/skd_main.c 	if (unlikely(skdev->dbg_level > 1)) {
skdev            1252 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, " spcl[%2d] %8ph\n", i,
skdev            1258 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev            1266 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev,
skdev            1280 drivers/block/skd_main.c 	dma_sync_single_for_device(&skdev->pdev->dev, skspcl->mb_dma_address,
skdev            1282 drivers/block/skd_main.c 	dma_sync_single_for_device(&skdev->pdev->dev,
skdev            1286 drivers/block/skd_main.c 	dma_sync_single_for_device(&skdev->pdev->dev,
skdev            1294 drivers/block/skd_main.c 	SKD_WRITEQ(skdev, qcmd, FIT_Q_COMMAND);
skdev            1303 drivers/block/skd_main.c static void skd_complete_other(struct skd_device *skdev,
skdev            1353 drivers/block/skd_main.c skd_check_status(struct skd_device *skdev,
skdev            1358 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "key/asc/ascq/fruc %02x/%02x/%02x/%02x\n",
skdev            1361 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev,
skdev            1391 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev,
skdev            1402 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "status check: error\n");
skdev            1406 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "status check good default\n");
skdev            1410 drivers/block/skd_main.c static void skd_resolve_req_exception(struct skd_device *skdev,
skdev            1416 drivers/block/skd_main.c 	switch (skd_check_status(skdev, cmp_status, &skreq->err_info)) {
skdev            1424 drivers/block/skd_main.c 		skd_log_skreq(skdev, skreq, "retry(busy)");
skdev            1426 drivers/block/skd_main.c 		dev_info(&skdev->pdev->dev, "drive BUSY imminent\n");
skdev            1427 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY_IMMINENT;
skdev            1428 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_TIMER_MINUTES(20);
skdev            1429 drivers/block/skd_main.c 		skd_quiesce_dev(skdev);
skdev            1434 drivers/block/skd_main.c 			skd_log_skreq(skdev, skreq, "retry");
skdev            1448 drivers/block/skd_main.c static void skd_release_skreq(struct skd_device *skdev,
skdev            1457 drivers/block/skd_main.c static int skd_isr_completion_posted(struct skd_device *skdev,
skdev            1474 drivers/block/skd_main.c 	lockdep_assert_held(&skdev->lock);
skdev            1477 drivers/block/skd_main.c 		SKD_ASSERT(skdev->skcomp_ix < SKD_N_COMPLETION_ENTRY);
skdev            1479 drivers/block/skd_main.c 		skcmp = &skdev->skcomp_table[skdev->skcomp_ix];
skdev            1485 drivers/block/skd_main.c 		skerr = &skdev->skerr_table[skdev->skcomp_ix];
skdev            1487 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev            1489 drivers/block/skd_main.c 			skdev->skcomp_cycle, skdev->skcomp_ix, cmp_cycle,
skdev            1490 drivers/block/skd_main.c 			cmp_cntxt, cmp_status, skd_in_flight(skdev),
skdev            1491 drivers/block/skd_main.c 			cmp_bytes, skdev->proto_ver);
skdev            1493 drivers/block/skd_main.c 		if (cmp_cycle != skdev->skcomp_cycle) {
skdev            1494 drivers/block/skd_main.c 			dev_dbg(&skdev->pdev->dev, "end of completions\n");
skdev            1501 drivers/block/skd_main.c 		skdev->skcomp_ix++;
skdev            1502 drivers/block/skd_main.c 		if (skdev->skcomp_ix >= SKD_N_COMPLETION_ENTRY) {
skdev            1503 drivers/block/skd_main.c 			skdev->skcomp_ix = 0;
skdev            1504 drivers/block/skd_main.c 			skdev->skcomp_cycle++;
skdev            1516 drivers/block/skd_main.c 		if (tag >= skdev->num_req_context) {
skdev            1520 drivers/block/skd_main.c 			WARN_ON_ONCE(blk_mq_tag_to_rq(skdev->tag_set.tags[hwq],
skdev            1522 drivers/block/skd_main.c 			skd_complete_other(skdev, skcmp, skerr);
skdev            1526 drivers/block/skd_main.c 		rq = blk_mq_tag_to_rq(skdev->tag_set.tags[hwq], tag);
skdev            1536 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev,
skdev            1548 drivers/block/skd_main.c 			skd_log_check_status(skdev, cmp_status, skerr->key,
skdev            1554 drivers/block/skd_main.c 			skd_postop_sg_list(skdev, skreq);
skdev            1556 drivers/block/skd_main.c 		skd_release_skreq(skdev, skreq);
skdev            1565 drivers/block/skd_main.c 			skd_resolve_req_exception(skdev, skreq, rq);
skdev            1577 drivers/block/skd_main.c 	if (skdev->state == SKD_DRVR_STATE_PAUSING &&
skdev            1578 drivers/block/skd_main.c 	    skd_in_flight(skdev) == 0) {
skdev            1579 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_PAUSED;
skdev            1580 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev            1586 drivers/block/skd_main.c static void skd_complete_other(struct skd_device *skdev,
skdev            1595 drivers/block/skd_main.c 	lockdep_assert_held(&skdev->lock);
skdev            1601 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "table=0x%x id=0x%x slot=%d\n", req_table,
skdev            1620 drivers/block/skd_main.c 			skspcl = &skdev->internal_skspcl;
skdev            1623 drivers/block/skd_main.c 				skd_complete_internal(skdev,
skdev            1648 drivers/block/skd_main.c static void skd_reset_skcomp(struct skd_device *skdev)
skdev            1650 drivers/block/skd_main.c 	memset(skdev->skcomp_table, 0, SKD_SKCOMP_SIZE);
skdev            1652 drivers/block/skd_main.c 	skdev->skcomp_ix = 0;
skdev            1653 drivers/block/skd_main.c 	skdev->skcomp_cycle = 1;
skdev            1663 drivers/block/skd_main.c 	struct skd_device *skdev =
skdev            1668 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            1674 drivers/block/skd_main.c 	skd_isr_completion_posted(skdev, 0, &flush_enqueued);
skdev            1675 drivers/block/skd_main.c 	schedule_work(&skdev->start_queue);
skdev            1677 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            1680 drivers/block/skd_main.c static void skd_isr_msg_from_dev(struct skd_device *skdev);
skdev            1685 drivers/block/skd_main.c 	struct skd_device *skdev = ptr;
skdev            1692 drivers/block/skd_main.c 	spin_lock(&skdev->lock);
skdev            1695 drivers/block/skd_main.c 		intstat = SKD_READL(skdev, FIT_INT_STATUS_HOST);
skdev            1700 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "intstat=0x%x ack=0x%x\n", intstat,
skdev            1712 drivers/block/skd_main.c 				if (likely (skdev->state
skdev            1720 drivers/block/skd_main.c 		SKD_WRITEL(skdev, ack, FIT_INT_STATUS_HOST);
skdev            1722 drivers/block/skd_main.c 		if (likely((skdev->state != SKD_DRVR_STATE_LOAD) &&
skdev            1723 drivers/block/skd_main.c 			   (skdev->state != SKD_DRVR_STATE_STOPPING))) {
skdev            1731 drivers/block/skd_main.c 						skd_isr_completion_posted(skdev,
skdev            1736 drivers/block/skd_main.c 				skd_isr_fwstate(skdev);
skdev            1737 drivers/block/skd_main.c 				if (skdev->state == SKD_DRVR_STATE_FAULT ||
skdev            1738 drivers/block/skd_main.c 				    skdev->state ==
skdev            1740 drivers/block/skd_main.c 					spin_unlock(&skdev->lock);
skdev            1746 drivers/block/skd_main.c 				skd_isr_msg_from_dev(skdev);
skdev            1751 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            1754 drivers/block/skd_main.c 		schedule_work(&skdev->completion_worker);
skdev            1756 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            1758 drivers/block/skd_main.c 	spin_unlock(&skdev->lock);
skdev            1763 drivers/block/skd_main.c static void skd_drive_fault(struct skd_device *skdev)
skdev            1765 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_FAULT;
skdev            1766 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "Drive FAULT\n");
skdev            1769 drivers/block/skd_main.c static void skd_drive_disappeared(struct skd_device *skdev)
skdev            1771 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_DISAPPEARED;
skdev            1772 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "Drive DISAPPEARED\n");
skdev            1775 drivers/block/skd_main.c static void skd_isr_fwstate(struct skd_device *skdev)
skdev            1780 drivers/block/skd_main.c 	int prev_driver_state = skdev->state;
skdev            1782 drivers/block/skd_main.c 	sense = SKD_READL(skdev, FIT_STATUS);
skdev            1785 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "s1120 state %s(%d)=>%s(%d)\n",
skdev            1786 drivers/block/skd_main.c 		skd_drive_state_to_str(skdev->drive_state), skdev->drive_state,
skdev            1789 drivers/block/skd_main.c 	skdev->drive_state = state;
skdev            1791 drivers/block/skd_main.c 	switch (skdev->drive_state) {
skdev            1793 drivers/block/skd_main.c 		if (skdev->state == SKD_DRVR_STATE_PROTOCOL_MISMATCH) {
skdev            1794 drivers/block/skd_main.c 			skd_disable_interrupts(skdev);
skdev            1797 drivers/block/skd_main.c 		if (skdev->state == SKD_DRVR_STATE_RESTARTING)
skdev            1798 drivers/block/skd_main.c 			skd_recover_requests(skdev);
skdev            1799 drivers/block/skd_main.c 		if (skdev->state == SKD_DRVR_STATE_WAIT_BOOT) {
skdev            1800 drivers/block/skd_main.c 			skdev->timer_countdown = SKD_STARTING_TIMO;
skdev            1801 drivers/block/skd_main.c 			skdev->state = SKD_DRVR_STATE_STARTING;
skdev            1802 drivers/block/skd_main.c 			skd_soft_reset(skdev);
skdev            1806 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1807 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1811 drivers/block/skd_main.c 		skdev->cur_max_queue_depth = skd_max_queue_depth;
skdev            1812 drivers/block/skd_main.c 		if (skdev->cur_max_queue_depth > skdev->dev_max_queue_depth)
skdev            1813 drivers/block/skd_main.c 			skdev->cur_max_queue_depth = skdev->dev_max_queue_depth;
skdev            1815 drivers/block/skd_main.c 		skdev->queue_low_water_mark =
skdev            1816 drivers/block/skd_main.c 			skdev->cur_max_queue_depth * 2 / 3 + 1;
skdev            1817 drivers/block/skd_main.c 		if (skdev->queue_low_water_mark < 1)
skdev            1818 drivers/block/skd_main.c 			skdev->queue_low_water_mark = 1;
skdev            1819 drivers/block/skd_main.c 		dev_info(&skdev->pdev->dev,
skdev            1821 drivers/block/skd_main.c 			 skdev->cur_max_queue_depth,
skdev            1822 drivers/block/skd_main.c 			 skdev->dev_max_queue_depth,
skdev            1823 drivers/block/skd_main.c 			 skdev->queue_low_water_mark);
skdev            1825 drivers/block/skd_main.c 		skd_refresh_device_data(skdev);
skdev            1829 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY;
skdev            1830 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_BUSY_TIMO;
skdev            1831 drivers/block/skd_main.c 		skd_quiesce_dev(skdev);
skdev            1837 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY_SANITIZE;
skdev            1838 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_TIMER_SECONDS(3);
skdev            1839 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            1842 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY_ERASE;
skdev            1843 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_BUSY_TIMO;
skdev            1846 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_IDLE;
skdev            1849 drivers/block/skd_main.c 		switch (skdev->state) {
skdev            1855 drivers/block/skd_main.c 			skdev->state = SKD_DRVR_STATE_RESTARTING;
skdev            1860 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "ISR FIT_SR_DRIVE_FW_BOOTING\n");
skdev            1861 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_WAIT_BOOT;
skdev            1862 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_WAIT_BOOT_TIMO;
skdev            1871 drivers/block/skd_main.c 		skd_drive_fault(skdev);
skdev            1872 drivers/block/skd_main.c 		skd_recover_requests(skdev);
skdev            1873 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            1878 drivers/block/skd_main.c 		dev_info(&skdev->pdev->dev, "state=0x%x sense=0x%x\n", state,
skdev            1880 drivers/block/skd_main.c 		skd_drive_disappeared(skdev);
skdev            1881 drivers/block/skd_main.c 		skd_recover_requests(skdev);
skdev            1882 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            1890 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "Driver state %s(%d)=>%s(%d)\n",
skdev            1892 drivers/block/skd_main.c 		skd_skdev_state_to_str(skdev->state), skdev->state);
skdev            1897 drivers/block/skd_main.c 	struct skd_device *const skdev = data;
skdev            1903 drivers/block/skd_main.c 	skd_log_skreq(skdev, skreq, "recover");
skdev            1907 drivers/block/skd_main.c 		skd_postop_sg_list(skdev, skreq);
skdev            1915 drivers/block/skd_main.c static void skd_recover_requests(struct skd_device *skdev)
skdev            1917 drivers/block/skd_main.c 	blk_mq_tagset_busy_iter(&skdev->tag_set, skd_recover_request, skdev);
skdev            1920 drivers/block/skd_main.c static void skd_isr_msg_from_dev(struct skd_device *skdev)
skdev            1926 drivers/block/skd_main.c 	mfd = SKD_READL(skdev, FIT_MSG_FROM_DEVICE);
skdev            1928 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "mfd=0x%x last_mtd=0x%x\n", mfd,
skdev            1929 drivers/block/skd_main.c 		skdev->last_mtd);
skdev            1932 drivers/block/skd_main.c 	if (FIT_MXD_TYPE(mfd) != FIT_MXD_TYPE(skdev->last_mtd))
skdev            1937 drivers/block/skd_main.c 		skdev->proto_ver = FIT_PROTOCOL_MAJOR_VER(mfd);
skdev            1939 drivers/block/skd_main.c 		if (skdev->proto_ver != FIT_PROTOCOL_VERSION_1) {
skdev            1940 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev, "protocol mismatch\n");
skdev            1941 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev, "  got=%d support=%d\n",
skdev            1942 drivers/block/skd_main.c 				skdev->proto_ver, FIT_PROTOCOL_VERSION_1);
skdev            1943 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev, "  please upgrade driver\n");
skdev            1944 drivers/block/skd_main.c 			skdev->state = SKD_DRVR_STATE_PROTOCOL_MISMATCH;
skdev            1945 drivers/block/skd_main.c 			skd_soft_reset(skdev);
skdev            1949 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1950 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1954 drivers/block/skd_main.c 		skdev->dev_max_queue_depth = FIT_MXD_DATA(mfd);
skdev            1957 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1958 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1962 drivers/block/skd_main.c 		SKD_WRITEQ(skdev, skdev->cq_dma_address, FIT_MSG_TO_DEVICE_ARG);
skdev            1964 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1965 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1969 drivers/block/skd_main.c 		skd_reset_skcomp(skdev);
skdev            1970 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_CMD_LOG_HOST_ID, 0, skdev->devno);
skdev            1971 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1972 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1977 drivers/block/skd_main.c 		skdev->connect_time_stamp = (u32)ktime_get_real_seconds();
skdev            1978 drivers/block/skd_main.c 		data = skdev->connect_time_stamp & 0xFFFF;
skdev            1980 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1981 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1985 drivers/block/skd_main.c 		skdev->drive_jiffies = FIT_MXD_DATA(mfd);
skdev            1986 drivers/block/skd_main.c 		data = (skdev->connect_time_stamp >> 16) & 0xFFFF;
skdev            1988 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1989 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1993 drivers/block/skd_main.c 		skdev->drive_jiffies |= (FIT_MXD_DATA(mfd) << 16);
skdev            1995 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
skdev            1996 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
skdev            1998 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "Time sync driver=0x%x device=0x%x\n",
skdev            1999 drivers/block/skd_main.c 			skdev->connect_time_stamp, skdev->drive_jiffies);
skdev            2003 drivers/block/skd_main.c 		skdev->last_mtd = 0;
skdev            2014 drivers/block/skd_main.c static void skd_disable_interrupts(struct skd_device *skdev)
skdev            2018 drivers/block/skd_main.c 	sense = SKD_READL(skdev, FIT_CONTROL);
skdev            2020 drivers/block/skd_main.c 	SKD_WRITEL(skdev, sense, FIT_CONTROL);
skdev            2021 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "sense 0x%x\n", sense);
skdev            2026 drivers/block/skd_main.c 	SKD_WRITEL(skdev, ~0, FIT_INT_MASK_HOST);
skdev            2029 drivers/block/skd_main.c static void skd_enable_interrupts(struct skd_device *skdev)
skdev            2039 drivers/block/skd_main.c 	SKD_WRITEL(skdev, ~val, FIT_INT_MASK_HOST);
skdev            2040 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "interrupt mask=0x%x\n", ~val);
skdev            2042 drivers/block/skd_main.c 	val = SKD_READL(skdev, FIT_CONTROL);
skdev            2044 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "control=0x%x\n", val);
skdev            2045 drivers/block/skd_main.c 	SKD_WRITEL(skdev, val, FIT_CONTROL);
skdev            2054 drivers/block/skd_main.c static void skd_soft_reset(struct skd_device *skdev)
skdev            2058 drivers/block/skd_main.c 	val = SKD_READL(skdev, FIT_CONTROL);
skdev            2060 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "control=0x%x\n", val);
skdev            2061 drivers/block/skd_main.c 	SKD_WRITEL(skdev, val, FIT_CONTROL);
skdev            2064 drivers/block/skd_main.c static void skd_start_device(struct skd_device *skdev)
skdev            2070 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2073 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_INT_DEF_MASK, FIT_INT_STATUS_HOST);
skdev            2075 drivers/block/skd_main.c 	sense = SKD_READL(skdev, FIT_STATUS);
skdev            2077 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "initial status=0x%x\n", sense);
skdev            2080 drivers/block/skd_main.c 	skdev->drive_state = state;
skdev            2081 drivers/block/skd_main.c 	skdev->last_mtd = 0;
skdev            2083 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_STARTING;
skdev            2084 drivers/block/skd_main.c 	skdev->timer_countdown = SKD_STARTING_TIMO;
skdev            2086 drivers/block/skd_main.c 	skd_enable_interrupts(skdev);
skdev            2088 drivers/block/skd_main.c 	switch (skdev->drive_state) {
skdev            2090 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "Drive offline...\n");
skdev            2094 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "FIT_SR_DRIVE_FW_BOOTING\n");
skdev            2095 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_WAIT_BOOT;
skdev            2096 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_WAIT_BOOT_TIMO;
skdev            2100 drivers/block/skd_main.c 		dev_info(&skdev->pdev->dev, "Start: BUSY_SANITIZE\n");
skdev            2101 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY_SANITIZE;
skdev            2102 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_STARTED_BUSY_TIMO;
skdev            2106 drivers/block/skd_main.c 		dev_info(&skdev->pdev->dev, "Start: BUSY_ERASE\n");
skdev            2107 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY_ERASE;
skdev            2108 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_STARTED_BUSY_TIMO;
skdev            2113 drivers/block/skd_main.c 		skd_soft_reset(skdev);
skdev            2117 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "Drive Busy...\n");
skdev            2118 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY;
skdev            2119 drivers/block/skd_main.c 		skdev->timer_countdown = SKD_STARTED_BUSY_TIMO;
skdev            2123 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "drive soft reset in prog\n");
skdev            2131 drivers/block/skd_main.c 		skd_drive_fault(skdev);
skdev            2133 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "starting queue\n");
skdev            2134 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            2135 drivers/block/skd_main.c 		skdev->gendisk_on = -1;
skdev            2136 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev            2142 drivers/block/skd_main.c 		skd_drive_disappeared(skdev);
skdev            2144 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev            2146 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            2147 drivers/block/skd_main.c 		skdev->gendisk_on = -1;
skdev            2148 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev            2152 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "Start: unknown state %x\n",
skdev            2153 drivers/block/skd_main.c 			skdev->drive_state);
skdev            2157 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_CONTROL);
skdev            2158 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "FIT Control Status=0x%x\n", state);
skdev            2160 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_INT_STATUS_HOST);
skdev            2161 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "Intr Status=0x%x\n", state);
skdev            2163 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_INT_MASK_HOST);
skdev            2164 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "Intr Mask=0x%x\n", state);
skdev            2166 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_MSG_FROM_DEVICE);
skdev            2167 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "Msg from Dev=0x%x\n", state);
skdev            2169 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_HW_VERSION);
skdev            2170 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "HW version=0x%x\n", state);
skdev            2172 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2175 drivers/block/skd_main.c static void skd_stop_device(struct skd_device *skdev)
skdev            2178 drivers/block/skd_main.c 	struct skd_special_context *skspcl = &skdev->internal_skspcl;
skdev            2182 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2184 drivers/block/skd_main.c 	if (skdev->state != SKD_DRVR_STATE_ONLINE) {
skdev            2185 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "%s not online no sync\n", __func__);
skdev            2190 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "%s no special\n", __func__);
skdev            2194 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_SYNCING;
skdev            2195 drivers/block/skd_main.c 	skdev->sync_done = 0;
skdev            2197 drivers/block/skd_main.c 	skd_send_internal_skspcl(skdev, skspcl, SYNCHRONIZE_CACHE);
skdev            2199 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2201 drivers/block/skd_main.c 	wait_event_interruptible_timeout(skdev->waitq,
skdev            2202 drivers/block/skd_main.c 					 (skdev->sync_done), (10 * HZ));
skdev            2204 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2206 drivers/block/skd_main.c 	switch (skdev->sync_done) {
skdev            2208 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "%s no sync\n", __func__);
skdev            2211 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "%s sync done\n", __func__);
skdev            2214 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "%s sync error\n", __func__);
skdev            2218 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_STOPPING;
skdev            2219 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2221 drivers/block/skd_main.c 	skd_kill_timer(skdev);
skdev            2223 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2224 drivers/block/skd_main.c 	skd_disable_interrupts(skdev);
skdev            2228 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_INT_DEF_MASK, FIT_INT_STATUS_HOST);
skdev            2229 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_CR_SOFT_RESET, FIT_CONTROL);
skdev            2231 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2236 drivers/block/skd_main.c 			SKD_READL(skdev, FIT_STATUS) & FIT_SR_DRIVE_STATE_MASK;
skdev            2244 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "%s state error 0x%02x\n", __func__,
skdev            2249 drivers/block/skd_main.c static void skd_restart_device(struct skd_device *skdev)
skdev            2254 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_INT_DEF_MASK, FIT_INT_STATUS_HOST);
skdev            2256 drivers/block/skd_main.c 	state = SKD_READL(skdev, FIT_STATUS);
skdev            2258 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "drive status=0x%x\n", state);
skdev            2261 drivers/block/skd_main.c 	skdev->drive_state = state;
skdev            2262 drivers/block/skd_main.c 	skdev->last_mtd = 0;
skdev            2264 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_RESTARTING;
skdev            2265 drivers/block/skd_main.c 	skdev->timer_countdown = SKD_RESTARTING_TIMO;
skdev            2267 drivers/block/skd_main.c 	skd_soft_reset(skdev);
skdev            2271 drivers/block/skd_main.c static int skd_quiesce_dev(struct skd_device *skdev)
skdev            2275 drivers/block/skd_main.c 	switch (skdev->state) {
skdev            2278 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "stopping queue\n");
skdev            2279 drivers/block/skd_main.c 		blk_mq_stop_hw_queues(skdev->queue);
skdev            2291 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "state [%d] not implemented\n",
skdev            2292 drivers/block/skd_main.c 			skdev->state);
skdev            2298 drivers/block/skd_main.c static int skd_unquiesce_dev(struct skd_device *skdev)
skdev            2300 drivers/block/skd_main.c 	int prev_driver_state = skdev->state;
skdev            2302 drivers/block/skd_main.c 	skd_log_skdev(skdev, "unquiesce");
skdev            2303 drivers/block/skd_main.c 	if (skdev->state == SKD_DRVR_STATE_ONLINE) {
skdev            2304 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "**** device already ONLINE\n");
skdev            2307 drivers/block/skd_main.c 	if (skdev->drive_state != FIT_SR_DRIVE_ONLINE) {
skdev            2316 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_BUSY;
skdev            2317 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "drive BUSY state\n");
skdev            2325 drivers/block/skd_main.c 	switch (skdev->state) {
skdev            2335 drivers/block/skd_main.c 		skdev->state = SKD_DRVR_STATE_ONLINE;
skdev            2336 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "Driver state %s(%d)=>%s(%d)\n",
skdev            2338 drivers/block/skd_main.c 			prev_driver_state, skd_skdev_state_to_str(skdev->state),
skdev            2339 drivers/block/skd_main.c 			skdev->state);
skdev            2340 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev            2342 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev, "starting queue\n");
skdev            2343 drivers/block/skd_main.c 		dev_info(&skdev->pdev->dev, "STEC s1120 ONLINE\n");
skdev            2344 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            2345 drivers/block/skd_main.c 		skdev->gendisk_on = 1;
skdev            2346 drivers/block/skd_main.c 		wake_up_interruptible(&skdev->waitq);
skdev            2351 drivers/block/skd_main.c 		dev_dbg(&skdev->pdev->dev,
skdev            2353 drivers/block/skd_main.c 			skdev->state);
skdev            2367 drivers/block/skd_main.c 	struct skd_device *skdev = skd_host_data;
skdev            2370 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2371 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
skdev            2372 drivers/block/skd_main.c 		SKD_READL(skdev, FIT_INT_STATUS_HOST));
skdev            2373 drivers/block/skd_main.c 	dev_err(&skdev->pdev->dev, "MSIX reserved irq %d = 0x%x\n", irq,
skdev            2374 drivers/block/skd_main.c 		SKD_READL(skdev, FIT_INT_STATUS_HOST));
skdev            2375 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_INT_RESERVED_MASK, FIT_INT_STATUS_HOST);
skdev            2376 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2382 drivers/block/skd_main.c 	struct skd_device *skdev = skd_host_data;
skdev            2385 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2386 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
skdev            2387 drivers/block/skd_main.c 		SKD_READL(skdev, FIT_INT_STATUS_HOST));
skdev            2388 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_ISH_FW_STATE_CHANGE, FIT_INT_STATUS_HOST);
skdev            2389 drivers/block/skd_main.c 	skd_isr_fwstate(skdev);
skdev            2390 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2396 drivers/block/skd_main.c 	struct skd_device *skdev = skd_host_data;
skdev            2401 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2402 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
skdev            2403 drivers/block/skd_main.c 		SKD_READL(skdev, FIT_INT_STATUS_HOST));
skdev            2404 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_ISH_COMPLETION_POSTED, FIT_INT_STATUS_HOST);
skdev            2405 drivers/block/skd_main.c 	deferred = skd_isr_completion_posted(skdev, skd_isr_comp_limit,
skdev            2408 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            2411 drivers/block/skd_main.c 		schedule_work(&skdev->completion_worker);
skdev            2413 drivers/block/skd_main.c 		schedule_work(&skdev->start_queue);
skdev            2415 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2422 drivers/block/skd_main.c 	struct skd_device *skdev = skd_host_data;
skdev            2425 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2426 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
skdev            2427 drivers/block/skd_main.c 		SKD_READL(skdev, FIT_INT_STATUS_HOST));
skdev            2428 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_ISH_MSG_FROM_DEV, FIT_INT_STATUS_HOST);
skdev            2429 drivers/block/skd_main.c 	skd_isr_msg_from_dev(skdev);
skdev            2430 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2436 drivers/block/skd_main.c 	struct skd_device *skdev = skd_host_data;
skdev            2439 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2440 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
skdev            2441 drivers/block/skd_main.c 		SKD_READL(skdev, FIT_INT_STATUS_HOST));
skdev            2442 drivers/block/skd_main.c 	SKD_WRITEL(skdev, FIT_INT_QUEUE_FULL, FIT_INT_STATUS_HOST);
skdev            2443 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2482 drivers/block/skd_main.c static int skd_acquire_msix(struct skd_device *skdev)
skdev            2485 drivers/block/skd_main.c 	struct pci_dev *pdev = skdev->pdev;
skdev            2490 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "failed to enable MSI-X %d\n", rc);
skdev            2494 drivers/block/skd_main.c 	skdev->msix_entries = kcalloc(SKD_MAX_MSIX_COUNT,
skdev            2496 drivers/block/skd_main.c 	if (!skdev->msix_entries) {
skdev            2498 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "msix table allocation error\n");
skdev            2504 drivers/block/skd_main.c 		struct skd_msix_entry *qentry = &skdev->msix_entries[i];
skdev            2507 drivers/block/skd_main.c 			 "%s%d-msix %s", DRV_NAME, skdev->devno,
skdev            2510 drivers/block/skd_main.c 		rc = devm_request_irq(&skdev->pdev->dev,
skdev            2511 drivers/block/skd_main.c 				pci_irq_vector(skdev->pdev, i),
skdev            2513 drivers/block/skd_main.c 				qentry->isr_name, skdev);
skdev            2515 drivers/block/skd_main.c 			dev_err(&skdev->pdev->dev,
skdev            2522 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "%d msix irq(s) enabled\n",
skdev            2528 drivers/block/skd_main.c 		devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), skdev);
skdev            2530 drivers/block/skd_main.c 	kfree(skdev->msix_entries);
skdev            2531 drivers/block/skd_main.c 	skdev->msix_entries = NULL;
skdev            2535 drivers/block/skd_main.c static int skd_acquire_irq(struct skd_device *skdev)
skdev            2537 drivers/block/skd_main.c 	struct pci_dev *pdev = skdev->pdev;
skdev            2542 drivers/block/skd_main.c 		rc = skd_acquire_msix(skdev);
skdev            2546 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev,
skdev            2550 drivers/block/skd_main.c 	snprintf(skdev->isr_name, sizeof(skdev->isr_name), "%s%d", DRV_NAME,
skdev            2551 drivers/block/skd_main.c 			skdev->devno);
skdev            2557 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev,
skdev            2564 drivers/block/skd_main.c 			skdev->isr_name, skdev);
skdev            2567 drivers/block/skd_main.c 		dev_err(&skdev->pdev->dev, "failed to allocate interrupt %d\n",
skdev            2575 drivers/block/skd_main.c static void skd_release_irq(struct skd_device *skdev)
skdev            2577 drivers/block/skd_main.c 	struct pci_dev *pdev = skdev->pdev;
skdev            2579 drivers/block/skd_main.c 	if (skdev->msix_entries) {
skdev            2584 drivers/block/skd_main.c 					skdev);
skdev            2587 drivers/block/skd_main.c 		kfree(skdev->msix_entries);
skdev            2588 drivers/block/skd_main.c 		skdev->msix_entries = NULL;
skdev            2590 drivers/block/skd_main.c 		devm_free_irq(&pdev->dev, pdev->irq, skdev);
skdev            2602 drivers/block/skd_main.c static void *skd_alloc_dma(struct skd_device *skdev, struct kmem_cache *s,
skdev            2606 drivers/block/skd_main.c 	struct device *dev = &skdev->pdev->dev;
skdev            2621 drivers/block/skd_main.c static void skd_free_dma(struct skd_device *skdev, struct kmem_cache *s,
skdev            2628 drivers/block/skd_main.c 	dma_unmap_single(&skdev->pdev->dev, dma_handle,
skdev            2633 drivers/block/skd_main.c static int skd_cons_skcomp(struct skd_device *skdev)
skdev            2638 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev,
skdev            2642 drivers/block/skd_main.c 	skcomp = dma_alloc_coherent(&skdev->pdev->dev, SKD_SKCOMP_SIZE,
skdev            2643 drivers/block/skd_main.c 				    &skdev->cq_dma_address, GFP_KERNEL);
skdev            2650 drivers/block/skd_main.c 	skdev->skcomp_table = skcomp;
skdev            2651 drivers/block/skd_main.c 	skdev->skerr_table = (struct fit_comp_error_info *)((char *)skcomp +
skdev            2659 drivers/block/skd_main.c static int skd_cons_skmsg(struct skd_device *skdev)
skdev            2664 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev,
skdev            2666 drivers/block/skd_main.c 		sizeof(struct skd_fitmsg_context), skdev->num_fitmsg_context,
skdev            2667 drivers/block/skd_main.c 		sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context);
skdev            2669 drivers/block/skd_main.c 	skdev->skmsg_table = kcalloc(skdev->num_fitmsg_context,
skdev            2672 drivers/block/skd_main.c 	if (skdev->skmsg_table == NULL) {
skdev            2677 drivers/block/skd_main.c 	for (i = 0; i < skdev->num_fitmsg_context; i++) {
skdev            2680 drivers/block/skd_main.c 		skmsg = &skdev->skmsg_table[i];
skdev            2684 drivers/block/skd_main.c 		skmsg->msg_buf = dma_alloc_coherent(&skdev->pdev->dev,
skdev            2703 drivers/block/skd_main.c static struct fit_sg_descriptor *skd_cons_sg_list(struct skd_device *skdev,
skdev            2709 drivers/block/skd_main.c 	sg_list = skd_alloc_dma(skdev, skdev->sglist_cache, ret_dma_addr,
skdev            2728 drivers/block/skd_main.c static void skd_free_sg_list(struct skd_device *skdev,
skdev            2735 drivers/block/skd_main.c 	skd_free_dma(skdev, skdev->sglist_cache, sg_list, dma_addr,
skdev            2742 drivers/block/skd_main.c 	struct skd_device *skdev = set->driver_data;
skdev            2748 drivers/block/skd_main.c 	skreq->sksg_list = skd_cons_sg_list(skdev, skd_sgs_per_request,
skdev            2757 drivers/block/skd_main.c 	struct skd_device *skdev = set->driver_data;
skdev            2760 drivers/block/skd_main.c 	skd_free_sg_list(skdev, skreq->sksg_list, skreq->sksg_dma_address);
skdev            2763 drivers/block/skd_main.c static int skd_cons_sksb(struct skd_device *skdev)
skdev            2768 drivers/block/skd_main.c 	skspcl = &skdev->internal_skspcl;
skdev            2773 drivers/block/skd_main.c 	skspcl->data_buf = skd_alloc_dma(skdev, skdev->databuf_cache,
skdev            2782 drivers/block/skd_main.c 	skspcl->msg_buf = skd_alloc_dma(skdev, skdev->msgbuf_cache,
skdev            2790 drivers/block/skd_main.c 	skspcl->req.sksg_list = skd_cons_sg_list(skdev, 1,
skdev            2797 drivers/block/skd_main.c 	if (!skd_format_internal_skspcl(skdev)) {
skdev            2814 drivers/block/skd_main.c static int skd_cons_disk(struct skd_device *skdev)
skdev            2827 drivers/block/skd_main.c 	skdev->disk = disk;
skdev            2828 drivers/block/skd_main.c 	sprintf(disk->disk_name, DRV_NAME "%u", skdev->devno);
skdev            2830 drivers/block/skd_main.c 	disk->major = skdev->major;
skdev            2831 drivers/block/skd_main.c 	disk->first_minor = skdev->devno * SKD_MINORS_PER_DEVICE;
skdev            2833 drivers/block/skd_main.c 	disk->private_data = skdev;
skdev            2835 drivers/block/skd_main.c 	memset(&skdev->tag_set, 0, sizeof(skdev->tag_set));
skdev            2836 drivers/block/skd_main.c 	skdev->tag_set.ops = &skd_mq_ops;
skdev            2837 drivers/block/skd_main.c 	skdev->tag_set.nr_hw_queues = 1;
skdev            2838 drivers/block/skd_main.c 	skdev->tag_set.queue_depth = skd_max_queue_depth;
skdev            2839 drivers/block/skd_main.c 	skdev->tag_set.cmd_size = sizeof(struct skd_request_context) +
skdev            2840 drivers/block/skd_main.c 		skdev->sgs_per_request * sizeof(struct scatterlist);
skdev            2841 drivers/block/skd_main.c 	skdev->tag_set.numa_node = NUMA_NO_NODE;
skdev            2842 drivers/block/skd_main.c 	skdev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE |
skdev            2844 drivers/block/skd_main.c 	skdev->tag_set.driver_data = skdev;
skdev            2845 drivers/block/skd_main.c 	rc = blk_mq_alloc_tag_set(&skdev->tag_set);
skdev            2848 drivers/block/skd_main.c 	q = blk_mq_init_queue(&skdev->tag_set);
skdev            2850 drivers/block/skd_main.c 		blk_mq_free_tag_set(&skdev->tag_set);
skdev            2854 drivers/block/skd_main.c 	q->queuedata = skdev;
skdev            2856 drivers/block/skd_main.c 	skdev->queue = q;
skdev            2860 drivers/block/skd_main.c 	blk_queue_max_segments(q, skdev->sgs_per_request);
skdev            2871 drivers/block/skd_main.c 	spin_lock_irqsave(&skdev->lock, flags);
skdev            2872 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "stopping queue\n");
skdev            2873 drivers/block/skd_main.c 	blk_mq_stop_hw_queues(skdev->queue);
skdev            2874 drivers/block/skd_main.c 	spin_unlock_irqrestore(&skdev->lock, flags);
skdev            2885 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            2890 drivers/block/skd_main.c 	skdev = kzalloc(sizeof(*skdev), GFP_KERNEL);
skdev            2892 drivers/block/skd_main.c 	if (!skdev) {
skdev            2897 drivers/block/skd_main.c 	skdev->state = SKD_DRVR_STATE_LOAD;
skdev            2898 drivers/block/skd_main.c 	skdev->pdev = pdev;
skdev            2899 drivers/block/skd_main.c 	skdev->devno = skd_next_devno++;
skdev            2900 drivers/block/skd_main.c 	skdev->major = blk_major;
skdev            2901 drivers/block/skd_main.c 	skdev->dev_max_queue_depth = 0;
skdev            2903 drivers/block/skd_main.c 	skdev->num_req_context = skd_max_queue_depth;
skdev            2904 drivers/block/skd_main.c 	skdev->num_fitmsg_context = skd_max_queue_depth;
skdev            2905 drivers/block/skd_main.c 	skdev->cur_max_queue_depth = 1;
skdev            2906 drivers/block/skd_main.c 	skdev->queue_low_water_mark = 1;
skdev            2907 drivers/block/skd_main.c 	skdev->proto_ver = 99;
skdev            2908 drivers/block/skd_main.c 	skdev->sgs_per_request = skd_sgs_per_request;
skdev            2909 drivers/block/skd_main.c 	skdev->dbg_level = skd_dbg_level;
skdev            2911 drivers/block/skd_main.c 	spin_lock_init(&skdev->lock);
skdev            2913 drivers/block/skd_main.c 	INIT_WORK(&skdev->start_queue, skd_start_queue);
skdev            2914 drivers/block/skd_main.c 	INIT_WORK(&skdev->completion_worker, skd_completion_worker);
skdev            2917 drivers/block/skd_main.c 	skdev->msgbuf_cache = kmem_cache_create("skd-msgbuf", size, 0,
skdev            2919 drivers/block/skd_main.c 	if (!skdev->msgbuf_cache)
skdev            2921 drivers/block/skd_main.c 	WARN_ONCE(kmem_cache_size(skdev->msgbuf_cache) < size,
skdev            2923 drivers/block/skd_main.c 		  kmem_cache_size(skdev->msgbuf_cache), size);
skdev            2925 drivers/block/skd_main.c 	skdev->sglist_cache = kmem_cache_create("skd-sglist", size, 0,
skdev            2927 drivers/block/skd_main.c 	if (!skdev->sglist_cache)
skdev            2929 drivers/block/skd_main.c 	WARN_ONCE(kmem_cache_size(skdev->sglist_cache) < size,
skdev            2931 drivers/block/skd_main.c 		  kmem_cache_size(skdev->sglist_cache), size);
skdev            2933 drivers/block/skd_main.c 	skdev->databuf_cache = kmem_cache_create("skd-databuf", size, 0,
skdev            2935 drivers/block/skd_main.c 	if (!skdev->databuf_cache)
skdev            2937 drivers/block/skd_main.c 	WARN_ONCE(kmem_cache_size(skdev->databuf_cache) < size,
skdev            2939 drivers/block/skd_main.c 		  kmem_cache_size(skdev->databuf_cache), size);
skdev            2941 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skcomp\n");
skdev            2942 drivers/block/skd_main.c 	rc = skd_cons_skcomp(skdev);
skdev            2946 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skmsg\n");
skdev            2947 drivers/block/skd_main.c 	rc = skd_cons_skmsg(skdev);
skdev            2951 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "sksb\n");
skdev            2952 drivers/block/skd_main.c 	rc = skd_cons_sksb(skdev);
skdev            2956 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "disk\n");
skdev            2957 drivers/block/skd_main.c 	rc = skd_cons_disk(skdev);
skdev            2961 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "VICTORY\n");
skdev            2962 drivers/block/skd_main.c 	return skdev;
skdev            2965 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "construct failed\n");
skdev            2966 drivers/block/skd_main.c 	skd_destruct(skdev);
skdev            2976 drivers/block/skd_main.c static void skd_free_skcomp(struct skd_device *skdev)
skdev            2978 drivers/block/skd_main.c 	if (skdev->skcomp_table)
skdev            2979 drivers/block/skd_main.c 		dma_free_coherent(&skdev->pdev->dev, SKD_SKCOMP_SIZE,
skdev            2980 drivers/block/skd_main.c 				  skdev->skcomp_table, skdev->cq_dma_address);
skdev            2982 drivers/block/skd_main.c 	skdev->skcomp_table = NULL;
skdev            2983 drivers/block/skd_main.c 	skdev->cq_dma_address = 0;
skdev            2986 drivers/block/skd_main.c static void skd_free_skmsg(struct skd_device *skdev)
skdev            2990 drivers/block/skd_main.c 	if (skdev->skmsg_table == NULL)
skdev            2993 drivers/block/skd_main.c 	for (i = 0; i < skdev->num_fitmsg_context; i++) {
skdev            2996 drivers/block/skd_main.c 		skmsg = &skdev->skmsg_table[i];
skdev            2999 drivers/block/skd_main.c 			dma_free_coherent(&skdev->pdev->dev, SKD_N_FITMSG_BYTES,
skdev            3007 drivers/block/skd_main.c 	kfree(skdev->skmsg_table);
skdev            3008 drivers/block/skd_main.c 	skdev->skmsg_table = NULL;
skdev            3011 drivers/block/skd_main.c static void skd_free_sksb(struct skd_device *skdev)
skdev            3013 drivers/block/skd_main.c 	struct skd_special_context *skspcl = &skdev->internal_skspcl;
skdev            3015 drivers/block/skd_main.c 	skd_free_dma(skdev, skdev->databuf_cache, skspcl->data_buf,
skdev            3021 drivers/block/skd_main.c 	skd_free_dma(skdev, skdev->msgbuf_cache, skspcl->msg_buf,
skdev            3027 drivers/block/skd_main.c 	skd_free_sg_list(skdev, skspcl->req.sksg_list,
skdev            3034 drivers/block/skd_main.c static void skd_free_disk(struct skd_device *skdev)
skdev            3036 drivers/block/skd_main.c 	struct gendisk *disk = skdev->disk;
skdev            3041 drivers/block/skd_main.c 	if (skdev->queue) {
skdev            3042 drivers/block/skd_main.c 		blk_cleanup_queue(skdev->queue);
skdev            3043 drivers/block/skd_main.c 		skdev->queue = NULL;
skdev            3048 drivers/block/skd_main.c 	if (skdev->tag_set.tags)
skdev            3049 drivers/block/skd_main.c 		blk_mq_free_tag_set(&skdev->tag_set);
skdev            3052 drivers/block/skd_main.c 	skdev->disk = NULL;
skdev            3055 drivers/block/skd_main.c static void skd_destruct(struct skd_device *skdev)
skdev            3057 drivers/block/skd_main.c 	if (skdev == NULL)
skdev            3060 drivers/block/skd_main.c 	cancel_work_sync(&skdev->start_queue);
skdev            3062 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "disk\n");
skdev            3063 drivers/block/skd_main.c 	skd_free_disk(skdev);
skdev            3065 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "sksb\n");
skdev            3066 drivers/block/skd_main.c 	skd_free_sksb(skdev);
skdev            3068 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skmsg\n");
skdev            3069 drivers/block/skd_main.c 	skd_free_skmsg(skdev);
skdev            3071 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skcomp\n");
skdev            3072 drivers/block/skd_main.c 	skd_free_skcomp(skdev);
skdev            3074 drivers/block/skd_main.c 	kmem_cache_destroy(skdev->databuf_cache);
skdev            3075 drivers/block/skd_main.c 	kmem_cache_destroy(skdev->sglist_cache);
skdev            3076 drivers/block/skd_main.c 	kmem_cache_destroy(skdev->msgbuf_cache);
skdev            3078 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skdev\n");
skdev            3079 drivers/block/skd_main.c 	kfree(skdev);
skdev            3090 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            3093 drivers/block/skd_main.c 	skdev = bdev->bd_disk->private_data;
skdev            3095 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "%s: CMD[%s] getgeo device\n",
skdev            3098 drivers/block/skd_main.c 	if (skdev->read_cap_is_valid) {
skdev            3099 drivers/block/skd_main.c 		capacity = get_capacity(skdev->disk);
skdev            3109 drivers/block/skd_main.c static int skd_bdev_attach(struct device *parent, struct skd_device *skdev)
skdev            3111 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "add_disk\n");
skdev            3112 drivers/block/skd_main.c 	device_add_disk(parent, skdev->disk, NULL);
skdev            3135 drivers/block/skd_main.c static char *skd_pci_info(struct skd_device *skdev, char *str)
skdev            3140 drivers/block/skd_main.c 	pcie_reg = pci_find_capability(skdev->pdev, PCI_CAP_ID_EXP);
skdev            3148 drivers/block/skd_main.c 		pci_read_config_word(skdev->pdev, pcie_reg, &pcie_lstat);
skdev            3169 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            3196 drivers/block/skd_main.c 	skdev = skd_construct(pdev);
skdev            3197 drivers/block/skd_main.c 	if (skdev == NULL) {
skdev            3202 drivers/block/skd_main.c 	skd_pci_info(skdev, pci_str);
skdev            3210 drivers/block/skd_main.c 		skdev->pcie_error_reporting_is_enabled = 0;
skdev            3212 drivers/block/skd_main.c 		skdev->pcie_error_reporting_is_enabled = 1;
skdev            3214 drivers/block/skd_main.c 	pci_set_drvdata(pdev, skdev);
skdev            3217 drivers/block/skd_main.c 		skdev->mem_phys[i] = pci_resource_start(pdev, i);
skdev            3218 drivers/block/skd_main.c 		skdev->mem_size[i] = (u32)pci_resource_len(pdev, i);
skdev            3219 drivers/block/skd_main.c 		skdev->mem_map[i] = ioremap(skdev->mem_phys[i],
skdev            3220 drivers/block/skd_main.c 					    skdev->mem_size[i]);
skdev            3221 drivers/block/skd_main.c 		if (!skdev->mem_map[i]) {
skdev            3228 drivers/block/skd_main.c 			skdev->mem_map[i], (uint64_t)skdev->mem_phys[i],
skdev            3229 drivers/block/skd_main.c 			skdev->mem_size[i]);
skdev            3232 drivers/block/skd_main.c 	rc = skd_acquire_irq(skdev);
skdev            3238 drivers/block/skd_main.c 	rc = skd_start_timer(skdev);
skdev            3242 drivers/block/skd_main.c 	init_waitqueue_head(&skdev->waitq);
skdev            3244 drivers/block/skd_main.c 	skd_start_device(skdev);
skdev            3246 drivers/block/skd_main.c 	rc = wait_event_interruptible_timeout(skdev->waitq,
skdev            3247 drivers/block/skd_main.c 					      (skdev->gendisk_on),
skdev            3249 drivers/block/skd_main.c 	if (skdev->gendisk_on > 0) {
skdev            3251 drivers/block/skd_main.c 		skd_bdev_attach(&pdev->dev, skdev);
skdev            3267 drivers/block/skd_main.c 	skd_stop_device(skdev);
skdev            3268 drivers/block/skd_main.c 	skd_release_irq(skdev);
skdev            3272 drivers/block/skd_main.c 		if (skdev->mem_map[i])
skdev            3273 drivers/block/skd_main.c 			iounmap(skdev->mem_map[i]);
skdev            3275 drivers/block/skd_main.c 	if (skdev->pcie_error_reporting_is_enabled)
skdev            3278 drivers/block/skd_main.c 	skd_destruct(skdev);
skdev            3292 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            3294 drivers/block/skd_main.c 	skdev = pci_get_drvdata(pdev);
skdev            3295 drivers/block/skd_main.c 	if (!skdev) {
skdev            3299 drivers/block/skd_main.c 	skd_stop_device(skdev);
skdev            3300 drivers/block/skd_main.c 	skd_release_irq(skdev);
skdev            3303 drivers/block/skd_main.c 		if (skdev->mem_map[i])
skdev            3304 drivers/block/skd_main.c 			iounmap(skdev->mem_map[i]);
skdev            3306 drivers/block/skd_main.c 	if (skdev->pcie_error_reporting_is_enabled)
skdev            3309 drivers/block/skd_main.c 	skd_destruct(skdev);
skdev            3321 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            3323 drivers/block/skd_main.c 	skdev = pci_get_drvdata(pdev);
skdev            3324 drivers/block/skd_main.c 	if (!skdev) {
skdev            3329 drivers/block/skd_main.c 	skd_stop_device(skdev);
skdev            3331 drivers/block/skd_main.c 	skd_release_irq(skdev);
skdev            3334 drivers/block/skd_main.c 		if (skdev->mem_map[i])
skdev            3335 drivers/block/skd_main.c 			iounmap(skdev->mem_map[i]);
skdev            3337 drivers/block/skd_main.c 	if (skdev->pcie_error_reporting_is_enabled)
skdev            3351 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            3353 drivers/block/skd_main.c 	skdev = pci_get_drvdata(pdev);
skdev            3354 drivers/block/skd_main.c 	if (!skdev) {
skdev            3382 drivers/block/skd_main.c 		skdev->pcie_error_reporting_is_enabled = 0;
skdev            3384 drivers/block/skd_main.c 		skdev->pcie_error_reporting_is_enabled = 1;
skdev            3388 drivers/block/skd_main.c 		skdev->mem_phys[i] = pci_resource_start(pdev, i);
skdev            3389 drivers/block/skd_main.c 		skdev->mem_size[i] = (u32)pci_resource_len(pdev, i);
skdev            3390 drivers/block/skd_main.c 		skdev->mem_map[i] = ioremap(skdev->mem_phys[i],
skdev            3391 drivers/block/skd_main.c 					    skdev->mem_size[i]);
skdev            3392 drivers/block/skd_main.c 		if (!skdev->mem_map[i]) {
skdev            3398 drivers/block/skd_main.c 			skdev->mem_map[i], (uint64_t)skdev->mem_phys[i],
skdev            3399 drivers/block/skd_main.c 			skdev->mem_size[i]);
skdev            3401 drivers/block/skd_main.c 	rc = skd_acquire_irq(skdev);
skdev            3407 drivers/block/skd_main.c 	rc = skd_start_timer(skdev);
skdev            3411 drivers/block/skd_main.c 	init_waitqueue_head(&skdev->waitq);
skdev            3413 drivers/block/skd_main.c 	skd_start_device(skdev);
skdev            3418 drivers/block/skd_main.c 	skd_stop_device(skdev);
skdev            3419 drivers/block/skd_main.c 	skd_release_irq(skdev);
skdev            3423 drivers/block/skd_main.c 		if (skdev->mem_map[i])
skdev            3424 drivers/block/skd_main.c 			iounmap(skdev->mem_map[i]);
skdev            3426 drivers/block/skd_main.c 	if (skdev->pcie_error_reporting_is_enabled)
skdev            3439 drivers/block/skd_main.c 	struct skd_device *skdev;
skdev            3443 drivers/block/skd_main.c 	skdev = pci_get_drvdata(pdev);
skdev            3444 drivers/block/skd_main.c 	if (!skdev) {
skdev            3450 drivers/block/skd_main.c 	skd_stop_device(skdev);
skdev            3564 drivers/block/skd_main.c static void skd_log_skdev(struct skd_device *skdev, const char *event)
skdev            3566 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skdev=%p event='%s'\n", skdev, event);
skdev            3567 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "  drive_state=%s(%d) driver_state=%s(%d)\n",
skdev            3568 drivers/block/skd_main.c 		skd_drive_state_to_str(skdev->drive_state), skdev->drive_state,
skdev            3569 drivers/block/skd_main.c 		skd_skdev_state_to_str(skdev->state), skdev->state);
skdev            3570 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "  busy=%d limit=%d dev=%d lowat=%d\n",
skdev            3571 drivers/block/skd_main.c 		skd_in_flight(skdev), skdev->cur_max_queue_depth,
skdev            3572 drivers/block/skd_main.c 		skdev->dev_max_queue_depth, skdev->queue_low_water_mark);
skdev            3573 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "  cycle=%d cycle_ix=%d\n",
skdev            3574 drivers/block/skd_main.c 		skdev->skcomp_cycle, skdev->skcomp_ix);
skdev            3577 drivers/block/skd_main.c static void skd_log_skreq(struct skd_device *skdev,
skdev            3584 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "skreq=%p event='%s'\n", skreq, event);
skdev            3585 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "  state=%s(%d) id=0x%04x fitmsg=0x%04x\n",
skdev            3588 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev, "  sg_dir=%d n_sg=%d\n",
skdev            3591 drivers/block/skd_main.c 	dev_dbg(&skdev->pdev->dev,