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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50387C4332F for ; Thu, 16 Dec 2021 16:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239561AbhLPQWy (ORCPT ); Thu, 16 Dec 2021 11:22:54 -0500 Received: from mga17.intel.com ([192.55.52.151]:39288 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239559AbhLPQWx (ORCPT ); Thu, 16 Dec 2021 11:22:53 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="220214111" X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="220214111" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 08:22:53 -0800 X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="611522820" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.163]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 08:22:48 -0800 Received: by lahna (sSMTP sendmail emulation); Thu, 16 Dec 2021 18:22:45 +0200 Date: Thu, 16 Dec 2021 18:22:45 +0200 From: Mika Westerberg To: Boris Brezillon Cc: Tudor Ambarus , Mark Brown , Lee Jones , Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Jonathan Corbet , Mauro Lima , Alexander Sverdlin , Andy Shevchenko , Hans-Gert Dahmen , linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org Subject: Re: [PATCH v4 2/3] mtd: spi-nor: intel-spi: Convert to SPI MEM Message-ID: References: <20211118130543.11179-1-mika.westerberg@linux.intel.com> <20211118130543.11179-3-mika.westerberg@linux.intel.com> <20211216115100.448351e4@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211216115100.448351e4@collabora.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hi, On Thu, Dec 16, 2021 at 11:51:00AM +0100, Boris Brezillon wrote: > On Thu, 18 Nov 2021 16:05:42 +0300 > Mika Westerberg wrote: > > > +static bool intel_spi_cmp_mem_op(const struct intel_spi_mem_op *iop, > > + const struct spi_mem_op *op) > > +{ > > + if (iop->mem_op.cmd.nbytes != op->cmd.nbytes || > > + iop->mem_op.cmd.buswidth != op->cmd.buswidth || > > + iop->mem_op.cmd.dtr != op->cmd.dtr || > > + iop->mem_op.cmd.opcode != op->cmd.opcode) > > + return false; > > + > > + if (iop->mem_op.addr.nbytes) { > > + if (iop->mem_op.addr.nbytes != op->addr.nbytes || > > + iop->mem_op.addr.dtr != op->addr.dtr) > > + return false; > > + } > > Hm, are you sure you want to allow op->addr.nbytes > 0 when > iop->mem_op.addr.nbytes == 0? Feels like the command should be reported > as unsupported in that case. Unless 0 is a wildcard meaning 'any', but > that would be confusing, since operations with 0 address bytes are > valid, and I actually expect the number of address cycles to be fixed > or bounded. Indeed. I will change it to: if (iop->mem_op.addr.nbytes) { if (iop->mem_op.addr.nbytes != op->addr.nbytes || iop->mem_op.addr.dtr != op->addr.dtr) return false; } else if (op->addr.nbytes > 0) { return false; } in v5 if that's what you meant.