Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp268068ybi; Wed, 29 May 2019 21:02:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyVfEUekCTjKp73qK6w1mVZcJeyv0/LkZHVjpQjcAqiibXJ10jSxzkJg6tfuVOqXFZR1nV X-Received: by 2002:a17:90a:718c:: with SMTP id i12mr1822953pjk.32.1559188931294; Wed, 29 May 2019 21:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188931; cv=none; d=google.com; s=arc-20160816; b=HIQdjfF/kzpUNlDtnrvleSf0svDkwqTtELuclo43/NFoiZSoQUblQooriv9nvRQKVJ wSlNLYBMGFrNhsq1iI4oLWK4OFRfb/384jpxCtu7Q1Y/fJG3h0RZFffULexpCYbocsu6 WnCKufFL0nBoAksFi47Y5Al/lS1qt9ah+BG+f7YDDXSzkaMXWmFifDD/zixGsRpzIqoJ s+04Nqr3WXWZCoR9ReJ4i0vQEFQ5nCf1hhGYdV4sZdRvr15rceqRtDFXC5IQ6GgBux61 vrSJfU9NbDw23ILOnI/JcqjuzZwWW0gROdxTeI2jXPQLkUZITlMRt8kqDhHwSjavInj0 vuFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TgKvtQnpm5PtqKxkcp7Qu+VdmoBUcKc/uOpUgT/Q8BQ=; b=Uo7WoL8/r/n28Voym8ZzIly61W3aDSu6zUJdm7Vdxd57mzlkxJOpJzywgwzIRHsRiI Cu1hu8hWlRwJs5W8jiA/gsU9lpIhASkQozkdF5YoLWh0GERzhctbiO2EP399FOZiOOUX VcMDF3nbpmop5G0MJw3afnsKVz5kLDvCxraCcY/oJeuzbm2nb+AEwlfCbNvrmDNLMYYj ZFnfaf8QDnJlNOodySnDV56Tins3lxDwLmXyWyrx10YU9k3laQLn71KrFSpV0mZZs5DA JcjQ5tvWmzF4eqULA85EKctTrAhoJOABBDdNjQwJHs1WnStkNyv1LYCI/ueshzUq3RvD myQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SIwe5Ju7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16si1730245plr.292.2019.05.29.21.01.55; Wed, 29 May 2019 21:02:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SIwe5Ju7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731633AbfE3EAi (ORCPT + 99 others); Thu, 30 May 2019 00:00:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:50856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730010AbfE3DSV (ORCPT ); Wed, 29 May 2019 23:18:21 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5856D2479B; Thu, 30 May 2019 03:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186301; bh=BqQOaGoHrd8Qb5pIChnRMgyyNk5t7UY4NN7cO91/rhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SIwe5Ju7wicvRlKMHlQbJmVyX72lVW2PSgdsO0PEnuxLi7iXf2rWGPMyEC9W+U0s7 WgaQ4iaO69vLx8X2gwTslSHZwo4eng3dizR3ZUKD/txD/e5ZrmoEckmtIHh+E+eP6w Q5v8J5fg5LX6VQP8VwJ8dK6H2CKoYL/0g9sRZjrI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 4.19 266/276] spi: rspi: Fix sequencer reset during initialization Date: Wed, 29 May 2019 20:07:04 -0700 Message-Id: <20190530030541.834613754@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 26843bb128590edd7eba1ad7ce22e4b9f1066ce3 ] While the sequencer is reset after each SPI message since commit 880c6d114fd79a69 ("spi: rspi: Add support for Quad and Dual SPI Transfers on QSPI"), it was never reset for the first message, thus relying on reset state or bootloader settings. Fix this by initializing it explicitly during configuration. Fixes: 0b2182ddac4b8837 ("spi: add support for Renesas RSPI") Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-rspi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index b37de1d991d6a..d61120822f026 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -279,7 +279,8 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size) /* Sets parity, interrupt mask */ rspi_write8(rspi, 0x00, RSPI_SPCR2); - /* Sets SPCMD */ + /* Resets sequencer */ + rspi_write8(rspi, 0, RSPI_SPSCR); rspi->spcmd |= SPCMD_SPB_8_TO_16(access_size); rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0); @@ -323,7 +324,8 @@ static int rspi_rz_set_config_register(struct rspi_data *rspi, int access_size) rspi_write8(rspi, 0x00, RSPI_SSLND); rspi_write8(rspi, 0x00, RSPI_SPND); - /* Sets SPCMD */ + /* Resets sequencer */ + rspi_write8(rspi, 0, RSPI_SPSCR); rspi->spcmd |= SPCMD_SPB_8_TO_16(access_size); rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0); @@ -374,7 +376,8 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size) /* Sets buffer to allow normal operation */ rspi_write8(rspi, 0x00, QSPI_SPBFCR); - /* Sets SPCMD */ + /* Resets sequencer */ + rspi_write8(rspi, 0, RSPI_SPSCR); rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0); /* Sets RSPI mode */ -- 2.20.1