Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1822759pxb; Mon, 13 Sep 2021 06:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv/Hn/D1/UpfOSrFI5po1QSTw9lyrx0a6nAJWGACVFjufDhGhvLRmajvpxqsfny2wiRRzM X-Received: by 2002:a6b:e70f:: with SMTP id b15mr9037766ioh.140.1631539277695; Mon, 13 Sep 2021 06:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539277; cv=none; d=google.com; s=arc-20160816; b=Njw/PJTU0viotuWRIo72jupXK+XamGmAMiRQ+4t7PTboBaS+ef8HFIKYVbcVkjSav0 s5qjTfZFsjeLV4WBbQVC5549L1HUDc+4xGvh3KeeCLtUUMtO1uFMgrT1aNLmWOhvRnEd BoQt5SleZsbsiKRnHjSNrBG0JmOHuVnKT3KNOE0joexIvKZ/H+bGPyt/bWiNwJo13ewY G4ItjHO1i7S71x4I9XS4Br60Nc2aCe/xgX74JCMFM2kRzqp9vZlY2Dgq+fBoA8lxWtXE 92CoRdvrnMnr5i+8RGQvdpJvVr35AufJjFZZgaHjCP33KVuiGfv0QsdoRliYnuJ5ufOM jrfA== 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=K1H4UZBg2rnour8Rrn1utHkJ9gI/gi9Ptc/4kb/yph8=; b=sBI90/LkYvjw1l2gVh+RjYOtVUEmuF0xf4XfMcoE8RoSNyXJSxlNzeH4VNVHzh01wP G9J4shlryDdsZtZJPhrV6sOSupPba/brd2kv0LD49BQ5Rl0IxGOSZ7/LZksCYKEj3xSf /5Y59BgOzMtgM5h7XPm6AdWbP8V+X6/6fASrTCTx/NksMAOvTgD2DlhZhd2mvZFwad/5 3aWZX3BO7fZ1A/BaOxHlRepO3uOZb7NgYyyB8feeMyJU+V+DNMX+q3vwmISUfzqyU9CR QxS4yhAht0yPz9cL6imvtOuZnG/PPHL1KhzJ//3xyJ6d0+mV5/C3OjdiKUBClazVW5h+ Z+LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CEVifUKK; 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 f11si6448712iok.80.2021.09.13.06.21.04; Mon, 13 Sep 2021 06:21:17 -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=CEVifUKK; 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 S240580AbhIMNVB (ORCPT + 99 others); Mon, 13 Sep 2021 09:21:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:35020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240342AbhIMNU1 (ORCPT ); Mon, 13 Sep 2021 09:20:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97D4161151; Mon, 13 Sep 2021 13:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539109; bh=kjrEMFN50luWHLg2ZPfMx0G7+RhCiUinoKE8PdgE6E4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEVifUKKb2Z5/cmwI5Ok/xR3L32PQDxln2JaHk83JmBhYFGiC6RA9t2bxyfMlb8A2 Uz0IF4rLxf357Ds6S+cjRIwyTzmWkfYTBHZeH8baLly81fO7spUrx6hucYvEiRrBth cUpDvufL8oeUq1hj9jYsk4yxXSh8Sq9fLkykhBhQ= 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.4 044/144] spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op not interruptible Date: Mon, 13 Sep 2021 15:13:45 +0200 Message-Id: <20210913131049.416428181@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 5cf6993ddce5..1ced6eb8b330 100644 --- a/drivers/spi/spi-zynq-qspi.c +++ b/drivers/spi/spi-zynq-qspi.c @@ -533,7 +533,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; } @@ -551,7 +551,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; } @@ -567,7 +567,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; @@ -591,7 +591,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