| @@ -305,53 +305,53 @@ static void ufshcd_scsi_block_requests(struct ufs_hba *hba) · 304 unmodified lines |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag, |
| 308 | | − const char *str) |
| 308 | + enum ufs_trace_str_t str_t) |
| 309 | 309 | { |
| 310 | 310 | struct utp_upiu_req *rq = hba->lrb[tag].ucd_req_ptr; |
| 311 | 311 | |
| 312 | | − trace_ufshcd_upiu(dev_name(hba->dev), str, &rq->header, &rq->sc.cdb); |
| 312 | + trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag, |
| 316 | | − const char *str) |
| 316 | + enum ufs_trace_str_t str_t) |
| 317 | 317 | { |
| 318 | 318 | struct utp_upiu_req *rq = hba->lrb[tag].ucd_req_ptr; |
| 319 | 319 | |
| 320 | | − trace_ufshcd_upiu(dev_name(hba->dev), str, &rq->header, &rq->qr); |
| 320 | + trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->qr); |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag, |
| 324 | | − const char *str) |
| 324 | + enum ufs_trace_str_t str_t) |
| 325 | 325 | { |
| 326 | 326 | int off = (int)tag - hba->nutrs; |
| 327 | 327 | struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[off]; |
| 328 | 328 | |
| 329 | | − trace_ufshcd_upiu(dev_name(hba->dev), str, &descp->req_header, |
| 329 | + trace_ufshcd_upiu(dev_name(hba->dev), str_t, &descp->req_header, |
| 330 | 330 | &descp->input_param1); |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | static void ufshcd_add_uic_command_trace(struct ufs_hba *hba, |
| 334 | 334 | struct uic_command *ucmd, |
| 335 | | − const char *str) |
| 335 | + enum ufs_trace_str_t str_t) |
| 336 | 336 | { |
| 337 | 337 | u32 cmd; |
| 338 | 338 | |
| 339 | 339 | if (!trace_ufshcd_uic_command_enabled()) |
| 340 | 340 | return; |
| 341 | 341 | |
| 342 | | − if (!strcmp(str, "send")) |
| 342 | + if (str_t == UFS_CMD_SEND) |
| 343 | 343 | cmd = ucmd->command; |
| 344 | 344 | else |
| 345 | 345 | cmd = ufshcd_readl(hba, REG_UIC_COMMAND); |
| 346 | 346 | |
| 347 | | − trace_ufshcd_uic_command(dev_name(hba->dev), str, cmd, |
| 347 | + trace_ufshcd_uic_command(dev_name(hba->dev), str_t, cmd, |
| 348 | 348 | ufshcd_readl(hba, REG_UIC_COMMAND_ARG_1), |
| 349 | 349 | ufshcd_readl(hba, REG_UIC_COMMAND_ARG_2), |
| 350 | 350 | ufshcd_readl(hba, REG_UIC_COMMAND_ARG_3)); |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | | −static void ufshcd_add_command_trace(struct ufs_hba *hba, |
| 354 | | − unsigned int tag, const char *str) |
| 353 | +static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, |
| 354 | + enum ufs_trace_str_t str_t) |
| 355 | 355 | { |
| 356 | 356 | sector_t lba = -1; |
| 357 | 357 | u8 opcode = 0, group_id = 0; |
| @@ -363,13 +363,13 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, · 5 unmodified lines |
| 363 | 363 | if (!trace_ufshcd_command_enabled()) { |
| 364 | 364 | /* trace UPIU W/O tracing command */ |
| 365 | 365 | if (cmd) |
| 366 | | − ufshcd_add_cmd_upiu_trace(hba, tag, str); |
| 366 | + ufshcd_add_cmd_upiu_trace(hba, tag, str_t); |
| 367 | 367 | return; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | if (cmd) { /* data phase exists */ |
| 371 | 371 | /* trace UPIU also */ |
| 372 | | − ufshcd_add_cmd_upiu_trace(hba, tag, str); |
| 372 | + ufshcd_add_cmd_upiu_trace(hba, tag, str_t); |
| 373 | 373 | opcode = cmd->cmnd[0]; |
| 374 | 374 | if ((opcode == READ_10) || (opcode == WRITE_10)) { |
| 375 | 375 | /* |
| @@ -392,7 +392,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, · 16 unmodified lines |
| 392 | 392 | |
| 393 | 393 | intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS); |
| 394 | 394 | doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); |
| 395 | | − trace_ufshcd_command(dev_name(hba->dev), str, tag, |
| 395 | + trace_ufshcd_command(dev_name(hba->dev), str_t, tag, |
| 396 | 396 | doorbell, transfer_len, intr, lba, opcode, group_id); |
| 397 | 397 | } |
| 398 | 398 | |
| @@ -2001,7 +2001,7 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag) · 1602 unmodified lines |
| 2001 | 2001 | lrbp->issue_time_stamp = ktime_get(); |
| 2002 | 2002 | lrbp->compl_time_stamp = ktime_set(0, 0); |
| 2003 | 2003 | ufshcd_vops_setup_xfer_req(hba, task_tag, (lrbp->cmd ? true : false)); |
| 2004 | | − ufshcd_add_command_trace(hba, task_tag, "send"); |
| 2004 | + ufshcd_add_command_trace(hba, task_tag, UFS_CMD_SEND); |
| 2005 | 2005 | ufshcd_clk_scaling_start_busy(hba); |
| 2006 | 2006 | __set_bit(task_tag, &hba->outstanding_reqs); |
| 2007 | 2007 | ufshcd_writel(hba, 1 << task_tag, REG_UTP_TRANSFER_REQ_DOOR_BELL); |
| @@ -2137,7 +2137,7 @@ ufshcd_dispatch_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd) · 129 unmodified lines |
| 2137 | 2137 | ufshcd_writel(hba, uic_cmd->argument2, REG_UIC_COMMAND_ARG_2); |
| 2138 | 2138 | ufshcd_writel(hba, uic_cmd->argument3, REG_UIC_COMMAND_ARG_3); |
| 2139 | 2139 | |
| 2140 | | − ufshcd_add_uic_command_trace(hba, uic_cmd, "send"); |
| 2140 | + ufshcd_add_uic_command_trace(hba, uic_cmd, UFS_CMD_SEND); |
| 2141 | 2141 | |
| 2142 | 2142 | /* Write UIC Cmd */ |
| 2143 | 2143 | ufshcd_writel(hba, uic_cmd->command & COMMAND_OPCODE_MASK, |
| @@ -2856,7 +2856,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, · 712 unmodified lines |
| 2856 | 2856 | |
| 2857 | 2857 | hba->dev_cmd.complete = &wait; |
| 2858 | 2858 | |
| 2859 | | − ufshcd_add_query_upiu_trace(hba, tag, "query_send"); |
| 2859 | + ufshcd_add_query_upiu_trace(hba, tag, UFS_QUERY_SEND); |
| 2860 | 2860 | /* Make sure descriptors are ready before ringing the doorbell */ |
| 2861 | 2861 | wmb(); |
| 2862 | 2862 | spin_lock_irqsave(hba->host->host_lock, flags); |
| @@ -2867,7 +2867,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, · 4 unmodified lines |
| 2867 | 2867 | |
| 2868 | 2868 | out: |
| 2869 | 2869 | ufshcd_add_query_upiu_trace(hba, tag, |
| 2870 | | − err ? "query_complete_err" : "query_complete"); |
| 2870 | + err ? UFS_QUERY_ERR : UFS_QUERY_COMP); |
| 2871 | 2871 | |
| 2872 | 2872 | out_put_tag: |
| 2873 | 2873 | blk_put_request(req); |
| @@ -5030,7 +5030,7 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status) · 2156 unmodified lines |
| 5030 | 5030 | |
| 5031 | 5031 | if (retval == IRQ_HANDLED) |
| 5032 | 5032 | ufshcd_add_uic_command_trace(hba, hba->active_uic_cmd, |
| 5033 | | − "complete"); |
| 5033 | + UFS_CMD_COMP); |
| 5034 | 5034 | return retval; |
| 5035 | 5035 | } |
| 5036 | 5036 | |
| @@ -5054,7 +5054,7 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, · 17 unmodified lines |
| 5054 | 5054 | lrbp->compl_time_stamp = ktime_get(); |
| 5055 | 5055 | cmd = lrbp->cmd; |
| 5056 | 5056 | if (cmd) { |
| 5057 | | − ufshcd_add_command_trace(hba, index, "complete"); |
| 5057 | + ufshcd_add_command_trace(hba, index, UFS_CMD_COMP); |
| 5058 | 5058 | result = ufshcd_transfer_rsp_status(hba, lrbp); |
| 5059 | 5059 | scsi_dma_unmap(cmd); |
| 5060 | 5060 | cmd->result = result; |
| @@ -5068,7 +5068,7 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, · 7 unmodified lines |
| 5068 | 5068 | lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) { |
| 5069 | 5069 | if (hba->dev_cmd.complete) { |
| 5070 | 5070 | ufshcd_add_command_trace(hba, index, |
| 5071 | | − "dev_complete"); |
| 5071 | + UFS_DEV_COMP); |
| 5072 | 5072 | complete(hba->dev_cmd.complete); |
| 5073 | 5073 | update_scaling = true; |
| 5074 | 5074 | } |
| @@ -6371,7 +6371,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba, · 1296 unmodified lines |
| 6371 | 6371 | |
| 6372 | 6372 | spin_unlock_irqrestore(host->host_lock, flags); |
| 6373 | 6373 | |
| 6374 | | − ufshcd_add_tm_upiu_trace(hba, task_tag, "tm_send"); |
| 6374 | + ufshcd_add_tm_upiu_trace(hba, task_tag, UFS_TM_SEND); |
| 6375 | 6375 | |
| 6376 | 6376 | /* wait until the task management command is completed */ |
| 6377 | 6377 | err = wait_for_completion_io_timeout(&wait, |
| @@ -6382,7 +6382,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba, · 4 unmodified lines |
| 6382 | 6382 | * use-after-free. |
| 6383 | 6383 | */ |
| 6384 | 6384 | req->end_io_data = NULL; |
| 6385 | | − ufshcd_add_tm_upiu_trace(hba, task_tag, "tm_complete_err"); |
| 6385 | + ufshcd_add_tm_upiu_trace(hba, task_tag, UFS_TM_ERR); |
| 6386 | 6386 | dev_err(hba->dev, "%s: task management cmd 0x%.2x timed-out\n", |
| 6387 | 6387 | __func__, tm_function); |
| 6388 | 6388 | if (ufshcd_clear_tm_cmd(hba, free_slot)) |
| @@ -6393,7 +6393,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba, · 4 unmodified lines |
| 6393 | 6393 | err = 0; |
| 6394 | 6394 | memcpy(treq, hba->utmrdl_base_addr + free_slot, sizeof(*treq)); |
| 6395 | 6395 | |
| 6396 | | − ufshcd_add_tm_upiu_trace(hba, task_tag, "tm_complete"); |
| 6396 | + ufshcd_add_tm_upiu_trace(hba, task_tag, UFS_TM_COMP); |
| 6397 | 6397 | } |
| 6398 | 6398 | |
| 6399 | 6399 | spin_lock_irqsave(hba->host->host_lock, flags); |