[RAMEN9610-9484][COMMON] scsi: rpmb: print information log when rpmb result is not...
authorHyeyeon Chung <hyeon.chung@samsung.com>
Wed, 5 Dec 2018 10:59:27 +0000 (19:59 +0900)
committerhskang <hs1218.kang@samsung.com>
Sat, 15 Dec 2018 08:51:47 +0000 (17:51 +0900)
- 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 <hyeon.chung@samsung.com>
drivers/scsi/scsi_srpmb.c
drivers/scsi/scsi_srpmb.h

index 64053449e3f2f1841b2e15523d6d1e84c5040f5c..549bfe5636c95d2b05e655b89a138d7a49f69e4b 100644 (file)
@@ -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;
index e4df7dc3014ded0fa92fe641dd146667661c9209..274522afd621e202b1f78f34e0bd15f169b7ece7 100644 (file)
@@ -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