Received: by 10.213.65.68 with SMTP id h4csp495852imn; Fri, 16 Mar 2018 09:29:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELsDnlsqtmMAE9fJIwMZKcpjCAGF++38KZMhwORsJffNjk/MEsW3LbydPp3TTeiQ+o+pGqa6 X-Received: by 2002:a17:902:8601:: with SMTP id f1-v6mr2774611plo.379.1521217772802; Fri, 16 Mar 2018 09:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521217772; cv=none; d=google.com; s=arc-20160816; b=Bi2TTNyVAdlEcQM2+Aqz420DHF4XcHJWxtr4urRzZbQUG+OuCmgtTJrSs4xi+oY9vf Hhp5l5t1uKFvoWjh4mS6hQuYgGNUPZK+rVttzwyTYg2+ix3cqyayq1hxuWfflOgMj/9R eTPKjwyFZptNCN3wMp0G1aezgjd4a+nQKja2HzTYT85H2z0fb3y1ohNPlQgeSGRmQrGa gOyfG9rdutaZaN6GiXCpzHrx2rIZEN1VUJuO+6IqAFG5mCfvZNA/ivdbhldPwsXRTyH/ pDerG1hI99vWkKAbpD/fAPbaRFHImD8ilkcuqo0eBDwd66rU+W231KAVIFmkPmCMo3pY +ACw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=urA3f7pS8Z/ZZyLtadXe9CFv7orjvgbaLUdNcRF/XrI=; b=ZvDs++ZTjjWlk+WvBrp6cM8pTwmDYTMgg6tUhAe1EOZTjWJ88fzERXaUaDmq7bo4Kb 6Ew+j7M9F9zYLJ+0piahM3dJ8/OHPWs5XAloJZIxI3nRdBbWjsQ5NR/wbxTfhPTVDqwS QqF5wYhsBaEtRoT+FI/+m+ACGSxDN8O6CrmG9tjdUvASKVTY7Hp0OD3w3A7ovZ1zWRRM NQvxqAKVCl7O5vnEYZLL7NgbbqE3qozox4bbJStGSe/lbTnnbpOivZHpvcG44Jth6D72 zDVeCOQQcbAGmXajscLULbUwuYKa3nRd+kwBwj+QqsqaL8sPddEZo48VX+layXyI4vJf q4GA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si5729082plq.674.2018.03.16.09.29.19; Fri, 16 Mar 2018 09:29:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754590AbeCPPjN (ORCPT + 99 others); Fri, 16 Mar 2018 11:39:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43176 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752829AbeCPPjJ (ORCPT ); Fri, 16 Mar 2018 11:39:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D6396CD8; Fri, 16 Mar 2018 15:39:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sinan Kaya , Vinod Koul , Sasha Levin Subject: [PATCH 4.14 108/109] dmaengine: qcom_hidma: check pending interrupts Date: Fri, 16 Mar 2018 16:24:17 +0100 Message-Id: <20180316152335.715008179@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sinan Kaya [ Upstream commit 38680bc6b1e3592bc9e18adc1d6e259667df27ce ] Driver is missing the interrupts if two requests are queued up at the same time as the interrupt handler is servicing a request that was just delivered. The ISR clears the interrupt at the end but it could be clearing the interrupt for an outstanding event. Therefore, second interrupt never arrives. Clear the interrupt first and then check for completions. Also, make sure that request start and interrupt clear do not overlap in time by using a spinlock. Signed-off-by: Sinan Kaya Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/dma/qcom/hidma_ll.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/dma/qcom/hidma_ll.c +++ b/drivers/dma/qcom/hidma_ll.c @@ -393,6 +393,8 @@ static int hidma_ll_reset(struct hidma_l */ static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause) { + unsigned long irqflags; + if (cause & HIDMA_ERR_INT_MASK) { dev_err(lldev->dev, "error 0x%x, disabling...\n", cause); @@ -410,6 +412,10 @@ static void hidma_ll_int_handler_interna return; } + spin_lock_irqsave(&lldev->lock, irqflags); + writel_relaxed(cause, lldev->evca + HIDMA_EVCA_IRQ_CLR_REG); + spin_unlock_irqrestore(&lldev->lock, irqflags); + /* * Fine tuned for this HW... * @@ -421,9 +427,6 @@ static void hidma_ll_int_handler_interna * Try to consume as many EVREs as possible. */ hidma_handle_tre_completion(lldev); - - /* We consumed TREs or there are pending TREs or EVREs. */ - writel_relaxed(cause, lldev->evca + HIDMA_EVCA_IRQ_CLR_REG); } irqreturn_t hidma_ll_inthandler(int chirq, void *arg)