Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp352032lqp; Wed, 12 Jun 2024 03:41:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUnbZGG7NDyTvvhF3gGi2z5IoqkbRAh1NTjE0jhAoST0dWtDB8JZCtMPajlLHAinx0lvngaUbAfI4ep+hnBRs5jMoiRnoUdi+iEGxenVQ== X-Google-Smtp-Source: AGHT+IF5Gvys8FMGE/P9ElBSM2W8eNakN/dWMJCxRoOTDLlzFeok+U9PjrX7dWFUkTc1mp9NjunW X-Received: by 2002:a05:6870:c155:b0:254:b6f0:21bb with SMTP id 586e51a60fabf-25514ee54d0mr1425769fac.58.1718188896642; Wed, 12 Jun 2024 03:41:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718188896; cv=pass; d=google.com; s=arc-20160816; b=gY+Vi063Mx+YrJ4SLVoZx6HA2f9vQpauyY7TbBrxedH6PsT5B8QI3ZTI+eZIG3Rp7N CqVW2+BllBRM/iIsIg4USC7JSJN/j46M89xL+wEuDpbGvoCgZgMUDR+ojszrEjVXePDU Vu01dkr+Rc9thOpXQ7i2qN1Z9Zw+L/1PcCVyXDAjF7pDrtkIBiQJ/UT2U5Loy3ZOXdm/ WDVSR58CzxPNQsOV5f9gCWecbLA7rjAQvQE8w4qJBZLaXedV1f/NGWPYdILzW+TvfowP QHBzMn4gAlZcBeDhGQaFF8lLB+i8G+FuY1KTcSk56GogP1zok01LI1bCJoHjBb7jmibo x7Eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=l5izw19VuLvrTxqP10Ei3AT8xFHZj8Hu+itgsQ+oErM=; fh=Fn70jeAgB5xf9qAub8uj2YM4UFXjZXPSXJzab8H+z14=; b=Yw06whj2NunG7A5o7Zm8hWQOV0FOTxave94dQM1kFruC7eg6QFJl2xGKMwh+G5ABVF dUw+vdP+fU2kUWxtzoH8oDgld/z1OcPRrJtSygxLJdMpKh6HkrdlVy6aYXC9YJjr6Uf1 GHw80j2Eupllo5Hf2ykw6DhbXOqhrnXc1V31h3562rVu7Hvd4nRyZXaSM6Rg5nPHDloj eUC2cX3VHr5ctvqLZBYTzZV58Qx8ccpRQoJn72owPEb1+Mq63kW7rwFCpGATHg+IYIIS t+TtbTMbJczCHQ74Rv80tuT7Pt9+EFkWOVmOxE/L09WPIdd3Tw6Ce3Im1ZCxXpRW9icG 2X5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OjtPeTTE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-211348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd5742dasi11230451b3a.361.2024.06.12.03.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 03:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OjtPeTTE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-211348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D568AB211EE for ; Wed, 12 Jun 2024 10:31:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D6A216EBEF; Wed, 12 Jun 2024 10:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OjtPeTTE" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 507A21C6AE; Wed, 12 Jun 2024 10:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718188310; cv=none; b=KbuAzhvUwJTw1/cZpWj6EM4phOxGQGMeXb3N6wOKIrlkd1K2SSciZGLHF7gJIjwHRQZDYpE1GUA9V5LBHycvUGenzsnIPA8zOaUrgNQiqy0LKpkOvpjY467E09P5wjTlashE1/48l5nXNU41K9XnX4zthrMCSSegvR7YSLRMJ4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718188310; c=relaxed/simple; bh=IKnzRWbZIW0uMBjg3hPVKLFJtN6YgQCWwnKZsfQ2BtI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tbwjYF3RplOmyvxgF2U/9ZhsHBjqxDn0Vgf8fY8f4WDNgfVMVrKwXr+PwRk5XuvBrIM3CfpWPe1vrgvmRcgLjf2hERfk5/NsnNCpLLMtdey6j+ynj8RgsfJWB54hYTIr/A/z+E+du4Ep1EOsEHYzluHWYm3sf0k9OvH/HDF5Ios= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OjtPeTTE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14164C4AF1A; Wed, 12 Jun 2024 10:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718188309; bh=IKnzRWbZIW0uMBjg3hPVKLFJtN6YgQCWwnKZsfQ2BtI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OjtPeTTE8aznrDm5OVgGIHxoLsNXOnhepszN2pDUXVV88OtMRWHojv2jAz+k3SZbw PkgzY75Hbt3qPZLNkk1uqYXmh0JdUQSb1aNTAeODYhe7j6Nns6+2yb1CaS4m+whVit I6c4U8w9n3P6Zt3fkCZe97sUVYmrnXI2fUFWRp4wgAmarSyCWGo/nmrsZ5WCp1YkB7 vNDnRKgWZbJWxnoAje5gTmCHnXVM5Y4MlSiZXGYH17RF9yQSvlYR47+/X0KAqAAIXi Sn5RePqW7rEpIQH9UYst+ndPNDm/28+HHQ8jVJh+vngAp+3kTrIUx8Jw1UrQwqSCkC VUXM3MwYigrFA== Date: Wed, 12 Jun 2024 11:31:40 +0100 From: Mark Brown To: Witold Sadowski Cc: "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "robh@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "conor+dt@kernel.org" , "pthombar@cadence.com" Subject: Re: [EXTERNAL] Re: [PATCH v8 2/4] spi: cadence: Add Marvell xSPI IP overlay changes Message-ID: References: <20240607151831.3858304-1-wsadowski@marvell.com> <20240607151831.3858304-3-wsadowski@marvell.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xvH9bqAg6EKL9q/g" Content-Disposition: inline In-Reply-To: X-Cookie: Your love life will be... interesting. --xvH9bqAg6EKL9q/g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 11, 2024 at 09:51:58PM +0000, Witold Sadowski wrote: > > On Fri, Jun 07, 2024 at 08:18:29AM -0700, Witold Sadowski wrote: > > > features included are: > > > - Clock configuration > > > - PHY configuration > > > - Interrupt configuration (enabling) > > This feels like it could usefully be split up so these three bits are > > separate, and there appear to be other changes buried in here as well. > > I can't tell what changes either the PHY or interrupt configuration might > > be referencing. > That changes are in single commit as, using not all of them will result in > total xSPI failure. Configuring PHY makes no sense if clock is not enabled. > But I can try to split that into 3 separate commits. They won't actually do anything until we detect the Marvell IP. > > > +static void mrvl_ioreadq(void __iomem *addr, void *buf, int len) { > > > + int i = 0; > > > + int rcount = len / 8; > > > + int rcount_nf = len % 8; > > > + uint64_t tmp; > > > + uint64_t *buf64 = (uint64_t *)buf; > > Any need to cast away from void * indicates a problem. > I will check that, but code is checking alignment of that pointer. A cast won't do anything to fix alignment issues. > > > case CDNS_XSPI_SDMA_DIR_READ: > > > - ioread8_rep(cdns_xspi->sdmabase, > > > - cdns_xspi->in_buffer, sdma_size); > > > + cdns_xspi_sdma_memread(cdns_xspi, sdma_size); > > > break; > > It's feeling like it might make sense to have an ops structure rather than > > sprinkling checks for the Marvell overlay everywhere. > Won't it cause big code duplication? There are some differences, but whole > Part of SPI stig mode configuration is the same. No more than having a bunch of functions which are called a single time with checks in them will? --xvH9bqAg6EKL9q/g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZpeQsACgkQJNaLcl1U h9ADNAf/WTR0H0Qn2OWdd/BymBjuQCwA8E904iCChNKnS4OQO/0+hIrOvaP17XKx CC+pD4RcnGfxAo7ZaSt+e/4x+FSwvCrvehnKyf/SyDsdGM9L7xiSA1DkaTUB17nn 2i4VK0aHKc1Dsl6/FBpX557xiWLY0/2Cvp7pSFvrKkserLjBXZQOK/bAKe+91DTg W1Khh+gxUR2WExITICPU9oK2mPMQLICmv2OESHgG5KORduKk89GtcS0UNHngP+Zt Rk1R8BwlDkdx9iGZSghCSZxMF+0Uce2z7xDL9iJiR6lCXvFKk2i2jTbX9vxy8v5/ D7z6idrOqBxEOijFsYLWngShvjw+NQ== =oof7 -----END PGP SIGNATURE----- --xvH9bqAg6EKL9q/g--