Commit d0c92afc authored by Tal Cohen's avatar Tal Cohen Committed by Oded Gabbay

habanalabs: change the write flag name of error info structs

positive flags naming will make more clear code while adding
more 'error info' structures
Signed-off-by: default avatarTal Cohen <talcohen@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 939ed076
...@@ -735,8 +735,8 @@ static void cs_timedout(struct work_struct *work) ...@@ -735,8 +735,8 @@ static void cs_timedout(struct work_struct *work)
hdev = cs->ctx->hdev; hdev = cs->ctx->hdev;
/* Save only the first CS timeout parameters */ /* Save only the first CS timeout parameters */
rc = atomic_cmpxchg(&hdev->last_error.cs_timeout.write_disable, 0, 1); rc = atomic_cmpxchg(&hdev->last_error.cs_timeout.write_enable, 1, 0);
if (!rc) { if (rc) {
hdev->last_error.cs_timeout.timestamp = ktime_get(); hdev->last_error.cs_timeout.timestamp = ktime_get();
hdev->last_error.cs_timeout.seq = cs->sequence; hdev->last_error.cs_timeout.seq = cs->sequence;
} }
......
...@@ -2570,21 +2570,21 @@ struct hl_clk_throttle { ...@@ -2570,21 +2570,21 @@ struct hl_clk_throttle {
/** /**
* struct cs_timeout_info - info of last CS timeout occurred. * struct cs_timeout_info - info of last CS timeout occurred.
* @timestamp: CS timeout timestamp. * @timestamp: CS timeout timestamp.
* @write_disable: if set writing to CS parameters in the structure is disabled so, * @write_enable: if set writing to CS parameters in the structure is enabled. otherwise - disabled,
* the first (root cause) CS timeout will not be overwritten. * so the first (root cause) CS timeout will not be overwritten.
* @seq: CS timeout sequence number. * @seq: CS timeout sequence number.
*/ */
struct cs_timeout_info { struct cs_timeout_info {
ktime_t timestamp; ktime_t timestamp;
atomic_t write_disable; atomic_t write_enable;
u64 seq; u64 seq;
}; };
/** /**
* struct razwi_info - info about last razwi error occurred. * struct razwi_info - info about last razwi error occurred.
* @timestamp: razwi timestamp. * @timestamp: razwi timestamp.
* @write_disable: if set writing to razwi parameters in the structure is disabled so the * @write_enable: if set writing to razwi parameters in the structure is enabled.
* first (root cause) razwi will not be overwritten. * otherwise - disabled, so the first (root cause) razwi will not be overwritten.
* @addr: address that caused razwi. * @addr: address that caused razwi.
* @engine_id_1: engine id of the razwi initiator, if it was initiated by engine that does * @engine_id_1: engine id of the razwi initiator, if it was initiated by engine that does
* not have engine id it will be set to U16_MAX. * not have engine id it will be set to U16_MAX.
...@@ -2596,7 +2596,7 @@ struct cs_timeout_info { ...@@ -2596,7 +2596,7 @@ struct cs_timeout_info {
*/ */
struct razwi_info { struct razwi_info {
ktime_t timestamp; ktime_t timestamp;
atomic_t write_disable; atomic_t write_enable;
u64 addr; u64 addr;
u16 engine_id_1; u16 engine_id_1;
u16 engine_id_2; u16 engine_id_2;
......
...@@ -195,8 +195,8 @@ int hl_device_open(struct inode *inode, struct file *filp) ...@@ -195,8 +195,8 @@ int hl_device_open(struct inode *inode, struct file *filp)
hl_debugfs_add_file(hpriv); hl_debugfs_add_file(hpriv);
atomic_set(&hdev->last_error.cs_timeout.write_disable, 0); atomic_set(&hdev->last_error.cs_timeout.write_enable, 1);
atomic_set(&hdev->last_error.razwi.write_disable, 0); atomic_set(&hdev->last_error.razwi.write_enable, 1);
hdev->open_counter++; hdev->open_counter++;
hdev->last_successful_open_jif = jiffies; hdev->last_successful_open_jif = jiffies;
......
...@@ -7410,8 +7410,8 @@ static void gaudi_print_irq_info(struct hl_device *hdev, u16 event_type, ...@@ -7410,8 +7410,8 @@ static void gaudi_print_irq_info(struct hl_device *hdev, u16 event_type,
gaudi_print_and_get_mmu_error_info(hdev, &razwi_addr, &razwi_type); gaudi_print_and_get_mmu_error_info(hdev, &razwi_addr, &razwi_type);
/* In case it's the first razwi, save its parameters*/ /* In case it's the first razwi, save its parameters*/
rc = atomic_cmpxchg(&hdev->last_error.razwi.write_disable, 0, 1); rc = atomic_cmpxchg(&hdev->last_error.razwi.write_enable, 1, 0);
if (!rc) { if (rc) {
hdev->last_error.razwi.timestamp = ktime_get(); hdev->last_error.razwi.timestamp = ktime_get();
hdev->last_error.razwi.addr = razwi_addr; hdev->last_error.razwi.addr = razwi_addr;
hdev->last_error.razwi.engine_id_1 = engine_id_1; hdev->last_error.razwi.engine_id_1 = engine_id_1;
......
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