]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
7 years agoALSA: x86: Create ELD control element
Takashi Iwai [Thu, 2 Feb 2017 15:38:39 +0000 (16:38 +0100)]
ALSA: x86: Create ELD control element

Like other drivers, expose the ELD bytes via a control element so that
user-space can parse it.

For the simplicity, the code to register the ctl elements is
refactored using an array.  Also, since ELD ctl read copies the bytes
also during disconnection, clear the ELD bytes at hot-unplug, in order
to avoid the leak of the previous bogus ELD.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Clean up unused defines and inclusions
Takashi Iwai [Thu, 2 Feb 2017 15:19:03 +0000 (16:19 +0100)]
ALSA: x86: Clean up unused defines and inclusions

Many defines and constants are left unused.  Clean them up.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Reduce redundant register field names
Takashi Iwai [Thu, 2 Feb 2017 14:58:35 +0000 (15:58 +0100)]
ALSA: x86: Reduce redundant register field names

Currently each register definition contains the own prefix in the
union struct itself; for example, union aud_ch_status_0 has
status_0_regx and status_0_regval fields.  These are simply
superfluous, since usually the type of the variable is seen in its
declaration or in its name.

In this patch, we cut off these prefixes.  Now all register
definitions have regx and regval fields consistently, instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Use the standard ELD bytes definitions
Takashi Iwai [Thu, 2 Feb 2017 14:37:11 +0000 (15:37 +0100)]
ALSA: x86: Use the standard ELD bytes definitions

We have some constants defined in drm/drm_edid.h, and clean up our own
definitions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Move stream status into pcm_stream_info
Takashi Iwai [Thu, 2 Feb 2017 13:57:22 +0000 (14:57 +0100)]
ALSA: x86: Move stream status into pcm_stream_info

The only remaining field in struct had_stream_data is stream_type that
holds the current stream status.  Such information fits better in
struct pcm_stream_info, so move it as a boolean "running" field to be
clearer.

This allows us to get rid or had_stream_data definition and
references.

Also, the superfluous status check get removed in a couple of places
where we can call PCM helpers in anyway.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Implement runtime PM
Takashi Iwai [Thu, 2 Feb 2017 13:43:39 +0000 (14:43 +0100)]
ALSA: x86: Implement runtime PM

Although the driver has some PM callbacks, it doesn't do it right:
- the suspend callback doesn't handle to suspend the running PCM,
- the runtime PM ops are missing,
- pm_runtime_get_sync() isn't used at the right place.

This patch covers the above and provides the basic runtime PM
functionality.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Properly manage PCM substream lifetype
Takashi Iwai [Thu, 2 Feb 2017 12:00:12 +0000 (13:00 +0100)]
ALSA: x86: Properly manage PCM substream lifetype

The PCM substream is referred not only in the PCM callbacks but also
in the irq handler and in the hotplug/unplug codes.  The latter code
paths don't take the PCM lock, thus the PCM may be released
unexpectedly while calling PCM helper functions or accessing
pcm->runtime fields.

This patch implements a simple refcount to assure the PCM substream
accessibility while the other codes are accessing.  It needed some
code refactoring in the relevant functions for avoiding the doubly
spinlocks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop unused fields from pcm_stream_info
Takashi Iwai [Wed, 1 Feb 2017 21:25:58 +0000 (22:25 +0100)]
ALSA: x86: Drop unused fields from pcm_stream_info

The struct pcm_stream_info contains a few unused or useless fields.
str_id is always zero, buffer_ptr is volatile, never read, and sfreq
is nowhere referred.  Kill them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop redundant had_stream_pvt
Takashi Iwai [Wed, 1 Feb 2017 21:03:26 +0000 (22:03 +0100)]
ALSA: x86: Drop redundant had_stream_pvt

The had_stream_pvt struct assigned to PCM runtime private data tracks
merely the stream running status, and the very same information is
carried by had_stream->stream_type.  Kill it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop superfluous state field
Takashi Iwai [Wed, 1 Feb 2017 16:53:19 +0000 (17:53 +0100)]
ALSA: x86: Drop superfluous state field

The state field keeps the connection state and it's basically as same
as drv_status field.  Drop this redundancy.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop flag_underrun field
Takashi Iwai [Wed, 1 Feb 2017 16:37:36 +0000 (17:37 +0100)]
ALSA: x86: Drop flag_underrun field

The flag_underrun flag is used to indicate to escalate the XRUN
reporting at the next position inquiry, but there is a much simpler
method to achieve it: just call snd_pcm_stop_xrun().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Fix racy access to chmap
Takashi Iwai [Wed, 1 Feb 2017 16:24:02 +0000 (17:24 +0100)]
ALSA: x86: Fix racy access to chmap

The access to chmap can be racy against the hotplug process, where it
recreates the chmap on the fly.  For protecting against it, a mutex is
introduced in this patch.  It's also used for protecting the change /
reference of eld and state fields, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Remove superfluous irqsave flags
Takashi Iwai [Wed, 1 Feb 2017 16:18:20 +0000 (17:18 +0100)]
ALSA: x86: Remove superfluous irqsave flags

We don't need to use irqsave/irqrestore versions for each spin lock,
but judge the context properly and use the simpler versions.

Also add some (still simplistic) comments to functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Constfy tables
Takashi Iwai [Wed, 1 Feb 2017 15:45:38 +0000 (16:45 +0100)]
ALSA: x86: Constfy tables

Some tables can be defined as const.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Remove _v[12] suffices
Takashi Iwai [Tue, 31 Jan 2017 17:14:15 +0000 (18:14 +0100)]
ALSA: x86: Remove _v[12] suffices

Although we dropped the most of the obsoleted *_v1 definitions and
codes, some codes still keep the _v1 or _v2 suffices.  Now they are
ripped off.

The only thing to be done carefully here is the definition of control
offsets.  The original code defines enum hdmi_ctrl_reg_offset_v1 and
a few new elements just for v2 on its top.  After this cleanup, we
remove the old AUD_HDMI_STATUS and AUD_HDMIW_INFOFR definitions and
replace with the v2 values.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Tidy up codes
Takashi Iwai [Tue, 31 Jan 2017 16:09:13 +0000 (17:09 +0100)]
ALSA: x86: Tidy up codes

Clean up codes, fix indentations, correct comments, etc.
No functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop had_get_hwstate()
Takashi Iwai [Tue, 31 Jan 2017 15:46:44 +0000 (16:46 +0100)]
ALSA: x86: Drop had_get_hwstate()

The helper function isn't clearer than the plain condition check
"if (drv_status == HDA_DRV_DISCONNECTED)".  By expanding this, the
compiler could even catch the possible uninitialized cases, so we
could fix them, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Remove superfluous check at resume
Takashi Iwai [Tue, 31 Jan 2017 15:38:22 +0000 (16:38 +0100)]
ALSA: x86: Remove superfluous check at resume

The had_get_hwstate() is identical with drv_status==DISCONECTED, which
was already checked before the call.  And, returning an error at
resume is simply bad.  That is, we should just kill this check.

Also, spewing an error at resume for drv_status!=SUSPENDED is also
annoying, as this is the normal case when the suspend was called
without the monitor connection.  Make it debug, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Fix sleep-in-atomic via i915 notification
Takashi Iwai [Tue, 31 Jan 2017 15:26:10 +0000 (16:26 +0100)]
ALSA: x86: Fix sleep-in-atomic via i915 notification

i915 notification is executed in a spinlock, thus it must not sleep;
i.e. we can't use kmalloc with GFP_KERNEL or such.

For making it working properly, move the notification handler in a
work, and handle it gracefully.  We have already such a work, and it
was used just at the start.  This can be re-used in a more generic
hotplug handling.

Also, the patch adds the proper call of cancel_work_sync() to the
destructor.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop superfluous PCM private_free
Takashi Iwai [Tue, 31 Jan 2017 15:17:14 +0000 (16:17 +0100)]
ALSA: x86: Drop superfluous PCM private_free

snd_pcm_lib_preallocate_free_for_all() doesn't have to be called from
each driver as it's called in the PCM core.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop unused fields from snd_intelhad struct
Takashi Iwai [Tue, 31 Jan 2017 15:11:27 +0000 (16:11 +0100)]
ALSA: x86: Drop unused fields from snd_intelhad struct

Also change the flag_underrun to bool to be clearer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Remove indirect call of snd_pcm_period_elapsed()
Takashi Iwai [Tue, 31 Jan 2017 15:04:10 +0000 (16:04 +0100)]
ALSA: x86: Remove indirect call of snd_pcm_period_elapsed()

Again another indirect call...  Let's straighten it up.
Also define the had_stream field with a proper type instead of a void
pointer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Fix for CONFIG_PM=n
Takashi Iwai [Wed, 1 Feb 2017 16:27:48 +0000 (17:27 +0100)]
ALSA: x86: Fix for CONFIG_PM=n

The direct access to power.runtime_status is taboo, let's use a helper
macro to avoid the compile error with CONFIG_PM=n.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Replace pr_xxx() with dev_xxx()
Takashi Iwai [Tue, 31 Jan 2017 14:49:15 +0000 (15:49 +0100)]
ALSA: x86: Replace pr_xxx() with dev_xxx()

dev_xxx() helpers give a tidier output in general.

While we're at it, remove many useless debug prints (e.g. the ones at
each function entry), replace some too verbose errors with debugs, and
use WARN_ON() for some serious errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Fold intel_hdmi_audio_if.c into main file
Takashi Iwai [Tue, 31 Jan 2017 12:57:58 +0000 (13:57 +0100)]
ALSA: x86: Fold intel_hdmi_audio_if.c into main file

As the very last step, we fold intel_hdmi_audio_if.c into the main
file, intel_hdmi_audio.c.  This is merely a cleanup, and no functional
change.

By this move, we can mark all functions and variables as static, which
allows the compiler more optimizations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Flatten two abstraction layers
Takashi Iwai [Tue, 31 Jan 2017 12:52:22 +0000 (13:52 +0100)]
ALSA: x86: Flatten two abstraction layers

This is the final stage for a big clean-up series.  Here we flatten
the two layers into one.  Formerly, the implementation was split to
HDMI "shell" that talks with the platform device, and HDMI audio part
that communicates via caps and other event handlers.  All these would
be good if there were multiple instantiations or if there were data
protection.  But neither are true in our case.  That said, it'll be
easier to have a flat driver structure in the end.

In this patch, the former struct hdmi_lpe_audio_ctx is forged into the
existing struct snd_intelhad.  The latter has already a few members
that are basically the copy from the former.  Only a few new members
for the lowlevel I/O are added by this change.

Then, the had_get_caps() and had_set_caps() are simply replaced with
the direct calls to copy the data in the struct fields.  Also, the
had_event_handler() calls are replaced with the direct call for each
event as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop unused hdmi_audio_query()
Takashi Iwai [Tue, 31 Jan 2017 10:06:34 +0000 (11:06 +0100)]
ALSA: x86: Drop unused hdmi_audio_query()

It's used nowhere.  Kill it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Call snd_card_register() at the end
Takashi Iwai [Tue, 31 Jan 2017 07:47:05 +0000 (08:47 +0100)]
ALSA: x86: Call snd_card_register() at the end

The card registration should be done at the last stage of the probe
procedure.  Otherwise user-space may access to the device before the
whole initialization is done.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Check platform_data earlier
Takashi Iwai [Tue, 31 Jan 2017 07:44:23 +0000 (08:44 +0100)]
ALSA: x86: Check platform_data earlier

Just a minor optimization; check the presence of platform_data earlier
in the probe function before actually starting allocation, which makes
the error path easier.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop superfluous CHT PCI ID check
Takashi Iwai [Tue, 31 Jan 2017 07:42:50 +0000 (08:42 +0100)]
ALSA: x86: Drop superfluous CHT PCI ID check

Since the config base offset is now set per pipe id, we don't have to
check Cherry Trail PCI IDs any longer.  Currently it's used only for
debug prints.  Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Embed snd_intelhad into snd_card
Takashi Iwai [Tue, 31 Jan 2017 07:14:34 +0000 (08:14 +0100)]
ALSA: x86: Embed snd_intelhad into snd_card

Instead of allocating snd_intelhad struct, use the card's private_data
and embed it.  It simplifies the code a lot.

While we're at it, embed had_stream into snd_intelhad struct instead
of individually allocating, and rename had_pvt_data to a bit more
specific name, had_stream_data.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Move dma_mask debug print into intel_hdmi_lpe_audio.c
Takashi Iwai [Tue, 31 Jan 2017 07:02:16 +0000 (08:02 +0100)]
ALSA: x86: Move dma_mask debug print into intel_hdmi_lpe_audio.c

It belongs to the right place.

And, remove a few sanity checks (e.g. NULL card) and debug prints as
well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop unused hw_silence field
Takashi Iwai [Tue, 31 Jan 2017 06:53:56 +0000 (07:53 +0100)]
ALSA: x86: Drop unused hw_silence field

It's nowhere used.  Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Move the global underrun_count to struct snd_intelhad
Takashi Iwai [Mon, 30 Jan 2017 17:17:44 +0000 (18:17 +0100)]
ALSA: x86: Move the global underrun_count to struct snd_intelhad

The last one is in intel_hdmi_audio.c, underrun_count: this can be
embedded in snd_intelhad object.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop global ELD copy
Takashi Iwai [Mon, 30 Jan 2017 17:15:40 +0000 (18:15 +0100)]
ALSA: x86: Drop global ELD copy

Similarly like the previous patch, drop the global variable to keep
the ELD copy.  It can be embedded in hdmi_lpe_audio_ctx as well.

And this makes easier to code, it's just a memcpy(), after all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop global hlpe_state
Takashi Iwai [Mon, 30 Jan 2017 17:11:13 +0000 (18:11 +0100)]
ALSA: x86: Drop global hlpe_state

Now it's the turn to drop the global hlpe_state variable.  It can be
gracefully embedded in hdmi_lpe_audio_ctx struct.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop the global platform device reference
Takashi Iwai [Mon, 30 Jan 2017 17:09:01 +0000 (18:09 +0100)]
ALSA: x86: Drop the global platform device reference

Instead of referring to the global hlpe_pdev variable, pass the
platform device object to each function properly.  Accessing to the
global object is really ugly and error-prone.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop unused mid_hdmi_audio_is_busy()
Takashi Iwai [Mon, 30 Jan 2017 16:44:00 +0000 (17:44 +0100)]
ALSA: x86: Drop unused mid_hdmi_audio_is_busy()

The function is nowhere used.  Kill it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Fix possible stale interrupt calls
Takashi Iwai [Mon, 30 Jan 2017 16:40:04 +0000 (17:40 +0100)]
ALSA: x86: Fix possible stale interrupt calls

Registering the irq handler at the too early place may cause a system
stall because the irq handler may be triggered before the other
initializations.  Move the irq handler registration to the later point.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Call event callback directly
Takashi Iwai [Mon, 30 Jan 2017 16:38:00 +0000 (17:38 +0100)]
ALSA: x86: Call event callback directly

Currently the driver calls the event callback stored in its ctx
pointer, but it's obviously inefficient.  Replace it with the direct
calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop useless mutex at probe
Takashi Iwai [Mon, 30 Jan 2017 16:31:29 +0000 (17:31 +0100)]
ALSA: x86: Drop useless mutex at probe

had_mutex is (supposedly) used to protect the concurrent calls of
hdmi_audio_probe().  But we may have only one device at most, so it's
utterly useless.  Drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Handle the error from hdmi_audio_probe() properly
Takashi Iwai [Tue, 31 Jan 2017 07:29:56 +0000 (08:29 +0100)]
ALSA: x86: Handle the error from hdmi_audio_probe() properly

The error from hdmi_audio_probe() wasn't handled properly, and it may
leave some resources leaked or mapped.  Fix it and also clean up the
error paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Pass snd_intelhad object to helpers
Takashi Iwai [Mon, 30 Jan 2017 16:23:39 +0000 (17:23 +0100)]
ALSA: x86: Pass snd_intelhad object to helpers

For reducing the global variable reference, keep snd_intelhad object
in the context and pass it to each helper.  It's a preliminary change
for further cleanup.

This also includes the simplification of the probe procedure: the LPE
platform driver directly gets the created snd_intelhad object by
hdmi_audio_probe(), and passes it to each helper and destructor,
hdmi_audio_remove().  The hdmi_audio_probe() function doesn't call the
back-registration any longer, which is fairly useless.  The LPE
platform driver initializes the stuff instead at the right place, and
calls the wq after the object creation in the probe function itself.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop snd_intel_had_interface indirect calls
Takashi Iwai [Mon, 30 Jan 2017 15:52:06 +0000 (16:52 +0100)]
ALSA: x86: Drop snd_intel_had_interface indirect calls

Yet another indirection is killed: at this time, it's
snd_intel_had_interface.  It contains also the name string, but it's
nowhere used, thus we can kill it, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Replace indirect query_ops with direct calls
Takashi Iwai [Mon, 30 Jan 2017 15:37:06 +0000 (16:37 +0100)]
ALSA: x86: Replace indirect query_ops with direct calls

Like the previous patch, this replaces the indirect query_ops calls
via direct function calls.  They are only get_caps and set_caps, so
fairly straightforward at this time.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Replace indirect register ops with direct calls
Takashi Iwai [Mon, 30 Jan 2017 15:29:39 +0000 (16:29 +0100)]
ALSA: x86: Replace indirect register ops with direct calls

Now about the indirect register ops: they are replaced with direct
calls, too.

The read / write / modify ops are simply replaced with the
corresponding functions.  The difference is that we calculate the
offset inside the function now.  So all the had_config_offset
references in the caller side are dropped.  This also simplifies the
DP-audio check in hdmi_audio_write() and hdmi_audio_rmw().

The hdmi_audio_get_register_base is dropped since it's no longer used
when the base address and config offset are referred in the read/write
functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Drop indirect calls of had_ops
Takashi Iwai [Mon, 30 Jan 2017 15:09:11 +0000 (16:09 +0100)]
ALSA: x86: Drop indirect calls of had_ops

We have only a single implementation of had_ops, hence there is no
merit to use the indirect calls at all.  Let's replace it with the
direct calls -- which allows the compiler more optimizations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Remove v1 ops and structs
Takashi Iwai [Mon, 30 Jan 2017 14:58:15 +0000 (15:58 +0100)]
ALSA: x86: Remove v1 ops and structs

The v1 code refers to Medfield/Clovertrail.  It's not used at all in
the current driver, and probably won't be ever.  Let's clean this up,
then we can go to the next stage of cleanup tasks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Don't set PCM state to DISCONNECTED
Takashi Iwai [Tue, 31 Jan 2017 06:30:20 +0000 (07:30 +0100)]
ALSA: x86: Don't set PCM state to DISCONNECTED

Theoretically setting the state to SNDRV_PCM_STATE_DISCONNECTED is
correct.  But, unfortunately, PA gets confused by this action, and it
won't re-probe the device after HDMI/DP is re-plugged.  (It reprobes
only when the card itself is recreated.)

As a workaround, set SNDRV_PCM_STATE_SETUP instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: Enable VLV audio chicken bit for LPE audio
Takashi Iwai [Thu, 2 Feb 2017 10:03:48 +0000 (11:03 +0100)]
drm/i915: Enable VLV audio chicken bit for LPE audio

The audio chicken bit (register offset 0x62f38) seems required to make
DP audio working on some machines.  At least, on Dell Wyse 3040, I
failed to get the audio unless this bit is set once.

Strangely, the bit seems necessary only once, and it persists after
that, even some power-off cycles.  The register is supposedly
write-only, so it's no evidence whether the bit keeps effect
persistently.  But, judging from the experiment, it looks enough to
set it up once at the device initialization.

The patch is basically a cut from the original patch by Pierre-Louis
Bossart.

v1->v2: drop read since it's a write-only reg.

Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: Pass platform device to LPE audio notifier
Takashi Iwai [Mon, 30 Jan 2017 16:56:39 +0000 (17:56 +0100)]
drm/i915: Pass platform device to LPE audio notifier

This allows the LPE HDMI driver to clean up its global variable
reference.

Also drop to pass the eld pointer because the connection status and
the ELD bytes can be retrieved from the attached pdata.

Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: Use config base depending on the pipe
Pierre-Louis Bossart [Tue, 31 Jan 2017 20:16:53 +0000 (14:16 -0600)]
ALSA: x86: Use config base depending on the pipe

Now the pipe that is being used is passed over i915 notification, we
can re-setup the relevant register offset depending on pipe assignments
during hotplug.
This allows playback on single port machines such Zotac Pi330 or
dual-port machines such as Dell Wyse 3040 box

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: intel_hdmi: add definitions and logic for DP audio
Pierre-Louis Bossart [Tue, 31 Jan 2017 20:16:52 +0000 (14:16 -0600)]
ALSA: x86: intel_hdmi: add definitions and logic for DP audio

Imported from legacy patches

Note: the new code doesn't assume a modified ELD but
an explicit notification that DP is present. It appears
that the i915 code does change the ELD so we could use
the ELD-based tests to check for DP audio

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: Pass pipe to LPE audio notification
Takashi Iwai [Tue, 31 Jan 2017 20:16:51 +0000 (14:16 -0600)]
drm/i915: Pass pipe to LPE audio notification

The LPE audio configuration depends on the pipe, thus we need to pass
the currently used pipe.  It's now embedded in struct
intel_hdmi_lpe_audio_eld as well as port id.

Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: Avoid MST pipe handling for LPE audio
Takashi Iwai [Tue, 31 Jan 2017 20:16:50 +0000 (14:16 -0600)]
drm/i915: Avoid MST pipe handling for LPE audio

The pipe gets cleared to -1 for non-MST before the ELD audio
notification due to the MST audio support.  This makes sense for
HD-audio that received the MST handling, but it's useless for LPE
audio.  Handle the MST pipe hack conditionally only for HD-audio.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: add DisplayPort amp unmute for LPE audio mode
Pierre-Louis Bossart [Tue, 31 Jan 2017 20:16:49 +0000 (14:16 -0600)]
drm/i915: add DisplayPort amp unmute for LPE audio mode

Enable unmute/mute amp notification. This doesn't seem to affect
HDMI support so this is done unconditionally.

An earlier version of this patch set a chicken bit at address 0x62F38
prior to the mute/unmute but this register doesn't seem to do anything
so this phase was removed.

v1->v2: Drop needless pipe A check, avoid temporary reg offset variable.
v2->v3: Add "_" prefix to VLV_AUD_PORT_EN_X_DBG as they are internal.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: add DP support in LPE audio mode
Pierre-Louis Bossart [Tue, 31 Jan 2017 20:16:48 +0000 (14:16 -0600)]
drm/i915: add DP support in LPE audio mode

If DisplayPort is detected, pass flag and link rate to audio driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoDocumentation/gpu: Move LPE audio section after HD-audio
Takashi Iwai [Thu, 26 Jan 2017 09:50:43 +0000 (10:50 +0100)]
Documentation/gpu: Move LPE audio section after HD-audio

As Daniel suggested, it makes more sense and reduces the conflicts.

Also, while we're at it, tidy up the section title from all lower
letters.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: hdmi: fix returnvar.cocci warnings
Julia Lawall [Tue, 24 Jan 2017 16:07:48 +0000 (17:07 +0100)]
ALSA: x86: hdmi: fix returnvar.cocci warnings

Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: fix resource_size.cocci warnings
kbuild test robot [Tue, 24 Jan 2017 15:41:46 +0000 (23:41 +0800)]
ALSA: x86: fix resource_size.cocci warnings

sound/x86/intel_hdmi_lpe_audio.c:498:24-27: ERROR: Missing resource_size with res_mmio

 Use resource_size function on resource object
 instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

CC: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: hdmi: continue playback even when display resolution changes
Jerome Anand [Tue, 24 Jan 2017 22:57:53 +0000 (04:27 +0530)]
ALSA: x86: hdmi: continue playback even when display resolution changes

When the display resolution changes, the drm disables the
display pipes due to which audio rendering stops. At this
time, we need to ensure the existing audio pointers and
buffers are cleared out so that the playback can restarted
once the display pipe is enabled with a different N/CTS values

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: x86: hdmi: Add audio support for BYT and CHT
Jerome Anand [Tue, 24 Jan 2017 22:57:52 +0000 (04:27 +0530)]
ALSA: x86: hdmi: Add audio support for BYT and CHT

Hdmi audio driver based on the child platform device
created by gfx driver is implemented.
This audio driver is derived from legacy intel
hdmi audio driver.

The interfaces for interaction between gfx and audio
are updated and the driver implementation updated to
derive interrupts in its own address space based on
irq chip framework

The changes to calculate sub-period positions was triggered
by David Henningsson <david.henningsson@canonical.com> and is
accomodated in this patch

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: add Intel HDMI LPE audio driver for BYT/CHT-T
Jerome Anand [Tue, 24 Jan 2017 22:57:51 +0000 (04:27 +0530)]
ALSA: add Intel HDMI LPE audio driver for BYT/CHT-T

On Baytrail and Cherrytrail, HDaudio may be fused out or disabled
by the BIOS. This driver enables an alternate path to the i915
display registers and DMA.

Although there is no hardware path between i915 display and LPE/SST
audio clusters, this HDMI capability is referred to in the documentation
as "HDMI LPE Audio" so we keep the name for consistency. There is no
hardware path or control dependencies with the LPE/SST DSP functionality.

The hdmi-lpe-audio driver will be probed when the i915 driver creates
a child platform device.

Since this driver is neither SoC nor PCI, a new x86 folder is added
Additional indirections in the code will be cleaned up in the next series
to aid smoother DP integration

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: Add support for audio driver notifications
Jerome Anand [Tue, 24 Jan 2017 22:57:50 +0000 (04:27 +0530)]
drm/i915: Add support for audio driver notifications

Notifiations like mode change, hot plug and edid to
the audio driver are added. This is inturn used by the
audio driver for its functionality.

A new interface file capturing the notifications needed by the
audio driver is added

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agodrm/i915: setup bridge for HDMI LPE audio driver
Jerome Anand [Tue, 24 Jan 2017 22:57:49 +0000 (04:27 +0530)]
drm/i915: setup bridge for HDMI LPE audio driver

Enable support for HDMI LPE audio mode on Baytrail and
Cherrytrail when HDaudio controller is not detected

Setup minimum required resources during i915_driver_load:
1. Create a platform device to share MMIO/IRQ resources
2. Make the platform device child of i915 device for runtime PM.
3. Create IRQ chip to forward HDMI LPE audio irqs.

HDMI LPE audio driver (a standalone sound driver) probes the
LPE audio device and creates a new sound card.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoLinux 4.10-rc5 v4.10-rc5
Linus Torvalds [Sun, 22 Jan 2017 20:54:15 +0000 (12:54 -0800)]
Linux 4.10-rc5

7 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 22 Jan 2017 20:47:48 +0000 (12:47 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fix from Thomas Gleixner:
 "Restore the retrigger callbacks in the IO APIC irq chips. That
  addresses a long standing regression which got introduced with the
  rewrite of the x86 irq subsystem two years ago and went unnoticed so
  far"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/ioapic: Restore IO-APIC irq_chip retrigger callback

7 years agoMerge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 22 Jan 2017 20:45:47 +0000 (12:45 -0800)]
Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull smp/hotplug fix from Thomas Gleixner:
 "Remove an unused variable which is a leftover from the notifier
  removal"

* 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  cpu/hotplug: Remove unused but set variable in _cpu_down()

7 years agoMerge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Linus Torvalds [Sun, 22 Jan 2017 20:40:09 +0000 (12:40 -0800)]
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio/vhost fixes from Michael Tsirkin:
 "Random fixes and cleanups that accumulated over the time"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio/s390: virtio: constify virtio_config_ops structures
  virtio/s390: add missing \n to end of dev_err message
  virtio/s390: support READ_STATUS command for virtio-ccw
  tools/virtio/ringtest: tweaks for s390
  tools/virtio/ringtest: fix run-on-all.sh for offline cpus
  virtio_console: fix a crash in config_work_handler
  vhost/scsi: silence uninitialized variable warning
  vhost: scsi: constify target_core_fabric_ops structures

7 years agoMerge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Sun, 22 Jan 2017 20:36:47 +0000 (12:36 -0800)]
Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal management fixes from Zhang Rui:

 - fix a regression that thermal zone dynamically allocated sysfs
   attributes are freed before they're removed, which is introduced in
   4.10-rc1 (Jacob von Chorus)

 - fix a boot warning because deprecated hwmon API is used (Fabio
   Estevam)

 - a couple of fixes for rockchip thermal driver (Brian Norris, Caesar
   Wang)

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: rockchip: fixes the conversion table
  thermal: core: move tz->device.groups cleanup to thermal_release
  thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
  thermal: rockchip: handle set_trips without the trip points
  thermal: rockchip: optimize the conversion table
  thermal: rockchip: fixes invalid temperature case
  thermal: rockchip: don't pass table structs by value
  thermal: rockchip: improve conversion error messages

7 years agoMerge tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 22 Jan 2017 03:01:06 +0000 (19:01 -0800)]
Merge tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are a few small USB fixes for 4.10-rc5.

  Most of these are gadget/dwc2 fixes for reported issues, all of these
  have been in linux-next for a while. The last one is a single xhci
  WARN_ON removal to handle an issue that the dwc3 driver is hitting in
  the 4.10-rc tree. The warning is harmless and needs to be removed, and
  a "real" fix that is more complex will show up in 4.11-rc1 for this
  device.

  That last patch hasn't been in linux-next yet due to the weekend
  timing, but it's a "simple" WARN_ON() removal so what could go wrong?
  :)"

Famous last words.

* tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  xhci: remove WARN_ON if dma mask is not set for platform devices
  usb: dwc2: host: fix Wmaybe-uninitialized warning
  usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value
  usb: gadget: udc: atmel: remove memory leak
  usb: dwc3: exynos fix axius clock error path to do cleanup
  usb: dwc2: Avoid suspending if we're in gadget mode
  usb: dwc2: use u32 for DT binding parameters
  usb: gadget: f_fs: Fix iterations on endpoints.
  usb: dwc2: gadget: Fix DMA memory freeing
  usb: gadget: composite: Fix function used to free memory

7 years agoMerge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
Linus Torvalds [Sun, 22 Jan 2017 02:53:06 +0000 (18:53 -0800)]
Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
 "Two fixes:

   - a regression fix for the multiple-pmem-namespace-per-region support
     added in 4.9. Even if an existing environment is not using that
     feature the act of creating and a destroying a single namespace
     with the ndctl utility will lead to the proliferation of extra
     unwanted namespace devices.

   - a fix for the error code returned from the pmem driver when the
     memcpy_mcsafe() routine returns -EFAULT. Btrfs seems to be the only
     block I/O consumer that tries to parse the meaning of the error
     code when it is non-zero.

  Neither of these fixes are critical, the namespace leak is awkward in
  that it can cause device naming to change and complicates debugging
  namespace initialization issues. The error code fix is included out of
  caution for what other consumers might be expecting -EIO for block I/O
  errors"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero
  pmem: return EIO on read_pmem() failure

7 years agoMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 22 Jan 2017 02:46:45 +0000 (18:46 -0800)]
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk fix from Stephen Boyd:
 "One fix for Samsung Exynos524x SoCs where recent IOMMU patches have
  caused some of these clocks to turn off when they were always left on
  before"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk/samsung: exynos542x: mark some clocks as critical

7 years agoMerge tag 'arc-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Linus Torvalds [Sun, 22 Jan 2017 02:07:40 +0000 (18:07 -0800)]
Merge tag 'arc-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:

 - more intc updates [Yuriv]

 - fix module build when unwinder is turned off

 - IO Coherency Programming model updates

 - other miscellaneous

* tag 'arc-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: Revert "ARC: mm: IOC: Don't enable IOC by default"
  ARC: mm: split arc_cache_init to allow __init reaping of bulk
  ARCv2: IOC: Use actual memory size to setup aperture size
  ARCv2: IOC: Adhere to progamming model guidelines to avoid DMA corruption
  ARCv2: IOC: refactor the IOC and SLC operations into own functions
  ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds
  ARCv2: save r30 on kernel entry as gcc uses it for code-gen
  ARCv2: IRQ: Call entry/exit functions for chained handlers in MCIP
  ARC: IRQ: Use hwirq instead of virq in mask/unmask
  ARC: mmu: clarify the MMUv3 programming model

7 years agoMerge tag 'powerpc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
Linus Torvalds [Sun, 22 Jan 2017 01:58:45 +0000 (17:58 -0800)]
Merge tag 'powerpc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "Two fixes for fallout from the hugetlb changes we merged this cycle.

  Ten other fixes, four only affect Power9, and the rest are a bit of a
  mixture though nothing terrible.

  Thanks to: Aneesh Kumar K.V, Anton Blanchard, Benjamin Herrenschmidt,
  Dave Martin, Gavin Shan, Madhavan Srinivasan, Nicholas Piggin, Reza
  Arbab"

* tag 'powerpc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc: Ignore reserved field in DCSR and PVR reads and writes
  powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write
  powerpc/ptrace: Preserve previous fprs/vsrs on short regset write
  powerpc/perf: Use MSR to report privilege level on P9 DD1
  selftest/powerpc: Wrong PMC initialized in pmc56_overflow test
  powerpc/eeh: Enable IO path on permanent error
  powerpc/perf: Fix PM_BRU_CMPL event code for power9
  powerpc/mm: Fix little-endian 4K hugetlb
  powerpc/mm/hugetlb: Don't panic when we don't find the default huge page size
  powerpc: Fix pgtable pmd cache init
  powerpc/icp-opal: Fix missing KVM case and harden replay
  powerpc/mm: Fix memory hotplug BUG() on radix

7 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Fri, 20 Jan 2017 22:19:34 +0000 (14:19 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fixes from Radim Krčmář:
 "ARM:
   - Fix for timer setup on VHE machines
   - Drop spurious warning when the timer races against the vcpu running
     again
   - Prevent a vgic deadlock when the initialization fails (for stable)

  s390:
   - Fix a kernel memory exposure (for stable)

  x86:
   - Fix exception injection when hypercall instruction cannot be
     patched"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: s390: do not expose random data via facility bitmap
  KVM: x86: fix fixing of hypercalls
  KVM: arm/arm64: vgic: Fix deadlock on error handling
  KVM: arm64: Access CNTHCTL_EL2 bit fields correctly on VHE systems
  KVM: arm/arm64: Fix occasional warning from the timer work function

7 years agoMerge branch 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 20 Jan 2017 22:17:04 +0000 (14:17 -0800)]
Merge branch 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux

Pull SCSI target fixes from Bart Van Assche:

 - two small fixes for the ibmvscsis driver

 - ten patches with bug fixes for the target mode of the qla2xxx driver

 - four patches that avoid that the "sparse" and "smatch" static
   analyzer tools report false positives for the qla2xxx code base

* 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux:
  qla2xxx: Disable out-of-order processing by default in firmware
  qla2xxx: Fix erroneous invalid handle message
  qla2xxx: Reduce exess wait during chip reset
  qla2xxx: Terminate exchange if corrupted
  qla2xxx: Fix crash due to null pointer access
  qla2xxx: Collect additional information to debug fw dump
  qla2xxx: Reset reserved field in firmware options to 0
  qla2xxx: Set tcm_qla2xxx version to automatically track qla2xxx version
  qla2xxx: Include ATIO queue in firmware dump when in target mode
  qla2xxx: Fix wrong IOCB type assumption
  qla2xxx: Avoid that building with W=1 triggers complaints about set-but-not-used variables
  qla2xxx: Move two arrays from header files to .c files
  qla2xxx: Declare an array with file scope static
  qla2xxx: Fix indentation
  ibmvscsis: Fix sleeping in interrupt context
  ibmvscsis: Fix max transfer length

7 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 20 Jan 2017 20:28:02 +0000 (12:28 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "Just two small fixes for this -rc.

  One is just killing an unused variable from Keith, but the other
  fixes a performance regression for nbd in this series, where we
  inadvertently flipped when we set MSG_MORE when outputting data"

* 'for-linus' of git://git.kernel.dk/linux-block:
  nbd: only set MSG_MORE when we have more to send
  blk-mq: Remove unused variable

7 years agoMerge tag 'spi-fix-v4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
Linus Torvalds [Fri, 20 Jan 2017 20:25:11 +0000 (12:25 -0800)]
Merge tag 'spi-fix-v4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "The usual small smattering of driver specific fixes. A few bits that
  stand out here:

   - the R-Car patches adding fallbacks are just adding new compatible
     strings to the driver so that device trees are written in a more
     robustly future proof fashion, this isn't strictly a fix but it's
     just new IDs and it's better to get it into mainline sooner to
     improve the ABI

   - the DesignWare "switch to new API part 2" patch is actually a
     misleadingly titled fix for a bit that got missed in the original
     conversion"

* tag 'spi-fix-v4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: davinci: use dma_mapping_error()
  spi: spi-axi: Free resources on error path
  spi: pxa2xx: add missed break
  spi: dw-mid: switch to new dmaengine_terminate_* API (part 2)
  spi: dw: Make debugfs name unique between instances
  spi: sh-msiof: Do not use C++ style comment
  spi: armada-3700: Set mode bits correctly
  spi: armada-3700: fix unsigned compare than zero on irq
  spi: sh-msiof: Add R-Car Gen 2 and 3 fallback bindings
  spi: SPI_FSL_DSPI should depend on HAS_DMA

7 years agoMerge tag 'ceph-for-4.10-rc5' of git://github.com/ceph/ceph-client
Linus Torvalds [Fri, 20 Jan 2017 20:15:48 +0000 (12:15 -0800)]
Merge tag 'ceph-for-4.10-rc5' of git://github.com/ceph/ceph-client

Pull ceph fixes from Ilya Dryomov:
 "Three filesystem endianness fixes (one goes back to the 2.6 era, all
  marked for stable) and two fixups for this merge window's patches"

* tag 'ceph-for-4.10-rc5' of git://github.com/ceph/ceph-client:
  ceph: fix bad endianness handling in parse_reply_info_extra
  ceph: fix endianness bug in frag_tree_split_cmp
  ceph: fix endianness of getattr mask in ceph_d_revalidate
  libceph: make sure ceph_aes_crypt() IV is aligned
  ceph: fix ceph_get_caps() interruption

7 years agoMerge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
Linus Torvalds [Fri, 20 Jan 2017 19:58:30 +0000 (11:58 -0800)]
Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs

Pull overlayfs fix from Miklos Szeredi:
 "This fixes a regression introduced in this cycle"

* 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
  ovl: fix possible use after free on redirect dir lookup

7 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
Linus Torvalds [Fri, 20 Jan 2017 19:56:29 +0000 (11:56 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse fixes from Miklos Szeredi:
 "Fix two regressions, one introduced in 4.9 and a less recent one in
  4.2"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: fix time_to_jiffies nsec sanity check
  fuse: clear FR_PENDING flag when moving requests out of pending queue

7 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Fri, 20 Jan 2017 19:47:18 +0000 (11:47 -0800)]
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is a set of 12 fixes including the mpt3sas one that was causing
  hangs on ATA passthrough.

  The others are a couple of zoned block device fixes, a SAS device
  detection bug which lead to SATA drives not being matched to bays, two
  qla2xxx MSI fixes, a qla2xxx req for rsp confusion caused by cut and
  paste, and a few other minor fixes"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: mpt3sas: fix hang on ata passthrough commands
  scsi: lpfc: Set elsiocb contexts to NULL after freeing it
  scsi: sd: Ignore zoned field for host-managed devices
  scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type
  scsi: bfa: fix wrongly initialized variable in bfad_im_bsg_els_ct_request()
  scsi: ses: Fix SAS device detection in enclosure
  scsi: libfc: Fix variable name in fc_set_wwpn
  scsi: lpfc: avoid double free of resource identifiers
  scsi: qla2xxx: remove irq_affinity_notifier
  scsi: qla2xxx: fix MSI-X vector affinity
  scsi: qla2xxx: Fix apparent cut-n-paste error.
  scsi: qla2xxx: Get mutex lock before checking optrom_state

7 years agoMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Linus Torvalds [Fri, 20 Jan 2017 19:44:47 +0000 (11:44 -0800)]
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

 - avoid potential stack information leak via the ptrace ABI caused by
   uninitialised variables

 - SWIOTLB DMA API fall-back allocation fix when the SWIOTLB buffer is
   not initialised (all RAM is suitable for 32-bit DMA masks)

 - fix the bad_mode function returning for unhandled exceptions coming
   from user space

 - fix name clash in __page_to_voff()

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: avoid returning from bad_mode
  arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields
  arm64/ptrace: Avoid uninitialised struct padding in fpr_set()
  arm64/ptrace: Preserve previous registers for short regset write
  arm64/ptrace: Preserve previous registers for short regset write
  arm64/ptrace: Preserve previous registers for short regset write
  arm64: mm: avoid name clash in __page_to_voff()
  arm64: Fix swiotlb fallback allocation

7 years agoMerge tag 'kvm-s390-master-4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Radim Krčmář [Fri, 20 Jan 2017 16:59:02 +0000 (17:59 +0100)]
Merge tag 'kvm-s390-master-4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux

KVM: s390: Fix for 4.10 (via kvm/master)

Fix a kernel memory exposure.

7 years agoKVM: s390: do not expose random data via facility bitmap
Christian Borntraeger [Thu, 12 Jan 2017 15:25:15 +0000 (16:25 +0100)]
KVM: s390: do not expose random data via facility bitmap

kvm_s390_get_machine() populates the facility bitmap by copying bytes
from the host results that are stored in a 256 byte array in the prefix
page. The KVM code does use the size of the target buffer (2k), thus
copying and exposing unrelated kernel memory (mostly machine check
related logout data).

Let's use the size of the source buffer instead.  This is ok, as the
target buffer will always be greater or equal than the source buffer as
the KVM internal buffers (and thus S390_ARCH_FAC_LIST_SIZE_BYTE) cover
the maximum possible size that is allowed by STFLE, which is 256
doublewords. All structures are zero allocated so we can leave bytes
256-2047 unchanged.

Add a similar fix for kvm_arch_init_vm().

Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
[found with smatch]
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
CC: stable@vger.kernel.org
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agoxhci: remove WARN_ON if dma mask is not set for platform devices
Mathias Nyman [Fri, 20 Jan 2017 13:38:24 +0000 (15:38 +0200)]
xhci: remove WARN_ON if dma mask is not set for platform devices

The warn on is a bit too much, we will anyway set the dma mask if not set
previously.

The main reason for this fix is that 4.10-rc1  has a dwc3 change that
pass a parent sysdev dev pointer instead of setting the dma mask of
its xhci platform device. xhci platform driver can then get more
attributes from the sysdev than just the dma mask.

The usb core and xhci changes are not yet in 4.10, and a fix like
this was preferred instead of taking those big changes this late in
the rc-cycle.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMerge branches 'thermal-core' and 'thermal-soc' into for-rc
Zhang Rui [Fri, 20 Jan 2017 08:24:54 +0000 (16:24 +0800)]
Merge branches 'thermal-core' and 'thermal-soc' into for-rc

7 years agopowerpc: Ignore reserved field in DCSR and PVR reads and writes
Anton Blanchard [Thu, 19 Jan 2017 03:19:10 +0000 (14:19 +1100)]
powerpc: Ignore reserved field in DCSR and PVR reads and writes

IBM bit 31 (for the rest of us - bit 0) is a reserved field in the
instruction definition of mtspr and mfspr. Hardware is encouraged to
(and does) ignore it.

As a result, if userspace executes an mtspr DSCR with the reserved bit
set, we get a DSCR facility unavailable exception. The kernel fails to
match against the expected value/mask, and we silently return to
userspace to try and re-execute the same mtspr DSCR instruction. We
loop forever until the process is killed.

We should do something here, and it seems mirroring what hardware does
is the better option vs killing the process. While here, relax the
matching of mfspr PVR too.

Cc: stable@vger.kernel.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
7 years agopowerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write
Dave Martin [Thu, 5 Jan 2017 16:50:57 +0000 (16:50 +0000)]
powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the check pointed registers, the thread's old check pointed
registers are preserved.

Fixes: 9d3918f7c0e5 ("powerpc/ptrace: Enable support for NT_PPC_CVSX")
Fixes: 19cbcbf75a0c ("powerpc/ptrace: Enable support for NT_PPC_CFPR")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
7 years agopowerpc/ptrace: Preserve previous fprs/vsrs on short regset write
Dave Martin [Thu, 5 Jan 2017 16:50:57 +0000 (16:50 +0000)]
powerpc/ptrace: Preserve previous fprs/vsrs on short regset write

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.

Fixes: c6e6771b87d4 ("powerpc: Introduce VSX thread_struct and CONFIG_VSX")
Cc: stable@vger.kernel.org # v2.6.27+
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
7 years agoMerge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Fri, 20 Jan 2017 00:40:03 +0000 (16:40 -0800)]
Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "We've been sitting on fixes for a while, and they keep trickling in at
  a low rate. Nothing in here comes across as particularly scary or
  noteworthy, for the most part it's a large collection of small DT
  tweaks"

* tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (24 commits)
  ARM: dts: da850-evm: fix read access to SPI flash
  ARM: dts: omap3: Fix Card Detect and Write Protect on Logic PD SOM-LV
  ARM64: dts: meson-gxbb-odroidc2: Disable SCPI DVFS
  ARM: dts: OMAP5 / DRA7: indicate that SATA port 0 is available.
  ARM: dts: NSP: Fix DT ranges error
  ARM: multi_v7_defconfig: set bcm47xx watchdog
  ARM: multi_v7_defconfig: fix config typo
  ARM: dts: dra72-evm-revc: fix typo in ethernet-phy node
  soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe()
  ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation
  ARM: dts: sunxi: Change node name for pwrseq pin on Olinuxino-lime2-emmc
  ARM: dts: sun8i: Support DTB build for NanoPi M1
  ARM: dts: sun6i: hummingbird: Enable display engine again
  ARM: dts: sun6i: Disable display pipeline by default
  ARM, ARM64: dts: drop "arm,amba-bus" in favor of "simple-bus" part 3
  ARM: dts: imx6qdl-nitrogen6_som2: fix sgtl5000 pinctrl init
  ARM: dts: imx6qdl-nitrogen6_max: fix sgtl5000 pinctrl init
  ARM: OMAP1: DMA: Correct the number of logical channels
  ARM: dts: am335x-icev2: Remove the duplicated pinmux setting
  ARM: OMAP2+: Fix WL1283 Bluetooth Baud Rate
  ...

7 years agoMerge tag 'xfs-for-linux-4.10-rc5-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Fri, 20 Jan 2017 00:33:00 +0000 (16:33 -0800)]
Merge tag 'xfs-for-linux-4.10-rc5-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:
 "I have a few more patches this week -- one to make the behavior of a
  quota id ioctl consistent with the other filesystems, and the rest
  improve validation of i_mode & i_size values coming into xfs so that
  we don't read off the ends of arrays or crash when handed garbage disk
  data.

  Summary:
   - inode i_mode sanitization
   - prevent overflows in getnextquota
   - minor build fixes"

* tag 'xfs-for-linux-4.10-rc5-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: fix xfs_mode_to_ftype() prototype
  xfs: don't wrap ID in xfs_dq_get_next_id
  xfs: sanity check inode di_mode
  xfs: sanity check inode mode when creating new dentry
  xfs: replace xfs_mode_to_ftype table with switch statement
  xfs: add missing include dependencies to xfs_dir2.h
  xfs: sanity check directory inode di_size
  xfs: make the ASSERT() condition likely

7 years agoARM: dts: da850-evm: fix read access to SPI flash
Fabien Parent [Tue, 17 Jan 2017 12:57:42 +0000 (13:57 +0100)]
ARM: dts: da850-evm: fix read access to SPI flash

Read access to the SPI flash are broken on da850-evm, i.e. the data
read is not what is actually programmed on the flash.
According to the datasheet for the M25P64 part present on the da850-evm,
if the SPI frequency is higher than 20MHz then the READ command is not
usable anymore and only the FAST_READ command can be used to read data.

This commit specifies in the DTS that we should use FAST_READ command
instead of the READ command.

Cc: stable@vger.kernel.org
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Fabien Parent <fparent@baylibre.com>
[nsekhar@ti.com: subject line adjustment]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
7 years agovirtio/s390: virtio: constify virtio_config_ops structures
Bhumika Goyal [Fri, 13 Jan 2017 18:48:56 +0000 (00:18 +0530)]
virtio/s390: virtio: constify virtio_config_ops structures

Declare virtio_config_ops structure as const as it is only stored in the
config field of a virtio_device structure. This field is of type const, so
virtio_config_ops structures having this property can be declared const.
Done using Coccinelle:

@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct virtio_config_ops i@p={...};

@ok1@
identifier r1.i;
position p;
struct virtio_ccw_device x;
@@
x.vdev.config=&i@p

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct virtio_config_ops i;

File size before and after applying the patch remains the same.
text data bss dec hex   filename
9235 296 32928 42459 a5db  drivers/s390/virtio/virtio_ccw.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Message-Id: <1484333336-13443-1-git-send-email-bhumirks@gmail.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agovirtio/s390: add missing \n to end of dev_err message
Colin Ian King [Tue, 27 Sep 2016 20:08:44 +0000 (13:08 -0700)]
virtio/s390: add missing \n to end of dev_err message

Trival fix, dev_err message is missing a \n, so add it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Message-Id: <20160927200844.16008-1-colin.king@canonical.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agovirtio/s390: support READ_STATUS command for virtio-ccw
Pierre Morel [Fri, 28 Aug 2015 09:09:32 +0000 (11:09 +0200)]
virtio/s390: support READ_STATUS command for virtio-ccw

As virtio-1 introduced the possibility of the device manipulating the
status byte, revision 2 of the virtio-ccw transport introduced a means
of getting the status byte from the device via READ_STATUS. Let's wire
it up for revisions >= 2 and fall back to returning the stored status
byte if not supported.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agotools/virtio/ringtest: tweaks for s390
Halil Pasic [Fri, 2 Sep 2016 15:59:36 +0000 (17:59 +0200)]
tools/virtio/ringtest: tweaks for s390

Make ringtest work on s390 too.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Acked-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agotools/virtio/ringtest: fix run-on-all.sh for offline cpus
Halil Pasic [Mon, 29 Aug 2016 16:25:22 +0000 (18:25 +0200)]
tools/virtio/ringtest: fix run-on-all.sh for offline cpus

Since ef1b144d ("tools/virtio/ringtest: fix run-on-all.sh to work
without /dev/cpu") run-on-all.sh uses seq 0 $HOST_AFFINITY as the list
of ids of the CPUs to run the command on (assuming ids of online CPUs
are consecutive and start from 0), where $HOST_AFFINITY is the highest
CPU id in the system previously determined using lscpu.  This can fail
on systems with offline CPUs.

Instead let's use lscpu to determine the list of online CPUs.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Fixes: ef1b144d ("tools/virtio/ringtest: fix run-on-all.sh to work without
/dev/cpu")
Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agovirtio_console: fix a crash in config_work_handler
G. Campana [Thu, 19 Jan 2017 21:37:46 +0000 (23:37 +0200)]
virtio_console: fix a crash in config_work_handler

Using control_work instead of config_work as the 3rd argument to
container_of results in an invalid portdev pointer. Indeed, the work
structure is initialized as below:

    INIT_WORK(&portdev->config_work, &config_work_handler);

It leads to a crash when portdev->vdev is dereferenced later. This
bug
is triggered when the guest uses a virtio-console without multiport
feature and receives a config_changed virtio interrupt.

Signed-off-by: G. Campana <gcampana@quarkslab.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>