i915_component.h has wrong prototype for function pin_eld_notify causing HDMI audio driver build problems

Bug #1755309 reported by Ubfan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-lts-xenial (Ubuntu)
New
Undecided
Unassigned

Bug Description

With kernel 4.4, HDMI audio code, e.g. intel_audio.c, cannot build because of the compiler error of a wrong number of arguments for function pin_eld_notify.
The Ubuntu kernel headers for the kernel 4.4 series have a file, .../drm/i915_component.h which contains a wrong prototype for function pin_eld_notify -- an extra argument, "pipe" which should not be present until the 4.10 kernel headers. The site bootlin shows the header without the extra argument for the kernels 4.4-4.9, only appearing in the 4.10 kernel code.
 https://elixir.bootlin.com/linux/v4.4.121/source/include/drm/i915_component.h
From i915_comnponent.h
...
struct i915_audio_component_audio_ops {
 /**
  * @audio_ptr: Pointer to be used in call to pin_eld_notify
  */
 void *audio_ptr;
 /**
  * @pin_eld_notify: Notify the HDA driver that pin sense and/or ELD information has changed
  *
  * Called when the i915 driver has set up audio pipeline or has just
  * begun to tear it down. This allows the HDA driver to update its
  * status accordingly (even when the HDA controller is in power save
  * mode).
  */
 void (*pin_eld_notify)(void *audio_ptr, int port, int pipe);
/* =====================================================^^^^^^^^^^ BAD CODE
};

Remove the ",int pipe", and the HDMI audio driver code using intel_audio.c may be built with the 4.4 kernel. This header fix is needed for the Intel Compute Stick STK1A8LFC running Ubuntu 14.04 when upgraded to the 4.4 kernel.

Revision history for this message
Ubfan (ubfan1) wrote :

The comment on the pin_eld_notify got fixed (sometime before 4.4.0-130), removing the pipe reference, and enumerating the two valid arguments, but the actual "pipe" argument was left.

===Partial fix of just comments from 4.4.0-130 packages ===
struct i915_audio_component_audio_ops {
 void *audio_ptr;
 /**
  * Call from i915 driver, notifying the HDA driver that
  * pin sense and/or ELD information has changed.
  * @audio_ptr: HDA driver object
  * @port: Which port has changed (PORTA / PORTB / PORTC etc)
  */
 void (*pin_eld_notify)(void *audio_ptr, int port, int pipe);
};

Revision history for this message
Ubfan (ubfan1) wrote :

Someone grabbed a release candidate for this file, and didn't notice it had changed before the final.
Look at the kernel source in https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/drm/i915_component.h?h=v4.4.172 for what the original file should be. The pipe argument did not appear again until 5 or 6 kernel releases later. Please fix this before the end-of-support date in April 2019. This error killed the HDMI audio for the Intel Compute Stick STCK1A8LFC when the Intel supplied 4.4 kernel update script is run.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.