From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC3BBC4345F for ; Wed, 24 Apr 2024 14:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S2cSIkPfFfAlHeSVhMM7VAPZ3rkHIP7q3MbyRbqre9o=; b=TEzhFc0SIrbsnQANpNHfHL7Lx7 YY8waGQBoyivggrSo2A0W9B/V+dRA1XDXB7Fp81Gtcerw2GWNgQI4d+sN9gOeSvF41IqBl4ZWlikG ve1IGUU3Fsg78poZ9lDamA7PfBY578TBPhksWEWtVph3sJv9+sP14Nqx4NP/fvDx5UBOh4pxo0vhc Gl48MMiRWbxLlxRRcsliQYdgiMoOYATkl3kNSumUY6zuzb6P38onaMPWn1+ack8xeHGwDwkgJrneD 2G+V1jpqokwKSEA4tJSsNS2EmRpoh1peeNNf1QSYmxaIPeQyS34oM5P3ibzPS8rooX/xscWlSWhOw zINHWgwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzdlD-00000004VzU-3Y7c; Wed, 24 Apr 2024 14:38:11 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzdlB-00000004Vxf-1oo1 for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 14:38:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4438D61B4D; Wed, 24 Apr 2024 14:38:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F2DEC113CD; Wed, 24 Apr 2024 14:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713969485; bh=unw30XBcP+yo/4XQdedsYzC3CosP/sGpCtqgeHeUPKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k84crXgkiHJ8utgOVxnb6effLWOQN/89JT7R1HOuKj3+267Vsu3pjQk9Ow0mJQD1n 59lmHacf95DKd5iM3jFFnQw/QiTPqhgmZcuCueQIFgtziZUuf3nukC6GvhF37jr9+7 Pg3wEXbClaZsKLmXKwOc9w7JY30IsVNh/S0/up9/fBh6TwLsOenD4/H6tAhS3/qjHG IVBbiNMCUjNw14H++AiDXxqXJw1CjOdd0TfvUL+uA9PEYntEAbbstO+Kw9QZjBKYHX k6N2U3AXc+0o+Rg6JAaOI/N1xg6w+PNG6igyc3oLKs3TgQ3Xy8IgyyJs8kJ89QiNAn 6/rDATaqYz6tQ== Date: Wed, 24 Apr 2024 16:38:02 +0200 From: Lorenzo Bianconi To: Andy Shevchenko Cc: linux-spi@vger.kernel.org, conor@kernel.org, broonie@kernel.org, lorenzo.bianconi83@gmail.com, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, nbd@nbd.name, john@phrozen.org, dd@embedd.com, catalin.marinas@arm.com, will@kernel.org, upstream@airoha.com, angelogioacchino.delregno@collabora.com Subject: Re: [PATCH v3 3/3] spi: airoha: add SPI-NAND Flash controller driver Message-ID: References: <497dc9dad823fcd1403ed62ba164dd7d70f31f90.1713866770.git.lorenzo@kernel.org> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_073809_610537_70D65713 X-CRM114-Status: GOOD ( 19.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1329352219716284103==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1329352219716284103== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o4U3+WsMGnukPqCb" Content-Disposition: inline --o4U3+WsMGnukPqCb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Wed, Apr 24, 2024 at 1:07=E2=80=AFPM Lorenzo Bianconi wrote: > > > Tue, Apr 23, 2024 at 12:16:37PM +0200, Lorenzo Bianconi kirjoitti: >=20 > ... >=20 > > > > + /* addr part */ > > > > + for (i =3D 0; i < op->addr.nbytes; i++) { > > > > + u8 cmd =3D opcode =3D=3D SPI_NAND_OP_GET_FEATURE ? 0x11= : 0x8; > > > > + > > > > + data =3D op->addr.val >> ((op->addr.nbytes - i - 1) * 8= ); > > > > > > Seems like you wanted to have always the same endianess and hence can= be done > > > outside the loop via cpu_to_xxx()? > > > > sorry, I did not get what you mean here, data value relies on the loop > > iteration. >=20 > u8 byte_stream[8]; > u8 cmd; >=20 > cmd =3D ...; >=20 > // find what suits your case(s) > put_unaligned_be64(op->addr.val, byte_stream); > for-loop { > err =3D _write_data(); > ... > } ack, I will fix it in v4. Rregards, Lorenzo >=20 >=20 > > > > + err =3D airoha_snand_write_data(as_ctrl, cmd, &data, > > > > + sizeof(data)); > > > > + if (err) > > > > + return err; > > > > + } >=20 > ... >=20 > > > Why not utilising cleanup.h? (__free(), no_free_ptr(), etc) > > > > I guess we can just allocate as_dev and as_dev->txrx_buf with devm_kzal= loc() > > here, agree? >=20 > If this is a solely part of ->probe() stage, yes. >=20 > --=20 > With Best Regards, > Andy Shevchenko --o4U3+WsMGnukPqCb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZikZSgAKCRA6cBh0uS2t rGU2AQDvbdXTZ+P+0LBWXD8icCgFhTk0QUDrZ/0gXTrvN2W8+QEAkkcFdBJ4/6RQ rccGnh3Wf0RGprTGjIa+gGbG09ffwgg= =2aL4 -----END PGP SIGNATURE----- --o4U3+WsMGnukPqCb-- --===============1329352219716284103== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1329352219716284103==--