From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE791C00449 for ; Mon, 8 Oct 2018 09:37:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E2A220878 for ; Mon, 8 Oct 2018 09:37:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E2A220878 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbeJHQsg (ORCPT ); Mon, 8 Oct 2018 12:48:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:58594 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726330AbeJHQsg (ORCPT ); Mon, 8 Oct 2018 12:48:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C96E2AEFB; Mon, 8 Oct 2018 09:37:45 +0000 (UTC) Date: Mon, 08 Oct 2018 11:37:45 +0200 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Sasha Levin , 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 In-Reply-To: <20181008093425.GB5684@sirena.org.uk> References: <20181005161424.20521-1-sashal@kernel.org> <20181005161424.20521-28-sashal@kernel.org> <20181008093425.GB5684@sirena.org.uk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 08 Oct 2018 11:34:25 +0200, Mark Brown wrote: > > On Fri, Oct 05, 2018 at 12:14:04PM -0400, Sasha Levin wrote: > > From: Yu Zhao > > > > [ 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. This one should be OK as a stable fix, too. thanks, Takashi > > > > 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 > > 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(-) > > > > 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 > > > [2 signature.asc ] >