Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp688161ybl; Tue, 13 Aug 2019 00:45:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCl6f5wTq+my88lC2wRFUGfNssDERbXtxDONupeR3xb5vQMvmRh3gCmynGa/REuj6tzV7s X-Received: by 2002:a17:90a:d593:: with SMTP id v19mr992144pju.1.1565682347513; Tue, 13 Aug 2019 00:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565682347; cv=none; d=google.com; s=arc-20160816; b=U44x9+0Z2zG3GcLtPrG5RXVWUUbm1kEv866+BkwlGfb9+aS70Ph9dEm5Y+zyeXZlZO wrYxn94w7Vhbxf0LEn9Pp0xQTDeNkrRzZ6SRzCQhrJC7XAdV/DNzc7H4nbEwpjQ4kXG3 g2WzXttTFseeUYXo8WbZEgtHt97aW07U+6T1OLCE6akhTGyvzDxu+SITIsJI30GsAs3j /rByg8/up9Rkc0RTwVam6xo9opsHIGAxdjFnf4uxyueIEVIwaKi/q3zSlQGj/yjjwffv yfMq3ijkcyqdyeSHfLujgwFbVnHe/2mOnCwC3Kll6JC9t1+V4oEffnoWiukbzFX75Qhl ElKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wGWISY3VrJOIlFf6UspJXH4MK7kN0CsW/Y8ULJ0Kwsg=; b=pMZIWmBZ6bY0ryFjlBTNVRfH1r1l+5X0cVR9lWxEAjzwwe035e7o5AK2na13nWu2gP lYsU5SG1S0h8qR/Uw97iNLTODbC8+kjqiSrkVxYk93sThR/G6TBpEH/aZh9wDNl6VJo1 Ra62+fJbbRjYjFYkhU4D5IwRUJlC+yGReZCvNeK493ymGtKUA3DaVy3ya3uPINO62AeZ grVR3uJXzeyCYUW+n5mGIkVLwAEbCiI0rjaHDrty2ARkB6iAfHeS+tk5tuDk+Y4xbre5 94x5FU9tgR/FPyJQKpE+bw2VTBjckJOJq7d9p8ECX4iGPBgV8EHCqEV0bHhEe6JqQADG Fh+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gr2P6VZA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s187si11691059pfb.92.2019.08.13.00.45.31; Tue, 13 Aug 2019 00:45:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gr2P6VZA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbfHMHoo (ORCPT + 99 others); Tue, 13 Aug 2019 03:44:44 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41744 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbfHMHoo (ORCPT ); Tue, 13 Aug 2019 03:44:44 -0400 Received: by mail-pg1-f195.google.com with SMTP id x15so40473529pgg.8 for ; Tue, 13 Aug 2019 00:44:44 -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=eHraWCI/xDeRddSiEVdKI5OENlK75R07ZfratELi9ttJm+mNTKY5ACR/ypjCnmCMwg Td/59FLwOm1QDdUdL8tpbJPea5k8b8KFeCoEIYwbx27BpE6OjQUjZr/jrTA5ZXRf1r5r KJNO3W9INcnWpR5Gt2mgKQTrEELpAvito2ZLTjyoO3yqUm+USLIDB5K4zwEKpIQYrfBv xZFxRiPAjM5pfF71eqrHd1jOmr6ZL+bYoxreR8WIH/8ZesjKxgsHbCqM8q9/oKpWsBFG 3Gmsh9gh1JJPgurBXEkUV3NY7EQdK7cfrTLkO5AsIep+pqw1o/gAVwVIuhAi4PbJw7Ph uSeA== X-Gm-Message-State: APjAAAUpACzyTZsfghxnPvT0xNrPVawEScr2Svox/oxgci4BKFTNdeYj rwCcbC6j96yNYQkvln52lNBngsK7j7M= 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 Cc: Mark Brown , Takashi Iwai , Liam Girdwood , Jaroslav Kysela , Heiko Stuebner , dianders@chromium.org, dgreid@chromium.org, tzungbi@chromium.org, zhengxing@rock-chips.com, cain.cai@rock-chips.com, eddie.cai@rock-chips.com, jeffy.chen@rock-chips.com, enric.balletbo@collabora.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Cheng-Yi Chiang 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.23.0.rc1.153.gdeed80330f-goog