Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1839659pxb; Mon, 13 Sep 2021 06:41:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYPRNa4y5wxEUXwf1fVqw/aQM9eQBW37AQJMQycSaWHG4azl9dOYTETavCcDvbW9vLN42J X-Received: by 2002:a05:6e02:13ef:: with SMTP id w15mr4606898ilj.255.1631540502613; Mon, 13 Sep 2021 06:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540502; cv=none; d=google.com; s=arc-20160816; b=IjrAOyexlJLsOtDlQbx/9One0JjIUUZNWQWfmTRwi279All5W5EVs4j7DTKkd5EDkb uGuR6BM1t2P0Ii6pgZiGIXpX/Finv1IgF1oie9iQk3YTQL8tu6LajA59SmtRZWgplntv nnRlTnFjKFPo5Zfid5vmvCzetuS+FDNaY+KWjvu+NJVRrUHO4va3dEZBCgb+aqUQ6K+p IhJKhuFuZnh9YSaMljGHSM98ODzfVZ601AEZJ2VEmCq1/jNKaM89ZHxsPPA9nx39TIBm 2zCLdk4bycZ8WXl6263aTUcAJtlgS3YfZDDhXsu2nwW7wbA2gTxp8SM79kZVB6Pj30t7 NeYQ== 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=OLheyV9LM+gaD0fPtuk+zVy6NDBxmmsxke50X4N7OOo=; b=jj5UcyyROcdimxTYrF/bCaxv/KbfoNPudfCrHxMRu2O9Brg64a4Sk/d4ERy93dXHBN t3MpKUO9XVW7pLbU1GBhLPliwvmo9qtFNlIH/zN7kSi4EvMl7ojzj5mm6GHQMgAxGQ6x NyNjbLA82rgqIcjoHD8OvPqWAkTWPFFWhCtkuuLwmg8Ki6kGrPRchxPjlXLREzKGq9WY ykuBXjB6lF4W4KnCwj7T+YtvS0cefz+9Hmt152ZktxeRrxjMmJbAe1+MtH6RZUYbL0m9 FsEHAPXjWqpMGnaoz0q1jTgmWN1H7UAkzG7L2nrKg3Ke8J0sSfsiEQl0xn8muks4mork UKVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y+4owsLU; 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 q22si6422786jae.93.2021.09.13.06.41.30; Mon, 13 Sep 2021 06:41:42 -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=y+4owsLU; 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 S242898AbhIMNlD (ORCPT + 99 others); Mon, 13 Sep 2021 09:41:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:60032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243280AbhIMNfL (ORCPT ); Mon, 13 Sep 2021 09:35:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D456E6113B; Mon, 13 Sep 2021 13:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539635; bh=6/nUNLV6uq2S6wGpXS5nMzjp8J1lMFzCHjONzA59AyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y+4owsLUPanEH/1IYwdDpwdDAg+JLsAx0BHqnqw0p1m+ptsCB6BYvINftbKg9JeiS Fkbb4B2gg9siBQbMAvxOtaJtpRTOEgSu/1OpqjHLLNqQ0eHaVejfj+BCOx20lMX8D2 xol4fKe9HeqhPWvg174M0fALz5ic8RMmEFkYQIRQ= 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.10 067/236] 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:52 +0200 Message-Id: <20210913131102.639110781@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 68193db8b2e3..b635835729d6 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