Return-Path: Date: Mon, 8 Oct 2018 10:34:25 +0100 From: Mark Brown To: Sasha Levin Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, Yu Zhao , Sasha Levin , tiwai@suse.de Subject: Re: [PATCH AUTOSEL 4.18 28/48] sound: don't call skl_init_chip() to reset intel skl soc Message-ID: <20181008093425.GB5684@sirena.org.uk> References: <20181005161424.20521-1-sashal@kernel.org> <20181005161424.20521-28-sashal@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="l76fUT7nc3MelDdI" Content-Disposition: inline In-Reply-To: <20181005161424.20521-28-sashal@kernel.org> List-ID: --l76fUT7nc3MelDdI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 05, 2018 at 12:14:04PM -0400, Sasha Levin wrote: > From: Yu Zhao >=20 > [ Upstream commit 75383f8d39d4c0fb96083dd460b7b139fbdac492 ] >=20 > 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. >=20 > 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. >=20 > Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset > device properly. >=20 > Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe= ") > Reviewed-by: Takashi Iwai > Signed-off-by: Yu Zhao > Signed-off-by: Mark Brown > Signed-off-by: Sasha Levin > --- > 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(-) >=20 > 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); > =20 > void snd_hdac_bus_update_rirb(struct hdac_bus *bus); > int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int st= atus, > 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 *bu= s) > EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset); > =20 > /* 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; > } > =20 > @@ -425,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_= reset) > =20 > return 0; > } > +EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link); > =20 > /* 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, boo= l full_reset) > return false; > =20 > /* reset controller */ > - azx_reset(bus, full_reset); > + snd_hdac_bus_reset_link(bus, full_reset); > =20 > /* 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; > } > =20 > - skl_init_chip(bus, true); > + snd_hdac_bus_reset_link(bus, true); > =20 > snd_hdac_bus_parse_capabilities(bus); > =20 > --=20 > 2.17.1 >=20 --l76fUT7nc3MelDdI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlu7JKAACgkQJNaLcl1U h9C7Xgf/RVSyhckeShF54sD6LD7X2UDGlEJfazLWtK2Es+BsT/BEhgdp/MDP29nr ZDzflW+21Wu+uvOcApJXSt5DarehJZAmc0k6kAzuLXOLZq2zupqM3adjtfncE5SC eSvJSOyrnkHqo5SusdfRbE/R15s1pBNUs72l/GGezsGJEtYIUCHvKlsahllPaxeg szWlzeUdLgx6OB4KZZoSHl47wFoVtZSao5XG5ceGXAlK6Z8f2QzFZXC+jSN37FBW qG/rmFAgkop+chGtx3tkRuvymYmZybzxDCswpn1+CipHvPaFKhYwZ7zh1v1vMBNp 0fxGBCl/2KE5hgEL4Js9DtKORTk0Ow== =ssFB -----END PGP SIGNATURE----- --l76fUT7nc3MelDdI--