From 22321e0325ca86c9e858f3667667f6b0d5a69c6c Mon Sep 17 00:00:00 2001 From: Hyeyeon Chung Date: Wed, 5 Dec 2018 19:59:27 +0900 Subject: [PATCH] [RAMEN9610-9484][COMMON] scsi: rpmb: print information log when rpmb result is not zero - Print result code in rpmb packet for debug information - Remove code checking rpmb result and returning ufs status for consistency Change-Id: Ib201e34958684a8b7f17a94c718f699e2745e9ae Signed-off-by: Hyeyeon Chung --- drivers/scsi/scsi_srpmb.c | 27 +++++++++++++++++++-------- drivers/scsi/scsi_srpmb.h | 3 +++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/scsi_srpmb.c b/drivers/scsi/scsi_srpmb.c index 64053449e3f2..549bfe5636c9 100644 --- a/drivers/scsi/scsi_srpmb.c +++ b/drivers/scsi/scsi_srpmb.c @@ -123,6 +123,12 @@ static void srpmb_worker(struct work_struct *data) dev_err(&sr_pdev->dev, "ioctl error : %x\n", ret); break; } + if (req->rpmb_data[RPMB_RESULT] || req->rpmb_data[RPMB_RESULT+1]) { + dev_info(&sr_pdev->dev, "GET_WRITE_COUNTER: REQ/RES = %02x%02x, RESULT = %02x%02x\n", + req->rpmb_data[RPMB_REQRES], req->rpmb_data[RPMB_REQRES+1], + req->rpmb_data[RPMB_RESULT], req->rpmb_data[RPMB_RESULT+1]); + } + update_rpmb_status_flag(rpmb_ctx, req, RPMB_PASSED); break; @@ -174,15 +180,14 @@ static void srpmb_worker(struct work_struct *data) "ioctl write_data result error: %x\n", ret); break; } - - swap_packet(req->rpmb_data, (uint8_t *)&packet); - if (packet.result == 0) { - update_rpmb_status_flag(rpmb_ctx, req, RPMB_PASSED); - } else { - update_rpmb_status_flag(rpmb_ctx, req, packet.result); - dev_err(&sr_pdev->dev, - "packet result error: %x\n", req->status_flag); + if (req->rpmb_data[RPMB_RESULT] || req->rpmb_data[RPMB_RESULT+1]) { + dev_info(&sr_pdev->dev, "WRITE_DATA: REQ/RES = %02x%02x, RESULT = %02x%02x\n", + req->rpmb_data[RPMB_REQRES], req->rpmb_data[RPMB_REQRES+1], + req->rpmb_data[RPMB_RESULT], req->rpmb_data[RPMB_RESULT+1]); } + + update_rpmb_status_flag(rpmb_ctx, req, RPMB_PASSED); + break; case READ_DATA: if (req->data_len < RPMB_PACKET_SIZE || @@ -215,6 +220,12 @@ static void srpmb_worker(struct work_struct *data) "ioctl result read data error : %x\n", ret); break; } + if (req->rpmb_data[RPMB_RESULT] || req->rpmb_data[RPMB_RESULT+1]) { + dev_info(&sr_pdev->dev, "READ_DATA: REQ/RES = %02x%02x, RESULT = %02x%02x\n", + req->rpmb_data[RPMB_REQRES], req->rpmb_data[RPMB_REQRES+1], + req->rpmb_data[RPMB_RESULT], req->rpmb_data[RPMB_RESULT+1]); + } + update_rpmb_status_flag(rpmb_ctx, req, RPMB_PASSED); break; diff --git a/drivers/scsi/scsi_srpmb.h b/drivers/scsi/scsi_srpmb.h index e4df7dc3014d..274522afd621 100644 --- a/drivers/scsi/scsi_srpmb.h +++ b/drivers/scsi/scsi_srpmb.h @@ -23,6 +23,9 @@ #define RPMB_END_ADDRESS 0x4000 #define RPMB_PACKET_SIZE 512 +#define RPMB_REQRES 510 +#define RPMB_RESULT 508 + #define WRITE_COUTNER_DATA_LEN_ERROR 0x601 #define WRITE_COUTNER_SECURITY_OUT_ERROR 0x602 -- 2.20.1