All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume
@ 2019-06-14 12:35 ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 12:35 UTC (permalink / raw)
  To: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra
  Cc: Bitan Biswas

Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP
resume needs tegra_hsp_doorbell_startup() call to fix timeout error for
tegra_bpmp_transfer() during genpd resume noirq on jetson-tx2.

Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
---
 drivers/mailbox/tegra-hsp.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
index 91f1a0c..f147374 100644
--- a/drivers/mailbox/tegra-hsp.c
+++ b/drivers/mailbox/tegra-hsp.c
@@ -771,10 +771,16 @@ static int tegra_hsp_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused tegra_hsp_resume(struct device *dev)
+static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
 {
 	struct tegra_hsp *hsp = dev_get_drvdata(dev);
 	unsigned int i;
+	struct tegra_hsp_doorbell *db;
+
+	list_for_each_entry(db, &hsp->doorbells, list) {
+		if (db && db->channel.chan)
+			tegra_hsp_doorbell_startup(db->channel.chan);
+	}
 
 	for (i = 0; i < hsp->num_sm; i++) {
 		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
@@ -786,7 +792,9 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume);
+static const struct dev_pm_ops tegra_hsp_pm_ops = {
+	.resume_noirq   = tegra_hsp_noirq_resume,
+};
 
 static const struct tegra_hsp_db_map tegra186_hsp_db_map[] = {
 	{ "ccplex", TEGRA_HSP_DB_MASTER_CCPLEX, HSP_DB_CCPLEX, },
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume
@ 2019-06-14 12:35 ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 12:35 UTC (permalink / raw)
  To: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra
  Cc: Bitan Biswas

Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP
resume needs tegra_hsp_doorbell_startup() call to fix timeout error for
tegra_bpmp_transfer() during genpd resume noirq on jetson-tx2.

Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
---
 drivers/mailbox/tegra-hsp.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
index 91f1a0c..f147374 100644
--- a/drivers/mailbox/tegra-hsp.c
+++ b/drivers/mailbox/tegra-hsp.c
@@ -771,10 +771,16 @@ static int tegra_hsp_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused tegra_hsp_resume(struct device *dev)
+static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
 {
 	struct tegra_hsp *hsp = dev_get_drvdata(dev);
 	unsigned int i;
+	struct tegra_hsp_doorbell *db;
+
+	list_for_each_entry(db, &hsp->doorbells, list) {
+		if (db && db->channel.chan)
+			tegra_hsp_doorbell_startup(db->channel.chan);
+	}
 
 	for (i = 0; i < hsp->num_sm; i++) {
 		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
@@ -786,7 +792,9 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume);
+static const struct dev_pm_ops tegra_hsp_pm_ops = {
+	.resume_noirq   = tegra_hsp_noirq_resume,
+};
 
 static const struct tegra_hsp_db_map tegra186_hsp_db_map[] = {
 	{ "ccplex", TEGRA_HSP_DB_MASTER_CCPLEX, HSP_DB_CCPLEX, },
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
  2019-06-14 12:35 ` Bitan Biswas
@ 2019-06-14 12:35   ` Bitan Biswas
  -1 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 12:35 UTC (permalink / raw)
  To: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra
  Cc: Bitan Biswas

If Tegra hsp device tree does not have 'shared irqs',
mailboxes pointer is NULL. Add non-NULL HSP mailboxes
check in resume callback before tegra_hsp_mailbox_startup()
call and prevent NULL pointer exception.

Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
---
 drivers/mailbox/tegra-hsp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
index f147374..a11fb1c 100644
--- a/drivers/mailbox/tegra-hsp.c
+++ b/drivers/mailbox/tegra-hsp.c
@@ -782,11 +782,13 @@ static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
 			tegra_hsp_doorbell_startup(db->channel.chan);
 	}
 
-	for (i = 0; i < hsp->num_sm; i++) {
-		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
+	if (hsp->mailboxes) {
+		for (i = 0; i < hsp->num_sm; i++) {
+			struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
 
-		if (mb->channel.chan->cl)
-			tegra_hsp_mailbox_startup(mb->channel.chan);
+			if (mb->channel.chan->cl)
+				tegra_hsp_mailbox_startup(mb->channel.chan);
+		}
 	}
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
@ 2019-06-14 12:35   ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 12:35 UTC (permalink / raw)
  To: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra
  Cc: Bitan Biswas

If Tegra hsp device tree does not have 'shared irqs',
mailboxes pointer is NULL. Add non-NULL HSP mailboxes
check in resume callback before tegra_hsp_mailbox_startup()
call and prevent NULL pointer exception.

Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
---
 drivers/mailbox/tegra-hsp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
index f147374..a11fb1c 100644
--- a/drivers/mailbox/tegra-hsp.c
+++ b/drivers/mailbox/tegra-hsp.c
@@ -782,11 +782,13 @@ static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
 			tegra_hsp_doorbell_startup(db->channel.chan);
 	}
 
-	for (i = 0; i < hsp->num_sm; i++) {
-		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
+	if (hsp->mailboxes) {
+		for (i = 0; i < hsp->num_sm; i++) {
+			struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
 
-		if (mb->channel.chan->cl)
-			tegra_hsp_mailbox_startup(mb->channel.chan);
+			if (mb->channel.chan->cl)
+				tegra_hsp_mailbox_startup(mb->channel.chan);
+		}
 	}
 
 	return 0;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume
  2019-06-14 12:35 ` Bitan Biswas
  (?)
  (?)
@ 2019-06-14 15:50 ` Thierry Reding
  2019-06-14 16:11     ` Bitan Biswas
  -1 siblings, 1 reply; 10+ messages in thread
From: Thierry Reding @ 2019-06-14 15:50 UTC (permalink / raw)
  To: Bitan Biswas
  Cc: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

On Fri, Jun 14, 2019 at 05:35:33AM -0700, Bitan Biswas wrote:
> Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP
> resume needs tegra_hsp_doorbell_startup() call to fix timeout error for
> tegra_bpmp_transfer() during genpd resume noirq on jetson-tx2.

s/jetson-tx2/Jetson TX2/?

> 
> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
> ---
>  drivers/mailbox/tegra-hsp.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
> index 91f1a0c..f147374 100644
> --- a/drivers/mailbox/tegra-hsp.c
> +++ b/drivers/mailbox/tegra-hsp.c
> @@ -771,10 +771,16 @@ static int tegra_hsp_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int __maybe_unused tegra_hsp_resume(struct device *dev)
> +static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)

Maybe call this tegra_hsp_resume_noirq() to match the naming of the
dev_pm_ops callback?

>  {
>  	struct tegra_hsp *hsp = dev_get_drvdata(dev);
>  	unsigned int i;
> +	struct tegra_hsp_doorbell *db;
> +
> +	list_for_each_entry(db, &hsp->doorbells, list) {
> +		if (db && db->channel.chan)
> +			tegra_hsp_doorbell_startup(db->channel.chan);
> +	}
>  
>  	for (i = 0; i < hsp->num_sm; i++) {
>  		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
> @@ -786,7 +792,9 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume);
> +static const struct dev_pm_ops tegra_hsp_pm_ops = {
> +	.resume_noirq   = tegra_hsp_noirq_resume,

There seems to be two extra spaces before that =.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
  2019-06-14 12:35   ` Bitan Biswas
  (?)
@ 2019-06-14 15:52   ` Thierry Reding
  2019-06-14 16:16       ` Bitan Biswas
  -1 siblings, 1 reply; 10+ messages in thread
From: Thierry Reding @ 2019-06-14 15:52 UTC (permalink / raw)
  To: Bitan Biswas
  Cc: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

On Fri, Jun 14, 2019 at 05:35:34AM -0700, Bitan Biswas wrote:
> If Tegra hsp device tree does not have 'shared irqs',

s/hsp/HSP/, otherwise looks good.

Thierry

> mailboxes pointer is NULL. Add non-NULL HSP mailboxes
> check in resume callback before tegra_hsp_mailbox_startup()
> call and prevent NULL pointer exception.
> 
> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
> ---
>  drivers/mailbox/tegra-hsp.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
> index f147374..a11fb1c 100644
> --- a/drivers/mailbox/tegra-hsp.c
> +++ b/drivers/mailbox/tegra-hsp.c
> @@ -782,11 +782,13 @@ static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
>  			tegra_hsp_doorbell_startup(db->channel.chan);
>  	}
>  
> -	for (i = 0; i < hsp->num_sm; i++) {
> -		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
> +	if (hsp->mailboxes) {
> +		for (i = 0; i < hsp->num_sm; i++) {
> +			struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>  
> -		if (mb->channel.chan->cl)
> -			tegra_hsp_mailbox_startup(mb->channel.chan);
> +			if (mb->channel.chan->cl)
> +				tegra_hsp_mailbox_startup(mb->channel.chan);
> +		}
>  	}
>  
>  	return 0;
> -- 
> 2.7.4
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume
  2019-06-14 15:50 ` [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume Thierry Reding
@ 2019-06-14 16:11     ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 16:11 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra



On 6/14/19 8:50 AM, Thierry Reding wrote:
> On Fri, Jun 14, 2019 at 05:35:33AM -0700, Bitan Biswas wrote:
>> Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP
>> resume needs tegra_hsp_doorbell_startup() call to fix timeout error for
>> tegra_bpmp_transfer() during genpd resume noirq on jetson-tx2.
> 
> s/jetson-tx2/Jetson TX2/?
I shall replace the string "jetson-tx2" in commit description with 
"Jetson TX2".

> 
>>
>> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
>> ---
>>   drivers/mailbox/tegra-hsp.c | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
>> index 91f1a0c..f147374 100644
>> --- a/drivers/mailbox/tegra-hsp.c
>> +++ b/drivers/mailbox/tegra-hsp.c
>> @@ -771,10 +771,16 @@ static int tegra_hsp_probe(struct platform_device *pdev)
>>   	return 0;
>>   }
>>   
>> -static int __maybe_unused tegra_hsp_resume(struct device *dev)
>> +static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
> 
> Maybe call this tegra_hsp_resume_noirq() to match the naming of the
> dev_pm_ops callback?
I shall rename tegra_hsp_noirq_resume back to tegra_hsp_resume.

> 
>>   {
>>   	struct tegra_hsp *hsp = dev_get_drvdata(dev);
>>   	unsigned int i;
>> +	struct tegra_hsp_doorbell *db;
>> +
>> +	list_for_each_entry(db, &hsp->doorbells, list) {
>> +		if (db && db->channel.chan)
>> +			tegra_hsp_doorbell_startup(db->channel.chan);
>> +	}
>>   
>>   	for (i = 0; i < hsp->num_sm; i++) {
>>   		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>> @@ -786,7 +792,9 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev)
>>   	return 0;
>>   }
>>   
>> -static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume);
>> +static const struct dev_pm_ops tegra_hsp_pm_ops = {
>> +	.resume_noirq   = tegra_hsp_noirq_resume,
> 
> There seems to be two extra spaces before that =.
Missed extra spaces. Shall fix.

-Thanks,
  Bitan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume
@ 2019-06-14 16:11     ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 16:11 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra



On 6/14/19 8:50 AM, Thierry Reding wrote:
> On Fri, Jun 14, 2019 at 05:35:33AM -0700, Bitan Biswas wrote:
>> Add noirq resume instead of resume callback for Tegra HSP. Tegra HSP
>> resume needs tegra_hsp_doorbell_startup() call to fix timeout error for
>> tegra_bpmp_transfer() during genpd resume noirq on jetson-tx2.
> 
> s/jetson-tx2/Jetson TX2/?
I shall replace the string "jetson-tx2" in commit description with 
"Jetson TX2".

> 
>>
>> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
>> ---
>>   drivers/mailbox/tegra-hsp.c | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
>> index 91f1a0c..f147374 100644
>> --- a/drivers/mailbox/tegra-hsp.c
>> +++ b/drivers/mailbox/tegra-hsp.c
>> @@ -771,10 +771,16 @@ static int tegra_hsp_probe(struct platform_device *pdev)
>>   	return 0;
>>   }
>>   
>> -static int __maybe_unused tegra_hsp_resume(struct device *dev)
>> +static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
> 
> Maybe call this tegra_hsp_resume_noirq() to match the naming of the
> dev_pm_ops callback?
I shall rename tegra_hsp_noirq_resume back to tegra_hsp_resume.

> 
>>   {
>>   	struct tegra_hsp *hsp = dev_get_drvdata(dev);
>>   	unsigned int i;
>> +	struct tegra_hsp_doorbell *db;
>> +
>> +	list_for_each_entry(db, &hsp->doorbells, list) {
>> +		if (db && db->channel.chan)
>> +			tegra_hsp_doorbell_startup(db->channel.chan);
>> +	}
>>   
>>   	for (i = 0; i < hsp->num_sm; i++) {
>>   		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>> @@ -786,7 +792,9 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev)
>>   	return 0;
>>   }
>>   
>> -static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume);
>> +static const struct dev_pm_ops tegra_hsp_pm_ops = {
>> +	.resume_noirq   = tegra_hsp_noirq_resume,
> 
> There seems to be two extra spaces before that =.
Missed extra spaces. Shall fix.

-Thanks,
  Bitan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
  2019-06-14 15:52   ` Thierry Reding
@ 2019-06-14 16:16       ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 16:16 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra



On 6/14/19 8:52 AM, Thierry Reding wrote:
> On Fri, Jun 14, 2019 at 05:35:34AM -0700, Bitan Biswas wrote:
>> If Tegra hsp device tree does not have 'shared irqs',
> 
> s/hsp/HSP/, otherwise looks good.
Shall correct.

> 
> Thierry
> 
>> mailboxes pointer is NULL. Add non-NULL HSP mailboxes
>> check in resume callback before tegra_hsp_mailbox_startup()
>> call and prevent NULL pointer exception.
>>
>> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
>> ---
>>   drivers/mailbox/tegra-hsp.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
>> index f147374..a11fb1c 100644
>> --- a/drivers/mailbox/tegra-hsp.c
>> +++ b/drivers/mailbox/tegra-hsp.c
>> @@ -782,11 +782,13 @@ static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
>>   			tegra_hsp_doorbell_startup(db->channel.chan);
>>   	}
>>   
>> -	for (i = 0; i < hsp->num_sm; i++) {
>> -		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>> +	if (hsp->mailboxes) {
>> +		for (i = 0; i < hsp->num_sm; i++) {
>> +			struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>>   
>> -		if (mb->channel.chan->cl)
>> -			tegra_hsp_mailbox_startup(mb->channel.chan);
>> +			if (mb->channel.chan->cl)
>> +				tegra_hsp_mailbox_startup(mb->channel.chan);
>> +		}
>>   	}
>>   
>>   	return 0;
>> -- 
>> 2.7.4

-Thanks,
  Bitan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
@ 2019-06-14 16:16       ` Bitan Biswas
  0 siblings, 0 replies; 10+ messages in thread
From: Bitan Biswas @ 2019-06-14 16:16 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jassi Brar, Thierry Reding, Jonathan Hunter, linux-kernel, linux-tegra



On 6/14/19 8:52 AM, Thierry Reding wrote:
> On Fri, Jun 14, 2019 at 05:35:34AM -0700, Bitan Biswas wrote:
>> If Tegra hsp device tree does not have 'shared irqs',
> 
> s/hsp/HSP/, otherwise looks good.
Shall correct.

> 
> Thierry
> 
>> mailboxes pointer is NULL. Add non-NULL HSP mailboxes
>> check in resume callback before tegra_hsp_mailbox_startup()
>> call and prevent NULL pointer exception.
>>
>> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
>> ---
>>   drivers/mailbox/tegra-hsp.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
>> index f147374..a11fb1c 100644
>> --- a/drivers/mailbox/tegra-hsp.c
>> +++ b/drivers/mailbox/tegra-hsp.c
>> @@ -782,11 +782,13 @@ static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
>>   			tegra_hsp_doorbell_startup(db->channel.chan);
>>   	}
>>   
>> -	for (i = 0; i < hsp->num_sm; i++) {
>> -		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>> +	if (hsp->mailboxes) {
>> +		for (i = 0; i < hsp->num_sm; i++) {
>> +			struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>>   
>> -		if (mb->channel.chan->cl)
>> -			tegra_hsp_mailbox_startup(mb->channel.chan);
>> +			if (mb->channel.chan->cl)
>> +				tegra_hsp_mailbox_startup(mb->channel.chan);
>> +		}
>>   	}
>>   
>>   	return 0;
>> -- 
>> 2.7.4

-Thanks,
  Bitan

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-06-14 16:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 12:35 [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume Bitan Biswas
2019-06-14 12:35 ` Bitan Biswas
2019-06-14 12:35 ` [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes Bitan Biswas
2019-06-14 12:35   ` Bitan Biswas
2019-06-14 15:52   ` Thierry Reding
2019-06-14 16:16     ` Bitan Biswas
2019-06-14 16:16       ` Bitan Biswas
2019-06-14 15:50 ` [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume Thierry Reding
2019-06-14 16:11   ` Bitan Biswas
2019-06-14 16:11     ` Bitan Biswas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.