* [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
@ 2025-03-05 11:00 Andy Shevchenko
2025-03-26 9:46 ` Andy Shevchenko
0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2025-03-05 11:00 UTC (permalink / raw)
To: Ofir Bitton, dri-devel, linux-kernel; +Cc: Oded Gabbay, Andy Shevchenko
Use %ptTs instead of open-coded variant to print contents of time64_t type
in human readable form.
This changes N/A output to 1970-01-01 00:00:00 for zero timestamps,
but it's used only in the dev_err() output and won't break anything.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: explained the difference for N/A cases (Jani)
v2: fixed the parameters to be the pointers
drivers/accel/habanalabs/common/device.c | 25 +++---------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index 68eebed3b050..80fa08bf57bd 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -1066,28 +1066,11 @@ static bool is_pci_link_healthy(struct hl_device *hdev)
return (device_id == hdev->pdev->device);
}
-static void stringify_time_of_last_heartbeat(struct hl_device *hdev, char *time_str, size_t size,
- bool is_pq_hb)
-{
- time64_t seconds = is_pq_hb ? hdev->heartbeat_debug_info.last_pq_heartbeat_ts
- : hdev->heartbeat_debug_info.last_eq_heartbeat_ts;
- struct tm tm;
-
- if (!seconds)
- return;
-
- time64_to_tm(seconds, 0, &tm);
-
- snprintf(time_str, size, "%ld-%02d-%02d %02d:%02d:%02d (UTC)",
- tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
-}
-
static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
{
struct eq_heartbeat_debug_info *heartbeat_debug_info = &hdev->heartbeat_debug_info;
u32 cpu_q_id = heartbeat_debug_info->cpu_queue_id, pq_pi_mask = (HL_QUEUE_LENGTH << 1) - 1;
struct asic_fixed_properties *prop = &hdev->asic_prop;
- char pq_time_str[64] = "N/A", eq_time_str[64] = "N/A";
if (!prop->cpucp_info.eq_health_check_supported)
return true;
@@ -1095,17 +1078,15 @@ static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
if (!hdev->eq_heartbeat_received) {
dev_err(hdev->dev, "EQ heartbeat event was not received!\n");
- stringify_time_of_last_heartbeat(hdev, pq_time_str, sizeof(pq_time_str), true);
- stringify_time_of_last_heartbeat(hdev, eq_time_str, sizeof(eq_time_str), false);
dev_err(hdev->dev,
- "EQ: {CI %u, HB counter %u, last HB time: %s}, PQ: {PI: %u, CI: %u (%u), last HB time: %s}\n",
+ "EQ: {CI %u, HB counter %u, last HB time: %ptTs}, PQ: {PI: %u, CI: %u (%u), last HB time: %ptTs}\n",
hdev->event_queue.ci,
heartbeat_debug_info->heartbeat_event_counter,
- eq_time_str,
+ &hdev->heartbeat_debug_info.last_eq_heartbeat_ts,
hdev->kernel_queues[cpu_q_id].pi,
atomic_read(&hdev->kernel_queues[cpu_q_id].ci),
atomic_read(&hdev->kernel_queues[cpu_q_id].ci) & pq_pi_mask,
- pq_time_str);
+ &hdev->heartbeat_debug_info.last_pq_heartbeat_ts);
hl_eq_dump(hdev, &hdev->event_queue);
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-03-05 11:00 [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs Andy Shevchenko
@ 2025-03-26 9:46 ` Andy Shevchenko
2025-03-26 9:55 ` Jani Nikula
0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2025-03-26 9:46 UTC (permalink / raw)
To: Ofir Bitton, dri-devel, linux-kernel; +Cc: Oded Gabbay, Jani Nikula
+Cc: Jani (sorry, forgot to add you in the first place).
Do you think it's applicable now?
On Wed, Mar 05, 2025 at 01:00:25PM +0200, Andy Shevchenko wrote:
> Use %ptTs instead of open-coded variant to print contents of time64_t type
> in human readable form.
>
> This changes N/A output to 1970-01-01 00:00:00 for zero timestamps,
> but it's used only in the dev_err() output and won't break anything.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>
> v3: explained the difference for N/A cases (Jani)
> v2: fixed the parameters to be the pointers
>
> drivers/accel/habanalabs/common/device.c | 25 +++---------------------
> 1 file changed, 3 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
> index 68eebed3b050..80fa08bf57bd 100644
> --- a/drivers/accel/habanalabs/common/device.c
> +++ b/drivers/accel/habanalabs/common/device.c
> @@ -1066,28 +1066,11 @@ static bool is_pci_link_healthy(struct hl_device *hdev)
> return (device_id == hdev->pdev->device);
> }
>
> -static void stringify_time_of_last_heartbeat(struct hl_device *hdev, char *time_str, size_t size,
> - bool is_pq_hb)
> -{
> - time64_t seconds = is_pq_hb ? hdev->heartbeat_debug_info.last_pq_heartbeat_ts
> - : hdev->heartbeat_debug_info.last_eq_heartbeat_ts;
> - struct tm tm;
> -
> - if (!seconds)
> - return;
> -
> - time64_to_tm(seconds, 0, &tm);
> -
> - snprintf(time_str, size, "%ld-%02d-%02d %02d:%02d:%02d (UTC)",
> - tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
> -}
> -
> static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
> {
> struct eq_heartbeat_debug_info *heartbeat_debug_info = &hdev->heartbeat_debug_info;
> u32 cpu_q_id = heartbeat_debug_info->cpu_queue_id, pq_pi_mask = (HL_QUEUE_LENGTH << 1) - 1;
> struct asic_fixed_properties *prop = &hdev->asic_prop;
> - char pq_time_str[64] = "N/A", eq_time_str[64] = "N/A";
>
> if (!prop->cpucp_info.eq_health_check_supported)
> return true;
> @@ -1095,17 +1078,15 @@ static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
> if (!hdev->eq_heartbeat_received) {
> dev_err(hdev->dev, "EQ heartbeat event was not received!\n");
>
> - stringify_time_of_last_heartbeat(hdev, pq_time_str, sizeof(pq_time_str), true);
> - stringify_time_of_last_heartbeat(hdev, eq_time_str, sizeof(eq_time_str), false);
> dev_err(hdev->dev,
> - "EQ: {CI %u, HB counter %u, last HB time: %s}, PQ: {PI: %u, CI: %u (%u), last HB time: %s}\n",
> + "EQ: {CI %u, HB counter %u, last HB time: %ptTs}, PQ: {PI: %u, CI: %u (%u), last HB time: %ptTs}\n",
> hdev->event_queue.ci,
> heartbeat_debug_info->heartbeat_event_counter,
> - eq_time_str,
> + &hdev->heartbeat_debug_info.last_eq_heartbeat_ts,
> hdev->kernel_queues[cpu_q_id].pi,
> atomic_read(&hdev->kernel_queues[cpu_q_id].ci),
> atomic_read(&hdev->kernel_queues[cpu_q_id].ci) & pq_pi_mask,
> - pq_time_str);
> + &hdev->heartbeat_debug_info.last_pq_heartbeat_ts);
>
> hl_eq_dump(hdev, &hdev->event_queue);
>
> --
> 2.47.2
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-03-26 9:46 ` Andy Shevchenko
@ 2025-03-26 9:55 ` Jani Nikula
2025-03-26 15:51 ` Andy Shevchenko
2025-03-30 11:15 ` Avizrat, Yaron
0 siblings, 2 replies; 9+ messages in thread
From: Jani Nikula @ 2025-03-26 9:55 UTC (permalink / raw)
To: Andy Shevchenko, dri-devel, linux-kernel
Cc: Oded Gabbay, Avizrat, Yaron, Elbaz, Koby, Sinyuk, Konstantin
On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> +Cc: Jani (sorry, forgot to add you in the first place).
>
> Do you think it's applicable now?
Cc: Yaron, Koby, and Konstantin who are supposed to be the new
maintainers for accel/habanalabs.
BR,
Jani.
>
> On Wed, Mar 05, 2025 at 01:00:25PM +0200, Andy Shevchenko wrote:
>> Use %ptTs instead of open-coded variant to print contents of time64_t type
>> in human readable form.
>>
>> This changes N/A output to 1970-01-01 00:00:00 for zero timestamps,
>> but it's used only in the dev_err() output and won't break anything.
>>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>>
>> v3: explained the difference for N/A cases (Jani)
>> v2: fixed the parameters to be the pointers
>>
>> drivers/accel/habanalabs/common/device.c | 25 +++---------------------
>> 1 file changed, 3 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
>> index 68eebed3b050..80fa08bf57bd 100644
>> --- a/drivers/accel/habanalabs/common/device.c
>> +++ b/drivers/accel/habanalabs/common/device.c
>> @@ -1066,28 +1066,11 @@ static bool is_pci_link_healthy(struct hl_device *hdev)
>> return (device_id == hdev->pdev->device);
>> }
>>
>> -static void stringify_time_of_last_heartbeat(struct hl_device *hdev, char *time_str, size_t size,
>> - bool is_pq_hb)
>> -{
>> - time64_t seconds = is_pq_hb ? hdev->heartbeat_debug_info.last_pq_heartbeat_ts
>> - : hdev->heartbeat_debug_info.last_eq_heartbeat_ts;
>> - struct tm tm;
>> -
>> - if (!seconds)
>> - return;
>> -
>> - time64_to_tm(seconds, 0, &tm);
>> -
>> - snprintf(time_str, size, "%ld-%02d-%02d %02d:%02d:%02d (UTC)",
>> - tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
>> -}
>> -
>> static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
>> {
>> struct eq_heartbeat_debug_info *heartbeat_debug_info = &hdev->heartbeat_debug_info;
>> u32 cpu_q_id = heartbeat_debug_info->cpu_queue_id, pq_pi_mask = (HL_QUEUE_LENGTH << 1) - 1;
>> struct asic_fixed_properties *prop = &hdev->asic_prop;
>> - char pq_time_str[64] = "N/A", eq_time_str[64] = "N/A";
>>
>> if (!prop->cpucp_info.eq_health_check_supported)
>> return true;
>> @@ -1095,17 +1078,15 @@ static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
>> if (!hdev->eq_heartbeat_received) {
>> dev_err(hdev->dev, "EQ heartbeat event was not received!\n");
>>
>> - stringify_time_of_last_heartbeat(hdev, pq_time_str, sizeof(pq_time_str), true);
>> - stringify_time_of_last_heartbeat(hdev, eq_time_str, sizeof(eq_time_str), false);
>> dev_err(hdev->dev,
>> - "EQ: {CI %u, HB counter %u, last HB time: %s}, PQ: {PI: %u, CI: %u (%u), last HB time: %s}\n",
>> + "EQ: {CI %u, HB counter %u, last HB time: %ptTs}, PQ: {PI: %u, CI: %u (%u), last HB time: %ptTs}\n",
>> hdev->event_queue.ci,
>> heartbeat_debug_info->heartbeat_event_counter,
>> - eq_time_str,
>> + &hdev->heartbeat_debug_info.last_eq_heartbeat_ts,
>> hdev->kernel_queues[cpu_q_id].pi,
>> atomic_read(&hdev->kernel_queues[cpu_q_id].ci),
>> atomic_read(&hdev->kernel_queues[cpu_q_id].ci) & pq_pi_mask,
>> - pq_time_str);
>> + &hdev->heartbeat_debug_info.last_pq_heartbeat_ts);
>>
>> hl_eq_dump(hdev, &hdev->event_queue);
>>
>> --
>> 2.47.2
>>
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-03-26 9:55 ` Jani Nikula
@ 2025-03-26 15:51 ` Andy Shevchenko
2025-04-02 9:15 ` Avizrat, Yaron
2025-03-30 11:15 ` Avizrat, Yaron
1 sibling, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2025-03-26 15:51 UTC (permalink / raw)
To: Jani Nikula
Cc: dri-devel, linux-kernel, Oded Gabbay, Avizrat, Yaron, Elbaz, Koby,
Sinyuk, Konstantin
On Wed, Mar 26, 2025 at 11:55:33AM +0200, Jani Nikula wrote:
> On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > +Cc: Jani (sorry, forgot to add you in the first place).
> >
> > Do you think it's applicable now?
>
> Cc: Yaron, Koby, and Konstantin who are supposed to be the new
> maintainers for accel/habanalabs.
Thank you!
> > On Wed, Mar 05, 2025 at 01:00:25PM +0200, Andy Shevchenko wrote:
> >> Use %ptTs instead of open-coded variant to print contents of time64_t type
> >> in human readable form.
> >>
> >> This changes N/A output to 1970-01-01 00:00:00 for zero timestamps,
> >> but it's used only in the dev_err() output and won't break anything.
> >>
> >> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >> ---
> >>
> >> v3: explained the difference for N/A cases (Jani)
> >> v2: fixed the parameters to be the pointers
> >>
> >> drivers/accel/habanalabs/common/device.c | 25 +++---------------------
> >> 1 file changed, 3 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
> >> index 68eebed3b050..80fa08bf57bd 100644
> >> --- a/drivers/accel/habanalabs/common/device.c
> >> +++ b/drivers/accel/habanalabs/common/device.c
> >> @@ -1066,28 +1066,11 @@ static bool is_pci_link_healthy(struct hl_device *hdev)
> >> return (device_id == hdev->pdev->device);
> >> }
> >>
> >> -static void stringify_time_of_last_heartbeat(struct hl_device *hdev, char *time_str, size_t size,
> >> - bool is_pq_hb)
> >> -{
> >> - time64_t seconds = is_pq_hb ? hdev->heartbeat_debug_info.last_pq_heartbeat_ts
> >> - : hdev->heartbeat_debug_info.last_eq_heartbeat_ts;
> >> - struct tm tm;
> >> -
> >> - if (!seconds)
> >> - return;
> >> -
> >> - time64_to_tm(seconds, 0, &tm);
> >> -
> >> - snprintf(time_str, size, "%ld-%02d-%02d %02d:%02d:%02d (UTC)",
> >> - tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
> >> -}
> >> -
> >> static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
> >> {
> >> struct eq_heartbeat_debug_info *heartbeat_debug_info = &hdev->heartbeat_debug_info;
> >> u32 cpu_q_id = heartbeat_debug_info->cpu_queue_id, pq_pi_mask = (HL_QUEUE_LENGTH << 1) - 1;
> >> struct asic_fixed_properties *prop = &hdev->asic_prop;
> >> - char pq_time_str[64] = "N/A", eq_time_str[64] = "N/A";
> >>
> >> if (!prop->cpucp_info.eq_health_check_supported)
> >> return true;
> >> @@ -1095,17 +1078,15 @@ static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
> >> if (!hdev->eq_heartbeat_received) {
> >> dev_err(hdev->dev, "EQ heartbeat event was not received!\n");
> >>
> >> - stringify_time_of_last_heartbeat(hdev, pq_time_str, sizeof(pq_time_str), true);
> >> - stringify_time_of_last_heartbeat(hdev, eq_time_str, sizeof(eq_time_str), false);
> >> dev_err(hdev->dev,
> >> - "EQ: {CI %u, HB counter %u, last HB time: %s}, PQ: {PI: %u, CI: %u (%u), last HB time: %s}\n",
> >> + "EQ: {CI %u, HB counter %u, last HB time: %ptTs}, PQ: {PI: %u, CI: %u (%u), last HB time: %ptTs}\n",
> >> hdev->event_queue.ci,
> >> heartbeat_debug_info->heartbeat_event_counter,
> >> - eq_time_str,
> >> + &hdev->heartbeat_debug_info.last_eq_heartbeat_ts,
> >> hdev->kernel_queues[cpu_q_id].pi,
> >> atomic_read(&hdev->kernel_queues[cpu_q_id].ci),
> >> atomic_read(&hdev->kernel_queues[cpu_q_id].ci) & pq_pi_mask,
> >> - pq_time_str);
> >> + &hdev->heartbeat_debug_info.last_pq_heartbeat_ts);
> >>
> >> hl_eq_dump(hdev, &hdev->event_queue);
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-03-26 9:55 ` Jani Nikula
2025-03-26 15:51 ` Andy Shevchenko
@ 2025-03-30 11:15 ` Avizrat, Yaron
2025-04-14 10:07 ` Andy Shevchenko
1 sibling, 1 reply; 9+ messages in thread
From: Avizrat, Yaron @ 2025-03-30 11:15 UTC (permalink / raw)
To: Jani Nikula, Andy Shevchenko, dri-devel, linux-kernel
Cc: Oded Gabbay, Elbaz, Koby, Sinyuk, Konstantin
On 26/03/2025 11:55, Jani Nikula wrote:
> On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>> +Cc: Jani (sorry, forgot to add you in the first place).
>>
>> Do you think it's applicable now?
> Cc: Yaron, Koby, and Konstantin who are supposed to be the new
> maintainers for accel/habanalabs.
>
>
> BR,
> Jani.
Thanks for the help, We’ll verify this change in our CI/CD pipeline and update you ASAP.
Regards,
Yaron
>
>
>
>> On Wed, Mar 05, 2025 at 01:00:25PM +0200, Andy Shevchenko wrote:
>>> Use %ptTs instead of open-coded variant to print contents of time64_t type
>>> in human readable form.
>>>
>>> This changes N/A output to 1970-01-01 00:00:00 for zero timestamps,
>>> but it's used only in the dev_err() output and won't break anything.
>>>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>> ---
>>>
>>> v3: explained the difference for N/A cases (Jani)
>>> v2: fixed the parameters to be the pointers
>>>
>>> drivers/accel/habanalabs/common/device.c | 25 +++---------------------
>>> 1 file changed, 3 insertions(+), 22 deletions(-)
>>>
>>> diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
>>> index 68eebed3b050..80fa08bf57bd 100644
>>> --- a/drivers/accel/habanalabs/common/device.c
>>> +++ b/drivers/accel/habanalabs/common/device.c
>>> @@ -1066,28 +1066,11 @@ static bool is_pci_link_healthy(struct hl_device *hdev)
>>> return (device_id == hdev->pdev->device);
>>> }
>>>
>>> -static void stringify_time_of_last_heartbeat(struct hl_device *hdev, char *time_str, size_t size,
>>> - bool is_pq_hb)
>>> -{
>>> - time64_t seconds = is_pq_hb ? hdev->heartbeat_debug_info.last_pq_heartbeat_ts
>>> - : hdev->heartbeat_debug_info.last_eq_heartbeat_ts;
>>> - struct tm tm;
>>> -
>>> - if (!seconds)
>>> - return;
>>> -
>>> - time64_to_tm(seconds, 0, &tm);
>>> -
>>> - snprintf(time_str, size, "%ld-%02d-%02d %02d:%02d:%02d (UTC)",
>>> - tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
>>> -}
>>> -
>>> static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
>>> {
>>> struct eq_heartbeat_debug_info *heartbeat_debug_info = &hdev->heartbeat_debug_info;
>>> u32 cpu_q_id = heartbeat_debug_info->cpu_queue_id, pq_pi_mask = (HL_QUEUE_LENGTH << 1) - 1;
>>> struct asic_fixed_properties *prop = &hdev->asic_prop;
>>> - char pq_time_str[64] = "N/A", eq_time_str[64] = "N/A";
>>>
>>> if (!prop->cpucp_info.eq_health_check_supported)
>>> return true;
>>> @@ -1095,17 +1078,15 @@ static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
>>> if (!hdev->eq_heartbeat_received) {
>>> dev_err(hdev->dev, "EQ heartbeat event was not received!\n");
>>>
>>> - stringify_time_of_last_heartbeat(hdev, pq_time_str, sizeof(pq_time_str), true);
>>> - stringify_time_of_last_heartbeat(hdev, eq_time_str, sizeof(eq_time_str), false);
>>> dev_err(hdev->dev,
>>> - "EQ: {CI %u, HB counter %u, last HB time: %s}, PQ: {PI: %u, CI: %u (%u), last HB time: %s}\n",
>>> + "EQ: {CI %u, HB counter %u, last HB time: %ptTs}, PQ: {PI: %u, CI: %u (%u), last HB time: %ptTs}\n",
>>> hdev->event_queue.ci,
>>> heartbeat_debug_info->heartbeat_event_counter,
>>> - eq_time_str,
>>> + &hdev->heartbeat_debug_info.last_eq_heartbeat_ts,
>>> hdev->kernel_queues[cpu_q_id].pi,
>>> atomic_read(&hdev->kernel_queues[cpu_q_id].ci),
>>> atomic_read(&hdev->kernel_queues[cpu_q_id].ci) & pq_pi_mask,
>>> - pq_time_str);
>>> + &hdev->heartbeat_debug_info.last_pq_heartbeat_ts);
>>>
>>> hl_eq_dump(hdev, &hdev->event_queue);
>>>
>>> --
>>> 2.47.2
>>>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-03-26 15:51 ` Andy Shevchenko
@ 2025-04-02 9:15 ` Avizrat, Yaron
0 siblings, 0 replies; 9+ messages in thread
From: Avizrat, Yaron @ 2025-04-02 9:15 UTC (permalink / raw)
To: Andy Shevchenko, Jani Nikula
Cc: dri-devel, linux-kernel, Oded Gabbay, Elbaz, Koby,
Sinyuk, Konstantin
On 26/03/2025 17:51, Andy Shevchenko wrote:
> On Wed, Mar 26, 2025 at 11:55:33AM +0200, Jani Nikula wrote:
>> On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>>> +Cc: Jani (sorry, forgot to add you in the first place).
>>>
>>> Do you think it's applicable now?
>> Cc: Yaron, Koby, and Konstantin who are supposed to be the new
>> maintainers for accel/habanalabs.
> Thank you!
Acked-by: Yaron Avizrat <yaron.avizrat@intel.com>
Thanks,
Yaron
>>> On Wed, Mar 05, 2025 at 01:00:25PM +0200, Andy Shevchenko wrote:
>>>> Use %ptTs instead of open-coded variant to print contents of time64_t type
>>>> in human readable form.
>>>>
>>>> This changes N/A output to 1970-01-01 00:00:00 for zero timestamps,
>>>> but it's used only in the dev_err() output and won't break anything.
>>>>
>>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>>> ---
>>>>
>>>> v3: explained the difference for N/A cases (Jani)
>>>> v2: fixed the parameters to be the pointers
>>>>
>>>> drivers/accel/habanalabs/common/device.c | 25 +++---------------------
>>>> 1 file changed, 3 insertions(+), 22 deletions(-)
>>>>
>>>> diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
>>>> index 68eebed3b050..80fa08bf57bd 100644
>>>> --- a/drivers/accel/habanalabs/common/device.c
>>>> +++ b/drivers/accel/habanalabs/common/device.c
>>>> @@ -1066,28 +1066,11 @@ static bool is_pci_link_healthy(struct hl_device *hdev)
>>>> return (device_id == hdev->pdev->device);
>>>> }
>>>>
>>>> -static void stringify_time_of_last_heartbeat(struct hl_device *hdev, char *time_str, size_t size,
>>>> - bool is_pq_hb)
>>>> -{
>>>> - time64_t seconds = is_pq_hb ? hdev->heartbeat_debug_info.last_pq_heartbeat_ts
>>>> - : hdev->heartbeat_debug_info.last_eq_heartbeat_ts;
>>>> - struct tm tm;
>>>> -
>>>> - if (!seconds)
>>>> - return;
>>>> -
>>>> - time64_to_tm(seconds, 0, &tm);
>>>> -
>>>> - snprintf(time_str, size, "%ld-%02d-%02d %02d:%02d:%02d (UTC)",
>>>> - tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
>>>> -}
>>>> -
>>>> static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
>>>> {
>>>> struct eq_heartbeat_debug_info *heartbeat_debug_info = &hdev->heartbeat_debug_info;
>>>> u32 cpu_q_id = heartbeat_debug_info->cpu_queue_id, pq_pi_mask = (HL_QUEUE_LENGTH << 1) - 1;
>>>> struct asic_fixed_properties *prop = &hdev->asic_prop;
>>>> - char pq_time_str[64] = "N/A", eq_time_str[64] = "N/A";
>>>>
>>>> if (!prop->cpucp_info.eq_health_check_supported)
>>>> return true;
>>>> @@ -1095,17 +1078,15 @@ static bool hl_device_eq_heartbeat_received(struct hl_device *hdev)
>>>> if (!hdev->eq_heartbeat_received) {
>>>> dev_err(hdev->dev, "EQ heartbeat event was not received!\n");
>>>>
>>>> - stringify_time_of_last_heartbeat(hdev, pq_time_str, sizeof(pq_time_str), true);
>>>> - stringify_time_of_last_heartbeat(hdev, eq_time_str, sizeof(eq_time_str), false);
>>>> dev_err(hdev->dev,
>>>> - "EQ: {CI %u, HB counter %u, last HB time: %s}, PQ: {PI: %u, CI: %u (%u), last HB time: %s}\n",
>>>> + "EQ: {CI %u, HB counter %u, last HB time: %ptTs}, PQ: {PI: %u, CI: %u (%u), last HB time: %ptTs}\n",
>>>> hdev->event_queue.ci,
>>>> heartbeat_debug_info->heartbeat_event_counter,
>>>> - eq_time_str,
>>>> + &hdev->heartbeat_debug_info.last_eq_heartbeat_ts,
>>>> hdev->kernel_queues[cpu_q_id].pi,
>>>> atomic_read(&hdev->kernel_queues[cpu_q_id].ci),
>>>> atomic_read(&hdev->kernel_queues[cpu_q_id].ci) & pq_pi_mask,
>>>> - pq_time_str);
>>>> + &hdev->heartbeat_debug_info.last_pq_heartbeat_ts);
>>>>
>>>> hl_eq_dump(hdev, &hdev->event_queue);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-03-30 11:15 ` Avizrat, Yaron
@ 2025-04-14 10:07 ` Andy Shevchenko
2025-04-14 16:47 ` Avizrat, Yaron
0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2025-04-14 10:07 UTC (permalink / raw)
To: Avizrat, Yaron
Cc: Jani Nikula, dri-devel, linux-kernel, Oded Gabbay, Elbaz, Koby,
Sinyuk, Konstantin
On Sun, Mar 30, 2025 at 02:15:50PM +0300, Avizrat, Yaron wrote:
>
> On 26/03/2025 11:55, Jani Nikula wrote:
> > On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >> +Cc: Jani (sorry, forgot to add you in the first place).
> >>
> >> Do you think it's applicable now?
> > Cc: Yaron, Koby, and Konstantin who are supposed to be the new
> > maintainers for accel/habanalabs.
> >
> >
> > BR,
> > Jani.
>
> Thanks for the help, We’ll verify this change in our CI/CD pipeline and update you ASAP.
What's news, please?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-04-14 10:07 ` Andy Shevchenko
@ 2025-04-14 16:47 ` Avizrat, Yaron
2025-05-02 14:16 ` Andy Shevchenko
0 siblings, 1 reply; 9+ messages in thread
From: Avizrat, Yaron @ 2025-04-14 16:47 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jani Nikula, dri-devel, linux-kernel, Oded Gabbay, Elbaz, Koby,
Sinyuk, Konstantin
On 14/04/2025 13:07, Andy Shevchenko wrote:
> On Sun, Mar 30, 2025 at 02:15:50PM +0300, Avizrat, Yaron wrote:
>> On 26/03/2025 11:55, Jani Nikula wrote:
>>> On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>>>> +Cc: Jani (sorry, forgot to add you in the first place).
>>>>
>>>> Do you think it's applicable now?
>>> Cc: Yaron, Koby, and Konstantin who are supposed to be the new
>>> maintainers for accel/habanalabs.
>>>
>>>
>>> BR,
>>> Jani.
>> Thanks for the help, We’ll verify this change in our CI/CD pipeline and update you ASAP.
> What's news, please?
Hi Andy,
Recently acked and merged into our repo. Will also push upstream later on.
Appreciate the relevant contribution!
Regards,
Yaron
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs
2025-04-14 16:47 ` Avizrat, Yaron
@ 2025-05-02 14:16 ` Andy Shevchenko
0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2025-05-02 14:16 UTC (permalink / raw)
To: Avizrat, Yaron
Cc: Jani Nikula, dri-devel, linux-kernel, Oded Gabbay, Elbaz, Koby,
Sinyuk, Konstantin
On Mon, Apr 14, 2025 at 07:47:26PM +0300, Avizrat, Yaron wrote:
> On 14/04/2025 13:07, Andy Shevchenko wrote:
> > On Sun, Mar 30, 2025 at 02:15:50PM +0300, Avizrat, Yaron wrote:
> >> On 26/03/2025 11:55, Jani Nikula wrote:
> >>> On Wed, 26 Mar 2025, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >>>> +Cc: Jani (sorry, forgot to add you in the first place).
> >>>>
> >>>> Do you think it's applicable now?
> >>> Cc: Yaron, Koby, and Konstantin who are supposed to be the new
> >>> maintainers for accel/habanalabs.
> >>>
> >> Thanks for the help, We’ll verify this change in our CI/CD pipeline and update you ASAP.
> > What's news, please?
>
> Recently acked and merged into our repo. Will also push upstream later on.
> Appreciate the relevant contribution!
I still don't see in in Linux Next.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-05-02 14:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05 11:00 [PATCH v3 1/1] accel/habanalabs: Switch to use %ptTs Andy Shevchenko
2025-03-26 9:46 ` Andy Shevchenko
2025-03-26 9:55 ` Jani Nikula
2025-03-26 15:51 ` Andy Shevchenko
2025-04-02 9:15 ` Avizrat, Yaron
2025-03-30 11:15 ` Avizrat, Yaron
2025-04-14 10:07 ` Andy Shevchenko
2025-04-14 16:47 ` Avizrat, Yaron
2025-05-02 14:16 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox