Commit 2e44b427 authored by rchinthekindi's avatar rchinthekindi Committed by Jens Axboe

skd: Replaced custom debug PRINTKs with pr_debug

Replaced DPRINTK() and VPRINTK() with pr_debug().
Signed-off-by: default avatarRamprasad C <ramprasad.chinthekindi@hgst.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f721bb0d
...@@ -68,14 +68,6 @@ enum { ...@@ -68,14 +68,6 @@ enum {
SKD_FLUSH_DATA_SECOND, SKD_FLUSH_DATA_SECOND,
}; };
#define DPRINTK(skdev, fmt, args ...) \
do { \
if (unlikely((skdev)->dbg_level > 0)) { \
pr_err("%s:%s:%d " fmt, (skdev)->name, \
__func__, __LINE__, ## args); \
} \
} while (0)
#define SKD_ASSERT(expr) \ #define SKD_ASSERT(expr) \
do { \ do { \
if (unlikely(!(expr))) { \ if (unlikely(!(expr))) { \
...@@ -84,15 +76,6 @@ enum { ...@@ -84,15 +76,6 @@ enum {
} \ } \
} while (0) } while (0)
#define VPRINTK(skdev, fmt, args ...) \
do { \
if (unlikely((skdev)->dbg_level > 1)) { \
pr_err("%s:%s:%d " fmt, (skdev)->name, \
__func__, __LINE__, ## args); \
} \
} while (0)
#define DRV_NAME "skd" #define DRV_NAME "skd"
#define DRV_VERSION "2.2.1" #define DRV_VERSION "2.2.1"
#define DRV_BUILD_ID "0260" #define DRV_BUILD_ID "0260"
...@@ -408,7 +391,8 @@ static inline u32 skd_reg_read32(struct skd_device *skdev, u32 offset) ...@@ -408,7 +391,8 @@ static inline u32 skd_reg_read32(struct skd_device *skdev, u32 offset)
barrier(); barrier();
val = readl(skdev->mem_map[1] + offset); val = readl(skdev->mem_map[1] + offset);
barrier(); barrier();
VPRINTK(skdev, "offset %x = %x\n", offset, val); pr_debug("%s:%s:%d offset %x = %x\n",
skdev->name, __func__, __LINE__, offset, val);
return val; return val;
} }
...@@ -424,7 +408,8 @@ static inline void skd_reg_write32(struct skd_device *skdev, u32 val, ...@@ -424,7 +408,8 @@ static inline void skd_reg_write32(struct skd_device *skdev, u32 val,
barrier(); barrier();
writel(val, skdev->mem_map[1] + offset); writel(val, skdev->mem_map[1] + offset);
barrier(); barrier();
VPRINTK(skdev, "offset %x = %x\n", offset, val); pr_debug("%s:%s:%d offset %x = %x\n",
skdev->name, __func__, __LINE__, offset, val);
} }
} }
...@@ -438,7 +423,8 @@ static inline void skd_reg_write64(struct skd_device *skdev, u64 val, ...@@ -438,7 +423,8 @@ static inline void skd_reg_write64(struct skd_device *skdev, u64 val,
barrier(); barrier();
writeq(val, skdev->mem_map[1] + offset); writeq(val, skdev->mem_map[1] + offset);
barrier(); barrier();
VPRINTK(skdev, "offset %x = %016llx\n", offset, val); pr_debug("%s:%s:%d offset %x = %016llx\n",
skdev->name, __func__, __LINE__, offset, val);
} }
} }
...@@ -764,15 +750,17 @@ static void skd_request_fn(struct request_queue *q) ...@@ -764,15 +750,17 @@ static void skd_request_fn(struct request_queue *q)
if (io_flags & REQ_FUA) if (io_flags & REQ_FUA)
fua++; fua++;
VPRINTK(skdev, pr_debug("%s:%s:%d new req=%p lba=%u(0x%x) "
"new req=%p lba=%u(0x%x) count=%u(0x%x) dir=%d\n", "count=%u(0x%x) dir=%d\n",
req, lba, lba, count, count, data_dir); skdev->name, __func__, __LINE__,
req, lba, lba, count, count, data_dir);
} else { } else {
if (!list_empty(&skdev->flush_list)) { if (!list_empty(&skdev->flush_list)) {
/* Process data part of FLUSH request. */ /* Process data part of FLUSH request. */
bio = (struct bio *)skd_flush_cmd_dequeue(skdev); bio = (struct bio *)skd_flush_cmd_dequeue(skdev);
flush++; flush++;
VPRINTK(skdev, "processing FLUSH request with data.\n"); pr_debug("%s:%s:%d processing FLUSH request with data.\n",
skdev->name, __func__, __LINE__);
} else { } else {
/* peek at our bio queue */ /* peek at our bio queue */
bio = bio_list_peek(&skdev->bio_queue); bio = bio_list_peek(&skdev->bio_queue);
...@@ -787,9 +775,10 @@ static void skd_request_fn(struct request_queue *q) ...@@ -787,9 +775,10 @@ static void skd_request_fn(struct request_queue *q)
data_dir = bio_data_dir(bio); data_dir = bio_data_dir(bio);
io_flags = bio->bi_rw; io_flags = bio->bi_rw;
VPRINTK(skdev, pr_debug("%s:%s:%d new bio=%p lba=%u(0x%x) "
"new bio=%p lba=%u(0x%x) count=%u(0x%x) dir=%d\n", "count=%u(0x%x) dir=%d\n",
bio, lba, lba, count, count, data_dir); skdev->name, __func__, __LINE__,
bio, lba, lba, count, count, data_dir);
if (io_flags & REQ_FLUSH) if (io_flags & REQ_FLUSH)
flush++; flush++;
...@@ -805,15 +794,17 @@ static void skd_request_fn(struct request_queue *q) ...@@ -805,15 +794,17 @@ static void skd_request_fn(struct request_queue *q)
/* Are too many requets already in progress? */ /* Are too many requets already in progress? */
if (skdev->in_flight >= skdev->cur_max_queue_depth) { if (skdev->in_flight >= skdev->cur_max_queue_depth) {
VPRINTK(skdev, "qdepth %d, limit %d\n", pr_debug("%s:%s:%d qdepth %d, limit %d\n",
skdev->in_flight, skdev->cur_max_queue_depth); skdev->name, __func__, __LINE__,
skdev->in_flight, skdev->cur_max_queue_depth);
break; break;
} }
/* Is a skd_request_context available? */ /* Is a skd_request_context available? */
skreq = skdev->skreq_free_list; skreq = skdev->skreq_free_list;
if (skreq == NULL) { if (skreq == NULL) {
VPRINTK(skdev, "Out of req=%p\n", q); pr_debug("%s:%s:%d Out of req=%p\n",
skdev->name, __func__, __LINE__, q);
break; break;
} }
SKD_ASSERT(skreq->state == SKD_REQ_STATE_IDLE); SKD_ASSERT(skreq->state == SKD_REQ_STATE_IDLE);
...@@ -822,7 +813,8 @@ static void skd_request_fn(struct request_queue *q) ...@@ -822,7 +813,8 @@ static void skd_request_fn(struct request_queue *q)
/* Now we check to see if we can get a fit msg */ /* Now we check to see if we can get a fit msg */
if (skmsg == NULL) { if (skmsg == NULL) {
if (skdev->skmsg_free_list == NULL) { if (skdev->skmsg_free_list == NULL) {
VPRINTK(skdev, "Out of msg\n"); pr_debug("%s:%s:%d Out of msg\n",
skdev->name, __func__, __LINE__);
break; break;
} }
} }
...@@ -862,7 +854,9 @@ static void skd_request_fn(struct request_queue *q) ...@@ -862,7 +854,9 @@ static void skd_request_fn(struct request_queue *q)
/* Are there any FIT msg buffers available? */ /* Are there any FIT msg buffers available? */
skmsg = skdev->skmsg_free_list; skmsg = skdev->skmsg_free_list;
if (skmsg == NULL) { if (skmsg == NULL) {
VPRINTK(skdev, "Out of msg skdev=%p\n", skdev); pr_debug("%s:%s:%d Out of msg skdev=%p\n",
skdev->name, __func__, __LINE__,
skdev);
break; break;
} }
SKD_ASSERT(skmsg->state == SKD_MSG_STATE_IDLE); SKD_ASSERT(skmsg->state == SKD_MSG_STATE_IDLE);
...@@ -945,7 +939,8 @@ static void skd_request_fn(struct request_queue *q) ...@@ -945,7 +939,8 @@ static void skd_request_fn(struct request_queue *q)
* only resource that has been allocated but might * only resource that has been allocated but might
* not be used is that the FIT msg could be empty. * not be used is that the FIT msg could be empty.
*/ */
DPRINTK(skdev, "error Out\n"); pr_debug("%s:%s:%d error Out\n",
skdev->name, __func__, __LINE__);
skd_end_request(skdev, skreq, error); skd_end_request(skdev, skreq, error);
continue; continue;
} }
...@@ -970,8 +965,9 @@ static void skd_request_fn(struct request_queue *q) ...@@ -970,8 +965,9 @@ static void skd_request_fn(struct request_queue *q)
timo_slot = skreq->timeout_stamp & SKD_TIMEOUT_SLOT_MASK; timo_slot = skreq->timeout_stamp & SKD_TIMEOUT_SLOT_MASK;
skdev->timeout_slot[timo_slot]++; skdev->timeout_slot[timo_slot]++;
skdev->in_flight++; skdev->in_flight++;
VPRINTK(skdev, "req=0x%x busy=%d\n", pr_debug("%s:%s:%d req=0x%x busy=%d\n",
skreq->id, skdev->in_flight); skdev->name, __func__, __LINE__,
skreq->id, skdev->in_flight);
/* /*
* If the FIT msg buffer is full send it. * If the FIT msg buffer is full send it.
...@@ -993,8 +989,9 @@ static void skd_request_fn(struct request_queue *q) ...@@ -993,8 +989,9 @@ static void skd_request_fn(struct request_queue *q)
if (skmsg != NULL) { if (skmsg != NULL) {
/* Bigger than just a FIT msg header? */ /* Bigger than just a FIT msg header? */
if (skmsg->length > sizeof(struct fit_msg_hdr)) { if (skmsg->length > sizeof(struct fit_msg_hdr)) {
VPRINTK(skdev, "sending msg=%p, len %d\n", pr_debug("%s:%s:%d sending msg=%p, len %d\n",
skmsg, skmsg->length); skdev->name, __func__, __LINE__,
skmsg, skmsg->length);
skd_send_fitmsg(skdev, skmsg); skd_send_fitmsg(skdev, skmsg);
} else { } else {
/* /*
...@@ -1027,7 +1024,8 @@ static void skd_end_request_blk(struct skd_device *skdev, ...@@ -1027,7 +1024,8 @@ static void skd_end_request_blk(struct skd_device *skdev,
if ((io_flags & REQ_DISCARD) && if ((io_flags & REQ_DISCARD) &&
(skreq->discard_page == 1)) { (skreq->discard_page == 1)) {
VPRINTK(skdev, "skd_end_request_blk, free the page!"); pr_debug("%s:%s:%d skd_end_request_blk, free the page!",
skdev->name, __func__, __LINE__);
free_page((unsigned long)req->buffer); free_page((unsigned long)req->buffer);
req->buffer = NULL; req->buffer = NULL;
} }
...@@ -1041,7 +1039,8 @@ static void skd_end_request_blk(struct skd_device *skdev, ...@@ -1041,7 +1039,8 @@ static void skd_end_request_blk(struct skd_device *skdev,
pr_err("(%s): Error cmd=%s sect=%u count=%u id=0x%x\n", pr_err("(%s): Error cmd=%s sect=%u count=%u id=0x%x\n",
skd_name(skdev), cmd, lba, count, skreq->id); skd_name(skdev), cmd, lba, count, skreq->id);
} else } else
VPRINTK(skdev, "id=0x%x error=%d\n", skreq->id, error); pr_debug("%s:%s:%d id=0x%x error=%d\n",
skdev->name, __func__, __LINE__, skreq->id, error);
__blk_end_request_all(skreq->req, error); __blk_end_request_all(skreq->req, error);
} }
...@@ -1093,14 +1092,16 @@ static int skd_preop_sg_list_blk(struct skd_device *skdev, ...@@ -1093,14 +1092,16 @@ static int skd_preop_sg_list_blk(struct skd_device *skdev,
skreq->sksg_list[n_sg - 1].control = FIT_SGD_CONTROL_LAST; skreq->sksg_list[n_sg - 1].control = FIT_SGD_CONTROL_LAST;
if (unlikely(skdev->dbg_level > 1)) { if (unlikely(skdev->dbg_level > 1)) {
VPRINTK(skdev, "skreq=%x sksg_list=%p sksg_dma=%llx\n", pr_debug("%s:%s:%d skreq=%x sksg_list=%p sksg_dma=%llx\n",
skreq->id, skreq->sksg_list, skreq->sksg_dma_address); skdev->name, __func__, __LINE__,
skreq->id, skreq->sksg_list, skreq->sksg_dma_address);
for (i = 0; i < n_sg; i++) { for (i = 0; i < n_sg; i++) {
struct fit_sg_descriptor *sgd = &skreq->sksg_list[i]; struct fit_sg_descriptor *sgd = &skreq->sksg_list[i];
VPRINTK(skdev, " sg[%d] count=%u ctrl=0x%x " pr_debug("%s:%s:%d sg[%d] count=%u ctrl=0x%x "
"addr=0x%llx next=0x%llx\n", "addr=0x%llx next=0x%llx\n",
i, sgd->byte_count, sgd->control, skdev->name, __func__, __LINE__,
sgd->host_side_addr, sgd->next_desc_ptr); i, sgd->byte_count, sgd->control,
sgd->host_side_addr, sgd->next_desc_ptr);
} }
} }
...@@ -1132,7 +1133,8 @@ static void skd_end_request_bio(struct skd_device *skdev, ...@@ -1132,7 +1133,8 @@ static void skd_end_request_bio(struct skd_device *skdev,
if ((io_flags & REQ_DISCARD) && if ((io_flags & REQ_DISCARD) &&
(skreq->discard_page == 1)) { (skreq->discard_page == 1)) {
VPRINTK(skdev, "biomode: skd_end_request: freeing DISCARD page.\n"); pr_debug("%s:%s:%d biomode: skd_end_request: freeing DISCARD page.\n",
skdev->name, __func__, __LINE__);
free_page((unsigned long)page_address(bio->bi_io_vec->bv_page)); free_page((unsigned long)page_address(bio->bi_io_vec->bv_page));
} }
...@@ -1157,7 +1159,8 @@ static void skd_end_request_bio(struct skd_device *skdev, ...@@ -1157,7 +1159,8 @@ static void skd_end_request_bio(struct skd_device *skdev,
part_stat_unlock(); part_stat_unlock();
} }
VPRINTK(skdev, "id=0x%x error=%d\n", skreq->id, error); pr_debug("%s:%s:%d id=0x%x error=%d\n",
skdev->name, __func__, __LINE__, skreq->id, error);
bio_endio(skreq->bio, error); bio_endio(skreq->bio, error);
} }
...@@ -1229,14 +1232,16 @@ static int skd_preop_sg_list_bio(struct skd_device *skdev, ...@@ -1229,14 +1232,16 @@ static int skd_preop_sg_list_bio(struct skd_device *skdev,
} }
if (unlikely(skdev->dbg_level > 1)) { if (unlikely(skdev->dbg_level > 1)) {
VPRINTK(skdev, "skreq=%x sksg_list=%p sksg_dma=%llx\n", pr_debug("%s:%s:%d skreq=%x sksg_list=%p sksg_dma=%llx\n",
skreq->id, skreq->sksg_list, skreq->sksg_dma_address); skdev->name, __func__, __LINE__,
skreq->id, skreq->sksg_list, skreq->sksg_dma_address);
for (i = 0; i < n_sg; i++) { for (i = 0; i < n_sg; i++) {
struct fit_sg_descriptor *sgd = &skreq->sksg_list[i]; struct fit_sg_descriptor *sgd = &skreq->sksg_list[i];
VPRINTK(skdev, " sg[%d] count=%u ctrl=0x%x " pr_debug("%s:%s:%d sg[%d] count=%u ctrl=0x%x "
"addr=0x%llx next=0x%llx\n", "addr=0x%llx next=0x%llx\n",
i, sgd->byte_count, sgd->control, skdev->name, __func__, __LINE__,
sgd->host_side_addr, sgd->next_desc_ptr); i, sgd->byte_count, sgd->control,
sgd->host_side_addr, sgd->next_desc_ptr);
} }
} }
...@@ -1391,8 +1396,9 @@ static void skd_timer_tick(ulong arg) ...@@ -1391,8 +1396,9 @@ static void skd_timer_tick(ulong arg)
/* Something is overdue */ /* Something is overdue */
overdue_timestamp = skdev->timeout_stamp - SKD_N_TIMEOUT_SLOT; overdue_timestamp = skdev->timeout_stamp - SKD_N_TIMEOUT_SLOT;
DPRINTK(skdev, "found %d timeouts, draining busy=%d\n", pr_debug("%s:%s:%d found %d timeouts, draining busy=%d\n",
skdev->timeout_slot[timo_slot], skdev->in_flight); skdev->name, __func__, __LINE__,
skdev->timeout_slot[timo_slot], skdev->in_flight);
pr_err("(%s): Overdue IOs (%d), busy %d\n", pr_err("(%s): Overdue IOs (%d), busy %d\n",
skd_name(skdev), skdev->timeout_slot[timo_slot], skd_name(skdev), skdev->timeout_slot[timo_slot],
skdev->in_flight); skdev->in_flight);
...@@ -1415,8 +1421,9 @@ static void skd_timer_tick_not_online(struct skd_device *skdev) ...@@ -1415,8 +1421,9 @@ static void skd_timer_tick_not_online(struct skd_device *skdev)
case SKD_DRVR_STATE_LOAD: case SKD_DRVR_STATE_LOAD:
break; break;
case SKD_DRVR_STATE_BUSY_SANITIZE: case SKD_DRVR_STATE_BUSY_SANITIZE:
VPRINTK(skdev, "drive busy sanitize[%x], driver[%x]\n", pr_debug("%s:%s:%d drive busy sanitize[%x], driver[%x]\n",
skdev->drive_state, skdev->state); skdev->name, __func__, __LINE__,
skdev->drive_state, skdev->state);
/* If we've been in sanitize for 3 seconds, we figure we're not /* If we've been in sanitize for 3 seconds, we figure we're not
* going to get anymore completions, so recover requests now * going to get anymore completions, so recover requests now
*/ */
...@@ -1430,14 +1437,16 @@ static void skd_timer_tick_not_online(struct skd_device *skdev) ...@@ -1430,14 +1437,16 @@ static void skd_timer_tick_not_online(struct skd_device *skdev)
case SKD_DRVR_STATE_BUSY: case SKD_DRVR_STATE_BUSY:
case SKD_DRVR_STATE_BUSY_IMMINENT: case SKD_DRVR_STATE_BUSY_IMMINENT:
case SKD_DRVR_STATE_BUSY_ERASE: case SKD_DRVR_STATE_BUSY_ERASE:
VPRINTK(skdev, "busy[%x], countdown=%d\n", pr_debug("%s:%s:%d busy[%x], countdown=%d\n",
skdev->state, skdev->timer_countdown); skdev->name, __func__, __LINE__,
skdev->state, skdev->timer_countdown);
if (skdev->timer_countdown > 0) { if (skdev->timer_countdown > 0) {
skdev->timer_countdown--; skdev->timer_countdown--;
return; return;
} }
DPRINTK(skdev, "busy[%x], timedout=%d, restarting device.", pr_debug("%s:%s:%d busy[%x], timedout=%d, restarting device.",
skdev->state, skdev->timer_countdown); skdev->name, __func__, __LINE__,
skdev->state, skdev->timer_countdown);
skd_restart_device(skdev); skd_restart_device(skdev);
break; break;
...@@ -1470,15 +1479,17 @@ static void skd_timer_tick_not_online(struct skd_device *skdev) ...@@ -1470,15 +1479,17 @@ static void skd_timer_tick_not_online(struct skd_device *skdev)
break; break;
case SKD_DRVR_STATE_DRAINING_TIMEOUT: case SKD_DRVR_STATE_DRAINING_TIMEOUT:
DPRINTK(skdev, pr_debug("%s:%s:%d "
"draining busy [%d] tick[%d] qdb[%d] tmls[%d]\n", "draining busy [%d] tick[%d] qdb[%d] tmls[%d]\n",
skdev->timo_slot, skdev->name, __func__, __LINE__,
skdev->timer_countdown, skdev->timo_slot,
skdev->in_flight, skdev->timer_countdown,
skdev->timeout_slot[skdev->timo_slot]); skdev->in_flight,
skdev->timeout_slot[skdev->timo_slot]);
/* if the slot has cleared we can let the I/O continue */ /* if the slot has cleared we can let the I/O continue */
if (skdev->timeout_slot[skdev->timo_slot] == 0) { if (skdev->timeout_slot[skdev->timo_slot] == 0) {
DPRINTK(skdev, "Slot drained, starting queue.\n"); pr_debug("%s:%s:%d Slot drained, starting queue.\n",
skdev->name, __func__, __LINE__);
skdev->state = SKD_DRVR_STATE_ONLINE; skdev->state = SKD_DRVR_STATE_ONLINE;
skd_start_queue(skdev); skd_start_queue(skdev);
return; return;
...@@ -1601,8 +1612,9 @@ static int skd_bdev_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -1601,8 +1612,9 @@ static int skd_bdev_ioctl(struct block_device *bdev, fmode_t mode,
struct skd_device *skdev = disk->private_data; struct skd_device *skdev = disk->private_data;
void __user *p = (void *)arg; void __user *p = (void *)arg;
DPRINTK(skdev, "%s: CMD[%s] ioctl mode 0x%x, cmd 0x%x arg %0lx\n", pr_debug("%s:%s:%d %s: CMD[%s] ioctl mode 0x%x, cmd 0x%x arg %0lx\n",
disk->disk_name, current->comm, mode, cmd_in, arg); skdev->name, __func__, __LINE__,
disk->disk_name, current->comm, mode, cmd_in, arg);
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
...@@ -1622,7 +1634,8 @@ static int skd_bdev_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -1622,7 +1634,8 @@ static int skd_bdev_ioctl(struct block_device *bdev, fmode_t mode,
break; break;
} }
DPRINTK(skdev, "%s: completion rc %d\n", disk->disk_name, rc); pr_debug("%s:%s:%d %s: completion rc %d\n",
skdev->name, __func__, __LINE__, disk->disk_name, rc);
return rc; return rc;
} }
...@@ -1643,7 +1656,8 @@ static int skd_ioctl_sg_io(struct skd_device *skdev, fmode_t mode, ...@@ -1643,7 +1656,8 @@ static int skd_ioctl_sg_io(struct skd_device *skdev, fmode_t mode,
break; break;
default: default:
DPRINTK(skdev, "drive not online\n"); pr_debug("%s:%s:%d drive not online\n",
skdev->name, __func__, __LINE__);
rc = -ENXIO; rc = -ENXIO;
goto out; goto out;
} }
...@@ -1697,33 +1711,38 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev, ...@@ -1697,33 +1711,38 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev,
int i, acc; int i, acc;
if (!access_ok(VERIFY_WRITE, sksgio->argp, sizeof(sg_io_hdr_t))) { if (!access_ok(VERIFY_WRITE, sksgio->argp, sizeof(sg_io_hdr_t))) {
DPRINTK(skdev, "access sg failed %p\n", sksgio->argp); pr_debug("%s:%s:%d access sg failed %p\n",
skdev->name, __func__, __LINE__, sksgio->argp);
return -EFAULT; return -EFAULT;
} }
if (__copy_from_user(sgp, sksgio->argp, sizeof(sg_io_hdr_t))) { if (__copy_from_user(sgp, sksgio->argp, sizeof(sg_io_hdr_t))) {
DPRINTK(skdev, "copy_from_user sg failed %p\n", sksgio->argp); pr_debug("%s:%s:%d copy_from_user sg failed %p\n",
skdev->name, __func__, __LINE__, sksgio->argp);
return -EFAULT; return -EFAULT;
} }
if (sgp->interface_id != SG_INTERFACE_ID_ORIG) { if (sgp->interface_id != SG_INTERFACE_ID_ORIG) {
DPRINTK(skdev, "interface_id invalid 0x%x\n", pr_debug("%s:%s:%d interface_id invalid 0x%x\n",
sgp->interface_id); skdev->name, __func__, __LINE__, sgp->interface_id);
return -EINVAL; return -EINVAL;
} }
if (sgp->cmd_len > sizeof(sksgio->cdb)) { if (sgp->cmd_len > sizeof(sksgio->cdb)) {
DPRINTK(skdev, "cmd_len invalid %d\n", sgp->cmd_len); pr_debug("%s:%s:%d cmd_len invalid %d\n",
skdev->name, __func__, __LINE__, sgp->cmd_len);
return -EINVAL; return -EINVAL;
} }
if (sgp->iovec_count > 256) { if (sgp->iovec_count > 256) {
DPRINTK(skdev, "iovec_count invalid %d\n", sgp->iovec_count); pr_debug("%s:%s:%d iovec_count invalid %d\n",
skdev->name, __func__, __LINE__, sgp->iovec_count);
return -EINVAL; return -EINVAL;
} }
if (sgp->dxfer_len > (PAGE_SIZE * SKD_N_SG_PER_SPECIAL)) { if (sgp->dxfer_len > (PAGE_SIZE * SKD_N_SG_PER_SPECIAL)) {
DPRINTK(skdev, "dxfer_len invalid %d\n", sgp->dxfer_len); pr_debug("%s:%s:%d dxfer_len invalid %d\n",
skdev->name, __func__, __LINE__, sgp->dxfer_len);
return -EINVAL; return -EINVAL;
} }
...@@ -1742,18 +1761,21 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev, ...@@ -1742,18 +1761,21 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev,
break; break;
default: default:
DPRINTK(skdev, "dxfer_dir invalid %d\n", sgp->dxfer_direction); pr_debug("%s:%s:%d dxfer_dir invalid %d\n",
skdev->name, __func__, __LINE__, sgp->dxfer_direction);
return -EINVAL; return -EINVAL;
} }
if (copy_from_user(sksgio->cdb, sgp->cmdp, sgp->cmd_len)) { if (copy_from_user(sksgio->cdb, sgp->cmdp, sgp->cmd_len)) {
DPRINTK(skdev, "copy_from_user cmdp failed %p\n", sgp->cmdp); pr_debug("%s:%s:%d copy_from_user cmdp failed %p\n",
skdev->name, __func__, __LINE__, sgp->cmdp);
return -EFAULT; return -EFAULT;
} }
if (sgp->mx_sb_len != 0) { if (sgp->mx_sb_len != 0) {
if (!access_ok(VERIFY_WRITE, sgp->sbp, sgp->mx_sb_len)) { if (!access_ok(VERIFY_WRITE, sgp->sbp, sgp->mx_sb_len)) {
DPRINTK(skdev, "access sbp failed %p\n", sgp->sbp); pr_debug("%s:%s:%d access sbp failed %p\n",
skdev->name, __func__, __LINE__, sgp->sbp);
return -EFAULT; return -EFAULT;
} }
} }
...@@ -1770,16 +1792,17 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev, ...@@ -1770,16 +1792,17 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev,
iov = kmalloc(nbytes, GFP_KERNEL); iov = kmalloc(nbytes, GFP_KERNEL);
if (iov == NULL) { if (iov == NULL) {
DPRINTK(skdev, "alloc iovec failed %d\n", pr_debug("%s:%s:%d alloc iovec failed %d\n",
sgp->iovec_count); skdev->name, __func__, __LINE__,
sgp->iovec_count);
return -ENOMEM; return -ENOMEM;
} }
sksgio->iov = iov; sksgio->iov = iov;
sksgio->iovcnt = sgp->iovec_count; sksgio->iovcnt = sgp->iovec_count;
if (copy_from_user(iov, sgp->dxferp, nbytes)) { if (copy_from_user(iov, sgp->dxferp, nbytes)) {
DPRINTK(skdev, "copy_from_user iovec failed %p\n", pr_debug("%s:%s:%d copy_from_user iovec failed %p\n",
sgp->dxferp); skdev->name, __func__, __LINE__, sgp->dxferp);
return -EFAULT; return -EFAULT;
} }
...@@ -1807,8 +1830,9 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev, ...@@ -1807,8 +1830,9 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev,
struct sg_iovec *iov = sksgio->iov; struct sg_iovec *iov = sksgio->iov;
for (i = 0; i < sksgio->iovcnt; i++, iov++) { for (i = 0; i < sksgio->iovcnt; i++, iov++) {
if (!access_ok(acc, iov->iov_base, iov->iov_len)) { if (!access_ok(acc, iov->iov_base, iov->iov_len)) {
DPRINTK(skdev, "access data failed %p/%d\n", pr_debug("%s:%s:%d access data failed %p/%d\n",
iov->iov_base, (int)iov->iov_len); skdev->name, __func__, __LINE__,
iov->iov_base, (int)iov->iov_len);
return -EFAULT; return -EFAULT;
} }
} }
...@@ -1843,14 +1867,16 @@ static int skd_sg_io_obtain_skspcl(struct skd_device *skdev, ...@@ -1843,14 +1867,16 @@ static int skd_sg_io_obtain_skspcl(struct skd_device *skdev,
break; break;
} }
DPRINTK(skdev, "blocking\n"); pr_debug("%s:%s:%d blocking\n",
skdev->name, __func__, __LINE__);
rc = wait_event_interruptible_timeout( rc = wait_event_interruptible_timeout(
skdev->waitq, skdev->waitq,
(skdev->skspcl_free_list != NULL), (skdev->skspcl_free_list != NULL),
msecs_to_jiffies(sksgio->sg.timeout)); msecs_to_jiffies(sksgio->sg.timeout));
DPRINTK(skdev, "unblocking, rc=%d\n", rc); pr_debug("%s:%s:%d unblocking, rc=%d\n",
skdev->name, __func__, __LINE__, rc);
if (rc <= 0) { if (rc <= 0) {
if (rc == 0) if (rc == 0)
...@@ -1927,15 +1953,17 @@ static int skd_skreq_prep_buffering(struct skd_device *skdev, ...@@ -1927,15 +1953,17 @@ static int skd_skreq_prep_buffering(struct skd_device *skdev,
if (unlikely(skdev->dbg_level > 1)) { if (unlikely(skdev->dbg_level > 1)) {
u32 i; u32 i;
VPRINTK(skdev, "skreq=%x sksg_list=%p sksg_dma=%llx\n", pr_debug("%s:%s:%d skreq=%x sksg_list=%p sksg_dma=%llx\n",
skreq->id, skreq->sksg_list, skreq->sksg_dma_address); skdev->name, __func__, __LINE__,
skreq->id, skreq->sksg_list, skreq->sksg_dma_address);
for (i = 0; i < skreq->n_sg; i++) { for (i = 0; i < skreq->n_sg; i++) {
struct fit_sg_descriptor *sgd = &skreq->sksg_list[i]; struct fit_sg_descriptor *sgd = &skreq->sksg_list[i];
VPRINTK(skdev, " sg[%d] count=%u ctrl=0x%x " pr_debug("%s:%s:%d sg[%d] count=%u ctrl=0x%x "
"addr=0x%llx next=0x%llx\n", "addr=0x%llx next=0x%llx\n",
i, sgd->byte_count, sgd->control, skdev->name, __func__, __LINE__,
sgd->host_side_addr, sgd->next_desc_ptr); i, sgd->byte_count, sgd->control,
sgd->host_side_addr, sgd->next_desc_ptr);
} }
} }
...@@ -2057,7 +2085,8 @@ static int skd_sg_io_await(struct skd_device *skdev, struct skd_sg_io *sksgio) ...@@ -2057,7 +2085,8 @@ static int skd_sg_io_await(struct skd_device *skdev, struct skd_sg_io *sksgio)
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
if (sksgio->skspcl->req.state == SKD_REQ_STATE_ABORTED) { if (sksgio->skspcl->req.state == SKD_REQ_STATE_ABORTED) {
DPRINTK(skdev, "skspcl %p aborted\n", sksgio->skspcl); pr_debug("%s:%s:%d skspcl %p aborted\n",
skdev->name, __func__, __LINE__, sksgio->skspcl);
/* Build check cond, sense and let command finish. */ /* Build check cond, sense and let command finish. */
/* For a timeout, we must fabricate completion and sense /* For a timeout, we must fabricate completion and sense
...@@ -2082,11 +2111,13 @@ static int skd_sg_io_await(struct skd_device *skdev, struct skd_sg_io *sksgio) ...@@ -2082,11 +2111,13 @@ static int skd_sg_io_await(struct skd_device *skdev, struct skd_sg_io *sksgio)
sksgio->skspcl->orphaned = 1; sksgio->skspcl->orphaned = 1;
sksgio->skspcl = NULL; sksgio->skspcl = NULL;
if (rc == 0) { if (rc == 0) {
DPRINTK(skdev, "timed out %p (%u ms)\n", sksgio, pr_debug("%s:%s:%d timed out %p (%u ms)\n",
sksgio->sg.timeout); skdev->name, __func__, __LINE__,
sksgio, sksgio->sg.timeout);
rc = -ETIMEDOUT; rc = -ETIMEDOUT;
} else { } else {
DPRINTK(skdev, "cntlc %p\n", sksgio); pr_debug("%s:%s:%d cntlc %p\n",
skdev->name, __func__, __LINE__, sksgio);
rc = -EINTR; rc = -EINTR;
} }
} }
...@@ -2116,8 +2147,9 @@ static int skd_sg_io_put_status(struct skd_device *skdev, ...@@ -2116,8 +2147,9 @@ static int skd_sg_io_put_status(struct skd_device *skdev,
if (sgp->masked_status || sgp->host_status || sgp->driver_status) if (sgp->masked_status || sgp->host_status || sgp->driver_status)
sgp->info |= SG_INFO_CHECK; sgp->info |= SG_INFO_CHECK;
DPRINTK(skdev, "status %x masked %x resid 0x%x\n", sgp->status, pr_debug("%s:%s:%d status %x masked %x resid 0x%x\n",
sgp->masked_status, sgp->resid); skdev->name, __func__, __LINE__,
sgp->status, sgp->masked_status, sgp->resid);
if (sgp->masked_status == SAM_STAT_CHECK_CONDITION) { if (sgp->masked_status == SAM_STAT_CHECK_CONDITION) {
if (sgp->mx_sb_len > 0) { if (sgp->mx_sb_len > 0) {
...@@ -2129,15 +2161,17 @@ static int skd_sg_io_put_status(struct skd_device *skdev, ...@@ -2129,15 +2161,17 @@ static int skd_sg_io_put_status(struct skd_device *skdev,
sgp->sb_len_wr = nbytes; sgp->sb_len_wr = nbytes;
if (__copy_to_user(sgp->sbp, ei, nbytes)) { if (__copy_to_user(sgp->sbp, ei, nbytes)) {
DPRINTK(skdev, "copy_to_user sense failed %p\n", pr_debug("%s:%s:%d copy_to_user sense failed %p\n",
sgp->sbp); skdev->name, __func__, __LINE__,
sgp->sbp);
return -EFAULT; return -EFAULT;
} }
} }
} }
if (__copy_to_user(sksgio->argp, sgp, sizeof(sg_io_hdr_t))) { if (__copy_to_user(sksgio->argp, sgp, sizeof(sg_io_hdr_t))) {
DPRINTK(skdev, "copy_to_user sg failed %p\n", sksgio->argp); pr_debug("%s:%s:%d copy_to_user sg failed %p\n",
skdev->name, __func__, __LINE__, sksgio->argp);
return -EFAULT; return -EFAULT;
} }
...@@ -2325,7 +2359,8 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2325,7 +2359,8 @@ static void skd_complete_internal(struct skd_device *skdev,
SKD_ASSERT(skspcl == &skdev->internal_skspcl); SKD_ASSERT(skspcl == &skdev->internal_skspcl);
DPRINTK(skdev, "complete internal %x\n", scsi->cdb[0]); pr_debug("%s:%s:%d complete internal %x\n",
skdev->name, __func__, __LINE__, scsi->cdb[0]);
skspcl->req.completion = *skcomp; skspcl->req.completion = *skcomp;
skspcl->req.state = SKD_REQ_STATE_IDLE; skspcl->req.state = SKD_REQ_STATE_IDLE;
...@@ -2345,11 +2380,13 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2345,11 +2380,13 @@ static void skd_complete_internal(struct skd_device *skdev,
skd_send_internal_skspcl(skdev, skspcl, WRITE_BUFFER); skd_send_internal_skspcl(skdev, skspcl, WRITE_BUFFER);
else { else {
if (skdev->state == SKD_DRVR_STATE_STOPPING) { if (skdev->state == SKD_DRVR_STATE_STOPPING) {
VPRINTK(skdev, "TUR failed, don't send anymore" pr_debug("%s:%s:%d TUR failed, don't send anymore state 0x%x\n",
"state 0x%x\n", skdev->state); skdev->name, __func__, __LINE__,
skdev->state);
return; return;
} }
DPRINTK(skdev, "**** TUR failed, retry skerr\n"); pr_debug("%s:%s:%d **** TUR failed, retry skerr\n",
skdev->name, __func__, __LINE__);
skd_send_internal_skspcl(skdev, skspcl, 0x00); skd_send_internal_skspcl(skdev, skspcl, 0x00);
} }
break; break;
...@@ -2359,12 +2396,13 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2359,12 +2396,13 @@ static void skd_complete_internal(struct skd_device *skdev,
skd_send_internal_skspcl(skdev, skspcl, READ_BUFFER); skd_send_internal_skspcl(skdev, skspcl, READ_BUFFER);
else { else {
if (skdev->state == SKD_DRVR_STATE_STOPPING) { if (skdev->state == SKD_DRVR_STATE_STOPPING) {
VPRINTK(skdev, "write buffer failed, don't send" pr_debug("%s:%s:%d write buffer failed, don't send anymore state 0x%x\n",
" anymore state 0x%x\n", skdev->state); skdev->name, __func__, __LINE__,
skdev->state);
return; return;
} }
DPRINTK(skdev, pr_debug("%s:%s:%d **** write buffer failed, retry skerr\n",
"**** write buffer failed, retry skerr\n"); skdev->name, __func__, __LINE__);
skd_send_internal_skspcl(skdev, skspcl, 0x00); skd_send_internal_skspcl(skdev, skspcl, 0x00);
} }
break; break;
...@@ -2392,13 +2430,15 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2392,13 +2430,15 @@ static void skd_complete_internal(struct skd_device *skdev,
} else { } else {
if (skdev->state == SKD_DRVR_STATE_STOPPING) { if (skdev->state == SKD_DRVR_STATE_STOPPING) {
VPRINTK(skdev, pr_debug("%s:%s:%d "
"read buffer failed, don't send anymore" "read buffer failed, don't send anymore state 0x%x\n",
"state 0x%x\n", skdev->state); skdev->name, __func__, __LINE__,
skdev->state);
return; return;
} }
DPRINTK(skdev, pr_debug("%s:%s:%d "
"**** read buffer failed, retry skerr\n"); "**** read buffer failed, retry skerr\n",
skdev->name, __func__, __LINE__);
skd_send_internal_skspcl(skdev, skspcl, 0x00); skd_send_internal_skspcl(skdev, skspcl, 0x00);
} }
break; break;
...@@ -2413,9 +2453,10 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2413,9 +2453,10 @@ static void skd_complete_internal(struct skd_device *skdev,
(buf[4] << 24) | (buf[5] << 16) | (buf[4] << 24) | (buf[5] << 16) |
(buf[6] << 8) | buf[7]; (buf[6] << 8) | buf[7];
DPRINTK(skdev, "last lba %d, bs %d\n", pr_debug("%s:%s:%d last lba %d, bs %d\n",
skdev->read_cap_last_lba, skdev->name, __func__, __LINE__,
skdev->read_cap_blocksize); skdev->read_cap_last_lba,
skdev->read_cap_blocksize);
set_capacity(skdev->disk, skdev->read_cap_last_lba + 1); set_capacity(skdev->disk, skdev->read_cap_last_lba + 1);
...@@ -2426,11 +2467,13 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2426,11 +2467,13 @@ static void skd_complete_internal(struct skd_device *skdev,
(skerr->key == MEDIUM_ERROR)) { (skerr->key == MEDIUM_ERROR)) {
skdev->read_cap_last_lba = ~0; skdev->read_cap_last_lba = ~0;
set_capacity(skdev->disk, skdev->read_cap_last_lba + 1); set_capacity(skdev->disk, skdev->read_cap_last_lba + 1);
DPRINTK(skdev, pr_debug("%s:%s:%d "
"**** MEDIUM ERROR caused READCAP to fail, ignore failure and continue to inquiry\n"); "**** MEDIUM ERROR caused READCAP to fail, ignore failure and continue to inquiry\n",
skdev->name, __func__, __LINE__);
skd_send_internal_skspcl(skdev, skspcl, INQUIRY); skd_send_internal_skspcl(skdev, skspcl, INQUIRY);
} else { } else {
DPRINTK(skdev, "**** READCAP failed, retry TUR\n"); pr_debug("%s:%s:%d **** READCAP failed, retry TUR\n",
skdev->name, __func__, __LINE__);
skd_send_internal_skspcl(skdev, skspcl, skd_send_internal_skspcl(skdev, skspcl,
TEST_UNIT_READY); TEST_UNIT_READY);
} }
...@@ -2447,7 +2490,8 @@ static void skd_complete_internal(struct skd_device *skdev, ...@@ -2447,7 +2490,8 @@ static void skd_complete_internal(struct skd_device *skdev,
} }
if (skd_unquiesce_dev(skdev) < 0) if (skd_unquiesce_dev(skdev) < 0)
DPRINTK(skdev, "**** failed, to ONLINE device\n"); pr_debug("%s:%s:%d **** failed, to ONLINE device\n",
skdev->name, __func__, __LINE__);
/* connection is complete */ /* connection is complete */
skdev->connect_retries = 0; skdev->connect_retries = 0;
break; break;
...@@ -2477,10 +2521,12 @@ static void skd_send_fitmsg(struct skd_device *skdev, ...@@ -2477,10 +2521,12 @@ static void skd_send_fitmsg(struct skd_device *skdev,
u64 qcmd; u64 qcmd;
struct fit_msg_hdr *fmh; struct fit_msg_hdr *fmh;
VPRINTK(skdev, "dma address 0x%llx, busy=%d\n", pr_debug("%s:%s:%d dma address 0x%llx, busy=%d\n",
skmsg->mb_dma_address, skdev->in_flight); skdev->name, __func__, __LINE__,
VPRINTK(skdev, "msg_buf 0x%p, offset %x\n", skmsg->mb_dma_address, skdev->in_flight);
skmsg->msg_buf, skmsg->offset); pr_debug("%s:%s:%d msg_buf 0x%p, offset %x\n",
skdev->name, __func__, __LINE__,
skmsg->msg_buf, skmsg->offset);
qcmd = skmsg->mb_dma_address; qcmd = skmsg->mb_dma_address;
qcmd |= FIT_QCMD_QID_NORMAL; qcmd |= FIT_QCMD_QID_NORMAL;
...@@ -2492,11 +2538,12 @@ static void skd_send_fitmsg(struct skd_device *skdev, ...@@ -2492,11 +2538,12 @@ static void skd_send_fitmsg(struct skd_device *skdev,
u8 *bp = (u8 *)skmsg->msg_buf; u8 *bp = (u8 *)skmsg->msg_buf;
int i; int i;
for (i = 0; i < skmsg->length; i += 8) { for (i = 0; i < skmsg->length; i += 8) {
VPRINTK(skdev, " msg[%2d] %02x %02x %02x %02x " pr_debug("%s:%s:%d msg[%2d] %02x %02x %02x %02x "
"%02x %02x %02x %02x\n", "%02x %02x %02x %02x\n",
i, bp[i + 0], bp[i + 1], bp[i + 2], skdev->name, __func__, __LINE__,
bp[i + 3], bp[i + 4], bp[i + 5], i, bp[i + 0], bp[i + 1], bp[i + 2],
bp[i + 6], bp[i + 7]); bp[i + 3], bp[i + 4], bp[i + 5],
bp[i + 6], bp[i + 7]);
if (i == 0) if (i == 0)
i = 64 - 8; i = 64 - 8;
} }
...@@ -2530,26 +2577,28 @@ static void skd_send_special_fitmsg(struct skd_device *skdev, ...@@ -2530,26 +2577,28 @@ static void skd_send_special_fitmsg(struct skd_device *skdev,
int i; int i;
for (i = 0; i < SKD_N_SPECIAL_FITMSG_BYTES; i += 8) { for (i = 0; i < SKD_N_SPECIAL_FITMSG_BYTES; i += 8) {
VPRINTK(skdev, pr_debug("%s:%s:%d spcl[%2d] %02x %02x %02x %02x "
" spcl[%2d] %02x %02x %02x %02x " "%02x %02x %02x %02x\n",
"%02x %02x %02x %02x\n", i, skdev->name, __func__, __LINE__, i,
bp[i + 0], bp[i + 1], bp[i + 2], bp[i + 3], bp[i + 0], bp[i + 1], bp[i + 2], bp[i + 3],
bp[i + 4], bp[i + 5], bp[i + 6], bp[i + 7]); bp[i + 4], bp[i + 5], bp[i + 6], bp[i + 7]);
if (i == 0) if (i == 0)
i = 64 - 8; i = 64 - 8;
} }
VPRINTK(skdev, "skspcl=%p id=%04x sksg_list=%p sksg_dma=%llx\n", pr_debug("%s:%s:%d skspcl=%p id=%04x sksg_list=%p sksg_dma=%llx\n",
skspcl, skspcl->req.id, skspcl->req.sksg_list, skdev->name, __func__, __LINE__,
skspcl->req.sksg_dma_address); skspcl, skspcl->req.id, skspcl->req.sksg_list,
skspcl->req.sksg_dma_address);
for (i = 0; i < skspcl->req.n_sg; i++) { for (i = 0; i < skspcl->req.n_sg; i++) {
struct fit_sg_descriptor *sgd = struct fit_sg_descriptor *sgd =
&skspcl->req.sksg_list[i]; &skspcl->req.sksg_list[i];
VPRINTK(skdev, " sg[%d] count=%u ctrl=0x%x " pr_debug("%s:%s:%d sg[%d] count=%u ctrl=0x%x "
"addr=0x%llx next=0x%llx\n", "addr=0x%llx next=0x%llx\n",
i, sgd->byte_count, sgd->control, skdev->name, __func__, __LINE__,
sgd->host_side_addr, sgd->next_desc_ptr); i, sgd->byte_count, sgd->control,
sgd->host_side_addr, sgd->next_desc_ptr);
} }
} }
...@@ -2632,9 +2681,9 @@ static enum skd_check_status_action skd_check_status(struct skd_device *skdev, ...@@ -2632,9 +2681,9 @@ static enum skd_check_status_action skd_check_status(struct skd_device *skdev,
skd_name(skdev), skerr->key, skerr->code, skerr->qual, skd_name(skdev), skerr->key, skerr->code, skerr->qual,
skerr->fruc); skerr->fruc);
VPRINTK(skdev, "stat: t=%02x stat=%02x k=%02x c=%02x q=%02x " pr_debug("%s:%s:%d stat: t=%02x stat=%02x k=%02x c=%02x q=%02x fruc=%02x\n",
"fruc=%02x\n", skerr->type, cmp_status, skerr->key, skdev->name, __func__, __LINE__, skerr->type, cmp_status,
skerr->code, skerr->qual, skerr->fruc); skerr->key, skerr->code, skerr->qual, skerr->fruc);
/* Does the info match an entry in the good category? */ /* Does the info match an entry in the good category? */
n = sizeof(skd_chkstat_table) / sizeof(skd_chkstat_table[0]); n = sizeof(skd_chkstat_table) / sizeof(skd_chkstat_table[0]);
...@@ -2674,11 +2723,13 @@ static enum skd_check_status_action skd_check_status(struct skd_device *skdev, ...@@ -2674,11 +2723,13 @@ static enum skd_check_status_action skd_check_status(struct skd_device *skdev,
* zero status means good * zero status means good
*/ */
if (cmp_status) { if (cmp_status) {
DPRINTK(skdev, "status check: error\n"); pr_debug("%s:%s:%d status check: error\n",
skdev->name, __func__, __LINE__);
return SKD_CHECK_STATUS_REPORT_ERROR; return SKD_CHECK_STATUS_REPORT_ERROR;
} }
DPRINTK(skdev, "status check good default\n"); pr_debug("%s:%s:%d status check good default\n",
skdev->name, __func__, __LINE__);
return SKD_CHECK_STATUS_REPORT_GOOD; return SKD_CHECK_STATUS_REPORT_GOOD;
} }
...@@ -2816,7 +2867,8 @@ static void skd_do_inq_page_00(struct skd_device *skdev, ...@@ -2816,7 +2867,8 @@ static void skd_do_inq_page_00(struct skd_device *skdev,
/* Caller requested "supported pages". The driver needs to insert /* Caller requested "supported pages". The driver needs to insert
* its page. * its page.
*/ */
VPRINTK(skdev, "skd_do_driver_inquiry: modify supported pages.\n"); pr_debug("%s:%s:%d skd_do_driver_inquiry: modify supported pages.\n",
skdev->name, __func__, __LINE__);
/* If the device rejected the request because the CDB was /* If the device rejected the request because the CDB was
* improperly formed, then just leave. * improperly formed, then just leave.
...@@ -2913,7 +2965,8 @@ static void skd_do_inq_page_da(struct skd_device *skdev, ...@@ -2913,7 +2965,8 @@ static void skd_do_inq_page_da(struct skd_device *skdev,
struct driver_inquiry_data inq; struct driver_inquiry_data inq;
u16 val; u16 val;
VPRINTK(skdev, "skd_do_driver_inquiry: return driver page\n"); pr_debug("%s:%s:%d skd_do_driver_inquiry: return driver page\n",
skdev->name, __func__, __LINE__);
memset(&inq, 0, sizeof(inq)); memset(&inq, 0, sizeof(inq));
...@@ -3045,14 +3098,16 @@ static int skd_isr_completion_posted(struct skd_device *skdev, ...@@ -3045,14 +3098,16 @@ static int skd_isr_completion_posted(struct skd_device *skdev,
skerr = &skdev->skerr_table[skdev->skcomp_ix]; skerr = &skdev->skerr_table[skdev->skcomp_ix];
VPRINTK(skdev, pr_debug("%s:%s:%d "
"cycle=%d ix=%d got cycle=%d cmdctxt=0x%x stat=%d " "cycle=%d ix=%d got cycle=%d cmdctxt=0x%x stat=%d "
"busy=%d rbytes=0x%x proto=%d\n", skdev->skcomp_cycle, "busy=%d rbytes=0x%x proto=%d\n",
skdev->skcomp_ix, cmp_cycle, cmp_cntxt, cmp_status, skdev->name, __func__, __LINE__, skdev->skcomp_cycle,
skdev->in_flight, cmp_bytes, skdev->proto_ver); skdev->skcomp_ix, cmp_cycle, cmp_cntxt, cmp_status,
skdev->in_flight, cmp_bytes, skdev->proto_ver);
if (cmp_cycle != skdev->skcomp_cycle) { if (cmp_cycle != skdev->skcomp_cycle) {
VPRINTK(skdev, "end of completions\n"); pr_debug("%s:%s:%d end of completions\n",
skdev->name, __func__, __LINE__);
break; break;
} }
/* /*
...@@ -3088,8 +3143,9 @@ static int skd_isr_completion_posted(struct skd_device *skdev, ...@@ -3088,8 +3143,9 @@ static int skd_isr_completion_posted(struct skd_device *skdev,
* Make sure the request ID for the slot matches. * Make sure the request ID for the slot matches.
*/ */
if (skreq->id != req_id) { if (skreq->id != req_id) {
DPRINTK(skdev, "mismatch comp_id=0x%x req_id=0x%x\n", pr_debug("%s:%s:%d mismatch comp_id=0x%x req_id=0x%x\n",
req_id, skreq->id); skdev->name, __func__, __LINE__,
req_id, skreq->id);
{ {
u16 new_id = cmp_cntxt; u16 new_id = cmp_cntxt;
pr_err("(%s): Completion mismatch " pr_err("(%s): Completion mismatch "
...@@ -3104,8 +3160,9 @@ static int skd_isr_completion_posted(struct skd_device *skdev, ...@@ -3104,8 +3160,9 @@ static int skd_isr_completion_posted(struct skd_device *skdev,
SKD_ASSERT(skreq->state == SKD_REQ_STATE_BUSY); SKD_ASSERT(skreq->state == SKD_REQ_STATE_BUSY);
if (skreq->state == SKD_REQ_STATE_ABORTED) { if (skreq->state == SKD_REQ_STATE_ABORTED) {
DPRINTK(skdev, "reclaim req %p id=%04x\n", pr_debug("%s:%s:%d reclaim req %p id=%04x\n",
skreq, skreq->id); skdev->name, __func__, __LINE__,
skreq, skreq->id);
/* a previously timed out command can /* a previously timed out command can
* now be cleaned up */ * now be cleaned up */
skd_release_skreq(skdev, skreq); skd_release_skreq(skdev, skreq);
...@@ -3125,9 +3182,10 @@ static int skd_isr_completion_posted(struct skd_device *skdev, ...@@ -3125,9 +3182,10 @@ static int skd_isr_completion_posted(struct skd_device *skdev,
if (((!skd_bio) && !skreq->req) || if (((!skd_bio) && !skreq->req) ||
((skd_bio) && !skreq->bio)) { ((skd_bio) && !skreq->bio)) {
DPRINTK(skdev, "NULL backptr skdreq %p, " pr_debug("%s:%s:%d NULL backptr skdreq %p, "
"req=0x%x req_id=0x%x\n", "req=0x%x req_id=0x%x\n",
skreq, skreq->id, req_id); skdev->name, __func__, __LINE__,
skreq, skreq->id, req_id);
} else { } else {
/* /*
* Capture the outcome and post it back to the * Capture the outcome and post it back to the
...@@ -3196,8 +3254,9 @@ static void skd_complete_other(struct skd_device *skdev, ...@@ -3196,8 +3254,9 @@ static void skd_complete_other(struct skd_device *skdev,
req_table = req_id & SKD_ID_TABLE_MASK; req_table = req_id & SKD_ID_TABLE_MASK;
req_slot = req_id & SKD_ID_SLOT_MASK; req_slot = req_id & SKD_ID_SLOT_MASK;
DPRINTK(skdev, "table=0x%x id=0x%x slot=%d\n", req_table, req_id, pr_debug("%s:%s:%d table=0x%x id=0x%x slot=%d\n",
req_slot); skdev->name, __func__, __LINE__,
req_table, req_id, req_slot);
/* /*
* Based on the request id, determine how to dispatch this completion. * Based on the request id, determine how to dispatch this completion.
...@@ -3265,12 +3324,14 @@ static void skd_complete_special(struct skd_device *skdev, ...@@ -3265,12 +3324,14 @@ static void skd_complete_special(struct skd_device *skdev,
volatile struct fit_comp_error_info *skerr, volatile struct fit_comp_error_info *skerr,
struct skd_special_context *skspcl) struct skd_special_context *skspcl)
{ {
DPRINTK(skdev, " completing special request %p\n", skspcl); pr_debug("%s:%s:%d completing special request %p\n",
skdev->name, __func__, __LINE__, skspcl);
if (skspcl->orphaned) { if (skspcl->orphaned) {
/* Discard orphaned request */ /* Discard orphaned request */
/* ?: Can this release directly or does it need /* ?: Can this release directly or does it need
* to use a worker? */ * to use a worker? */
DPRINTK(skdev, "release orphaned %p\n", skspcl); pr_debug("%s:%s:%d release orphaned %p\n",
skdev->name, __func__, __LINE__, skspcl);
skd_release_special(skdev, skspcl); skd_release_special(skdev, skspcl);
return; return;
} }
...@@ -3308,7 +3369,8 @@ static void skd_release_special(struct skd_device *skdev, ...@@ -3308,7 +3369,8 @@ static void skd_release_special(struct skd_device *skdev,
skdev->skspcl_free_list = (struct skd_special_context *)skspcl; skdev->skspcl_free_list = (struct skd_special_context *)skspcl;
if (was_depleted) { if (was_depleted) {
DPRINTK(skdev, "skspcl was depleted\n"); pr_debug("%s:%s:%d skspcl was depleted\n",
skdev->name, __func__, __LINE__);
/* Free list was depleted. Their might be waiters. */ /* Free list was depleted. Their might be waiters. */
wake_up_interruptible(&skdev->waitq); wake_up_interruptible(&skdev->waitq);
} }
...@@ -3373,7 +3435,8 @@ static skd_isr(int irq, void *ptr) ...@@ -3373,7 +3435,8 @@ static skd_isr(int irq, void *ptr)
ack = FIT_INT_DEF_MASK; ack = FIT_INT_DEF_MASK;
ack &= intstat; ack &= intstat;
VPRINTK(skdev, "intstat=0x%x ack=0x%x\n", intstat, ack); pr_debug("%s:%s:%d intstat=0x%x ack=0x%x\n",
skdev->name, __func__, __LINE__, intstat, ack);
/* As long as there is an int pending on device, keep /* As long as there is an int pending on device, keep
* running loop. When none, get out, but if we've never * running loop. When none, get out, but if we've never
...@@ -3534,7 +3597,8 @@ static void skd_isr_fwstate(struct skd_device *skdev) ...@@ -3534,7 +3597,8 @@ static void skd_isr_fwstate(struct skd_device *skdev)
} }
break; break;
case FIT_SR_DRIVE_FW_BOOTING: case FIT_SR_DRIVE_FW_BOOTING:
VPRINTK(skdev, "ISR FIT_SR_DRIVE_FW_BOOTING %s\n", skdev->name); pr_debug("%s:%s:%d ISR FIT_SR_DRIVE_FW_BOOTING %s\n",
skdev->name, __func__, __LINE__, skdev->name);
skdev->state = SKD_DRVR_STATE_WAIT_BOOT; skdev->state = SKD_DRVR_STATE_WAIT_BOOT;
skdev->timer_countdown = SKD_WAIT_BOOT_TIMO; skdev->timer_countdown = SKD_WAIT_BOOT_TIMO;
break; break;
...@@ -3643,10 +3707,14 @@ static void skd_recover_requests(struct skd_device *skdev, int requeue) ...@@ -3643,10 +3707,14 @@ static void skd_recover_requests(struct skd_device *skdev, int requeue)
*/ */
if (skspcl->req.state == SKD_REQ_STATE_BUSY) { if (skspcl->req.state == SKD_REQ_STATE_BUSY) {
if (skspcl->orphaned) { if (skspcl->orphaned) {
DPRINTK(skdev, "orphaned %p\n", skspcl); pr_debug("%s:%s:%d orphaned %p\n",
skdev->name, __func__, __LINE__,
skspcl);
skd_release_special(skdev, skspcl); skd_release_special(skdev, skspcl);
} else { } else {
DPRINTK(skdev, "not orphaned %p\n", skspcl); pr_debug("%s:%s:%d not orphaned %p\n",
skdev->name, __func__, __LINE__,
skspcl);
skspcl->req.state = SKD_REQ_STATE_ABORTED; skspcl->req.state = SKD_REQ_STATE_ABORTED;
} }
} }
...@@ -3667,7 +3735,8 @@ static void skd_isr_msg_from_dev(struct skd_device *skdev) ...@@ -3667,7 +3735,8 @@ static void skd_isr_msg_from_dev(struct skd_device *skdev)
mfd = SKD_READL(skdev, FIT_MSG_FROM_DEVICE); mfd = SKD_READL(skdev, FIT_MSG_FROM_DEVICE);
DPRINTK(skdev, "mfd=0x%x last_mtd=0x%x\n", mfd, skdev->last_mtd); pr_debug("%s:%s:%d mfd=0x%x last_mtd=0x%x\n",
skdev->name, __func__, __LINE__, mfd, skdev->last_mtd);
/* ignore any mtd that is an ack for something we didn't send */ /* ignore any mtd that is an ack for something we didn't send */
if (FIT_MXD_TYPE(mfd) != FIT_MXD_TYPE(skdev->last_mtd)) if (FIT_MXD_TYPE(mfd) != FIT_MXD_TYPE(skdev->last_mtd))
...@@ -3762,7 +3831,8 @@ static void skd_disable_interrupts(struct skd_device *skdev) ...@@ -3762,7 +3831,8 @@ static void skd_disable_interrupts(struct skd_device *skdev)
sense = SKD_READL(skdev, FIT_CONTROL); sense = SKD_READL(skdev, FIT_CONTROL);
sense &= ~FIT_CR_ENABLE_INTERRUPTS; sense &= ~FIT_CR_ENABLE_INTERRUPTS;
SKD_WRITEL(skdev, sense, FIT_CONTROL); SKD_WRITEL(skdev, sense, FIT_CONTROL);
DPRINTK(skdev, "sense 0x%x\n", sense); pr_debug("%s:%s:%d sense 0x%x\n",
skdev->name, __func__, __LINE__, sense);
/* Note that the 1s is written. A 1-bit means /* Note that the 1s is written. A 1-bit means
* disable, a 0 means enable. * disable, a 0 means enable.
...@@ -3781,11 +3851,13 @@ static void skd_enable_interrupts(struct skd_device *skdev) ...@@ -3781,11 +3851,13 @@ static void skd_enable_interrupts(struct skd_device *skdev)
/* Note that the compliment of mask is written. A 1-bit means /* Note that the compliment of mask is written. A 1-bit means
* disable, a 0 means enable. */ * disable, a 0 means enable. */
SKD_WRITEL(skdev, ~val, FIT_INT_MASK_HOST); SKD_WRITEL(skdev, ~val, FIT_INT_MASK_HOST);
DPRINTK(skdev, "interrupt mask=0x%x\n", ~val); pr_debug("%s:%s:%d interrupt mask=0x%x\n",
skdev->name, __func__, __LINE__, ~val);
val = SKD_READL(skdev, FIT_CONTROL); val = SKD_READL(skdev, FIT_CONTROL);
val |= FIT_CR_ENABLE_INTERRUPTS; val |= FIT_CR_ENABLE_INTERRUPTS;
DPRINTK(skdev, "control=0x%x\n", val); pr_debug("%s:%s:%d control=0x%x\n",
skdev->name, __func__, __LINE__, val);
SKD_WRITEL(skdev, val, FIT_CONTROL); SKD_WRITEL(skdev, val, FIT_CONTROL);
} }
...@@ -3801,7 +3873,8 @@ static void skd_soft_reset(struct skd_device *skdev) ...@@ -3801,7 +3873,8 @@ static void skd_soft_reset(struct skd_device *skdev)
val = SKD_READL(skdev, FIT_CONTROL); val = SKD_READL(skdev, FIT_CONTROL);
val |= (FIT_CR_SOFT_RESET); val |= (FIT_CR_SOFT_RESET);
DPRINTK(skdev, "control=0x%x\n", val); pr_debug("%s:%s:%d control=0x%x\n",
skdev->name, __func__, __LINE__, val);
SKD_WRITEL(skdev, val, FIT_CONTROL); SKD_WRITEL(skdev, val, FIT_CONTROL);
} }
...@@ -3818,7 +3891,8 @@ static void skd_start_device(struct skd_device *skdev) ...@@ -3818,7 +3891,8 @@ static void skd_start_device(struct skd_device *skdev)
sense = SKD_READL(skdev, FIT_STATUS); sense = SKD_READL(skdev, FIT_STATUS);
DPRINTK(skdev, "initial status=0x%x\n", sense); pr_debug("%s:%s:%d initial status=0x%x\n",
skdev->name, __func__, __LINE__, sense);
state = sense & FIT_SR_DRIVE_STATE_MASK; state = sense & FIT_SR_DRIVE_STATE_MASK;
skdev->drive_state = state; skdev->drive_state = state;
...@@ -3835,7 +3909,8 @@ static void skd_start_device(struct skd_device *skdev) ...@@ -3835,7 +3909,8 @@ static void skd_start_device(struct skd_device *skdev)
break; break;
case FIT_SR_DRIVE_FW_BOOTING: case FIT_SR_DRIVE_FW_BOOTING:
VPRINTK(skdev, "FIT_SR_DRIVE_FW_BOOTING %s\n", skdev->name); pr_debug("%s:%s:%d FIT_SR_DRIVE_FW_BOOTING %s\n",
skdev->name, __func__, __LINE__, skdev->name);
skdev->state = SKD_DRVR_STATE_WAIT_BOOT; skdev->state = SKD_DRVR_STATE_WAIT_BOOT;
skdev->timer_countdown = SKD_WAIT_BOOT_TIMO; skdev->timer_countdown = SKD_WAIT_BOOT_TIMO;
break; break;
...@@ -3876,7 +3951,8 @@ static void skd_start_device(struct skd_device *skdev) ...@@ -3876,7 +3951,8 @@ static void skd_start_device(struct skd_device *skdev)
*/ */
skd_drive_fault(skdev); skd_drive_fault(skdev);
/*start the queue so we can respond with error to requests */ /*start the queue so we can respond with error to requests */
VPRINTK(skdev, "starting %s queue\n", skdev->name); pr_debug("%s:%s:%d starting %s queue\n",
skdev->name, __func__, __LINE__, skdev->name);
skd_start_queue(skdev); skd_start_queue(skdev);
skdev->gendisk_on = -1; skdev->gendisk_on = -1;
wake_up_interruptible(&skdev->waitq); wake_up_interruptible(&skdev->waitq);
...@@ -3887,8 +3963,8 @@ static void skd_start_device(struct skd_device *skdev) ...@@ -3887,8 +3963,8 @@ static void skd_start_device(struct skd_device *skdev)
* to the BAR1 addresses. */ * to the BAR1 addresses. */
skd_drive_disappeared(skdev); skd_drive_disappeared(skdev);
/*start the queue so we can respond with error to requests */ /*start the queue so we can respond with error to requests */
VPRINTK(skdev, "starting %s queue to error-out reqs\n", pr_debug("%s:%s:%d starting %s queue to error-out reqs\n",
skdev->name); skdev->name, __func__, __LINE__, skdev->name);
skd_start_queue(skdev); skd_start_queue(skdev);
skdev->gendisk_on = -1; skdev->gendisk_on = -1;
wake_up_interruptible(&skdev->waitq); wake_up_interruptible(&skdev->waitq);
...@@ -3901,19 +3977,24 @@ static void skd_start_device(struct skd_device *skdev) ...@@ -3901,19 +3977,24 @@ static void skd_start_device(struct skd_device *skdev)
} }
state = SKD_READL(skdev, FIT_CONTROL); state = SKD_READL(skdev, FIT_CONTROL);
DPRINTK(skdev, "FIT Control Status=0x%x\n", state); pr_debug("%s:%s:%d FIT Control Status=0x%x\n",
skdev->name, __func__, __LINE__, state);
state = SKD_READL(skdev, FIT_INT_STATUS_HOST); state = SKD_READL(skdev, FIT_INT_STATUS_HOST);
DPRINTK(skdev, "Intr Status=0x%x\n", state); pr_debug("%s:%s:%d Intr Status=0x%x\n",
skdev->name, __func__, __LINE__, state);
state = SKD_READL(skdev, FIT_INT_MASK_HOST); state = SKD_READL(skdev, FIT_INT_MASK_HOST);
DPRINTK(skdev, "Intr Mask=0x%x\n", state); pr_debug("%s:%s:%d Intr Mask=0x%x\n",
skdev->name, __func__, __LINE__, state);
state = SKD_READL(skdev, FIT_MSG_FROM_DEVICE); state = SKD_READL(skdev, FIT_MSG_FROM_DEVICE);
DPRINTK(skdev, "Msg from Dev=0x%x\n", state); pr_debug("%s:%s:%d Msg from Dev=0x%x\n",
skdev->name, __func__, __LINE__, state);
state = SKD_READL(skdev, FIT_HW_VERSION); state = SKD_READL(skdev, FIT_HW_VERSION);
DPRINTK(skdev, "HW version=0x%x\n", state); pr_debug("%s:%s:%d HW version=0x%x\n",
skdev->name, __func__, __LINE__, state);
spin_unlock_irqrestore(&skdev->lock, flags); spin_unlock_irqrestore(&skdev->lock, flags);
} }
...@@ -4006,7 +4087,8 @@ static void skd_restart_device(struct skd_device *skdev) ...@@ -4006,7 +4087,8 @@ static void skd_restart_device(struct skd_device *skdev)
state = SKD_READL(skdev, FIT_STATUS); state = SKD_READL(skdev, FIT_STATUS);
DPRINTK(skdev, "drive status=0x%x\n", state); pr_debug("%s:%s:%d drive status=0x%x\n",
skdev->name, __func__, __LINE__, state);
state &= FIT_SR_DRIVE_STATE_MASK; state &= FIT_SR_DRIVE_STATE_MASK;
skdev->drive_state = state; skdev->drive_state = state;
...@@ -4026,7 +4108,8 @@ static int skd_quiesce_dev(struct skd_device *skdev) ...@@ -4026,7 +4108,8 @@ static int skd_quiesce_dev(struct skd_device *skdev)
switch (skdev->state) { switch (skdev->state) {
case SKD_DRVR_STATE_BUSY: case SKD_DRVR_STATE_BUSY:
case SKD_DRVR_STATE_BUSY_IMMINENT: case SKD_DRVR_STATE_BUSY_IMMINENT:
VPRINTK(skdev, "stopping %s queue\n", skdev->name); pr_debug("%s:%s:%d stopping %s queue\n",
skdev->name, __func__, __LINE__, skdev->name);
skd_stop_queue(skdev); skd_stop_queue(skdev);
break; break;
case SKD_DRVR_STATE_ONLINE: case SKD_DRVR_STATE_ONLINE:
...@@ -4039,7 +4122,8 @@ static int skd_quiesce_dev(struct skd_device *skdev) ...@@ -4039,7 +4122,8 @@ static int skd_quiesce_dev(struct skd_device *skdev)
case SKD_DRVR_STATE_RESUMING: case SKD_DRVR_STATE_RESUMING:
default: default:
rc = -EINVAL; rc = -EINVAL;
VPRINTK(skdev, "state [%d] not implemented\n", skdev->state); pr_debug("%s:%s:%d state [%d] not implemented\n",
skdev->name, __func__, __LINE__, skdev->state);
} }
return rc; return rc;
} }
...@@ -4051,7 +4135,8 @@ static int skd_unquiesce_dev(struct skd_device *skdev) ...@@ -4051,7 +4135,8 @@ static int skd_unquiesce_dev(struct skd_device *skdev)
skd_log_skdev(skdev, "unquiesce"); skd_log_skdev(skdev, "unquiesce");
if (skdev->state == SKD_DRVR_STATE_ONLINE) { if (skdev->state == SKD_DRVR_STATE_ONLINE) {
DPRINTK(skdev, "**** device already ONLINE\n"); pr_debug("%s:%s:%d **** device already ONLINE\n",
skdev->name, __func__, __LINE__);
return 0; return 0;
} }
if (skdev->drive_state != FIT_SR_DRIVE_ONLINE) { if (skdev->drive_state != FIT_SR_DRIVE_ONLINE) {
...@@ -4064,7 +4149,8 @@ static int skd_unquiesce_dev(struct skd_device *skdev) ...@@ -4064,7 +4149,8 @@ static int skd_unquiesce_dev(struct skd_device *skdev)
* to become available. * to become available.
*/ */
skdev->state = SKD_DRVR_STATE_BUSY; skdev->state = SKD_DRVR_STATE_BUSY;
DPRINTK(skdev, "drive BUSY state\n"); pr_debug("%s:%s:%d drive BUSY state\n",
skdev->name, __func__, __LINE__);
return 0; return 0;
} }
...@@ -4088,8 +4174,10 @@ static int skd_unquiesce_dev(struct skd_device *skdev) ...@@ -4088,8 +4174,10 @@ static int skd_unquiesce_dev(struct skd_device *skdev)
skd_skdev_state_to_str(prev_driver_state), skd_skdev_state_to_str(prev_driver_state),
prev_driver_state, skd_skdev_state_to_str(skdev->state), prev_driver_state, skd_skdev_state_to_str(skdev->state),
skdev->state); skdev->state);
DPRINTK(skdev, "**** device ONLINE...starting block queue\n"); pr_debug("%s:%s:%d **** device ONLINE...starting block queue\n",
VPRINTK(skdev, "starting %s queue\n", skdev->name); skdev->name, __func__, __LINE__);
pr_debug("%s:%s:%d starting %s queue\n",
skdev->name, __func__, __LINE__, skdev->name);
pr_info("(%s): STEC s1120 ONLINE\n", skd_name(skdev)); pr_info("(%s): STEC s1120 ONLINE\n", skd_name(skdev));
skd_start_queue(skdev); skd_start_queue(skdev);
skdev->gendisk_on = 1; skdev->gendisk_on = 1;
...@@ -4098,8 +4186,9 @@ static int skd_unquiesce_dev(struct skd_device *skdev) ...@@ -4098,8 +4186,9 @@ static int skd_unquiesce_dev(struct skd_device *skdev)
case SKD_DRVR_STATE_DISAPPEARED: case SKD_DRVR_STATE_DISAPPEARED:
default: default:
DPRINTK(skdev, "**** driver state %d, not implemented \n", pr_debug("%s:%s:%d **** driver state %d, not implemented \n",
skdev->state); skdev->name, __func__, __LINE__,
skdev->state);
return -EBUSY; return -EBUSY;
} }
return 0; return 0;
...@@ -4117,7 +4206,9 @@ static irqreturn_t skd_reserved_isr(int irq, void *skd_host_data) ...@@ -4117,7 +4206,9 @@ static irqreturn_t skd_reserved_isr(int irq, void *skd_host_data)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
VPRINTK(skdev, "MSIX = 0x%x\n", SKD_READL(skdev, FIT_INT_STATUS_HOST)); pr_debug("%s:%s:%d MSIX = 0x%x\n",
skdev->name, __func__, __LINE__,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
pr_err("(%s): MSIX reserved irq %d = 0x%x\n", skd_name(skdev), pr_err("(%s): MSIX reserved irq %d = 0x%x\n", skd_name(skdev),
irq, SKD_READL(skdev, FIT_INT_STATUS_HOST)); irq, SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_INT_RESERVED_MASK, FIT_INT_STATUS_HOST); SKD_WRITEL(skdev, FIT_INT_RESERVED_MASK, FIT_INT_STATUS_HOST);
...@@ -4131,7 +4222,9 @@ static irqreturn_t skd_statec_isr(int irq, void *skd_host_data) ...@@ -4131,7 +4222,9 @@ static irqreturn_t skd_statec_isr(int irq, void *skd_host_data)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
VPRINTK(skdev, "MSIX = 0x%x\n", SKD_READL(skdev, FIT_INT_STATUS_HOST)); pr_debug("%s:%s:%d MSIX = 0x%x\n",
skdev->name, __func__, __LINE__,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_ISH_FW_STATE_CHANGE, FIT_INT_STATUS_HOST); SKD_WRITEL(skdev, FIT_ISH_FW_STATE_CHANGE, FIT_INT_STATUS_HOST);
skd_isr_fwstate(skdev); skd_isr_fwstate(skdev);
spin_unlock_irqrestore(&skdev->lock, flags); spin_unlock_irqrestore(&skdev->lock, flags);
...@@ -4146,7 +4239,9 @@ static irqreturn_t skd_comp_q(int irq, void *skd_host_data) ...@@ -4146,7 +4239,9 @@ static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
int deferred; int deferred;
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
VPRINTK(skdev, "MSIX = 0x%x\n", SKD_READL(skdev, FIT_INT_STATUS_HOST)); pr_debug("%s:%s:%d MSIX = 0x%x\n",
skdev->name, __func__, __LINE__,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_ISH_COMPLETION_POSTED, FIT_INT_STATUS_HOST); SKD_WRITEL(skdev, FIT_ISH_COMPLETION_POSTED, FIT_INT_STATUS_HOST);
deferred = skd_isr_completion_posted(skdev, skd_isr_comp_limit, deferred = skd_isr_completion_posted(skdev, skd_isr_comp_limit,
&flush_enqueued); &flush_enqueued);
...@@ -4170,7 +4265,9 @@ static irqreturn_t skd_msg_isr(int irq, void *skd_host_data) ...@@ -4170,7 +4265,9 @@ static irqreturn_t skd_msg_isr(int irq, void *skd_host_data)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
VPRINTK(skdev, "MSIX = 0x%x\n", SKD_READL(skdev, FIT_INT_STATUS_HOST)); pr_debug("%s:%s:%d MSIX = 0x%x\n",
skdev->name, __func__, __LINE__,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_ISH_MSG_FROM_DEV, FIT_INT_STATUS_HOST); SKD_WRITEL(skdev, FIT_ISH_MSG_FROM_DEV, FIT_INT_STATUS_HOST);
skd_isr_msg_from_dev(skdev); skd_isr_msg_from_dev(skdev);
spin_unlock_irqrestore(&skdev->lock, flags); spin_unlock_irqrestore(&skdev->lock, flags);
...@@ -4183,7 +4280,9 @@ static irqreturn_t skd_qfull_isr(int irq, void *skd_host_data) ...@@ -4183,7 +4280,9 @@ static irqreturn_t skd_qfull_isr(int irq, void *skd_host_data)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
VPRINTK(skdev, "MSIX = 0x%x\n", SKD_READL(skdev, FIT_INT_STATUS_HOST)); pr_debug("%s:%s:%d MSIX = 0x%x\n",
skdev->name, __func__, __LINE__,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_INT_QUEUE_FULL, FIT_INT_STATUS_HOST); SKD_WRITEL(skdev, FIT_INT_QUEUE_FULL, FIT_INT_STATUS_HOST);
spin_unlock_irqrestore(&skdev->lock, flags); spin_unlock_irqrestore(&skdev->lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -4275,8 +4374,9 @@ static int skd_acquire_msix(struct skd_device *skdev) ...@@ -4275,8 +4374,9 @@ static int skd_acquire_msix(struct skd_device *skdev)
skd_name(skdev), rc); skd_name(skdev), rc);
goto msix_out; goto msix_out;
} }
DPRINTK(skdev, "%s: <%s> allocated %d MSI-X vectors\n", pr_debug("%s:%s:%d %s: <%s> allocated %d MSI-X vectors\n",
pci_name(pdev), skdev->name, rc); skdev->name, __func__, __LINE__,
pci_name(pdev), skdev->name, rc);
skdev->msix_count = rc; skdev->msix_count = rc;
rc = pci_enable_msix(pdev, entries, skdev->msix_count); rc = pci_enable_msix(pdev, entries, skdev->msix_count);
...@@ -4303,9 +4403,10 @@ static int skd_acquire_msix(struct skd_device *skdev) ...@@ -4303,9 +4403,10 @@ static int skd_acquire_msix(struct skd_device *skdev)
qentry->entry = entries[i].entry; qentry->entry = entries[i].entry;
qentry->rsp = NULL; qentry->rsp = NULL;
qentry->have_irq = 0; qentry->have_irq = 0;
DPRINTK(skdev, "%s: <%s> msix (%d) vec %d, entry %x\n", pr_debug("%s:%s:%d %s: <%s> msix (%d) vec %d, entry %x\n",
pci_name(pdev), skdev->name, skdev->name, __func__, __LINE__,
i, qentry->vector, qentry->entry); pci_name(pdev), skdev->name,
i, qentry->vector, qentry->entry);
qentry++; qentry++;
} }
...@@ -4328,8 +4429,9 @@ static int skd_acquire_msix(struct skd_device *skdev) ...@@ -4328,8 +4429,9 @@ static int skd_acquire_msix(struct skd_device *skdev)
qentry->rsp = skdev; qentry->rsp = skdev;
} }
} }
DPRINTK(skdev, "%s: <%s> msix %d irq(s) enabled\n", pr_debug("%s:%s:%d %s: <%s> msix %d irq(s) enabled\n",
pci_name(pdev), skdev->name, skdev->msix_count); skdev->name, __func__, __LINE__,
pci_name(pdev), skdev->name, skdev->msix_count);
return 0; return 0;
msix_out: msix_out:
...@@ -4489,43 +4591,42 @@ static struct skd_device *skd_construct(struct pci_dev *pdev) ...@@ -4489,43 +4591,42 @@ static struct skd_device *skd_construct(struct pci_dev *pdev)
INIT_WORK(&skdev->completion_worker, skd_completion_worker); INIT_WORK(&skdev->completion_worker, skd_completion_worker);
INIT_LIST_HEAD(&skdev->flush_list); INIT_LIST_HEAD(&skdev->flush_list);
VPRINTK(skdev, "skcomp\n"); pr_debug("%s:%s:%d skcomp\n", skdev->name, __func__, __LINE__);
rc = skd_cons_skcomp(skdev); rc = skd_cons_skcomp(skdev);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
VPRINTK(skdev, "skmsg\n"); pr_debug("%s:%s:%d skmsg\n", skdev->name, __func__, __LINE__);
rc = skd_cons_skmsg(skdev); rc = skd_cons_skmsg(skdev);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
VPRINTK(skdev, "skreq\n"); pr_debug("%s:%s:%d skreq\n", skdev->name, __func__, __LINE__);
rc = skd_cons_skreq(skdev); rc = skd_cons_skreq(skdev);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
VPRINTK(skdev, "skspcl\n"); pr_debug("%s:%s:%d skspcl\n", skdev->name, __func__, __LINE__);
rc = skd_cons_skspcl(skdev); rc = skd_cons_skspcl(skdev);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
VPRINTK(skdev, "sksb\n"); pr_debug("%s:%s:%d sksb\n", skdev->name, __func__, __LINE__);
rc = skd_cons_sksb(skdev); rc = skd_cons_sksb(skdev);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
VPRINTK(skdev, "disk\n"); pr_debug("%s:%s:%d disk\n", skdev->name, __func__, __LINE__);
rc = skd_cons_disk(skdev); rc = skd_cons_disk(skdev);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
pr_debug("%s:%s:%d VICTORY\n", skdev->name, __func__, __LINE__);
DPRINTK(skdev, "VICTORY\n");
return skdev; return skdev;
err_out: err_out:
DPRINTK(skdev, "construct failed\n"); pr_debug("%s:%s:%d construct failed\n",
skdev->name, __func__, __LINE__);
skd_destruct(skdev); skd_destruct(skdev);
return NULL; return NULL;
} }
...@@ -4539,8 +4640,9 @@ static int skd_cons_skcomp(struct skd_device *skdev) ...@@ -4539,8 +4640,9 @@ static int skd_cons_skcomp(struct skd_device *skdev)
nbytes = sizeof(*skcomp) * SKD_N_COMPLETION_ENTRY; nbytes = sizeof(*skcomp) * SKD_N_COMPLETION_ENTRY;
nbytes += sizeof(struct fit_comp_error_info) * SKD_N_COMPLETION_ENTRY; nbytes += sizeof(struct fit_comp_error_info) * SKD_N_COMPLETION_ENTRY;
VPRINTK(skdev, "comp pci_alloc, total bytes %d entries %d\n", nbytes, pr_debug("%s:%s:%d comp pci_alloc, total bytes %d entries %d\n",
SKD_N_COMPLETION_ENTRY); skdev->name, __func__, __LINE__,
nbytes, SKD_N_COMPLETION_ENTRY);
skcomp = pci_alloc_consistent(skdev->pdev, nbytes, skcomp = pci_alloc_consistent(skdev->pdev, nbytes,
&skdev->cq_dma_address); &skdev->cq_dma_address);
...@@ -4566,10 +4668,11 @@ static int skd_cons_skmsg(struct skd_device *skdev) ...@@ -4566,10 +4668,11 @@ static int skd_cons_skmsg(struct skd_device *skdev)
int rc = 0; int rc = 0;
u32 i; u32 i;
VPRINTK(skdev, "skmsg_table kzalloc, struct %lu, count %u total %lu\n", pr_debug("%s:%s:%d skmsg_table kzalloc, struct %lu, count %u total %lu\n",
sizeof(struct skd_fitmsg_context), skdev->name, __func__, __LINE__,
skdev->num_fitmsg_context, sizeof(struct skd_fitmsg_context),
sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context); skdev->num_fitmsg_context,
sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context);
skdev->skmsg_table = kzalloc(sizeof(struct skd_fitmsg_context) skdev->skmsg_table = kzalloc(sizeof(struct skd_fitmsg_context)
*skdev->num_fitmsg_context, GFP_KERNEL); *skdev->num_fitmsg_context, GFP_KERNEL);
...@@ -4620,10 +4723,11 @@ static int skd_cons_skreq(struct skd_device *skdev) ...@@ -4620,10 +4723,11 @@ static int skd_cons_skreq(struct skd_device *skdev)
int rc = 0; int rc = 0;
u32 i; u32 i;
VPRINTK(skdev, "skreq_table kzalloc, struct %lu, count %u total %lu\n", pr_debug("%s:%s:%d skreq_table kzalloc, struct %lu, count %u total %lu\n",
sizeof(struct skd_request_context), skdev->name, __func__, __LINE__,
skdev->num_req_context, sizeof(struct skd_request_context),
sizeof(struct skd_request_context) * skdev->num_req_context); skdev->num_req_context,
sizeof(struct skd_request_context) * skdev->num_req_context);
skdev->skreq_table = kzalloc(sizeof(struct skd_request_context) skdev->skreq_table = kzalloc(sizeof(struct skd_request_context)
* skdev->num_req_context, GFP_KERNEL); * skdev->num_req_context, GFP_KERNEL);
...@@ -4632,9 +4736,10 @@ static int skd_cons_skreq(struct skd_device *skdev) ...@@ -4632,9 +4736,10 @@ static int skd_cons_skreq(struct skd_device *skdev)
goto err_out; goto err_out;
} }
VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %lu total %lu\n", pr_debug("%s:%s:%d alloc sg_table sg_per_req %u scatlist %lu total %lu\n",
skdev->sgs_per_request, sizeof(struct scatterlist), skdev->name, __func__, __LINE__,
skdev->sgs_per_request * sizeof(struct scatterlist)); skdev->sgs_per_request, sizeof(struct scatterlist),
skdev->sgs_per_request * sizeof(struct scatterlist));
for (i = 0; i < skdev->num_req_context; i++) { for (i = 0; i < skdev->num_req_context; i++) {
struct skd_request_context *skreq; struct skd_request_context *skreq;
...@@ -4677,10 +4782,11 @@ static int skd_cons_skspcl(struct skd_device *skdev) ...@@ -4677,10 +4782,11 @@ static int skd_cons_skspcl(struct skd_device *skdev)
int rc = 0; int rc = 0;
u32 i, nbytes; u32 i, nbytes;
VPRINTK(skdev, "skspcl_table kzalloc, struct %lu, count %u total %lu\n", pr_debug("%s:%s:%d skspcl_table kzalloc, struct %lu, count %u total %lu\n",
sizeof(struct skd_special_context), skdev->name, __func__, __LINE__,
skdev->n_special, sizeof(struct skd_special_context),
sizeof(struct skd_special_context) * skdev->n_special); skdev->n_special,
sizeof(struct skd_special_context) * skdev->n_special);
skdev->skspcl_table = kzalloc(sizeof(struct skd_special_context) skdev->skspcl_table = kzalloc(sizeof(struct skd_special_context)
* skdev->n_special, GFP_KERNEL); * skdev->n_special, GFP_KERNEL);
...@@ -4872,7 +4978,8 @@ static int skd_cons_disk(struct skd_device *skdev) ...@@ -4872,7 +4978,8 @@ static int skd_cons_disk(struct skd_device *skdev)
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
spin_lock_irqsave(&skdev->lock, flags); spin_lock_irqsave(&skdev->lock, flags);
VPRINTK(skdev, "stopping %s queue\n", skdev->name); pr_debug("%s:%s:%d stopping %s queue\n",
skdev->name, __func__, __LINE__, skdev->name);
skd_stop_queue(skdev); skd_stop_queue(skdev);
spin_unlock_irqrestore(&skdev->lock, flags); spin_unlock_irqrestore(&skdev->lock, flags);
...@@ -4902,25 +5009,25 @@ static void skd_destruct(struct skd_device *skdev) ...@@ -4902,25 +5009,25 @@ static void skd_destruct(struct skd_device *skdev)
return; return;
VPRINTK(skdev, "disk\n"); pr_debug("%s:%s:%d disk\n", skdev->name, __func__, __LINE__);
skd_free_disk(skdev); skd_free_disk(skdev);
VPRINTK(skdev, "sksb\n"); pr_debug("%s:%s:%d sksb\n", skdev->name, __func__, __LINE__);
skd_free_sksb(skdev); skd_free_sksb(skdev);
VPRINTK(skdev, "skspcl\n"); pr_debug("%s:%s:%d skspcl\n", skdev->name, __func__, __LINE__);
skd_free_skspcl(skdev); skd_free_skspcl(skdev);
VPRINTK(skdev, "skreq\n"); pr_debug("%s:%s:%d skreq\n", skdev->name, __func__, __LINE__);
skd_free_skreq(skdev); skd_free_skreq(skdev);
VPRINTK(skdev, "skmsg\n"); pr_debug("%s:%s:%d skmsg\n", skdev->name, __func__, __LINE__);
skd_free_skmsg(skdev); skd_free_skmsg(skdev);
VPRINTK(skdev, "skcomp\n"); pr_debug("%s:%s:%d skcomp\n", skdev->name, __func__, __LINE__);
skd_free_skcomp(skdev); skd_free_skcomp(skdev);
VPRINTK(skdev, "skdev\n"); pr_debug("%s:%s:%d skdev\n", skdev->name, __func__, __LINE__);
kfree(skdev); kfree(skdev);
} }
...@@ -5106,8 +5213,9 @@ static int skd_bdev_getgeo(struct block_device *bdev, struct hd_geometry *geo) ...@@ -5106,8 +5213,9 @@ static int skd_bdev_getgeo(struct block_device *bdev, struct hd_geometry *geo)
skdev = bdev->bd_disk->private_data; skdev = bdev->bd_disk->private_data;
DPRINTK(skdev, "%s: CMD[%s] getgeo device\n", pr_debug("%s:%s:%d %s: CMD[%s] getgeo device\n",
bdev->bd_disk->disk_name, current->comm); skdev->name, __func__, __LINE__,
bdev->bd_disk->disk_name, current->comm);
if (skdev->read_cap_is_valid) { if (skdev->read_cap_is_valid) {
capacity = get_capacity(skdev->disk); capacity = get_capacity(skdev->disk);
...@@ -5122,7 +5230,7 @@ static int skd_bdev_getgeo(struct block_device *bdev, struct hd_geometry *geo) ...@@ -5122,7 +5230,7 @@ static int skd_bdev_getgeo(struct block_device *bdev, struct hd_geometry *geo)
static int skd_bdev_attach(struct skd_device *skdev) static int skd_bdev_attach(struct skd_device *skdev)
{ {
DPRINTK(skdev, "add_disk\n"); pr_debug("%s:%s:%d add_disk\n", skdev->name, __func__, __LINE__);
add_disk(skdev->disk); add_disk(skdev->disk);
return 0; return 0;
} }
...@@ -5245,9 +5353,10 @@ static int skd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -5245,9 +5353,10 @@ static int skd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = -ENODEV; rc = -ENODEV;
goto err_out_iounmap; goto err_out_iounmap;
} }
DPRINTK(skdev, "mem_map=%p, phyd=%016llx, size=%d\n", pr_debug("%s:%s:%d mem_map=%p, phyd=%016llx, size=%d\n",
skdev->mem_map[i], skdev->name, __func__, __LINE__,
(uint64_t)skdev->mem_phys[i], skdev->mem_size[i]); skdev->mem_map[i],
(uint64_t)skdev->mem_phys[i], skdev->mem_size[i]);
} }
rc = skd_acquire_irq(skdev); rc = skd_acquire_irq(skdev);
...@@ -5441,9 +5550,10 @@ static int skd_pci_resume(struct pci_dev *pdev) ...@@ -5441,9 +5550,10 @@ static int skd_pci_resume(struct pci_dev *pdev)
rc = -ENODEV; rc = -ENODEV;
goto err_out_iounmap; goto err_out_iounmap;
} }
DPRINTK(skdev, "mem_map=%p, phyd=%016llx, size=%d\n", pr_debug("%s:%s:%d mem_map=%p, phyd=%016llx, size=%d\n",
skdev->mem_map[i], skdev->name, __func__, __LINE__,
(uint64_t)skdev->mem_phys[i], skdev->mem_size[i]); skdev->mem_map[i],
(uint64_t)skdev->mem_phys[i], skdev->mem_size[i]);
} }
rc = skd_acquire_irq(skdev); rc = skd_acquire_irq(skdev);
if (rc) { if (rc) {
...@@ -5643,35 +5753,44 @@ const char *skd_skreq_state_to_str(enum skd_req_state state) ...@@ -5643,35 +5753,44 @@ const char *skd_skreq_state_to_str(enum skd_req_state state)
static void skd_log_skdev(struct skd_device *skdev, const char *event) static void skd_log_skdev(struct skd_device *skdev, const char *event)
{ {
DPRINTK(skdev, "(%s) skdev=%p event='%s'\n", skdev->name, skdev, event); pr_debug("%s:%s:%d (%s) skdev=%p event='%s'\n",
DPRINTK(skdev, " drive_state=%s(%d) driver_state=%s(%d)\n", skdev->name, __func__, __LINE__, skdev->name, skdev, event);
skd_drive_state_to_str(skdev->drive_state), skdev->drive_state, pr_debug("%s:%s:%d drive_state=%s(%d) driver_state=%s(%d)\n",
skd_skdev_state_to_str(skdev->state), skdev->state); skdev->name, __func__, __LINE__,
DPRINTK(skdev, " busy=%d limit=%d dev=%d lowat=%d\n", skd_drive_state_to_str(skdev->drive_state), skdev->drive_state,
skdev->in_flight, skdev->cur_max_queue_depth, skd_skdev_state_to_str(skdev->state), skdev->state);
skdev->dev_max_queue_depth, skdev->queue_low_water_mark); pr_debug("%s:%s:%d busy=%d limit=%d dev=%d lowat=%d\n",
DPRINTK(skdev, " timestamp=0x%x cycle=%d cycle_ix=%d\n", skdev->name, __func__, __LINE__,
skdev->timeout_stamp, skdev->skcomp_cycle, skdev->skcomp_ix); skdev->in_flight, skdev->cur_max_queue_depth,
skdev->dev_max_queue_depth, skdev->queue_low_water_mark);
pr_debug("%s:%s:%d timestamp=0x%x cycle=%d cycle_ix=%d\n",
skdev->name, __func__, __LINE__,
skdev->timeout_stamp, skdev->skcomp_cycle, skdev->skcomp_ix);
} }
static void skd_log_skmsg(struct skd_device *skdev, static void skd_log_skmsg(struct skd_device *skdev,
struct skd_fitmsg_context *skmsg, const char *event) struct skd_fitmsg_context *skmsg, const char *event)
{ {
DPRINTK(skdev, "(%s) skmsg=%p event='%s'\n", skdev->name, skmsg, event); pr_debug("%s:%s:%d (%s) skmsg=%p event='%s'\n",
DPRINTK(skdev, " state=%s(%d) id=0x%04x length=%d\n", skdev->name, __func__, __LINE__, skdev->name, skmsg, event);
skd_skmsg_state_to_str(skmsg->state), skmsg->state, pr_debug("%s:%s:%d state=%s(%d) id=0x%04x length=%d\n",
skmsg->id, skmsg->length); skdev->name, __func__, __LINE__,
skd_skmsg_state_to_str(skmsg->state), skmsg->state,
skmsg->id, skmsg->length);
} }
static void skd_log_skreq(struct skd_device *skdev, static void skd_log_skreq(struct skd_device *skdev,
struct skd_request_context *skreq, const char *event) struct skd_request_context *skreq, const char *event)
{ {
DPRINTK(skdev, "(%s) skreq=%p event='%s'\n", skdev->name, skreq, event); pr_debug("%s:%s:%d (%s) skreq=%p event='%s'\n",
DPRINTK(skdev, " state=%s(%d) id=0x%04x fitmsg=0x%04x\n", skdev->name, __func__, __LINE__, skdev->name, skreq, event);
skd_skreq_state_to_str(skreq->state), skreq->state, pr_debug("%s:%s:%d state=%s(%d) id=0x%04x fitmsg=0x%04x\n",
skreq->id, skreq->fitmsg_id); skdev->name, __func__, __LINE__,
DPRINTK(skdev, " timo=0x%x sg_dir=%d n_sg=%d\n", skd_skreq_state_to_str(skreq->state), skreq->state,
skreq->timeout_stamp, skreq->sg_data_dir, skreq->n_sg); skreq->id, skreq->fitmsg_id);
pr_debug("%s:%s:%d timo=0x%x sg_dir=%d n_sg=%d\n",
skdev->name, __func__, __LINE__,
skreq->timeout_stamp, skreq->sg_data_dir, skreq->n_sg);
if (!skd_bio) { if (!skd_bio) {
if (skreq->req != NULL) { if (skreq->req != NULL) {
...@@ -5679,24 +5798,28 @@ static void skd_log_skreq(struct skd_device *skdev, ...@@ -5679,24 +5798,28 @@ static void skd_log_skreq(struct skd_device *skdev,
u32 lba = (u32)blk_rq_pos(req); u32 lba = (u32)blk_rq_pos(req);
u32 count = blk_rq_sectors(req); u32 count = blk_rq_sectors(req);
DPRINTK(skdev, pr_debug("%s:%s:%d "
" req=%p lba=%u(0x%x) count=%u(0x%x) dir=%d\n", "req=%p lba=%u(0x%x) count=%u(0x%x) dir=%d\n",
req, lba, lba, count, count, skdev->name, __func__, __LINE__,
(int)rq_data_dir(req)); req, lba, lba, count, count,
(int)rq_data_dir(req));
} else } else
DPRINTK(skdev, " req=NULL\n"); pr_debug("%s:%s:%d req=NULL\n",
skdev->name, __func__, __LINE__);
} else { } else {
if (skreq->bio != NULL) { if (skreq->bio != NULL) {
struct bio *bio = skreq->bio; struct bio *bio = skreq->bio;
u32 lba = (u32)bio->bi_sector; u32 lba = (u32)bio->bi_sector;
u32 count = bio_sectors(bio); u32 count = bio_sectors(bio);
DPRINTK(skdev, pr_debug("%s:%s:%d "
" bio=%p lba=%u(0x%x) count=%u(0x%x) dir=%d\n", "bio=%p lba=%u(0x%x) count=%u(0x%x) dir=%d\n",
bio, lba, lba, count, count, skdev->name, __func__, __LINE__,
(int)bio_data_dir(bio)); bio, lba, lba, count, count,
(int)bio_data_dir(bio));
} else } else
DPRINTK(skdev, " req=NULL\n"); pr_debug("%s:%s:%d req=NULL\n",
skdev->name, __func__, __LINE__);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment