Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp208279lqs; Mon, 4 Mar 2024 22:20:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVYbRq2yoiaa7gK2hqKzEx4uJp+4ePJoxgxi3dUf7UFREmUpsZHVzlBknX7ny6O8wWDYwmvpjWzUgMoXkFuGVDy84twTqNIclP3Vyx4/A== X-Google-Smtp-Source: AGHT+IGwJC8XMrNZaXa+A52j2UiKfl+NA2yzgug5t24ZKz7BpVYGiVx/CUY63nc10y8ObbSgJZHF X-Received: by 2002:a17:90a:ac01:b0:29b:645:103e with SMTP id o1-20020a17090aac0100b0029b0645103emr8454300pjq.1.1709619658002; Mon, 04 Mar 2024 22:20:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709619657; cv=pass; d=google.com; s=arc-20160816; b=ArUMoQhgVtZzbWe5YBIyVJ5901EUmaz+qu7wijFJhJ73rSxAZYyulF/r9Io+yAFNdV SMZjKRQPRP1EhgsrFQr5mSSn1RHbmRuYrS3pI0lH4yUrbzKfo/i2013FGMecw8GwpVxK LcRPNbCor1ERuo5dB30cAN0Csnba3MjCf7j/qhNxofqlSJON0QbEz98f8o1I/7Zr+Biz l2K/U4kHUciTNw4q/2LPmTqcP1K2E/gYtCQBLoEefDaRMdgDaRjmrXIDtMrcLjkNi4+y +yhAWFbEj0SJ3UL9zs5AwqmJ5SLDVq0u+pHFGweHsg1o3JAnODmJTdu/mB2WWmIEIJOa svXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=VUyE2CiKhsfUXFjkUTpgRFfJaUNoDyxfOrTQvJ6ukKc=; fh=NNMw2fo0qNgiBFz+h4XLpgZ+9DRpj44XdLUMq2eUpcY=; b=tK1o7mujvciCqKAzX7bNwyqBAYkL0G+w1KLfm6hp4sdrmu5KNqHm7PnsYCLmmrSF9P 9cZp0IOratUAOkU/giMCMcpsQygULolSBfZYqmf2wpuHfTFsP8ozDB4m3sPQfTduCT3Z ypRWaylB1gGD1tw5eqjFux7NbuSIPmpg834t0sYuU71cWxCAqNXxvEuKcM8vQnqDeulG BAr28NM6H7SUV1lbbLEaLZtBKcx4ZmccnQbFCfQbqPNaRmH6pYKftu3afbTBmGyDFowa syiWjFGUZCiwaDK1HdwhSHzIg7cIfV213yekxSEY18e0aLQbV+eIFaKIKmL/n8A0w4wu Pq7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@linumiz.com header.s=default header.b=aA6RsbfO; arc=pass (i=1 spf=pass spfdomain=linumiz.com dkim=pass dkdomain=linumiz.com); spf=pass (google.com: domain of linux-kernel+bounces-91733-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91733-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s24-20020a17090aad9800b0029ac01b0281si11387019pjq.180.2024.03.04.22.20.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 22:20:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91733-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@linumiz.com header.s=default header.b=aA6RsbfO; arc=pass (i=1 spf=pass spfdomain=linumiz.com dkim=pass dkdomain=linumiz.com); spf=pass (google.com: domain of linux-kernel+bounces-91733-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91733-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A8FCE283631 for ; Tue, 5 Mar 2024 06:20:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 916D57D3F8; Tue, 5 Mar 2024 06:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linumiz.com header.i=@linumiz.com header.b="aA6RsbfO" Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 340647E10D for ; Tue, 5 Mar 2024 06:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.89.44.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709619639; cv=none; b=s8gP+Q4jz5Xogpjhxe9BOlWYmmyL/ivbe6IQOJrFOTnfAKvUM4ChGmb7W/p5+kPYtTJXpOfw3tyhbPxoyGNpsDNfOo8zxReaZzP7BMQrrgoOiirb+Mczl/dfswBG5+AHVjv26xsu2CXsdS0muDHGxn0hcGto8pyrwfvWIC2q7jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709619639; c=relaxed/simple; bh=RDc2FgK9KBEAoEybt2cK76Njw4wXKy3QNd6y2peeaIE=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=NcJvOhQEzQts8MwZmZN3T98rnWbO4KLNohcCDfX0F8Ces7qyEAYk01pkVwqKQrKP2yrOUU7AO4jkYnXCzsGhZ8Jdw4F6GxD45/4ZSwPAyBfl7eSkV9pcGU6/1phLC7He66YH9uTZCOQZfpp3pkLvLefBLFH6CH9Mt5LGKHwwB6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linumiz.com; spf=pass smtp.mailfrom=linumiz.com; dkim=pass (2048-bit key) header.d=linumiz.com header.i=@linumiz.com header.b=aA6RsbfO; arc=none smtp.client-ip=35.89.44.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linumiz.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linumiz.com Received: from eig-obgw-5005a.ext.cloudfilter.net ([10.0.29.234]) by cmsmtp with ESMTPS id hG5Brbv0fHXmAhOAFrBiW3; Tue, 05 Mar 2024 06:20:35 +0000 Received: from md-in-79.webhostbox.net ([43.225.55.182]) by cmsmtp with ESMTPS id hOABrNOukREFhhOADrdcqU; Tue, 05 Mar 2024 06:20:34 +0000 X-Authority-Analysis: v=2.4 cv=cuKdkU4i c=1 sm=1 tr=0 ts=65e6b9b2 a=LfuyaZh/8e9VOkaVZk0aRw==:117 a=kofhyyBXuK/oEhdxNjf66Q==:17 a=IkcTkHD0fZMA:10 a=K6JAEmCyrfEA:10 a=oz0wMknONp8A:10 a=hD80L64hAAAA:8 a=7CQSdrXTAAAA:8 a=VwQbUJbxAAAA:8 a=LywAyCD41A-1GUSnf9cA:9 a=QEXdDO2ut3YA:10 a=a-qgeE7W1pNrGK8U0ZQC:22 a=AjGcO6oz07-iQ99wixmX:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linumiz.com ; s=default; h=Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To: MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VUyE2CiKhsfUXFjkUTpgRFfJaUNoDyxfOrTQvJ6ukKc=; b=aA6RsbfOajw6u/Q+b719qtWWve j7DzUOMiahS7+wiMZ7GxnrG29K1nooZD+tey/3ozbFNmEBcQmrSdr8YuYU7IYjJB8wUxu1nzQwXmL JPsmY5BV4oyO9hrwgrMHRU1Q+S4GPRGON6J38cljVnzOvADNlBYz0fOakGwW7yEsQuLxF4wWDT84v wY6EUo16Skc3dZ6/Z5cZxWJi4TY8+xpV19ZU2nsRHAq2NPFa1bUHfwBeDRo/9heAfVZwac3Uc0Kz1 3lCZshjuo8b38286ANAl5QuWzvWprMlV8XuEJTVnBW9Z0kdk5PqghafQrMFAkqAcGUQcv0H6MleFl kFokNYkA==; Received: from [122.165.245.213] (port=54194 helo=[192.168.1.21]) by md-in-79.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rhOAA-002kMF-03; Tue, 05 Mar 2024 11:50:30 +0530 Message-ID: <1553a526-6f28-4a68-88a8-f35bd22d9894@linumiz.com> Date: Tue, 5 Mar 2024 11:50:03 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: vkoul@kernel.org, bumyong.lee@samsung.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, parthiban@linumiz.com, saravanan@linumiz.com From: karthikeyan Subject: dmaengine: CPU stalls while loading bluetooth module Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - md-in-79.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - linumiz.com X-BWhitelist: no X-Source-IP: 122.165.245.213 X-Source-L: No X-Exim-ID: 1rhOAA-002kMF-03 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.21]) [122.165.245.213]:54194 X-Source-Auth: karthikeyan@linumiz.com X-Email-Count: 1 X-Org: HG=dishared_whb_net_legacy;ORG=directi; X-Source-Cap: bGludW1jbWM7aG9zdGdhdG9yO21kLWluLTc5LndlYmhvc3Rib3gubmV0 X-Local-Domain: yes X-CMAE-Envelope: MS4xfMgiBHd5wB21jxDOc9zZheDjDd7uayCDtvdwxCwuKhE8e0ST4xDRgPivRjxjTeqYFbWNKGSZRIHUQxbComS1LxSEaFr/TuABJSolynMihgNt4q1CKIUg wH5gkBk4XeJCJsLDbBtOkn0jigD7p3z1KzR7rZhhuS/elwLoxASLLuAXnwShc2mRXb/3dXUapmMtqZhJFFnITjceDS13cfc7nD1cSv6HhYX+xh3zWmfQPxt9 Hi all, we have encountered CPU stalls in mainline kernel while loading the bluetooth module. We have custom board based on rockchip rv1109 soc and there is bluetooth chipset of relatek 8821cs. CPU is stalls while realtek 8821cs module. Bug/Regression: In current mainline, we found CPU is stalls when we load bluetooth module. git bisect shows commit 22a9d9585812440211b0b34a6bc02ade62314be4 as a bad, which produce CPU stalls. git show 22a9d9585812440211b0b34a6bc02ade62314be4 commit 22a9d9585812440211b0b34a6bc02ade62314be4 Author: Bumyong Lee Date: Tue Dec 19 14:50:26 2023 +0900 dmaengine: pl330: issue_pending waits until WFP state According to DMA-330 errata notice[1] 71930, DMAKILL cannot clear internal signal, named pipeline_req_active. it makes that pl330 would wait forever in WFP state although dma already send dma request if pl330 gets dma request before entering WFP state. The errata suggests that polling until entering WFP state as workaround and then peripherals allows to issue dma request. [1]: https://developer.arm.com/documentation/genc008428/latest Signed-off-by: Bumyong Lee Link: https://lore.kernel.org/r/20231219055026.118695-1-bumyong.lee@samsung.com Signed-off-by: Vinod Koul diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 3cf0b38387ae..c29744bfdf2c 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1053,6 +1053,9 @@ static bool _trigger(struct pl330_thread *thrd) thrd->req_running = idx; + if (desc->rqtype == DMA_MEM_TO_DEV || desc->rqtype == DMA_DEV_TO_MEM) + UNTIL(thrd, PL330_STATE_WFP); + return true; } By reverting this commit, we have success in loading of bluetooth module. Output of CPU stalls: # modprobe hci_uart [ 27.024749] Bluetooth: HCI UART driver ver 2.3 [ 27.025284] Bluetooth: HCI UART protocol Three-wire (H5) registered # [ 28.125338] dwmmc_rockchip ffc70000.mmc: Unexpected interrupt latency [ 33.245339] dwmmc_rockchip ffc50000.mmc: Unexpected interrupt latency [ 326.195321] rcu: INFO: rcu_sched detected stalls on CPUs/tasks: [ 326.195880] rcu: 0-...0: (3 ticks this GP) idle=e5f4/1/0x40000000 softirq=551/552 fqs=420 [ 326.196621] rcu: hardirqs softirqs csw/system [ 326.197115] rcu: number: 0 0 0 [ 326.197612] rcu: cputime: 0 0 0 ==> 10500(ms) [ 326.198231] rcu: (detected by 1, t=2105 jiffies, g=-455, q=17 ncpus=2) [ 326.198823] Sending NMI from CPU 1 to CPUs 0: Expected Output: # modprobe hci_uart [ 30.690321] Bluetooth: HCI UART driver ver 2.3 [ 30.690852] Bluetooth: HCI UART protocol Three-wire (H5) registered # [ 31.453586] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c lmp_ver=08 lmp_subver=8821 [ 31.458061] Bluetooth: hci0: RTL: rom_version status=0 version=1 [ 31.458608] Bluetooth: hci0: RTL: loading rtl_bt/rtl8821cs_fw.bin [ 31.465029] Bluetooth: hci0: RTL: loading rtl_bt/rtl8821cs_config.bin [ 31.483926] Bluetooth: hci0: RTL: cfg_sz 25, total sz 36953 [ 32.213105] Bluetooth: hci0: RTL: fw version 0x75b8f098 [ 32.274216] Bluetooth: MGMT ver 1.22 [ 32.285376] NET: Registered PF_ALG protocol family Thanks, Karthikeyan K