Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2652330iob; Sat, 30 Apr 2022 15:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylqy5Za0Zt/NkvwgPd7QjmgGybuDxNPKylHz/U3lUawIIp9SQhvG/auYovi31NrsLaYlg7 X-Received: by 2002:a05:6512:13a7:b0:447:3dac:7a03 with SMTP id p39-20020a05651213a700b004473dac7a03mr4402300lfa.362.1651356800989; Sat, 30 Apr 2022 15:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651356800; cv=none; d=google.com; s=arc-20160816; b=PECTYLB8QkAVGKVBC5Y4xM2MwIsezcxjlj+wNcH68mSfaOeGP83Prn8uMorKrMlGcI HaxXnbwJZ/AFTS4mGQ71RYSYdu/NY3BbjqhQ5syn3D+je+zJj2dGXnU5vzp+smO2VMhp D1AwyBhZG916b8ni3x1WHz8mXucE8MftWop4pC7yCKP79WYbAzty39iriDgLmhcRnsOk Tpa7+bHangFB3ZhOd+BAy6qVEbMc4HA8u4TDjsUb4ytKDx1dzoKBFqsx20FeFaXJ3jEX 4oaqjQRmRL9IdYby3qHS+neDM0F0id4+kW+xfRp3ZRM/P8OL13PkfiY/VsWiyTOmRJIe Eprw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S4No/j+RzlQBrNmQzGgnkjFW2pDaZAdEHYz4CfvsYrE=; b=io7lvpHn0GPDRD5neAqiquroPPK2jDoU1OeBW7v3S5K+hGYhsc1ghqm5Dof4PZjDoa MXBD+KfbcN9YB8YfU1ApYXA1l4164LxAWGNWdB1km9ucdqHa4yWQmQqAPfgadfDwH8jt zOC87yXRrPoFJX91aiHKgGP/7Wwlqp4IaU1vxKeSqUPrzEGSTUavviq5fKnHEhiKvoIx QVmsi1GOIsgv2xzz2axOGcI6t6CDx7rdrQq8wJ37DfsZy8hp4+M2mPe/b3HKRneFICVh WmGsgeGQ7Baz8UuUaTadw3GLcXlhWoJvuBlBpsUzkbZyi79udBhAhlSDaE3CsTIm1h5A GZdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="gcnnHe/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a197b0b000000b00471d9c25008si10001710lfc.473.2022.04.30.15.12.54; Sat, 30 Apr 2022 15:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="gcnnHe/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1348305AbiD1OjS (ORCPT + 99 others); Thu, 28 Apr 2022 10:39:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232699AbiD1OjQ (ORCPT ); Thu, 28 Apr 2022 10:39:16 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52A91616F; Thu, 28 Apr 2022 07:36:01 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id m23so6951519ljb.8; Thu, 28 Apr 2022 07:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=S4No/j+RzlQBrNmQzGgnkjFW2pDaZAdEHYz4CfvsYrE=; b=gcnnHe/El+IFsFQpKDY7o9V+g4X1WvfQOQ4/XxIdYT3169jm6xf1sxsDfWv8SgVZAk wKvLaTzTNJiGp3t5dyKCLKo9wdCuTDLn68WSMU/mfew8fCdyl/kUd20lloLfR4NOLx9l Q9HFS14P3w35Mc1/o79XitfRgdBzxf8WOC9IqyIBUOkI41z/xeOdZmkmY34R8+/jAGED W18KUtfcSc0Gbw2941A0J0l9edYxSsPOo3+/y6dVO50Y4n1ynV+hpHphGsc/aOQrRKEd P/1iW48qvLnE1jV2v0A/CVy1r5r+g5u2bEY0/c8kuoHP9vAJsbv33Oj+56uteCKbMp/t SmJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S4No/j+RzlQBrNmQzGgnkjFW2pDaZAdEHYz4CfvsYrE=; b=pHG3OtlzV2NAuMKL5QeTDdpfa0CT3017OoSAegwyyVAtNH4C6HWv1Ui0QXRcZPE57R sNqUaTm85uVFcFrPlaT5735xVUROL7JVaUmZpOek9wE3Bz7bh1lyP85jqXqoqHvGwqXZ hzVOuOqwDzmzRM52gOvk7t2M/uB2G7b2AWJuPUKIQeGoUCbuBYmVqRUt0aruUseSTJQ3 myu3AHwQMLAxWJz4g9l1cTmSZK8Z3zoJ4DeNT3Pt0W1XYga3457RFaso3/sCzSuirryD jhfe6ZHjDhmjbK1F7OvMItiBwOPb2mcfJD4Fnm0ZtzlqZFdh3EJQ5buKwkjMOUDKpcG4 xDWg== X-Gm-Message-State: AOAM532ONKo3lDCvhvqeDn2xN6NOWwJJgcXkMl77/p6o2i1VyrodxcYA 6RCYO9MXcMpLBg7TvyRWP1E= X-Received: by 2002:a2e:5c6:0:b0:24f:5bd:5f89 with SMTP id 189-20020a2e05c6000000b0024f05bd5f89mr17196690ljf.170.1651156559558; Thu, 28 Apr 2022 07:35:59 -0700 (PDT) Received: from mobilestation.baikal.int (mail.baikalelectronics.com. [87.245.175.226]) by smtp.gmail.com with ESMTPSA id p21-20020a056512139500b00447c9b87945sm17212lfa.172.2022.04.28.07.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 07:35:59 -0700 (PDT) Date: Thu, 28 Apr 2022 17:35:56 +0300 From: Serge Semin To: "Srikandan, Nandhini" Cc: Serge Semin , "broonie@kernel.org" , "robh+dt@kernel.org" , "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "mgross@linux.intel.com" , "Pan, Kris" , "Demakkanavar, Kenchappa" , "Zhou, Furong" , "Sangannavar, Mallikarjunappa" , "Vaidya, Mahesh R" , "A, Rashmi" Subject: Re: [PATCH v4 3/3] spi: dw: Add support for master mode selection for DWC SSI controller Message-ID: <20220428143454.igdqqbbtufrzrizz@mobilestation.baikal.int> References: <20220308103331.4116-1-nandhini.srikandan@intel.com> <20220308103331.4116-4-nandhini.srikandan@intel.com> <20220413130249.ueisqj5xs3komhmr@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 27, 2022 at 09:51:47AM +0000, Srikandan, Nandhini wrote: > > > > -----Original Message----- > > From: Serge Semin > > Sent: Wednesday, April 13, 2022 6:33 PM > > To: Srikandan, Nandhini > > Cc: Serge Semin ; broonie@kernel.org; > > robh+dt@kernel.org; linux-spi@vger.kernel.org; linux- > > kernel@vger.kernel.org; devicetree@vger.kernel.org; > > mgross@linux.intel.com; Pan, Kris ; Demakkanavar, > > Kenchappa ; Zhou, Furong > > ; Sangannavar, Mallikarjunappa > > ; Vaidya, Mahesh R > > ; A, Rashmi > > Subject: Re: [PATCH v4 3/3] spi: dw: Add support for master mode selection > > for DWC SSI controller > > > > Hello Nandhini > > > > AFAICS this patch should go before > > [PATCH v4 2/3] spi: dw: Add support for Intel Thunder Bay SPI controller > > Thus you'd perform the DWC AHB SSI Master mode conversion first, then > > introduce the new controller support. Otherwise without this patch applied > > the DW SPI driver is most likely left broken for the Intel SPI controllers since > > you drop the DW_SPI_CAP_KEEMBAY_MST macro usage in [PATCH 2/3] while > > the new DW AHB SSI Master functionality is introduced in the next patch > > [PATCH 3/3]. So please convert the series to the harmless configuration on > > each git image state. > > > Sure, I will reorder patch 2/3 and 3/3 so that the master mode conversion happens first followed by new controller support. > > > On Tue, Mar 08, 2022 at 06:33:31PM +0800, nandhini.srikandan@intel.com > > wrote: > > > From: Nandhini Srikandan > > > > > > Add support to select the controller mode as master mode by setting > > > Bit 31 of CTRLR0 register. This feature is supported for controller > > > versions above v1.02. > > > > > > Signed-off-by: Nandhini Srikandan > > > --- > > > drivers/spi/spi-dw-core.c | 4 ++-- > > > drivers/spi/spi-dw.h | 7 +++---- > > > 2 files changed, 5 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c > > > index ecea471ff42c..68bfdf2c4dc7 100644 > > > --- a/drivers/spi/spi-dw-core.c > > > +++ b/drivers/spi/spi-dw-core.c > > > @@ -307,8 +307,8 @@ static u32 dw_spi_prepare_cr0(struct dw_spi *dws, > > struct spi_device *spi) > > > if (spi->mode & SPI_LOOP) > > > cr0 |= DW_HSSI_CTRLR0_SRL; > > > > > > > > - if (dws->caps & DW_SPI_CAP_KEEMBAY_MST) > > > - cr0 |= DW_HSSI_CTRLR0_KEEMBAY_MST; > > > + /* CTRLR0[31] MST */ > > > + cr0 |= DW_HSSI_CTRLR0_MST; > > > > Could you please conditionally set that flag here? That's what we agreed to > > do in v3: > > https://lore.kernel.org/linux- > > spi/20211116191542.vc42cxvflzn66ien@mobilestation/ > > like this: > > + /* CTRLR0[31] MST */ > > + if (dw_spi_ver_is_ge(dws, HSSI, 102A)) > > + cr0 |= DWC_HSSI_CTRLR0_MST; > > > In case of Keem Bay, though the version of SPI controller is shown as 1.01a from the HW register, it still needs the MST BIT31 to be set in order for controller to work in master mode. > Also since the older versions of the controller which do not need the BIT31 to be set, the bit was reserved. Hence there is no impact by setting this BIT31 for older versions. > So, the condition check was removed. I am completely confused. Earlier you said that both Keem Bay and Thunder bay had v1.02a DW AHB SSI IP-core: https://patchwork.kernel.org/project/spi-devel-general/patch/20210824085856.12714-3-nandhini.srikandan@intel.com/ Now you say they are based on the different versions of the core. Please clarify. -Sergey > > > > } > > > > > > return cr0; > > > diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index > > > d5ee5130601e..2583b7314c41 100644 > > > --- a/drivers/spi/spi-dw.h > > > +++ b/drivers/spi/spi-dw.h > > > @@ -23,7 +23,7 @@ > > > ((_dws)->ip == DW_ ## _ip ## _ID) > > > > > > > > #define __dw_spi_ver_cmp(_dws, _ip, _ver, _op) \ > > > - (dw_spi_ip_is(_dws, _ip) && (_dws)->ver _op DW_ ## _ip ## _ver) > > > + (dw_spi_ip_is(_dws, _ip) && (_dws)->ver _op DW_ ## _ip ## _ ## > > _ver) > > > > Nice catch. My mistake. Could you please move this change into a dedicated > > patch with the next fixes tag? > > Fixes: 2cc8d9227bbb ("spi: dw: Introduce Synopsys IP-core versions > > interface") > > > Sure, I will convert this to a dedicated patch. Just for confirmation, the patch should be a separate patch with this title "Fixes: 2cc8d9227bbb ("spi: dw: Introduce Synopsys IP-core versions interface")" > and not part of the current patch set series. You can add that patch to this series (better to the head of it). The title can be something like: "spi: dw: Fix IP-core versions macro". The tag needs to be added in the commit log above the Signed-off-by tag. -Sergey > > > > > > #define dw_spi_ver_is(_dws, _ip, _ver) __dw_spi_ver_cmp(_dws, _ip, > > > _ver, ==) > > > > > > @@ -31,8 +31,7 @@ > > > > > > /* DW SPI controller capabilities */ > > > #define DW_SPI_CAP_CS_OVERRIDE BIT(0) > > > -#define DW_SPI_CAP_KEEMBAY_MST BIT(1) > > > -#define DW_SPI_CAP_DFS32 BIT(2) > > > +#define DW_SPI_CAP_DFS32 BIT(1) > > > > > > /* Register offsets (Generic for both DWC APB SSI and DWC SSI IP-cores) */ > > > #define DW_SPI_CTRLR0 0x00 > > > @@ -100,7 +99,7 @@ > > > > > * 0: SSI is slave > > > * 1: SSI is master > > > */ > > > -#define DW_HSSI_CTRLR0_KEEMBAY_MST BIT(31) > > > +#define DW_HSSI_CTRLR0_MST BIT(31) > > > > Could you please drop the redundant comment above and join the macro > > with the DW_HSSI_* macros group? > > > Sure, I will remove the comment and group the macros. > > -Sergey > > > > > > > > /* Bit fields in CTRLR1 */ > > > #define DW_SPI_NDF_MASK GENMASK(15, 0) > > > -- > > > 2.17.1 > > >