All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: Abort capability probe on invalid capability
@ 2017-10-18 18:07 Ughreja, Rakesh A
  0 siblings, 0 replies; 5+ messages in thread
From: Ughreja, Rakesh A @ 2017-10-18 18:07 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, vinod.koul, Rakesh Ughreja

From: Rakesh Ughreja <rakesh.a.ughreja@intel.com>

When an invalid capability is discovered, stop traversing
the capability link list further.

print the invalid capability error and set it to zero

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
---
 sound/hda/hdac_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index 978dc18..8f7d0d9 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
+			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+			cur_cap = 0;
 			break;
 		}
 
-- 
2.7.4

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

* [PATCH] ALSA: hda: Abort capability probe on invalid capability
@ 2017-10-18 17:59 Ughreja, Rakesh A
  2017-10-18 10:19 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Ughreja, Rakesh A @ 2017-10-18 17:59 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, vinod.koul, Rakesh Ughreja

From: Rakesh Ughreja <rakesh.a.ughreja@intel.com>

When an invalid capability is discovered, stop traversing
the capability link list further.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
---
 sound/hda/hdac_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index 978dc18..4fa0cc0 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
+			cur_cap = 0;
+			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
 			break;
 		}
 
-- 
2.7.4

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

* Re: [PATCH] ALSA: hda: Abort capability probe on invalid capability
  2017-10-18 10:29   ` Ughreja, Rakesh A
@ 2017-10-18 10:45     ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2017-10-18 10:45 UTC (permalink / raw)
  To: Ughreja, Rakesh A; +Cc: Koul, Vinod, alsa-devel

On Wed, 18 Oct 2017 12:29:14 +0200,
Ughreja, Rakesh A wrote:
> 
> 
> 
> >-----Original Message-----
> >From: Takashi Iwai [mailto:tiwai@suse.de]
> >Sent: Wednesday, October 18, 2017 3:50 PM
> >To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>
> >Cc: alsa-devel@alsa-project.org; Koul, Vinod <vinod.koul@intel.com>
> >Subject: Re: [PATCH] ALSA: hda: Abort capability probe on invalid capability
> >
> >On Wed, 18 Oct 2017 19:59:36 +0200,
> >Ughreja, Rakesh A wrote:
> >>
> >> From: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
> >>
> >> When an invalid capability is discovered, stop traversing
> >> the capability link list further.
> >
> >Could you give more background, especially *why* we change that?
> >It's almost clear what the patch does by looking at the change, but
> >it's not clear why it is needed.
> 
> Is the following description in patch okay for you ?
> 
> Due to bugs in BIOS it's possible that the HDA capability link list is 
> not constructed properly. This may lead to driver going into unknown
> state. So whenever driver discovers unknown HDA capability, 
> log it as error and stop traversing the link list further.

Yes, looks good.


thanks,

Takashi

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

* Re: [PATCH] ALSA: hda: Abort capability probe on invalid capability
  2017-10-18 10:19 ` Takashi Iwai
@ 2017-10-18 10:29   ` Ughreja, Rakesh A
  2017-10-18 10:45     ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Ughreja, Rakesh A @ 2017-10-18 10:29 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Koul, Vinod, alsa-devel



>-----Original Message-----
>From: Takashi Iwai [mailto:tiwai@suse.de]
>Sent: Wednesday, October 18, 2017 3:50 PM
>To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>
>Cc: alsa-devel@alsa-project.org; Koul, Vinod <vinod.koul@intel.com>
>Subject: Re: [PATCH] ALSA: hda: Abort capability probe on invalid capability
>
>On Wed, 18 Oct 2017 19:59:36 +0200,
>Ughreja, Rakesh A wrote:
>>
>> From: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
>>
>> When an invalid capability is discovered, stop traversing
>> the capability link list further.
>
>Could you give more background, especially *why* we change that?
>It's almost clear what the patch does by looking at the change, but
>it's not clear why it is needed.

Is the following description in patch okay for you ?

Due to bugs in BIOS it's possible that the HDA capability link list is 
not constructed properly. This may lead to driver going into unknown
state. So whenever driver discovers unknown HDA capability, 
log it as error and stop traversing the link list further.

Regards,
Rakesh
 

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

* Re: [PATCH] ALSA: hda: Abort capability probe on invalid capability
  2017-10-18 17:59 Ughreja, Rakesh A
@ 2017-10-18 10:19 ` Takashi Iwai
  2017-10-18 10:29   ` Ughreja, Rakesh A
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2017-10-18 10:19 UTC (permalink / raw)
  To: Ughreja, Rakesh A; +Cc: vinod.koul, alsa-devel

On Wed, 18 Oct 2017 19:59:36 +0200,
Ughreja, Rakesh A wrote:
> 
> From: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
> 
> When an invalid capability is discovered, stop traversing
> the capability link list further.

Could you give more background, especially *why* we change that?
It's almost clear what the patch does by looking at the change, but
it's not clear why it is needed.


thanks,

Takashi


> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
> ---
>  sound/hda/hdac_controller.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
> index 978dc18..4fa0cc0 100644
> --- a/sound/hda/hdac_controller.c
> +++ b/sound/hda/hdac_controller.c
> @@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
>  			break;
>  
>  		default:
> -			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
> +			cur_cap = 0;
> +			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
>  			break;
>  		}
>  
> -- 
> 2.7.4
> 

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

end of thread, other threads:[~2017-10-18 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 18:07 [PATCH] ALSA: hda: Abort capability probe on invalid capability Ughreja, Rakesh A
  -- strict thread matches above, loose matches on Subject: below --
2017-10-18 17:59 Ughreja, Rakesh A
2017-10-18 10:19 ` Takashi Iwai
2017-10-18 10:29   ` Ughreja, Rakesh A
2017-10-18 10:45     ` Takashi Iwai

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.