Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4110388rwl; Tue, 28 Mar 2023 02:46:37 -0700 (PDT) X-Google-Smtp-Source: AKy350aG5/PugkAq8Wl/dsFLjqMVvgnUtVEKjYFTNVSCZ5+M+47jmQPYjw9An3oNXlEYI80PymJw X-Received: by 2002:a05:6402:1:b0:4fc:c7c8:e78d with SMTP id d1-20020a056402000100b004fcc7c8e78dmr14801928edu.31.1679996797355; Tue, 28 Mar 2023 02:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679996797; cv=none; d=google.com; s=arc-20160816; b=QJpitnTCO5KV7+U0Z5il3NXkh9XCtDGYv2ROc5NGJl7hKJaKnKlMZuQHrGU/qCNVjm gM7HSmBEbn1LRr3/1+bTCAgKt5Tq0vT3qNXek/sPHUZhuExswfoHBtr7yBuZ35N7LW64 V4tWroILhSFhymotB3UafGni0lr/ChsQ1BR9TfwYnp+it1FQdb1hvmEa5UxIKoHTpVTg 1TmaA+q1aJpu/UgS7z8OnweZ8cg3LQlMVguulB94oCx0e+oFV9SN9l3haj5hkpv/Pl3X tNU1XuF6OkrjPLBE0TYsTyMHTpkqGPrug2hh9TxK6om1BbVBssAx93tStSvCdU2tAQYS L+/Q== 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=Vja9KX42w8UL4uRd1kGJawOi+VYoStnPw3D2kkWoKXQ=; b=QOxsel+wgEJ7iVUra0cMdLe683lCqkaNC26Uj9Ul2G1kRy3IEo21pk9Ig4k+kAn7rx BKpT081C/WvXRQwgcLs0YzLrgy4T3LMKZ3DTvAgD9lLIViVKtus3E9dVo7WkvBDv+w0h 28TQ16rBMefEK+fYHNmQPG5yrRDIgwqKNMcffgOvr81oSNxQcXnB+P9jbXF1seAw5C6C LwZc187tp76CTct0M5IFhz0WtpmQUbl+xb5fcemuxq7n9uwLxjpgw+Y4L285vtBrVX8X 9J8hf/+9ALyj7CSlyxZ4/sVNK1LNvpRNUipH6gS25sqCT0e64EAT0j7yTobPzjSZ2ZOC uo1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HhDTMnAC; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020aa7d04d000000b00501c4e46efasi8366084edo.345.2023.03.28.02.46.12; Tue, 28 Mar 2023 02:46:37 -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=@kernel.org header.s=k20201202 header.b=HhDTMnAC; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232372AbjC1Jj7 (ORCPT + 99 others); Tue, 28 Mar 2023 05:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjC1Jjo (ORCPT ); Tue, 28 Mar 2023 05:39:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE3775BA5; Tue, 28 Mar 2023 02:39:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 88E206163C; Tue, 28 Mar 2023 09:39:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CE24C4339B; Tue, 28 Mar 2023 09:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679996373; bh=Wd9Ay6SO5CAcXIM2nKfNytXszwXbA4x1Yllp/z8nE64=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HhDTMnACS8BU9XlDEHNeiGmsk2PXPK9tYvnPlubxps5rR6KJPQ9mr1nPpTspQwlSq oITu2u1ZCBeqO4BSPhNMswLSeK0zYfZqAfGn5RRpUqZbnJukr33dYgufTUL9G4a6DF PiDpKNWo2zE3fBsBh2ExB8rrK4pT2cIrVPDJQJaXMtiDPDf31xKJe+go5EItMzflQx WX73XNznOsacVlfXDzipjaVX91Y1AS+agNIAqYaWJi5qpe5NfkAEmw2Par0042S+9O H+HeVgrQw+YawW4rFgpDlrHqNtSu5AXOZrG/zU1iyYBjvK8+aQpbsemALDS/phicNT gI/KCpt10LDug== Date: Tue, 28 Mar 2023 11:39:29 +0200 From: Andi Shyti To: Piyush Malgujar Cc: broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, jannadurai@marvell.com, cchavva@marvell.com, Suneel Garapati Subject: Re: [PATCH 1/2] spi: octeontx2: Add support for octeontx2 spi controller Message-ID: <20230328093929.qkg2oseuibot3afl@intel.intel> References: <20230327180753.2279-1-pmalgujar@marvell.com> <20230327180753.2279-2-pmalgujar@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230327180753.2279-2-pmalgujar@marvell.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Hi Suneel, [...] > +static int tbi_clk_en = 1; bool? > +module_param(tbi_clk_en, uint, 0644); > +MODULE_PARM_DESC(tbi_clk_en, > + "Use Fixed Time Base 100MHz Reference Clock (0=Disable, 1=Enable [default])"); can we avoid using module parameters? You can have these defined in device tree and you can also make sysfs interfaces, as well. > +static int cfg_mode_delay = 30; > +module_param(cfg_mode_delay, uint, 0644); > +MODULE_PARM_DESC(cfg_mode_delay, > + "Delay in micro-seconds for mode change in MPI CFG register (30 [default])"); > + > +static void octeontx2_spi_wait_ready(struct octeontx2_spi *p) > +{ > + union mpix_sts mpi_sts; > + unsigned int loops = 0; > + > + mpi_sts.u64 = 0; > + do { > + if (loops++) > + __delay(500); mmhhh... why have you chosen __delay() ? > + mpi_sts.u64 = readq(p->register_base + OCTEONTX2_SPI_STS(p)); > + } while (mpi_sts.s.busy); [...] > + if (mpi_cfg.u64 != p->last_cfg) { > + p->last_cfg = mpi_cfg.u64; > + writeq(mpi_cfg.u64, p->register_base + OCTEONTX2_SPI_CFG(p)); > + mpi_cfg.u64 = readq(p->register_base + OCTEONTX2_SPI_CFG(p)); > + udelay(cfg_mode_delay); /* allow CS change to settle */ before "udelaying" anything that the user gives you, I would check what cfg_mode_delay is. Andi