From patchwork Tue Aug 13 07:44:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-yi Chiang X-Patchwork-Id: 11091399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAB68746 for ; Tue, 13 Aug 2019 07:44:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA248285E8 for ; Tue, 13 Aug 2019 07:44:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADCCE285EB; Tue, 13 Aug 2019 07:44:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50DA9285E8 for ; Tue, 13 Aug 2019 07:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=eBSoTt76gEYuGWhrbj5tBB3XBwrz2+02XuW8IyOqSPI=; b=Srx0QHPxNxkvsZ EpauAl4ztliLV3RjnseCDaaYh0cec3BXAWuv0VmoeWHIOFN6f74mVLsjIi3kGhULcf676Tpm9dElg UQDhsNw0R/oHGr83RpR6vsBCZAHeJ+GqLvabrKIBc8abREcuqBDE4onqyZHSItMXZ23JW0QEalDTz MA/i3lPBGbNPJkIam/6jiGm02QHjlhz25o6GBlStq4cyfsDXRINrpQU35VwdaB3EEqGY6atavq84X tIAPnHLs6azHHmHHbWrcJ/Xm2Omu+7cUpXt7TcJOElUd8f2wtW2HF45sr3tOKHEtoDC+2pJ3Yo9xY oq6S4xMyvAopk7IU/F9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxRU6-0005Bk-UX; Tue, 13 Aug 2019 07:44:47 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxRU4-0005B2-En for linux-rockchip@lists.infradead.org; Tue, 13 Aug 2019 07:44:45 +0000 Received: by mail-pg1-x544.google.com with SMTP id n4so9086310pgv.2 for ; Tue, 13 Aug 2019 00:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wGWISY3VrJOIlFf6UspJXH4MK7kN0CsW/Y8ULJ0Kwsg=; b=gr2P6VZATnnB9+lPemtkV6oz7hDqDZRqLEIsHSwg3T/hclit7LQRxjp93NpWl2MES2 Um+PzAS1Kko5EqOad+bjxXZKqx+uymm1exp3k8E1foMXH74iYttXfc4Iy13TYyEllztv hUB/V1Le4fDSi6DYbcaFO7khLFTIlpHwS5Qy8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wGWISY3VrJOIlFf6UspJXH4MK7kN0CsW/Y8ULJ0Kwsg=; b=HCVOwtoAWwjysSU6L45eYdlbYqHhPEiSx5CjnRhRVOivNex3d9i4LhoyoPhPCXDYrY 7AqYo0cNJ9EE1arXhqNQoF0g6VTGmBLCPgVWoggL9JftlWF1PJRBvcUbzHyO0K0mB6L/ XHuNiNoA4vX7vY3pBFZUXEe5hmT/wlha8HAFJZqiAE8M+qIBIwCIQeESyeA9JdfcDZlH BnyFGXEe8vdGSWOcWv+647tAiJJEhuFEPzmJ+uTcfyVsW596Ya5BDtraIKKscxLP3Mqv oX2dwcmXkJozwWBmjG2saSaFeji63Wtv2gFzpLLkAsg3sqJShabcV/+FSKNZV2qaSX99 TN8Q== X-Gm-Message-State: APjAAAXjHvlNX4naIq5x3YnSDVkP09ujiKrqaOtv6UeqIQdfHEhX8e9q snwgERQzLxgKFTwyH+FxBOZKIw== X-Google-Smtp-Source: APXvYqzkzDTF0AwWSIcaHQgPLZiwdVjeEy+ci5i4EwVLcCB8uW8sIMX56ixAY+7bZj0RLkfelhwRAg== X-Received: by 2002:a63:db45:: with SMTP id x5mr16250861pgi.293.1565682283264; Tue, 13 Aug 2019 00:44:43 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:79b4:bd83:e4a5:a720]) by smtp.gmail.com with ESMTPSA id p3sm682260pjo.3.2019.08.13.00.44.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 00:44:42 -0700 (PDT) From: Cheng-Yi Chiang To: linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: rockchip: rockchip_max98090: Set period size to 240 Date: Tue, 13 Aug 2019 15:44:30 +0800 Message-Id: <20190813074430.191791-1-cychiang@chromium.org> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190813_004444_503381_11DD8E0D X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, dianders@chromium.org, Heiko Stuebner , zhengxing@rock-chips.com, Liam Girdwood , jeffy.chen@rock-chips.com, Takashi Iwai , tzungbi@chromium.org, Jaroslav Kysela , linux-rockchip@lists.infradead.org, Mark Brown , eddie.cai@rock-chips.com, linux-arm-kernel@lists.infradead.org, enric.balletbo@collabora.com, dgreid@chromium.org, cain.cai@rock-chips.com, Cheng-Yi Chiang Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From stress testing of arecord, we found that period size greater than ~900 will bring pl330 to DYING state and can not recover within 100 iterations. The result is that arecord will stuck and get I/O error, and issue can not be recovered until reboot. This issue does not happen when period size is small. Set constraint of period size to 240 to prevent such issue. With the constraint, there will be no issue after 2000 iterations. We can revert this patch once the root cause is found in rockchip's pl330 implementation. Signed-off-by: Cheng-Yi Chiang --- sound/soc/rockchip/rockchip_max98090.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index 7b0c21fa6dca..0097df1fae66 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -137,8 +137,19 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream, return ret; } +static int rk_aif1_startup(struct snd_pcm_substream *substream) +{ + /* + * Set period size to 240 because pl330 has issue + * dealing with larger period in stress testing. + */ + return snd_pcm_hw_constraint_minmax(substream->runtime, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 240, 240); +} + static const struct snd_soc_ops rk_aif1_ops = { .hw_params = rk_aif1_hw_params, + .startup = rk_aif1_startup, }; SND_SOC_DAILINK_DEFS(hifi,