Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2764825yba; Mon, 8 Apr 2019 04:20:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGRytx4VfQAxQPHM09wH0W+LzI3NtXf8w3NsGSuGqVv+2fRrn413ShOjLlxRaJniiymOBj X-Received: by 2002:a17:902:f089:: with SMTP id go9mr28606327plb.309.1554722429920; Mon, 08 Apr 2019 04:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554722429; cv=none; d=google.com; s=arc-20160816; b=XEO4DtCx+rfppqvceK9l5vZNfFqFhltcupEa6oKUeh5EmxoQCaLX8INykxg88Rh0cA nbltBWyNZW+o3grOysDi3uin/13P+V5M185Py2qgCoey/I85qZ57Be2n8ZrBN4hLVOqT /DlrrThhVOjbMV1P3MUm7r2DGK9YHZ9ZgKzhqu0BpRkkNbFyXBqr9LGZy04knQ/q7+3l z3xu2AkemSTqxVNm9as+yYIDRFQ6ajj9zDoNQXPBRQQrT4QCw8prqv8P8lIjHMTvAj/4 /gKyyq/lPWoFUjSIUjOiS6Aj6W10nW5pmpKpap5WG4n4/lpV25MWD88BkWhSzqp/9yGm bHlQ== 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:user-agent :references:in-reply-to:message-id:mime-version:date:subject:cc:to :from:dkim-signature; bh=picsGpjcrUCwT8YUKL80MWGiGtJMGcjFvUvK1NQ15h4=; b=t6FKcLqbOjjfeL5PbIBc9c5ZdRzpaXD/AkFdKL2uRJQVErUDRpb0yJ0lVRH2tHI8yv 1zFjXbCDzK+Zntt2Vrl42Rl1sSADY062rt04sPZbfoNoQl3wrHTHi0n0b+dcoLDNNnQj zINz/AlI2yubYT19PFiMxRaPS1guh4SqAuvdvYpuqV+cpXLpJKQtmdv6f3nC95If5XGn Aib9ah8m3F03tXVneh1zZSl9NXdO9qoSdCR98BSBwo39j7xbqT0/Oah1pQMrYLi1vSoH 6mErFlkgk1pyMc5YKl730sSyTg3Tjzlro2zEJwh8cHUQeibQV4ciYUSCkjtR/XJUKUGX E2Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uG079AaR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si26229388plp.201.2019.04.08.04.20.14; Mon, 08 Apr 2019 04:20:29 -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=@gmail.com header.s=20161025 header.b=uG079AaR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726501AbfDHLTT (ORCPT + 99 others); Mon, 8 Apr 2019 07:19:19 -0400 Received: from mail-wm1-f42.google.com ([209.85.128.42]:38204 "EHLO mail-wm1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfDHLTT (ORCPT ); Mon, 8 Apr 2019 07:19:19 -0400 Received: by mail-wm1-f42.google.com with SMTP id w15so14261528wmc.3; Mon, 08 Apr 2019 04:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:mime-version:message-id:in-reply-to :references:user-agent:content-transfer-encoding; bh=picsGpjcrUCwT8YUKL80MWGiGtJMGcjFvUvK1NQ15h4=; b=uG079AaRDji3vn+300Q/1JHyh0SvrOT0J6XHh4SrN90FL+n7e3WsmkVJnzfbgritGY 66ZcU9owVY5ayphdobkcHjtwtFbPcVKH9ou5/1sJN0LWoOA3GGhdSQk5pT3dBwmEPcHW d7XOL2XnaYPzFdyqKrnFc6BjDJSov7gdAH0aKQttqfyoWcMPOfP3hZZK3lTUcJOi/cw2 sBKgTIwVkoiYUHVOPleL6e35p5dZoMusvCQXSkytx+4qq3U8dAK/8nrnfr7T6tnT88+x b+TY1gXQvY5dCI3g36OZzlEtuOcqnkIwgFeGYxs+WhQkmAxRA1JRmfsfQURiRwfaumG5 Nrsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:mime-version:message-id :in-reply-to:references:user-agent:content-transfer-encoding; bh=picsGpjcrUCwT8YUKL80MWGiGtJMGcjFvUvK1NQ15h4=; b=aTiIzXBACToUEE3vaa+Yd3AKFuGtYlxHI1gMRmBJKEe6rPj/WlpVQuK26LNUVoVr3h Lf9FTU4Njdfl1b2GrGrCcl02c9BD4wFT1JlUIzuFZVq1ztr73GCwkv5yHsi2AAQgLRtm Q8MdPpb+dhypgiW0PtXhlbmzBmZeFUTMFCsh4wnhdHrcKwIx+3IloemqQZyWrIGrfo1S 3t18GAOmdSVgsVdC/BWhlirmMcrxJWXJyHgMfCP5pTqTR+o3xRvQsk+UAf3RZFGEpizz Lpe8Yn/XKYYs377Fu7pFZVGoUkcSRHdcJ3VoKIitBWpHmhB/n7895Av7tIoJqU+a6LZP lZpw== X-Gm-Message-State: APjAAAW632pWg5/R71DmFWPE3XtjIQBMk3Ur6WVO/l16O+gcEdUSo8Rh UXgZt/Khr3bKKobPusP7eb4= X-Received: by 2002:a05:600c:2189:: with SMTP id e9mr138948wme.4.1554722357501; Mon, 08 Apr 2019 04:19:17 -0700 (PDT) Received: from localhost ([92.59.185.54]) by smtp.gmail.com with ESMTPSA id 11sm10161234wmk.17.2019.04.08.04.19.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Apr 2019 04:19:16 -0700 (PDT) From: Vicente Bergas To: Emil Renner Berthing Cc: "open list:ARM/Rockchip SoC..." , , Mark Brown , Heiko Stuebner , Linux Kernel Mailing List , linux-arm-kernel Subject: Re: [BUG] Rockchip SPI: long burst writes produce unexpected result Date: Mon, 08 Apr 2019 13:19:14 +0200 MIME-Version: 1.0 Message-ID: <1fcd4954-e0e8-4f93-80d3-8cbd169d0af9@gmail.com> In-Reply-To: References: <21d83ed2-a8db-49cf-ba8c-c7844157d7b0@gmail.com> User-Agent: Trojita Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday, April 7, 2019 9:55:10 PM CEST, Emil Renner Berthing wrote: > Hi Vicente, > > On Sat, 6 Apr 2019 at 19:35, Vicente Bergas wrote: >> Hi, >> i have been experiencing issues writing to NOR-Flash SPI Memories >> from two RK3399-based platforms: gru-kevin and sapphire board. >> For kevin, this resulted in a bricked device because that memory >> is the only boot device. ... > > Since you say reverting the "set min/max speed" patch fixes your issues > could you try raising the spi clock like this and see if it works for you? > > + assigned-clocks =3D <&cru SCLK_SPI1>; > + assigned-clock-rates =3D <400000000>; > > Of course the driver shouldn't let you configure the spi-controller in a wa= y > that makes it skip bytes, but if this works for you then I still think > you're better off explicitly setting the spi clock speed rather than having= > the driver raise it for you. At least while it does it without > checking for errors > or having a way to lower it again as outlined in the commit message. > >> status =3D "okay"; >> spidev@0 { >> compatible =3D "spidev"; >> reg =3D <0>; >> spi-max-frequency =3D <50000000>; >> }; >> }; >> ... > > /Emil > Hi Emil, I've added both assigned-clocks properties to the spi1 node and tested again. Unfortunately it still fails in a similar way: Before the maximum write burst without errors was 47, now it is 33. I've also tested it with an SPI bus speed of 100KHz to make sure the external hardware is not overrun: ioctl SPI_IOC_WR_MAX_SPEED_HZ 100000 Regards, Vicen=C3=A7.