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: 9505569 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 1DBD760757 for ; Mon, 9 Jan 2017 17:03:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23DF02849D for ; Mon, 9 Jan 2017 17:03:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18925284B9; Mon, 9 Jan 2017 17:03:53 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 B911F2849D for ; Mon, 9 Jan 2017 17:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762955AbdAIRDt (ORCPT ); Mon, 9 Jan 2017 12:03:49 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38690 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762954AbdAIRDo (ORCPT ); Mon, 9 Jan 2017 12:03:44 -0500 Received: by mail-wm0-f50.google.com with SMTP id k184so128297936wme.1 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=LnZkBWu84E2Vh7MgFqucSB9Dlt5UwiKXhqbWKjp3AXGTfCuhDLE5rXRUDz/lJZMAZG 037rtq+VG6LgsWM+dJvqnbVA1bAqLoFXoTaCZqJsRPn5WDVt5tqQrwLVoA2mj+5GnWIH NOvMIk0eeOhDTQidYQ6KAxhdqmEw4A+431dd5ltMt1pdYO9b0q207D9fwQ+Pu+8txyta QJizf/hkBIkU7MHaZY2Jwve9RP5azQ8RaYBAaWmSDMbfZk3OWrwlnWM3s1KyJgZlQll6 a89Kx8kDm/RSr6bIBmLN0UKO0OIrVVUMPoemnK9aXIqV89B9sNb1E1+eAgG7GfjA5qri RIEw== X-Gm-Message-State: AIkVDXLgHBlXDrEmDIPhMoEBL6ACp2ZwWbYg023YtFdjxzeL1m4K71LyPxmZozD6+yxPNPJ2 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: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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); } }