Loading drivers/soc/qcom/hab/hab.c +18 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,13 @@ long hab_vchan_send(struct uhab_context *ctx, schedule(); } /* * The ret here as 0 indicates the message was already sent out * from the hab_vchan_send()'s perspective. */ if (!ret) vchan->tx_cnt++; err: if (vchan) hab_vchan_put(vchan); Loading @@ -611,6 +618,8 @@ int hab_vchan_recv(struct uhab_context *ctx, return -ENODEV; } vchan->rx_inflight = 1; if (nonblocking_flag) { /* * Try to pull data from the ring in this context instead of Loading @@ -628,8 +637,17 @@ int hab_vchan_recv(struct uhab_context *ctx, ret = -ENODEV; else if (ret == -ERESTARTSYS) ret = -EINTR; } else if (!ret) { /* * Here, it is for sure that a message was received from the * hab_vchan_recv()'s view w/ the ret as 0 and *message as * non-zero. */ vchan->rx_cnt++; } vchan->rx_inflight = 0; hab_vchan_put(vchan); return ret; } Loading drivers/soc/qcom/hab/hab.h +5 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #ifndef __HAB_H #define __HAB_H Loading Loading @@ -341,6 +341,10 @@ struct virtual_channel { */ int closed; int forked; /* if fork is detected and assume only once */ /* stats */ uint64_t tx_cnt; /* total succeeded tx */ uint64_t rx_cnt; /* total succeeded rx */ int rx_inflight; /* rx in progress/blocking */ }; /* Loading drivers/soc/qcom/hab/hab_stat.c +6 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */ #include "hab.h" #include "hab_grantable.h" Loading Loading @@ -61,9 +61,12 @@ int hab_stat_show_vchan(struct hab_driver *driver, read_lock(&pchan->vchans_lock); list_for_each_entry(vc, &pchan->vchannels, pnode) { ret = hab_stat_buffer_print(buf, size, "%08X(%d:%d) ", vc->id, "%08X(%d:%d:%lu:%lu:%d) ", vc->id, get_refcnt(vc->refcount), vc->otherend_closed); vc->otherend_closed, (unsigned long)vc->tx_cnt, (unsigned long)vc->rx_cnt, vc->rx_inflight); } ret = hab_stat_buffer_print(buf, size, "\n"); read_unlock(&pchan->vchans_lock); Loading Loading
drivers/soc/qcom/hab/hab.c +18 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,13 @@ long hab_vchan_send(struct uhab_context *ctx, schedule(); } /* * The ret here as 0 indicates the message was already sent out * from the hab_vchan_send()'s perspective. */ if (!ret) vchan->tx_cnt++; err: if (vchan) hab_vchan_put(vchan); Loading @@ -611,6 +618,8 @@ int hab_vchan_recv(struct uhab_context *ctx, return -ENODEV; } vchan->rx_inflight = 1; if (nonblocking_flag) { /* * Try to pull data from the ring in this context instead of Loading @@ -628,8 +637,17 @@ int hab_vchan_recv(struct uhab_context *ctx, ret = -ENODEV; else if (ret == -ERESTARTSYS) ret = -EINTR; } else if (!ret) { /* * Here, it is for sure that a message was received from the * hab_vchan_recv()'s view w/ the ret as 0 and *message as * non-zero. */ vchan->rx_cnt++; } vchan->rx_inflight = 0; hab_vchan_put(vchan); return ret; } Loading
drivers/soc/qcom/hab/hab.h +5 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #ifndef __HAB_H #define __HAB_H Loading Loading @@ -341,6 +341,10 @@ struct virtual_channel { */ int closed; int forked; /* if fork is detected and assume only once */ /* stats */ uint64_t tx_cnt; /* total succeeded tx */ uint64_t rx_cnt; /* total succeeded rx */ int rx_inflight; /* rx in progress/blocking */ }; /* Loading
drivers/soc/qcom/hab/hab_stat.c +6 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */ #include "hab.h" #include "hab_grantable.h" Loading Loading @@ -61,9 +61,12 @@ int hab_stat_show_vchan(struct hab_driver *driver, read_lock(&pchan->vchans_lock); list_for_each_entry(vc, &pchan->vchannels, pnode) { ret = hab_stat_buffer_print(buf, size, "%08X(%d:%d) ", vc->id, "%08X(%d:%d:%lu:%lu:%d) ", vc->id, get_refcnt(vc->refcount), vc->otherend_closed); vc->otherend_closed, (unsigned long)vc->tx_cnt, (unsigned long)vc->rx_cnt, vc->rx_inflight); } ret = hab_stat_buffer_print(buf, size, "\n"); read_unlock(&pchan->vchans_lock); Loading