Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3494335imu; Sun, 11 Nov 2018 16:22:22 -0800 (PST) X-Google-Smtp-Source: AJdET5c8+uWt9mnek4gi9KKjyFnTAQKdlJQq2eiVSiReiAXW8PsGhtWr9gw1goGWITjHL85kJXTI X-Received: by 2002:a62:d2c7:: with SMTP id c190-v6mr17929815pfg.26.1541982142259; Sun, 11 Nov 2018 16:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541982142; cv=none; d=google.com; s=arc-20160816; b=tOPqDUgWvh4jUpx0CuMw7KNLqH3voP9P/VdZwKKHQqu794YOLv6mvfTQyEUL3lWefG 8DnmgIahIzvAC7ZJdhIq+0JEgcdkZZmCRpI+v6QGFIYK+1OxfWDeAQXXP1yO8xdKguI6 N5V6wXgd5NTd561sx5CWDqvLscmXsmv7xdqq+bq3J0bDxZAdQVMhFlKP01r9ibw+ybF9 E70Ue0T6ziDIG3fEqXFhJDUZmqfQeRY9+9vhVnWp1bYtYkABprTznqLAwpnuWqkotmUg EfRSUR7TOY0Zn5/4BIKXv4LOeQGCQ4BSo+ZdwS/6Zm7PK0c0X4RP6qwYmRFYbPiP2U2b Ggfw== 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=1PnVSE05XYMON7ZNWEwDIX0hACSDhd5wB+XW6TbDHqo=; b=0+vJe3ZpNQ13h406qCs6lI/qQVIPP5lxpsIiYoMIqwIDkd0AGJH6tsL09PBmYhBly3 /qu8fYuKaVKGlcvgHyBzCoeA643LiLLd+PRtzXSogYyUmQKURXGkqzNMG07/HQ6gHg8t zjUstRWNWRqhrlG86Q9tpU4b65RiJ2EydH7RDbmoimwLo/ERw6PfNj55cJNAZeJuruGH uBD7Kmms7a8dSMtpm0EYjATUwkq2nPjdt7k4iT+Ef6o8yyRXmqK4FUFA+D+HkiUFyqgK NeBGq20E26yVKz5RWxB8eUjQQfT6r9kCmNoOfkxZojdL2z4p2ttsKfxRmPEJGq0Ucdzi XOjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U4qKkenf; 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 t4si14180555pga.83.2018.11.11.16.22.07; Sun, 11 Nov 2018 16:22:22 -0800 (PST) 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=U4qKkenf; 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 S1730261AbeKLKLD (ORCPT + 99 others); Mon, 12 Nov 2018 05:11:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:58352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729637AbeKLIQv (ORCPT ); Mon, 12 Nov 2018 03:16:51 -0500 Received: from localhost (unknown [206.108.79.134]) (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 80C4B214E0; Sun, 11 Nov 2018 22:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975215; bh=VrzXONenTv2kPRObLVJSw/76mri7jG8Rt5AkAC2Cby8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U4qKkenfg+xM1Elbxx+oOPgz4NB7k6SxU7aBEU20dyIEuXZa7FMS49At8u+70UBdz 7RjIDncKgeCk/kyo9MhNWMvqNb6/kbzCG63O/l1ed3gxlItqK2IxjcIdZRmIuXLieO 9reA3l2NcLN620TYajzGNUPdu1aTIT7USu4m9e9Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Mark Brown Subject: [PATCH 4.19 010/361] spi: bcm-qspi: switch back to reading flash using smaller chunks Date: Sun, 11 Nov 2018 14:15:57 -0800 Message-Id: <20181111221621.418979932@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rafał Miłecki commit 940ec770c295682993d1cccce3081fd7c74fece8 upstream. Fixing/optimizing bcm_qspi_bspi_read() performance introduced two changes: 1) It added a loop to read all requested data using multiple BSPI ops. 2) It bumped max size of a single BSPI block request from 256 to 512 B. The later change resulted in occasional BSPI timeouts causing a regression. For some unknown reason hardware doesn't always handle reads as expected when using 512 B chunks. In such cases it may happen that BSPI returns amount of requested bytes without the last 1-3 ones. It provides the remaining bytes later but doesn't raise an interrupt until another LR start. Switching back to 256 B reads fixes that problem and regression. Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance") Signed-off-by: Rafał Miłecki Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -89,7 +89,7 @@ #define BSPI_BPP_MODE_SELECT_MASK BIT(8) #define BSPI_BPP_ADDR_SELECT_MASK BIT(16) -#define BSPI_READ_LENGTH 512 +#define BSPI_READ_LENGTH 256 /* MSPI register offsets */ #define MSPI_SPCR0_LSB 0x000