diff mbox series

[v1,2/4] remoteproc: qcom_q6v5_mss: Replace mask based tracking with size

Message ID 1594326716-15474-3-git-send-email-rishabhb@codeaurora.org
State Superseded
Headers show
Series Extend coredump functionality | expand

Commit Message

Rishabh Bhatnagar July 9, 2020, 8:31 p.m. UTC
From: Sibi Sankar <sibis@codeaurora.org>

In order to land inline coredump support for mss, the dump_segment
function would need to support granularities less than the segment
size. This is achieved by replacing mask based tracking with size.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Comments

Mathieu Poirier July 14, 2020, 5:18 p.m. UTC | #1
On Thu, Jul 09, 2020 at 01:31:54PM -0700, Rishabh Bhatnagar wrote:
> From: Sibi Sankar <sibis@codeaurora.org>
> 
> In order to land inline coredump support for mss, the dump_segment
> function would need to support granularities less than the segment
> size. This is achieved by replacing mask based tracking with size.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index feb70283b..c6ce032 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -181,8 +181,8 @@ struct q6v5 {
>  	bool running;
>  
>  	bool dump_mba_loaded;
> -	unsigned long dump_segment_mask;
> -	unsigned long dump_complete_mask;
> +	size_t current_dump_size;
> +	size_t total_dump_size;
>  
>  	phys_addr_t mba_phys;
>  	void *mba_region;
> @@ -1203,7 +1203,6 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
>  {
>  	int ret = 0;
>  	struct q6v5 *qproc = rproc->priv;
> -	unsigned long mask = BIT((unsigned long)segment->priv);
>  	int offset = segment->da - qproc->mpss_reloc;
>  	void *ptr = NULL;
>  
> @@ -1229,10 +1228,10 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
>  		memset(dest, 0xff, segment->size);
>  	}
>  
> -	qproc->dump_segment_mask |= mask;
> +	qproc->current_dump_size += segment->size;
>  
>  	/* Reclaim mba after copying segments */
> -	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
> +	if (qproc->current_dump_size == qproc->total_dump_size) {
>  		if (qproc->dump_mba_loaded) {
>  			/* Try to reset ownership back to Q6 */
>  			q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
> @@ -1274,7 +1273,7 @@ static int q6v5_start(struct rproc *rproc)
>  			"Failed to reclaim mba buffer system may become unstable\n");
>  
>  	/* Reset Dump Segment Mask */
> -	qproc->dump_segment_mask = 0;
> +	qproc->current_dump_size = 0;
>  	qproc->running = true;
>  
>  	return 0;
> @@ -1323,7 +1322,7 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  
>  	ehdr = (struct elf32_hdr *)fw->data;
>  	phdrs = (struct elf32_phdr *)(ehdr + 1);
> -	qproc->dump_complete_mask = 0;
> +	qproc->total_dump_size = 0;
>  
>  	for (i = 0; i < ehdr->e_phnum; i++) {
>  		phdr = &phdrs[i];
> @@ -1338,7 +1337,7 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  		if (ret)
>  			break;

There is also no longer a need to carry the 'i' in:

                ret = rproc_coredump_add_custom_segment(rproc, phdr->p_paddr,
                                                        phdr->p_memsz,
                                                        qcom_q6v5_dump_segment,
                                                        (void *)i);
>  
> -		qproc->dump_complete_mask |= BIT(i);
> +		qproc->total_dump_size += phdr->p_memsz;
>  	}
>  
>  	release_firmware(fw);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Sibi Sankar July 14, 2020, 6:12 p.m. UTC | #2
On 2020-07-14 22:48, Mathieu Poirier wrote:
> On Thu, Jul 09, 2020 at 01:31:54PM -0700, Rishabh Bhatnagar wrote:
>> From: Sibi Sankar <sibis@codeaurora.org>
>> 
>> In order to land inline coredump support for mss, the dump_segment
>> function would need to support granularities less than the segment
>> size. This is achieved by replacing mask based tracking with size.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
>> ---
>>  drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++--------
>>  1 file changed, 7 insertions(+), 8 deletions(-)
>> 
>> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c 
>> b/drivers/remoteproc/qcom_q6v5_mss.c
>> index feb70283b..c6ce032 100644
>> --- a/drivers/remoteproc/qcom_q6v5_mss.c
>> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
>> @@ -181,8 +181,8 @@ struct q6v5 {
>>  	bool running;
>> 
>>  	bool dump_mba_loaded;
>> -	unsigned long dump_segment_mask;
>> -	unsigned long dump_complete_mask;
>> +	size_t current_dump_size;
>> +	size_t total_dump_size;
>> 
>>  	phys_addr_t mba_phys;
>>  	void *mba_region;
>> @@ -1203,7 +1203,6 @@ static void qcom_q6v5_dump_segment(struct rproc 
>> *rproc,
>>  {
>>  	int ret = 0;
>>  	struct q6v5 *qproc = rproc->priv;
>> -	unsigned long mask = BIT((unsigned long)segment->priv);
>>  	int offset = segment->da - qproc->mpss_reloc;
>>  	void *ptr = NULL;
>> 
>> @@ -1229,10 +1228,10 @@ static void qcom_q6v5_dump_segment(struct 
>> rproc *rproc,
>>  		memset(dest, 0xff, segment->size);
>>  	}
>> 
>> -	qproc->dump_segment_mask |= mask;
>> +	qproc->current_dump_size += segment->size;
>> 
>>  	/* Reclaim mba after copying segments */
>> -	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
>> +	if (qproc->current_dump_size == qproc->total_dump_size) {
>>  		if (qproc->dump_mba_loaded) {
>>  			/* Try to reset ownership back to Q6 */
>>  			q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
>> @@ -1274,7 +1273,7 @@ static int q6v5_start(struct rproc *rproc)
>>  			"Failed to reclaim mba buffer system may become unstable\n");
>> 
>>  	/* Reset Dump Segment Mask */
>> -	qproc->dump_segment_mask = 0;
>> +	qproc->current_dump_size = 0;
>>  	qproc->running = true;
>> 
>>  	return 0;
>> @@ -1323,7 +1322,7 @@ static int 
>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>> 
>>  	ehdr = (struct elf32_hdr *)fw->data;
>>  	phdrs = (struct elf32_phdr *)(ehdr + 1);
>> -	qproc->dump_complete_mask = 0;
>> +	qproc->total_dump_size = 0;
>> 
>>  	for (i = 0; i < ehdr->e_phnum; i++) {
>>  		phdr = &phdrs[i];
>> @@ -1338,7 +1337,7 @@ static int 
>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>>  		if (ret)
>>  			break;
> 
> There is also no longer a need to carry the 'i' in:
> 
>                 ret = rproc_coredump_add_custom_segment(rproc, 
> phdr->p_paddr,
>                                                         phdr->p_memsz,
>                                                         
> qcom_q6v5_dump_segment,
>                                                         (void *)i);

Mathieu,
Thanks for the review. Will pass in
NULL instead in the next re-spin.

>> 
>> -		qproc->dump_complete_mask |= BIT(i);
>> +		qproc->total_dump_size += phdr->p_memsz;
>>  	}
>> 
>>  	release_firmware(fw);
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>>
Sibi Sankar July 16, 2020, 8:10 a.m. UTC | #3
On 2020-07-14 22:48, Mathieu Poirier wrote:
> On Thu, Jul 09, 2020 at 01:31:54PM -0700, Rishabh Bhatnagar wrote:
>> From: Sibi Sankar <sibis@codeaurora.org>
>> 
>> In order to land inline coredump support for mss, the dump_segment
>> function would need to support granularities less than the segment
>> size. This is achieved by replacing mask based tracking with size.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
>> ---
>>  drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++--------
>>  1 file changed, 7 insertions(+), 8 deletions(-)
>> 
>> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c 
>> b/drivers/remoteproc/qcom_q6v5_mss.c
>> index feb70283b..c6ce032 100644
>> --- a/drivers/remoteproc/qcom_q6v5_mss.c
>> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
>> @@ -181,8 +181,8 @@ struct q6v5 {
>>  	bool running;
>> 
>>  	bool dump_mba_loaded;
>> -	unsigned long dump_segment_mask;
>> -	unsigned long dump_complete_mask;
>> +	size_t current_dump_size;
>> +	size_t total_dump_size;
>> 
>>  	phys_addr_t mba_phys;
>>  	void *mba_region;
>> @@ -1203,7 +1203,6 @@ static void qcom_q6v5_dump_segment(struct rproc 
>> *rproc,
>>  {
>>  	int ret = 0;
>>  	struct q6v5 *qproc = rproc->priv;
>> -	unsigned long mask = BIT((unsigned long)segment->priv);
>>  	int offset = segment->da - qproc->mpss_reloc;
>>  	void *ptr = NULL;
>> 
>> @@ -1229,10 +1228,10 @@ static void qcom_q6v5_dump_segment(struct 
>> rproc *rproc,
>>  		memset(dest, 0xff, segment->size);
>>  	}
>> 
>> -	qproc->dump_segment_mask |= mask;
>> +	qproc->current_dump_size += segment->size;
>> 
>>  	/* Reclaim mba after copying segments */
>> -	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
>> +	if (qproc->current_dump_size == qproc->total_dump_size) {
>>  		if (qproc->dump_mba_loaded) {
>>  			/* Try to reset ownership back to Q6 */
>>  			q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
>> @@ -1274,7 +1273,7 @@ static int q6v5_start(struct rproc *rproc)
>>  			"Failed to reclaim mba buffer system may become unstable\n");
>> 
>>  	/* Reset Dump Segment Mask */
>> -	qproc->dump_segment_mask = 0;
>> +	qproc->current_dump_size = 0;
>>  	qproc->running = true;
>> 
>>  	return 0;
>> @@ -1323,7 +1322,7 @@ static int 
>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>> 
>>  	ehdr = (struct elf32_hdr *)fw->data;
>>  	phdrs = (struct elf32_phdr *)(ehdr + 1);
>> -	qproc->dump_complete_mask = 0;
>> +	qproc->total_dump_size = 0;
>> 
>>  	for (i = 0; i < ehdr->e_phnum; i++) {
>>  		phdr = &phdrs[i];
>> @@ -1338,7 +1337,7 @@ static int 
>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>>  		if (ret)
>>  			break;
> 
> There is also no longer a need to carry the 'i' in:
> 
>                 ret = rproc_coredump_add_custom_segment(rproc, 
> phdr->p_paddr,
>                                                         phdr->p_memsz,
>                                                         
> qcom_q6v5_dump_segment,
>                                                         (void *)i);

I assume Rishabh will re-spin the
series today and this will be taken
care as well.

>> 
>> -		qproc->dump_complete_mask |= BIT(i);
>> +		qproc->total_dump_size += phdr->p_memsz;
>>  	}
>> 
>>  	release_firmware(fw);
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>>
Rishabh Bhatnagar July 16, 2020, 6:24 p.m. UTC | #4
On 2020-07-16 01:10, Sibi Sankar wrote:
> On 2020-07-14 22:48, Mathieu Poirier wrote:
>> On Thu, Jul 09, 2020 at 01:31:54PM -0700, Rishabh Bhatnagar wrote:
>>> From: Sibi Sankar <sibis@codeaurora.org>
>>> 
>>> In order to land inline coredump support for mss, the dump_segment
>>> function would need to support granularities less than the segment
>>> size. This is achieved by replacing mask based tracking with size.
>>> 
>>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>>> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
>>> ---
>>>  drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++--------
>>>  1 file changed, 7 insertions(+), 8 deletions(-)
>>> 
>>> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c 
>>> b/drivers/remoteproc/qcom_q6v5_mss.c
>>> index feb70283b..c6ce032 100644
>>> --- a/drivers/remoteproc/qcom_q6v5_mss.c
>>> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
>>> @@ -181,8 +181,8 @@ struct q6v5 {
>>>  	bool running;
>>> 
>>>  	bool dump_mba_loaded;
>>> -	unsigned long dump_segment_mask;
>>> -	unsigned long dump_complete_mask;
>>> +	size_t current_dump_size;
>>> +	size_t total_dump_size;
>>> 
>>>  	phys_addr_t mba_phys;
>>>  	void *mba_region;
>>> @@ -1203,7 +1203,6 @@ static void qcom_q6v5_dump_segment(struct rproc 
>>> *rproc,
>>>  {
>>>  	int ret = 0;
>>>  	struct q6v5 *qproc = rproc->priv;
>>> -	unsigned long mask = BIT((unsigned long)segment->priv);
>>>  	int offset = segment->da - qproc->mpss_reloc;
>>>  	void *ptr = NULL;
>>> 
>>> @@ -1229,10 +1228,10 @@ static void qcom_q6v5_dump_segment(struct 
>>> rproc *rproc,
>>>  		memset(dest, 0xff, segment->size);
>>>  	}
>>> 
>>> -	qproc->dump_segment_mask |= mask;
>>> +	qproc->current_dump_size += segment->size;
>>> 
>>>  	/* Reclaim mba after copying segments */
>>> -	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
>>> +	if (qproc->current_dump_size == qproc->total_dump_size) {
>>>  		if (qproc->dump_mba_loaded) {
>>>  			/* Try to reset ownership back to Q6 */
>>>  			q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
>>> @@ -1274,7 +1273,7 @@ static int q6v5_start(struct rproc *rproc)
>>>  			"Failed to reclaim mba buffer system may become unstable\n");
>>> 
>>>  	/* Reset Dump Segment Mask */
>>> -	qproc->dump_segment_mask = 0;
>>> +	qproc->current_dump_size = 0;
>>>  	qproc->running = true;
>>> 
>>>  	return 0;
>>> @@ -1323,7 +1322,7 @@ static int 
>>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>>> 
>>>  	ehdr = (struct elf32_hdr *)fw->data;
>>>  	phdrs = (struct elf32_phdr *)(ehdr + 1);
>>> -	qproc->dump_complete_mask = 0;
>>> +	qproc->total_dump_size = 0;
>>> 
>>>  	for (i = 0; i < ehdr->e_phnum; i++) {
>>>  		phdr = &phdrs[i];
>>> @@ -1338,7 +1337,7 @@ static int 
>>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>>>  		if (ret)
>>>  			break;
>> 
>> There is also no longer a need to carry the 'i' in:
>> 
>>                 ret = rproc_coredump_add_custom_segment(rproc, 
>> phdr->p_paddr,
>>                                                         phdr->p_memsz,
>>                                                         
>> qcom_q6v5_dump_segment,
>>                                                         (void *)i);
> 
> I assume Rishabh will re-spin the
> series today and this will be taken
> care as well.
> 
Hi Sibi,
I'll respin and add the fixes.
Thanks
>>> 
>>> -		qproc->dump_complete_mask |= BIT(i);
>>> +		qproc->total_dump_size += phdr->p_memsz;
>>>  	}
>>> 
>>>  	release_firmware(fw);
>>> --
>>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>>> Forum,
>>> a Linux Foundation Collaborative Project
>>>
Mathieu Poirier July 20, 2020, 4:57 p.m. UTC | #5
On Thu, Jul 09, 2020 at 01:31:54PM -0700, Rishabh Bhatnagar wrote:
> From: Sibi Sankar <sibis@codeaurora.org>
> 
> In order to land inline coredump support for mss, the dump_segment
> function would need to support granularities less than the segment
> size. This is achieved by replacing mask based tracking with size.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>

Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>

> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index feb70283b..c6ce032 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -181,8 +181,8 @@ struct q6v5 {
>  	bool running;
>  
>  	bool dump_mba_loaded;
> -	unsigned long dump_segment_mask;
> -	unsigned long dump_complete_mask;
> +	size_t current_dump_size;
> +	size_t total_dump_size;
>  
>  	phys_addr_t mba_phys;
>  	void *mba_region;
> @@ -1203,7 +1203,6 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
>  {
>  	int ret = 0;
>  	struct q6v5 *qproc = rproc->priv;
> -	unsigned long mask = BIT((unsigned long)segment->priv);
>  	int offset = segment->da - qproc->mpss_reloc;
>  	void *ptr = NULL;
>  
> @@ -1229,10 +1228,10 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
>  		memset(dest, 0xff, segment->size);
>  	}
>  
> -	qproc->dump_segment_mask |= mask;
> +	qproc->current_dump_size += segment->size;
>  
>  	/* Reclaim mba after copying segments */
> -	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
> +	if (qproc->current_dump_size == qproc->total_dump_size) {
>  		if (qproc->dump_mba_loaded) {
>  			/* Try to reset ownership back to Q6 */
>  			q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
> @@ -1274,7 +1273,7 @@ static int q6v5_start(struct rproc *rproc)
>  			"Failed to reclaim mba buffer system may become unstable\n");
>  
>  	/* Reset Dump Segment Mask */
> -	qproc->dump_segment_mask = 0;
> +	qproc->current_dump_size = 0;
>  	qproc->running = true;
>  
>  	return 0;
> @@ -1323,7 +1322,7 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  
>  	ehdr = (struct elf32_hdr *)fw->data;
>  	phdrs = (struct elf32_phdr *)(ehdr + 1);
> -	qproc->dump_complete_mask = 0;
> +	qproc->total_dump_size = 0;
>  
>  	for (i = 0; i < ehdr->e_phnum; i++) {
>  		phdr = &phdrs[i];
> @@ -1338,7 +1337,7 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  		if (ret)
>  			break;
>  
> -		qproc->dump_complete_mask |= BIT(i);
> +		qproc->total_dump_size += phdr->p_memsz;
>  	}
>  
>  	release_firmware(fw);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
diff mbox series

Patch

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index feb70283b..c6ce032 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -181,8 +181,8 @@  struct q6v5 {
 	bool running;
 
 	bool dump_mba_loaded;
-	unsigned long dump_segment_mask;
-	unsigned long dump_complete_mask;
+	size_t current_dump_size;
+	size_t total_dump_size;
 
 	phys_addr_t mba_phys;
 	void *mba_region;
@@ -1203,7 +1203,6 @@  static void qcom_q6v5_dump_segment(struct rproc *rproc,
 {
 	int ret = 0;
 	struct q6v5 *qproc = rproc->priv;
-	unsigned long mask = BIT((unsigned long)segment->priv);
 	int offset = segment->da - qproc->mpss_reloc;
 	void *ptr = NULL;
 
@@ -1229,10 +1228,10 @@  static void qcom_q6v5_dump_segment(struct rproc *rproc,
 		memset(dest, 0xff, segment->size);
 	}
 
-	qproc->dump_segment_mask |= mask;
+	qproc->current_dump_size += segment->size;
 
 	/* Reclaim mba after copying segments */
-	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
+	if (qproc->current_dump_size == qproc->total_dump_size) {
 		if (qproc->dump_mba_loaded) {
 			/* Try to reset ownership back to Q6 */
 			q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
@@ -1274,7 +1273,7 @@  static int q6v5_start(struct rproc *rproc)
 			"Failed to reclaim mba buffer system may become unstable\n");
 
 	/* Reset Dump Segment Mask */
-	qproc->dump_segment_mask = 0;
+	qproc->current_dump_size = 0;
 	qproc->running = true;
 
 	return 0;
@@ -1323,7 +1322,7 @@  static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 
 	ehdr = (struct elf32_hdr *)fw->data;
 	phdrs = (struct elf32_phdr *)(ehdr + 1);
-	qproc->dump_complete_mask = 0;
+	qproc->total_dump_size = 0;
 
 	for (i = 0; i < ehdr->e_phnum; i++) {
 		phdr = &phdrs[i];
@@ -1338,7 +1337,7 @@  static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 		if (ret)
 			break;
 
-		qproc->dump_complete_mask |= BIT(i);
+		qproc->total_dump_size += phdr->p_memsz;
 	}
 
 	release_firmware(fw);