On Wed, 13 Apr 2016 16:53:59 +0200, Hyungwon Hwang wrote:
2016년 04월 13일 16:33에 Takashi Iwai 이(가) 쓴 글:
On Wed, 13 Apr 2016 02:27:39 +0200, Hyungwon Hwang wrote:
pin_eld is a temporary structure. So before calling update_eld(), eld should be updated from pin_eld.
Signed-off-by: Hyungwon Hwang hyungwon.hwang7@gmail.com
It's not clear what you're trying to solve only by the description above alone. It's about the inconsistent "monitor present" appearance in eld proc file, right? You need to write "why your patch is necessary" in your patch description.
Now back to the code change:
sound/pci/hda/patch_hdmi.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 5af372d..9de114d 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1414,6 +1414,8 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
mutex_lock(&per_pin->lock); pin_eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);
- eld->monitor_present = pin_eld->monitor_present;
- if (pin_eld->monitor_present) eld->eld_valid = !!(present & AC_PINSENSE_ELDV); else
OK, this would work, but the fundamental problem is that pin_eld is modified in this function. This used to work in the past casually due to a bug, but I plugged it in the commit bd48128539ab ALSA: hda - Fix forgotten HDMI monitor_present update but overlooked the regression in non-component side. My bad.
So, the real fix is to replace the all pin_eld with eld in this function. The untested patch is below. Could you check whether this works for you?
Your code works well in my case, and seems more reasonable even to me. Thanks for your review and work.
OK, I resubmit your and my patches with slightly more comments, then apply them to for-linus branch.
thanks,
Takashi