Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2728479imm; Sun, 30 Sep 2018 03:42:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV63kWMksO3Kha+632KWb9iQ/I/tu3eZHPZUaPI3s5K/lZt2J9iHbEgdK0zdqqV6lp2bZNkjH X-Received: by 2002:a63:ce14:: with SMTP id y20-v6mr6229308pgf.248.1538304149343; Sun, 30 Sep 2018 03:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538304149; cv=none; d=google.com; s=arc-20160816; b=gu6FWsdQ0IA9RMCOJzDxzHL/PTIoTTXNmj+FZmoGQlWBzF7m6teOQc75sjw22PnXFU v/CgfeKc0+VjCFTtTvuN6Sg+dlwaK7hq3i2uUZPaeyX7gC1LSZlyk3jB6xChc1BKoAqm PvH+dBujey0C3RSjiEdRCGyWYPbUciVrsDd0YeZ4wpWn63/CJq4UWdumrsQ2yuTbHuK0 7SlL7Dt9UZGb62a3XBYQiT1PxS4ClgNnNAIEuk1OdNqF7CkVJEVIZFio3kCirH3L4yFv BBh5rmKJYjgNlISxEPS0zSBmfwq5I6ApXLWp3GqRQIVqJ7T/uZ6Y6cL2mThwZxikfbRe 6okA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=TURb5n58ujCDz7zhXIC4UrGmLOOQooi+kbHoyqmWrKI=; b=k7aDU4pWWibKfUtrFKvV4/207rFm1E2j2ioSFXIr2ThOqYFnNTexMHKJywaNULNIGN 7aNqmnX/XenCOrQurlWurdJ+5UqscRGhIXDqox4dGcO9b3odjnRjRPFQAHQSOFSauVu6 S96muB0t6IJTLLsSn83onYvQTz+F/9wtT350psNj7W1gckywWM45ZgowIueFeZY0t36P 8+yuRUkau6VdEc97PnkjxuFXm/CCrNY6bGiIx6Ycz3BHRGe+iDkDO7CaZ3+po6TuqXsx aZNXWUaGinU/DJyhkB7j4trtll8X7ianKpglkTDHyZoD8Zj1o72jM1T4JXgU/TcgLTYJ Qxpg== ARC-Authentication-Results: i=1; mx.google.com; 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 m65-v6si5335203pfc.75.2018.09.30.03.42.15; Sun, 30 Sep 2018 03:42: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; 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 S1728281AbeI3ROe convert rfc822-to-8bit (ORCPT + 99 others); Sun, 30 Sep 2018 13:14:34 -0400 Received: from mail.bootlin.com ([62.4.15.54]:38772 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727821AbeI3ROd (ORCPT ); Sun, 30 Sep 2018 13:14:33 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 44578207D8; Sun, 30 Sep 2018 12:42:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 043A920379; Sun, 30 Sep 2018 12:41:50 +0200 (CEST) Date: Sun, 30 Sep 2018 12:41:51 +0200 From: Boris Brezillon To: Esben Haabendal Cc: Chuanhua Han , "broonie\@kernel.org" , "linux-spi\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH v2 2/4] spi: spi-fsl-dspi: Fix delete the processing of undefined bitmask for rxdata Message-ID: <20180930124151.7ffed180@bbrezillon> In-Reply-To: <877ej36zkd.fsf@gmail.com> References: <20180930092535.24544-1-chuanhua.han@nxp.com> <20180930092535.24544-2-chuanhua.han@nxp.com> <20180930120659.71b0e1e5@bbrezillon> <20180930121707.4724edd6@bbrezillon> <877ej36zkd.fsf@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) 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 On Sun, 30 Sep 2018 12:37:38 +0200 Esben Haabendal wrote: > Boris Brezillon writes: > > > On Sun, 30 Sep 2018 10:10:14 +0000 > > Chuanhua Han wrote: > > > >> > -----Original Message----- > >> > From: Boris Brezillon > >> > Sent: 2018年9月30日 18:07 > >> > To: Chuanhua Han > >> > Cc: broonie@kernel.org; linux-spi@vger.kernel.org; > >> > linux-kernel@vger.kernel.org; eha@deif.com > >> > Subject: Re: [PATCH v2 2/4] spi: spi-fsl-dspi: Fix delete the processing of > >> > undefined bitmask for rxdata > >> > > >> > On Sun, 30 Sep 2018 17:25:33 +0800 > >> > Chuanhua Han wrote: > >> > > >> > > This patch fixes the problem of rxdata being equal to 0 during the > >> > > XSPI mode transfer of the dspi controller. > >> > > In XSPI mode, If it is not deleted, the value of rxdata will be equal > >> > > to 0, and the data received will not be received correctly, causing > >> > > the receiving transfer of the spi to fail. > >> > > > >> > > Signed-off-by: Chuanhua Han > >> > > --- > >> > > Changes in v2: > >> > > -The original patch is divided into multiple patches(the original > >> > > patch theme is "spi: spi-fsl-dspi: Fix support for XSPI transport > >> > > mode"),one of which is segmented. > >> > > > >> > > drivers/spi/spi-fsl-dspi.c | 3 --- > >> > > 1 file changed, 3 deletions(-) > >> > > > >> > > diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c > >> > > index 3082e72e4f6c..4dc1064bf408 100644 > >> > > --- a/drivers/spi/spi-fsl-dspi.c > >> > > +++ b/drivers/spi/spi-fsl-dspi.c > >> > > @@ -243,9 +243,6 @@ static void dspi_push_rx(struct fsl_dspi *dspi, u32 > >> > rxdata) > >> > > if (!dspi->rx) > >> > > return; > >> > > > >> > > - /* Mask of undefined bits */ > >> > > - rxdata &= (1 << dspi->bits_per_word) - 1; > >> > > - > >> > > >> > Why not > >> In xspi mode, the value of rxdata after the statement is processed is equal > >> to 0 no matter what data is received. > > > > Only if dspi->bits_per_word is 0. > > > > Actually, I just had a look, and xfer->bits_per_word should never be 0 > > because spi_validate() makes sure it's initialized [1]. Don't know > > where dpsi->bits_per_word comes from, but maybe you have a problem > > there (dpsi->bits_per_word and xfer->bits_per_word not in sync). > > > > [1]https://elixir.bootlin.com/linux/v4.19-rc5/source/drivers/spi/spi.c#L2869 > > dspi->bits_per_word = xfer->bits_per_word > > https://elixir.bootlin.com/linux/v4.19-rc5/source/drivers/spi/spi-fsl-dspi.c#L697 > > So it should never be out of sync, and it should never be 0. > > As I mentioned in another mail, I suspect what Han is observing is > caused by byte ordering, so that the mask masks the wrong data. > Maybe related to the byte-ordering fix patch. Okay. Wait and see then.