Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp881544pxk; Thu, 17 Sep 2020 20:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4e7lZkiOy97IeEnL/e/c8NEU1Fgi3tPCTCn0pGakSAn6NlrtJ5RiFnHXGOaJJ7P1ACJ2b X-Received: by 2002:a50:d7d0:: with SMTP id m16mr37056978edj.105.1600398795870; Thu, 17 Sep 2020 20:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398795; cv=none; d=google.com; s=arc-20160816; b=RGXW7EmoNduDmxhmpIDMiRbyxkCeTXZZlXJivKdwiIUDhJUJJp+NRpNx3CBBQD7yp1 vbCw8mgETpFGhkTtuL5rYidGTbJdChfqr3lKbygUgC03HofAj9zVaL4pEMi+KvoyFAz/ rATckBbB+dlwRe0ayTJNd1bOFf44GEg9d9Fv7gdNbOzaCB4n8eSzZ0z1lpVuUn9LJNVS YzYMLW36NKt9cXjZLlZN9AIIW664qUdX6LPt6IgSEThms1mibiGDC9XhCCUi59rtLGoQ joDCfXmGwMCJKIVZux9WwBTkPetPorLsw92K1CNkhvWTXGWA70samdgvHrI8fohXY/1I q93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RHxVXBeudZTz2+z8yJXQqIBTugPtAo5dKaLoyJNCiG8=; b=0/bGPcPD0fv9E5P+1wOD/1dB3wWLtS25nk+fv6xDkaJ9wQI1qUdA4JLqWSPCed+XNC xPkkI7IgkoiCdGXfFPpkFCtoterNd6bcg13WF2yLtFFX55iAtfzMMyBve1WLtsgMTpxk rYBOqSXfIRcZy01wTrZ8DpOHvc3lWdsNgUGDJzo9lne73rtQfigfCR48x0Fa+tB53HuE g7Ar5Nto+/lAJFyuDS10bR6K+EQk0PJ9I/SWWbVno6RxL1VAhkaxqJQA0XaW8qkcEihh pDKeQAQUfAHOtTeGZ5jhfsrXaHC4NYL94no7i6xK5LDOMpZ5DFlwAEawntXdCM2FICzn 0kfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CyoXwP1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si1079886edl.282.2020.09.17.20.12.52; Thu, 17 Sep 2020 20:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CyoXwP1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbgIRCCc (ORCPT + 99 others); Thu, 17 Sep 2020 22:02:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:47708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbgIRCCa (ORCPT ); Thu, 17 Sep 2020 22:02:30 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D789823731; Fri, 18 Sep 2020 02:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394548; bh=L/RPD5vnKSQDqRYPSE4OdlONRIwszqPQ8jg7XI6cdII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CyoXwP1jSOVifoGU6ru/+ba8p8k5SRpxPz3yJSenh220EhaYr4aZlC7TVR0XWTmFC kItfh6IwSYaatLlINHVe2H1GYSiccf98wmzKLvZjlxRyyrK29G6DF/P/gijtQvPxPn Cs67RLG4Ztbj2ni1stlBIlm10eeuyI7KmCm5MOp4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tzung-Bi Shih , Pierre-Louis Bossart , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 065/330] ASoC: max98090: remove msleep in PLL unlocked workaround Date: Thu, 17 Sep 2020 21:56:45 -0400 Message-Id: <20200918020110.2063155-65-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tzung-Bi Shih [ Upstream commit acb874a7c049ec49d8fc66c893170fb42c01bdf7 ] It was observed Baytrail-based chromebooks could cause continuous PLL unlocked when using playback stream and capture stream simultaneously. Specifically, starting a capture stream after started a playback stream. As a result, the audio data could corrupt or turn completely silent. As the datasheet suggested, the maximum PLL lock time should be 7 msec. The workaround resets the codec softly by toggling SHDN off and on if PLL failed to lock for 10 msec. Notably, there is no suggested hold time for SHDN off. On Baytrail-based chromebooks, it would easily happen continuous PLL unlocked if there is a 10 msec delay between SHDN off and on. Removes the msleep(). Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20191122073114.219945-2-tzungbi@google.com Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/max98090.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 45da2b51543e7..6b9d326e11b07 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2112,10 +2112,16 @@ static void max98090_pll_work(struct max98090_priv *max98090) dev_info_ratelimited(component->dev, "PLL unlocked\n"); + /* + * As the datasheet suggested, the maximum PLL lock time should be + * 7 msec. The workaround resets the codec softly by toggling SHDN + * off and on if PLL failed to lock for 10 msec. Notably, there is + * no suggested hold time for SHDN off. + */ + /* Toggle shutdown OFF then ON */ snd_soc_component_update_bits(component, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, 0); - msleep(10); snd_soc_component_update_bits(component, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, M98090_SHDNN_MASK); -- 2.25.1