linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yu Zhao <yuzhao@google.com>,
	Sasha Levin <alexander.levin@microsoft.com>,
	tiwai@suse.de
Subject: Re: [PATCH AUTOSEL 4.18 28/48] sound: don't call skl_init_chip() to reset intel skl soc
Date: Mon, 8 Oct 2018 10:34:25 +0100	[thread overview]
Message-ID: <20181008093425.GB5684@sirena.org.uk> (raw)
In-Reply-To: <20181005161424.20521-28-sashal@kernel.org>

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

On Fri, Oct 05, 2018 at 12:14:04PM -0400, Sasha Levin wrote:
> From: Yu Zhao <yuzhao@google.com>
> 
> [ Upstream commit 75383f8d39d4c0fb96083dd460b7b139fbdac492 ]
> 
> Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
> 1) sets bus->chip_init to prevent multiple entrances before device
> is stopped; 2) enables interrupt.

And here.

> 
> We shouldn't use it for the purpose of resetting device only because
> 1) when we really want to initialize device, we won't be able to do
> so; 2) we are ready to handle interrupt yet, and kernel crashes when
> interrupt comes in.
> 
> Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
> device properly.
> 
> Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
> Reviewed-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Yu Zhao <yuzhao@google.com>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
> ---
>  include/sound/hdaudio.h       | 1 +
>  sound/hda/hdac_controller.c   | 7 ++++---
>  sound/soc/intel/skylake/skl.c | 2 +-
>  3 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
> index c052afc27547..138e976a2ba2 100644
> --- a/include/sound/hdaudio.h
> +++ b/include/sound/hdaudio.h
> @@ -355,6 +355,7 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus);
>  void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus);
>  void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
>  void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
> +int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset);
>  
>  void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
>  int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,
> diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
> index 11057d9f84ec..74244d8e2909 100644
> --- a/sound/hda/hdac_controller.c
> +++ b/sound/hda/hdac_controller.c
> @@ -385,7 +385,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus)
>  EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset);
>  
>  /* reset codec link */
> -static int azx_reset(struct hdac_bus *bus, bool full_reset)
> +int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset)
>  {
>  	if (!full_reset)
>  		goto skip_reset;
> @@ -410,7 +410,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
>   skip_reset:
>  	/* check to see if controller is ready */
>  	if (!snd_hdac_chip_readb(bus, GCTL)) {
> -		dev_dbg(bus->dev, "azx_reset: controller not ready!\n");
> +		dev_dbg(bus->dev, "controller not ready!\n");
>  		return -EBUSY;
>  	}
>  
> @@ -425,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link);
>  
>  /* enable interrupts */
>  static void azx_int_enable(struct hdac_bus *bus)
> @@ -479,7 +480,7 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
>  		return false;
>  
>  	/* reset controller */
> -	azx_reset(bus, full_reset);
> +	snd_hdac_bus_reset_link(bus, full_reset);
>  
>  	/* clear interrupts */
>  	azx_int_clear(bus);
> diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
> index f0d9793f872a..c7cdfa4a7076 100644
> --- a/sound/soc/intel/skylake/skl.c
> +++ b/sound/soc/intel/skylake/skl.c
> @@ -844,7 +844,7 @@ static int skl_first_init(struct hdac_ext_bus *ebus)
>  		return -ENXIO;
>  	}
>  
> -	skl_init_chip(bus, true);
> +	snd_hdac_bus_reset_link(bus, true);
>  
>  	snd_hdac_bus_parse_capabilities(bus);
>  
> -- 
> 2.17.1
> 

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

  reply	other threads:[~2018-10-08  9:34 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 16:13 [PATCH AUTOSEL 4.18 01/48] ASoC: dapm: Fix NULL pointer deference on CODEC to CODEC DAIs Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 02/48] ASoC: max98373: Added speaker FS gain cotnrol register to volatile Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 03/48] ASoC: rt5514: Fix the issue of the delay volume applied again Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 04/48] selftests: android: move config up a level Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 05/48] selftests: kselftest: Remove outdated comment Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 06/48] ASoC: max98373: Added 10ms sleep after amp software reset Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 07/48] ASoC: wm8804: Add ACPI support Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 08/48] ASoC: sigmadsp: safeload should not have lower byte limit Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 09/48] ASoC: q6routing: initialize data correctly Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 10/48] selftests: add headers_install to lib.mk Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 11/48] selftests/efivarfs: add required kernel configs Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 12/48] selftests: memory-hotplug: add required configs Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 13/48] ASoC: rsnd: adg: care clock-frequency size Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 14/48] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 15/48] hwmon: (nct6775) Fix access to fan pulse registers Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 16/48] Fix cg_read_strcmp() Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 17/48] Add tests for memory.oom.group Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 18/48] ASoC: AMD: Ensure reset bit is cleared before configuring Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 19/48] drm/pl111: Make sure of_device_id tables are NULL terminated Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 20/48] Bluetooth: SMP: Fix trying to use non-existent local OOB data Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 21/48] Bluetooth: Use correct tfm to generate " Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 22/48] Bluetooth: hci_ldisc: Free rw_semaphore on close Sasha Levin
2018-10-05 16:13 ` [PATCH AUTOSEL 4.18 23/48] mfd: omap-usb-host: Fix dts probe of children Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 24/48] KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 25/48] scsi: iscsi: target: Don't use stack buffer for scatterlist Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 26/48] scsi: qla2xxx: Fix an endian bug in fcpcmd_is_corrupted() Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 27/48] sound: enable interrupt after dma buffer initialization Sasha Levin
2018-10-08  9:34   ` Mark Brown
2018-10-08  9:36     ` Takashi Iwai
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 28/48] sound: don't call skl_init_chip() to reset intel skl soc Sasha Levin
2018-10-08  9:34   ` Mark Brown [this message]
2018-10-08  9:37     ` Takashi Iwai
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 29/48] bpf: btf: Fix end boundary calculation for type section Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 30/48] bpf: use __GFP_COMP while allocating page Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 31/48] hwmon: (nct6775) Fix virtual temperature sources for NCT6796D Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 32/48] hwmon: (nct6775) Fix RPM output for fan7 on NCT6796D Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 33/48] stmmac: fix valid numbers of unicast filter entries Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 34/48] hwmon: (nct6775) Use different register to get fan RPM for fan7 Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 35/48] net: ethernet: ti: add missing GENERIC_ALLOCATOR dependency Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 36/48] net: macb: disable scatter-gather for macb on sama5d3 Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 37/48] ARM: dts: at91: add new compatibility string " Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 38/48] PCI: hv: support reporting serial number as slot information Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 39/48] hv_netvsc: pair VF based on serial number Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 40/48] clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 41/48] clk: x86: Stop marking clocks as CLK_IS_CRITICAL Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 42/48] pinctrl: cannonlake: Fix gpio base for GPP-E Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 43/48] x86/kvm/lapic: always disable MMIO interface in x2APIC mode Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 44/48] drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7 Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 45/48] drm/amdkfd: Change the control stack MTYPE from UC to NC on GFX9 Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 46/48] drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 47/48] ubifs: Check for name being NULL while mounting Sasha Levin
2018-10-05 16:14 ` [PATCH AUTOSEL 4.18 48/48] mm: slowly shrink slabs with a relatively small number of objects Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181008093425.GB5684@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alexander.levin@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=yuzhao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).