From nobody Thu Sep 19 00:19:34 2024 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 0438F176242; Mon, 26 Aug 2024 12:11:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724674279; cv=none; b=p18dksAUyAZHkGMSKkTpkmtKrr5eyHOuipk4EVzSAaq8aZ5Gr75u9AEDEtiBWGbrfD20ymsgp4lvqalP+I7zha4J4sYhJyKm1JGk4hE/+rrNPz+6qpD34g75Man98gFI7xBATD8Mhvs1Psv/sQiBAWb0knBO/uji5ulKIvh64oE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724674279; c=relaxed/simple; bh=A1EGEgVEh+++0jc6Bgdz3ZDUqdc5bSbPLOUO55xH/QQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=BKPgpS88mIIOAZkVDtgdPlL6zoXkEnkeo7YR08H0jQdaPaVeAZAVSHP3BXrqrdHR2aVKBtJvLaluoXUqviDADmsR3UeURs3Hvw4O3746I7mINdVVw/4D8wIWqiAZI504DY5xkpyAOuhnGVF53huZGeYf78YmLPSXgYAeR5n4vCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=cWrrDhRL; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cWrrDhRL" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47Q8MPIE017707; Mon, 26 Aug 2024 12:11:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:date:from:in-reply-to:message-id:references:subject:to; s= qcppdkim1; bh=Fd15ANGpJfwgpnbRdYVbXe17Bhso7G6exCCX0TOn9Mw=; b=cW rrDhRLDz5MCQjPIXoxeFuCrsF7fl4QhX1OdkpDVA2FYlINVYILuPc7kHODT9J9sT 9PyqysDZrzpM5a3AsTg2fhUotflwVPcoXlqHJXfQZAa9Vqzwqhf0LUxlGyOj84V8 VNrH1YUhuzcjCxvxj/9Eqpg5YcExWEsNY54pmSMqYSdXeA/fRrW3mBjGOo8ogANO 9dRZQUYqzmikguanvePXUpv6NLjxnMA+hVqg9SipaHQx4vhQV0aimqvlLJIq/Q7i cP0hUDJcskKkgiPfwCzyThccpQ2RZ4+2oYceCmgC4uAcsiaIZKe0HrhTJj0EFCJr /BwebwkhZAnBRDgQlcHQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4179a1uhjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Aug 2024 12:11:09 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 47QCB6IW023386; Mon, 26 Aug 2024 12:11:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 4178kkjamx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 26 Aug 2024 12:11:06 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 47QCB5gU023378; Mon, 26 Aug 2024 12:11:06 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-msarkar-hyd.qualcomm.com [10.213.111.194]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 47QCB5Ga023377; Mon, 26 Aug 2024 12:11:05 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3891782) id 2A201B63; Mon, 26 Aug 2024 17:41:05 +0530 (+0530) From: Mrinmay Sarkar To: manivannan.sadhasivam@linaro.org, fancer.lancer@gmail.com, vkoul@kernel.org Cc: quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, Mrinmay Sarkar , stable@vger.kernel.org, Cai Huoqing , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA Date: Mon, 26 Aug 2024 17:41:00 +0530 Message-Id: <1724674261-3144-2-git-send-email-quic_msarkar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1724674261-3144-1-git-send-email-quic_msarkar@quicinc.com> References: <1724674261-3144-1-git-send-email-quic_msarkar@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: pxBCF2daSs5PiRLpeD7CIvrSiAS88wJR X-Proofpoint-ORIG-GUID: pxBCF2daSs5PiRLpeD7CIvrSiAS88wJR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-26_08,2024-08-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 bulkscore=0 phishscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=618 spamscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408260095 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The current logic is enabling both STOP_INT_MASK and ABORT_INT_MASK bit. This is apparently masking those particular interrupts rather than unmasking the same. If the interrupts are masked, they would never get triggered. So fix the issue by unmasking the STOP and ABORT interrupts properly. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") cc: stable@vger.kernel.org Signed-off-by: Mrinmay Sarkar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin --- drivers/dma/dw-edma/dw-hdma-v0-core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw= -hdma-v0-core.c index 10e8f07..2addaca 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c @@ -247,10 +247,11 @@ static void dw_hdma_v0_core_start(struct dw_edma_chun= k *chunk, bool first) if (first) { /* Enable engine */ SET_CH_32(dw, chan->dir, chan->id, ch_en, BIT(0)); - /* Interrupt enable&unmask - done, abort */ - tmp =3D GET_CH_32(dw, chan->dir, chan->id, int_setup) | - HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK | - HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN; + /* Interrupt unmask - stop, abort */ + tmp =3D GET_CH_32(dw, chan->dir, chan->id, int_setup); + tmp &=3D ~(HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK); + /* Interrupt enable - stop, abort */ + tmp |=3D HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN; if (!(dw->chip->flags & DW_EDMA_CHIP_LOCAL)) tmp |=3D HDMA_V0_REMOTE_STOP_INT_EN | HDMA_V0_REMOTE_ABORT_INT_EN; SET_CH_32(dw, chan->dir, chan->id, int_setup, tmp); --=20 2.7.4 From nobody Thu Sep 19 00:19:34 2024 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 3B81A1922C5; Mon, 26 Aug 2024 12:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724674280; cv=none; b=Xme7y8mlYpCVowWshMbKoe7siQDmufEUV97VLTE6miH/7DAjlC3bTRcNbmlznob6mDmZxEb1ofBX1fubr/pCswY7+VZ60R0p893IYGvsidPoDpFZwm3jhXrGWJ1yQXuPFpoyRAw3nT73amIDS8IYtL9Hcaoryughba6qo1cu19M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724674280; c=relaxed/simple; bh=2LR4QjIA/PkoKFG4ghzl7hwL4NmodTxNSXJuhMxmrVk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Z7WNwSS2c1G0KNB2dW/jaZydJIcJqjYuSELWsN3x5FC/stAcb7XruNCbwqMWAuXIfgYBO+IDxKszuphAPwo6nOXVwcSg+/P8PTkm26hMDzXiVqsihlM4x3gK7z3xEvgavMcxKoS49ksxiHfWpsasEhX6RrJCeDwD8fnMnG1PFcQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=NN4pM6e7; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="NN4pM6e7" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47Q8MOnP017688; Mon, 26 Aug 2024 12:11:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:date:from:in-reply-to:message-id:references:subject:to; s= qcppdkim1; bh=X4BCi4GwH41+U+y5D6WUKqWUYYIsRuvsCMc7bjn8fTk=; b=NN 4pM6e7pcboVLpH6Wb6pTThprZaTcxU0+vfjPtZZouSAe0wiTHvjp0EcdopXjsrcr DjVjJNd2v02PXPM3UTvdKf/7VQ61D6CjN4QWpU0UFuVYbNmhr/5/hFjIvqhdBVOj gVIWPgVAcSYgld0U1D7pnQw9cLlIl3uUcqGKa/v3Wab+ZbMw+TgNLiXeUVwu70mi ryZ150DCOK51W/+wvxdkzVg10Qcs65tC3Lj61ZXdNYGEWKiYFu2R0AArBy4krlr3 zKRWzZ4K95hxXdF65DV9o/f44FB77dnLc0kc4ufQtw6ySRKPt/yveQbqYXJe/mW5 U8s9n5tJ035+4Ts73fgw== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4179a1uhjd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Aug 2024 12:11:10 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 47QCB7Mn023402; Mon, 26 Aug 2024 12:11:07 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 4178kkjan7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 26 Aug 2024 12:11:07 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 47QCB7nU023396; Mon, 26 Aug 2024 12:11:07 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-msarkar-hyd.qualcomm.com [10.213.111.194]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 47QCB75O023393; Mon, 26 Aug 2024 12:11:07 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3891782) id 66C5FB63; Mon, 26 Aug 2024 17:41:06 +0530 (+0530) From: Mrinmay Sarkar To: manivannan.sadhasivam@linaro.org, fancer.lancer@gmail.com, vkoul@kernel.org Cc: quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, Mrinmay Sarkar , stable@vger.kernel.org, Cai Huoqing , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] dmaengine: dw-edma: Do not enable watermark interrupts for HDMA Date: Mon, 26 Aug 2024 17:41:01 +0530 Message-Id: <1724674261-3144-3-git-send-email-quic_msarkar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1724674261-3144-1-git-send-email-quic_msarkar@quicinc.com> References: <1724674261-3144-1-git-send-email-quic_msarkar@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: CWL01elRRLT20lk9S5NS2KdGYT3U3BpE X-Proofpoint-ORIG-GUID: CWL01elRRLT20lk9S5NS2KdGYT3U3BpE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-26_08,2024-08-26_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=467 spamscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408260095 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" DW_HDMA_V0_LIE and DW_HDMA_V0_RIE are initialized as BIT(3) and BIT(4) respectively in dw_hdma_control enum. But as per HDMA register these bits are corresponds to LWIE and RWIE bit i.e local watermark interrupt enable and remote watermarek interrupt enable. In linked list mode LWIE and RWIE bits only enable the local and remote watermark interrupt. Since the watermark interrupts are not used but enabled, this leads to spurious interrupts getting generated. So remove the code that enables them to avoid generating spurious watermark interrupts. And also rename DW_HDMA_V0_LIE to DW_HDMA_V0_LWIE and DW_HDMA_V0_RIE to DW_HDMA_V0_RWIE as there is no LIE and RIE bits in HDMA and those bits are corresponds to LWIE and RWIE bits. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") cc: stable@vger.kernel.org Signed-off-by: Mrinmay Sarkar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin --- drivers/dma/dw-edma/dw-hdma-v0-core.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw= -hdma-v0-core.c index 2addaca..e3f8db4 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c @@ -17,8 +17,8 @@ enum dw_hdma_control { DW_HDMA_V0_CB =3D BIT(0), DW_HDMA_V0_TCB =3D BIT(1), DW_HDMA_V0_LLP =3D BIT(2), - DW_HDMA_V0_LIE =3D BIT(3), - DW_HDMA_V0_RIE =3D BIT(4), + DW_HDMA_V0_LWIE =3D BIT(3), + DW_HDMA_V0_RWIE =3D BIT(4), DW_HDMA_V0_CCS =3D BIT(8), DW_HDMA_V0_LLE =3D BIT(9), }; @@ -195,25 +195,14 @@ static void dw_hdma_v0_write_ll_link(struct dw_edma_c= hunk *chunk, static void dw_hdma_v0_core_write_chunk(struct dw_edma_chunk *chunk) { struct dw_edma_burst *child; - struct dw_edma_chan *chan =3D chunk->chan; u32 control =3D 0, i =3D 0; - int j; =20 if (chunk->cb) control =3D DW_HDMA_V0_CB; =20 - j =3D chunk->bursts_alloc; - list_for_each_entry(child, &chunk->burst->list, list) { - j--; - if (!j) { - control |=3D DW_HDMA_V0_LIE; - if (!(chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL)) - control |=3D DW_HDMA_V0_RIE; - } - + list_for_each_entry(child, &chunk->burst->list, list) dw_hdma_v0_write_ll_data(chunk, i++, control, child->sz, child->sar, child->dar); - } =20 control =3D DW_HDMA_V0_LLP | DW_HDMA_V0_TCB; if (!chunk->cb) --=20 2.7.4