Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1483887ybt; Mon, 15 Jun 2020 01:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbwLZVNu+3kmkn96h0TzqJyRFZ6hQzDfbmKRVH5ryiipRvC03L27YADj351G0us+n4Wv2z X-Received: by 2002:a05:6402:17af:: with SMTP id j15mr22145253edy.67.1592208632592; Mon, 15 Jun 2020 01:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592208632; cv=none; d=google.com; s=arc-20160816; b=LxFWwDprnsYNFljIQPtpMyPgw99FyDwY0oC3medIZiPyVPwqwQ5hm0x9SxkhqOPs26 rzhsQXhbH+gUagJ1x7CUV/mJx4hv3qW/0MLhmwkG/5RAIlNaW8XEQauyWVXMXR/eUGVW p/VZ9hNYJzrUnBz3RA6CN9bMgX8cnWUv41wMid/iQ5OXEcDg6ZUHecxzOCEzCo/wyEhI sDIGicxiP2LEDiEFpS2Aiu4wtKDTW6euB0qZ65AfRXjZs3mJbrbY2wnmIYQwXnjX00f8 Ndr6brN7R+vTnlQtN1FKH9s/yvAgOh9hufmxN7/eB5/lIXmziqZ0o9K3J0bPsHiXaTs7 0c/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=enzftT61/4Cjg+8ZFlhnrP2FfwW8xIrJGDydodkDdeg=; b=LXJvJPxSmOdXQp/C//WTUPsDPqoi/ch+tWJUrLULhknS+FPbnSiI6E8+4nxWnBu9xv iWkWn9KPfqF4tF7Zlnw0wR2X3LQzCBgJY/4n0bdiREZGEeheiWknDx58xN1p/R+7SuDV J/4sJ6kFSiSSMouC0jln/OQF4ypOW4tf47iF8QZM+GTxx0/sB1ObIUWx0+Ias9eYmlvi ed6g5R3PkX85CSgpDwRb8rmDHNKfoRrEwZJkG+12Fs6t/KgWzzd4en47SRWarZxNWBGh pkK9VpLVlUg1Yn8sP1yYPkUXvd1weHO0CWmXqZKt3kZTa6hBamOOt5nZA6+nQVfJtp+s gcqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="y/jRKJDC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si8575209edt.481.2020.06.15.01.10.10; Mon, 15 Jun 2020 01:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="y/jRKJDC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728895AbgFOIIK (ORCPT + 99 others); Mon, 15 Jun 2020 04:08:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:60934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728260AbgFOIIG (ORCPT ); Mon, 15 Jun 2020 04:08:06 -0400 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCD7E20739; Mon, 15 Jun 2020 08:08:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592208485; bh=LUPoJCPiZ/wjm5oTIJ2xHNWoOg9h7BTPPnxEp9CP1Rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y/jRKJDCe1kmUUnZACX5iG5uZnbo8a87qS/eLcoyn8WyMxZ8TZqNtsWgAUlDDoQVi r66uEnd1Cs4XmeFA0kJMzcRSXFaeiBJnZCMJLs7b6z4O8bku20AJTaoqMlngop29bs gWdzFS9HnTnB+NDjbSZN+b5DKNdGaWf6c+5Um3Qo= From: Krzysztof Kozlowski To: Mark Brown , Thomas Gleixner , Vladimir Oltean , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marc Kleine-Budde , Wolfram Sang , kernel@pengutronix.de, Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH v2 2/3] spi: spi-fsl-dspi: Initialize completion before possible interrupt Date: Mon, 15 Jun 2020 10:07:18 +0200 Message-Id: <1592208439-17594-2-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592208439-17594-1-git-send-email-krzk@kernel.org> References: <1592208439-17594-1-git-send-email-krzk@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The interrupt handler calls completion and is IRQ requested before the completion is initialized. Logically it should be the other way. Fixes: 4f5ee75ea171 ("spi: spi-fsl-dspi: Replace interruptible wait queue with a simple completion") Cc: Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Rework the commit msg. --- drivers/spi/spi-fsl-dspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 023e05c53b85..080c5624bd1e 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1385,6 +1385,8 @@ static int dspi_probe(struct platform_device *pdev) goto poll_mode; } + init_completion(&dspi->xfer_done); + ret = devm_request_irq(&pdev->dev, dspi->irq, dspi_interrupt, IRQF_SHARED, pdev->name, dspi); if (ret < 0) { @@ -1392,8 +1394,6 @@ static int dspi_probe(struct platform_device *pdev) goto out_clk_put; } - init_completion(&dspi->xfer_done); - poll_mode: if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) { -- 2.7.4