Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2420432ybi; Sun, 9 Jun 2019 11:18:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyatfbrpcLrqm6eUFsEdEnXdnWCtDZq+VlQcj+9V8xR5ScNpo/76AgVQraTNgDAQNDr/RAn X-Received: by 2002:a17:90a:3086:: with SMTP id h6mr17584555pjb.14.1560104338102; Sun, 09 Jun 2019 11:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560104338; cv=none; d=google.com; s=arc-20160816; b=lqwhh1udQgBMP8Qy5POCuYeG1sVilvnW4lMCJ4D9AQ6LrLDazpdznAN4R9udZGOUam K7n20NRwjgcbiPCFS06jSHgOSQHP4dho/a269ed0bQHQjeklVLJXSP4dmz42BaGHVdou kNvX8V4AWXHgvev9xlv4g6TIOOUfIQg7gQR/H/x9aTuNjxPjunAJZ4tKuYlQbjqVKjGF XRN3R0tSdHlAqQdHVe1COQPuHsDrIWz+DL5A77m8YA49ue3gHvtOdEMArTnxp0WxSUcd Z/Q+flIYFPw5daHffvmdiCyipXgnaDyMKB30NxisGvYivx0Qoz+TT8N8QuQ6mat89cic NAMg== 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=/tAe0nk+PN0flgmhltNYJufDs1tj/lJ6fwIDz880bkk=; b=ENKLz1Lq1hCZAgZUb18IRhykBNBcjm3yZgeoWbhI9KCIGiMXee6ncSdGSfCQOXcK4e EbvMwZOPX2J8kPOxh/QauSCQ7ak8lfCNYDfySBldTy8hyjND3WnpCvix1yb6NqxS+a0V /75zunfb4whRobOTf3uHZCIy59YAIeR3GfrbUpO07yEaxiEqDO85r0jWu8snui7ngz/h 7cFO5Z9E5JdMply7LFP/l9v0P5HjcV0WNzr/3vMwfWQLOclxSVq7c0jS5ldJycjKT/dV 2V3gTMlMh6NXBk1yTuQgyAarmgyxQ7OKv/UTXG42TEXOWYALv2ihQiHgIrfHsjzQ0Tvy CIlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LJHwlz8u; 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 x12si2671551pgx.314.2019.06.09.11.18.42; Sun, 09 Jun 2019 11:18:58 -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=LJHwlz8u; 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 S2388483AbfFIRDq (ORCPT + 99 others); Sun, 9 Jun 2019 13:03:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:42206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388473AbfFIRDo (ORCPT ); Sun, 9 Jun 2019 13:03:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 34697204EC; Sun, 9 Jun 2019 17:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560099823; bh=odSzfNYLgGwh+HeY6bVD3ucvuPMWfg1Li9wkAhYdllY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LJHwlz8uPjGXEqhoVWDS3/uC3zrRTEgAJYtMP0k50oOJt0LXxEhLlbwcYVqKASVjB UTvKDwp8KcCS16YVjMhdPad28BU9nUbRR2PJx0TT+lro+rlE33/UgGBZnX8OHgzl51 q8JH+Bb6fmKZ6d/LYhnMUh4dl2MNd0BCczr3bFZc= 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.4 177/241] spi: rspi: Fix sequencer reset during initialization Date: Sun, 9 Jun 2019 18:41:59 +0200 Message-Id: <20190609164152.940621719@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164147.729157653@linuxfoundation.org> References: <20190609164147.729157653@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 9882d93e7566d..0556259377f77 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); @@ -313,7 +314,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); @@ -364,7 +366,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); /* Enables SPI function in master mode */ -- 2.20.1