From patchwork Mon Jan 9 17:03:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 9505571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D6D360757 for ; Mon, 9 Jan 2017 17:03:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83B2B2849D for ; Mon, 9 Jan 2017 17:03:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 786A7284B9; Mon, 9 Jan 2017 17:03:54 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ABE42849D for ; Mon, 9 Jan 2017 17:03:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761085AbdAIRDs (ORCPT ); Mon, 9 Jan 2017 12:03:48 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37309 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762948AbdAIRDo (ORCPT ); Mon, 9 Jan 2017 12:03:44 -0500 Received: by mail-wm0-f54.google.com with SMTP id c206so40185739wme.0 for ; Mon, 09 Jan 2017 09:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IOPdPyro8RvAF8oFE5jOHlVEYDARnrO+X9JyqwP/RTo=; b=2KTKf075Pv2tx0gvpHapFpbSzpuEkbqgj2vwOGM7QGuOQpPVJasRAfo0mLsl0ufrP8 ZVbkBPendRD13l1yLclc9cDD7/gd4FXutz0Xb/7ZsvfiVTrQS96TuPFb5sQFV/+5XIqn 8nKDfib1BrexhDVmgDAzauTn51X+uIDFwcVewLqakvZr9PXeQZc+MTkG1rIVpLy3Up9L F4A6YsEyXEEzB/+C0vrvMaslaUSvZeXBbZiQkxhbwz8bGCDUEcSHw8MJyrHwUj3AxHnc Nfwp5ig5Ux3lbkL1FN7jMuzRHBemGE//TKB0cKqcS0u4mANU/IeKNQ4Znp4fmmcdC4JN kdCg== 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:in-reply-to :references; bh=IOPdPyro8RvAF8oFE5jOHlVEYDARnrO+X9JyqwP/RTo=; b=tIMsuvZ/v6j6vVvB/je6hQO5mP4qup2Tjq0saHyHVKPYOLmNf1XL1cesvXDy6rE3Cx 7piww58cDOS5l+eJ7tqF3FvNysGcOlO7P085/FThsfkuBid2/oOWs5DzUnTHyne8ttyH 1zE3DbT/ZZ5McjF6iG7jOO8G/3maqVvFs+6OnqOgxYvr/v+hkBDIZQiU66vZZrjMRpRf /+WO9oMpVaLbOCKwkprX7hR1mwnAuWEBfC03CAuSd9FIE2CDk6/6yJs+jeAyDfV7CYM5 wxPBMQA7aNEO4fFwDLeBpZYCRwc8B9rXXkwVWTEeftQSbc+CLtgkRyRXlpOVPNB9UeeX LlPQ== X-Gm-Message-State: AIkVDXKYAKs6OPfH0h0R8NU6YuLd6wKecrGCUHUf5NwPV6/g6ENffRP/gameIRCosOQBaSHY X-Received: by 10.28.16.70 with SMTP id 67mr4698796wmq.53.1483981422690; Mon, 09 Jan 2017 09:03:42 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id l67sm19775913wmf.20.2017.01.09.09.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jan 2017 09:03:42 -0800 (PST) From: Alexandre Bailon To: vinod.koul@intel.com Cc: dmaengine@vger.kernel.org, linux-usb@vger.kernel.org, nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, tony@atomide.com, linux-omap@vger.kernel.org, andy.shevchenko@gmail.com, Alexandre Bailon Subject: [PATCH v2 2/2] dmaengine: cppi41: Ignore EINPROGRESS for PM runtime in interrupt handler Date: Mon, 9 Jan 2017 18:03:37 +0100 Message-Id: <20170109170337.6957-3-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170109170337.6957-1-abailon@baylibre.com> References: <20170109170337.6957-1-abailon@baylibre.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We can occasionally get -EINPROGRESS for pm_runtime_get. This is happening when an interrupt is fired before PM runtime had time to update the PM state to RESUMED. In that case, don't print any error. Signed-off-by: Alexandre Bailon --- drivers/dma/cppi41.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 025fee4..2306020 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -320,7 +320,7 @@ static irqreturn_t cppi41_irq(int irq, void *data) int error; error = pm_runtime_get(cdd->ddev.dev); - if (error < 0) + if ((error != -EINPROGRESS) && error < 0) dev_err(cdd->ddev.dev, "%s pm runtime get: %i\n", __func__, error); @@ -492,8 +492,7 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan) */ if (error == -EINPROGRESS) { spin_lock_irqsave(&cdd->lock, flags); - if (list_empty(&cdd->pending)) - active = true; + active = !!list_empty(&cdd->pending); spin_unlock_irqrestore(&cdd->lock, flags); } }