Files
android/drivers/scsi/ufs/ufs-mtk-block.h
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

82 lines
1.9 KiB
C

/*
* Copyright (C) 2017 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _UFS_MTK_BLOCK_H
#define _UFS_MTK_BLOCK_H
#include <linux/types.h>
#include <mt-plat/mtk_blocktag.h>
#include "ufshcd.h"
#if defined(CONFIG_MTK_UFS_BLOCK_IO_LOG)
int ufs_mtk_biolog_init(bool qos_allowed);
int ufs_mtk_biolog_exit(void);
void ufs_mtk_biolog_send_command(unsigned int task_id,
struct scsi_cmnd *cmd);
void ufs_mtk_biolog_transfer_req_compl(unsigned int taski_id,
unsigned long req_mask);
void ufs_mtk_biolog_check(unsigned long req_mask);
void ufs_mtk_biolog_clk_gating(bool gated);
#define UFS_BIOLOG_RINGBUF_MAX 120
#define UFS_BIOLOG_CONTEXT_TASKS 32
#define UFS_BIOLOG_CONTEXTS 1
enum {
tsk_send_cmd = 0,
tsk_req_compl,
tsk_max
};
struct ufs_mtk_bio_context_task {
__u32 qid;
__u16 cmd;
__u16 len;
__u32 lba;
uint64_t t[tsk_max];
};
/* Context of Request Queue */
struct ufs_mtk_bio_context {
int id;
int state;
pid_t pid;
__u16 qid;
__u16 q_depth;
__u16 q_depth_top;
spinlock_t lock;
uint64_t busy_start_t;
uint64_t period_start_t;
uint64_t period_end_t;
uint64_t period_usage;
struct ufs_mtk_bio_context_task task[UFS_BIOLOG_CONTEXT_TASKS];
struct mtk_btag_workload workload;
struct mtk_btag_throughput throughput;
struct mtk_btag_pidlogger pidlog;
};
#else
#define ufs_mtk_biolog_init(...)
#define ufs_mtk_biolog_exit(...)
#define ufs_mtk_biolog_send_command(...)
#define ufs_mtk_biolog_transfer_req_compl(...)
#define ufs_mtk_biolog_check(...)
#define ufs_mtk_biolog_clk_gating(...)
#endif
#endif