Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1885096pxb; Mon, 13 Sep 2021 07:31:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF9MQBSOoUuEaKEqf8WXTjFBC7fVlinyJB7KuQteksNULvLoGsRFvQD+kqmdPKcMv9aOEn X-Received: by 2002:a05:6402:2810:: with SMTP id h16mr12667957ede.293.1631543489724; Mon, 13 Sep 2021 07:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631543489; cv=none; d=google.com; s=arc-20160816; b=KsYiJrPkZ9nQS4xCMr3MIVTpmgHa5fO9YCQjuW1URwQ+EEP3iOI4NpR/kHF7K+xRxC RQzmZY69bNplh+yPkk/aSaxY0T0yMMhtmBfWxpc5EA4RncUvk0CVwhIW09RJmMdszppT bK27JbQfVvd10+v1Zcbcizf3L0fMVAu1Pgq7ONVBuvMWEmTviEkd369TBfS9sXUpmv9k FFvxQTVM+UFEzyfCfJVMH0JlW+r3RAclLaNu5KyY/zDkZCVnFIJ8hmed52Mt0mcByp8E jii+c3pMbUu8Ay/O/gMTzTLyZixn4wx3s6gib+qLZQ+VYT8/QsvgGB17L5QtKJwsbF+N RYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xyh0iEDelHGkujXvsskuDjQKettxAXPwpC+u1r0Laxw=; b=fwUAr2dpb97kqFCuWmAHrtJHJ1kDBRJnXCcJst1opRwLCEDBpSHrsWPwKHaZ9eaS4F hBljEGAEpBFWOlr7mFqBq4SWsblVpMv45Lxa/BQiV1Mgnc+sWj+iuBK3ogM2fn7g7cXq dVpTYy13+AeJNxehY97L0vUR02IFlmBvugUZ4UWT6JYmmqwVZ/SdivyvQNOsWEUgSsau sx6Ci+3QnZ5ejKpiDV+Zb51YYBPWqGPKdtopgn700g3AeqNvQDgvzrC+mRLy4RmB3+Y6 3nCeLFvVlKWzfmiKcK6p6lcUtkSKW/2FTPfvvbFgbAaGErSl6PvVoM4rWJp1aco6Sg0D 13XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ERzLQKHP; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si9182374ejy.467.2021.09.13.07.31.03; Mon, 13 Sep 2021 07:31:29 -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=@linuxfoundation.org header.s=korg header.b=ERzLQKHP; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346084AbhIMO3P (ORCPT + 99 others); Mon, 13 Sep 2021 10:29:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:46960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346426AbhIMOY3 (ORCPT ); Mon, 13 Sep 2021 10:24:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D087F6121F; Mon, 13 Sep 2021 13:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540902; bh=nP78YhW5egISnhxIC3ox67pxakh0FxRWK5AJa/va5pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ERzLQKHPxPpaqVofSFDk6Hu69+mOwB5la/qBp91MMtjJeN9vpiGjuEAvPi2GL5ttw 75FsemUCX6V1Lrcaewwk3JlNq+Hn66D9PtJQZYzHZW1yNZSQB2N9KGUxFkzu4676kK sdEoP6Hg7onzdQP0sk3qla066MsGRDZmv54pmg/8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quanyang Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.14 081/334] spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op not interruptible Date: Mon, 13 Sep 2021 15:12:15 +0200 Message-Id: <20210913131116.133561645@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quanyang Wang [ Upstream commit 26cfc0dbe43aae60dc03af27077775244f26c167 ] The function wait_for_completion_interruptible_timeout will return -ERESTARTSYS immediately when receiving SIGKILL signal which is sent by "jffs2_gcd_mtd" during umounting jffs2. This will break the SPI memory operation because the data transmitting may begin before the command or address transmitting completes. Use wait_for_completion_timeout to prevent the process from being interruptible. Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller") Signed-off-by: Quanyang Wang Link: https://lore.kernel.org/r/20210826005930.20572-1-quanyang.wang@windriver.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-zynq-qspi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c index 9262c6418463..cfa222c9bd5e 100644 --- a/drivers/spi/spi-zynq-qspi.c +++ b/drivers/spi/spi-zynq-qspi.c @@ -545,7 +545,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem, zynq_qspi_write_op(xqspi, ZYNQ_QSPI_FIFO_DEPTH, true); zynq_qspi_write(xqspi, ZYNQ_QSPI_IEN_OFFSET, ZYNQ_QSPI_IXR_RXTX_MASK); - if (!wait_for_completion_interruptible_timeout(&xqspi->data_completion, + if (!wait_for_completion_timeout(&xqspi->data_completion, msecs_to_jiffies(1000))) err = -ETIMEDOUT; } @@ -563,7 +563,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem, zynq_qspi_write_op(xqspi, ZYNQ_QSPI_FIFO_DEPTH, true); zynq_qspi_write(xqspi, ZYNQ_QSPI_IEN_OFFSET, ZYNQ_QSPI_IXR_RXTX_MASK); - if (!wait_for_completion_interruptible_timeout(&xqspi->data_completion, + if (!wait_for_completion_timeout(&xqspi->data_completion, msecs_to_jiffies(1000))) err = -ETIMEDOUT; } @@ -579,7 +579,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem, zynq_qspi_write_op(xqspi, ZYNQ_QSPI_FIFO_DEPTH, true); zynq_qspi_write(xqspi, ZYNQ_QSPI_IEN_OFFSET, ZYNQ_QSPI_IXR_RXTX_MASK); - if (!wait_for_completion_interruptible_timeout(&xqspi->data_completion, + if (!wait_for_completion_timeout(&xqspi->data_completion, msecs_to_jiffies(1000))) err = -ETIMEDOUT; @@ -603,7 +603,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem, zynq_qspi_write_op(xqspi, ZYNQ_QSPI_FIFO_DEPTH, true); zynq_qspi_write(xqspi, ZYNQ_QSPI_IEN_OFFSET, ZYNQ_QSPI_IXR_RXTX_MASK); - if (!wait_for_completion_interruptible_timeout(&xqspi->data_completion, + if (!wait_for_completion_timeout(&xqspi->data_completion, msecs_to_jiffies(1000))) err = -ETIMEDOUT; } -- 2.30.2