From patchwork Mon Sep 21 09:42:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?U2h1bWluZyBb6IyD5pu46YqYXQ==?= X-Patchwork-Id: 11789031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 205C56CA for ; Mon, 21 Sep 2020 09:44:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27FBA2076B for ; Mon, 21 Sep 2020 09:43:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WJMhcLXP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27FBA2076B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3BC8F16FB; Mon, 21 Sep 2020 11:43:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3BC8F16FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1600681437; bh=UC3QxJDZ40YaHUw7nI2AEGOwo8sUAnILDElnnCVR7UA=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=WJMhcLXPzNvFCitPnUu0D3c6zLhaAlwcXEWe8hEIzNlQA1GFnbsjtLJ54EOgnhhRT TWh/WBkgu5c96Qj0VUG7I0f+mM37CAT9OrX44De2JxZcUYHJpCw1GJs1G3HDOiXlbF LE71ueBluKBA0NNOm9mw/O7NOg09RbPlyJ10q+SA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C6AC4F8010A; Mon, 21 Sep 2020 11:43:12 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7A667F8020B; Mon, 21 Sep 2020 11:43:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9C051F8010A for ; Mon, 21 Sep 2020 11:43:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9C051F8010A Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.69 with qID 08L9goijF019252, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexmb06.realtek.com.tw[172.21.6.99]) by rtits2.realtek.com.tw (8.15.2/2.66/5.86) with ESMTPS id 08L9goijF019252 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 21 Sep 2020 17:42:50 +0800 Received: from RTEXMB01.realtek.com.tw (172.21.6.94) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Mon, 21 Sep 2020 17:42:50 +0800 Received: from localhost.localdomain (172.22.102.1) by RTEXMB01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Mon, 21 Sep 2020 17:42:49 +0800 From: To: , Subject: [PATCH 1/2] ASoC: rt700: wait for the delayed work to finish when the system suspends Date: Mon, 21 Sep 2020 17:42:44 +0800 Message-ID: <20200921094244.31869-1-shumingf@realtek.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Originating-IP: [172.22.102.1] X-ClientProxiedBy: RTEXMB01.realtek.com.tw (172.21.6.94) To RTEXMB01.realtek.com.tw (172.21.6.94) Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, mengdong.lin@intel.com, derek.fang@realtek.com, Shuming Fan , flove@realtek.com, pierre-louis.bossart@intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Shuming Fan To avoid the IO error, we need to cancel the delayed work and wait for it to finish. Signed-off-by: Shuming Fan Reviewed-by: Pierre-Louis Bossart --- sound/soc/codecs/rt700-sdw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/rt700-sdw.c b/sound/soc/codecs/rt700-sdw.c index ead4918bbf90..c7deb4e4fcf1 100644 --- a/sound/soc/codecs/rt700-sdw.c +++ b/sound/soc/codecs/rt700-sdw.c @@ -490,6 +490,9 @@ static int __maybe_unused rt700_dev_suspend(struct device *dev) if (!rt700->hw_init) return 0; + cancel_delayed_work_sync(&rt700->jack_detect_work); + cancel_delayed_work_sync(&rt700->jack_btn_check_work); + regcache_cache_only(rt700->regmap, true); return 0; From patchwork Mon Sep 21 09:43:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?U2h1bWluZyBb6IyD5pu46YqYXQ==?= X-Patchwork-Id: 11789033 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3675359D for ; Mon, 21 Sep 2020 09:44:47 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55638216C4 for ; Mon, 21 Sep 2020 09:44:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Op3z4LYJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55638216C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7FCC31701; Mon, 21 Sep 2020 11:43:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7FCC31701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1600681483; bh=cCCqLbHtpfMLn2ao9XU9YIoRvMrwy1zaoMYBT8odZ9U=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Op3z4LYJc0C0iCcYhDjZExoCuNKdvPoiwXzQNSuYD2vewk1GBafjNsyh11aorY10Z 88smyjw1Ww2JJngfrE0GOxyOpyCBHN42t7UsBkdItGYcy/Mf/AnWN0KNS/V4PQ9/wF 5aPf/jyo1CahpT5PD9wDMChYBByE9QLpoGjXvkEc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1AB0EF8021C; Mon, 21 Sep 2020 11:43:26 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 43FA9F8028D; Mon, 21 Sep 2020 11:43:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1B0C2F8020B for ; Mon, 21 Sep 2020 11:43:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B0C2F8020B Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.69 with qID 08L9hE1T1019325, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexmb05.realtek.com.tw[172.21.6.98]) by rtits2.realtek.com.tw (8.15.2/2.66/5.86) with ESMTPS id 08L9hE1T1019325 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 21 Sep 2020 17:43:14 +0800 Received: from RTEXMB01.realtek.com.tw (172.21.6.94) by RTEXMB05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Mon, 21 Sep 2020 17:43:14 +0800 Received: from localhost.localdomain (172.22.102.1) by RTEXMB01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Mon, 21 Sep 2020 17:43:13 +0800 From: To: , Subject: [PATCH 2/2] ASoC: rt711: wait for the delayed work to finish when the system suspends Date: Mon, 21 Sep 2020 17:43:08 +0800 Message-ID: <20200921094308.31921-1-shumingf@realtek.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Originating-IP: [172.22.102.1] X-ClientProxiedBy: RTEXMB01.realtek.com.tw (172.21.6.94) To RTEXMB01.realtek.com.tw (172.21.6.94) Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, mengdong.lin@intel.com, derek.fang@realtek.com, Shuming Fan , flove@realtek.com, pierre-louis.bossart@intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Shuming Fan To avoid the IO error, we need to cancel the delayed work and wait for it to finish. Signed-off-by: Shuming Fan Reviewed-by: Pierre-Louis Bossart --- sound/soc/codecs/rt711-sdw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c index 28d663673320..3a8ca600d1cf 100644 --- a/sound/soc/codecs/rt711-sdw.c +++ b/sound/soc/codecs/rt711-sdw.c @@ -491,6 +491,10 @@ static int __maybe_unused rt711_dev_suspend(struct device *dev) if (!rt711->hw_init) return 0; + cancel_delayed_work_sync(&rt711->jack_detect_work); + cancel_delayed_work_sync(&rt711->jack_btn_check_work); + cancel_work_sync(&rt711->calibration_work); + regcache_cache_only(rt711->regmap, true); return 0;