Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp453820ybl; Fri, 9 Aug 2019 08:27:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF0hcsM3h2KhKHUm08c0jZQQmfE0LV70JExgGCERYcKD0BSG+hEO28J1CPBNg74dBhltcw X-Received: by 2002:a63:fc09:: with SMTP id j9mr17344383pgi.377.1565364463168; Fri, 09 Aug 2019 08:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565364463; cv=none; d=google.com; s=arc-20160816; b=dfRpIR0b1ex/pK1a6Ib9aEfdL6FgDZPaqajpvslm/uO69fscRVEH1EMerhGzvvlcCk V+jtICkHNk6447kcDoZ7vXKDJKZZNRtDkUP3gRYoMqTfDQOyROlRw1JzI6rLJJbbMNbi t9gn90G40oBWi6z54rOFe7Ly80UhuiIP0GltNBzYf0UCCrs4bszh289uy2JN3KOWqwr7 nJ0/A1sMnHxlXMX1Z/OG40+LFH3rw2MDTjTUIe2qS+JO+0S4aG+oFkjPqH+KbU6aThpz MxmtbppVRIu0Q9nshPcS91lBzLgWklW/x3rhXWNVoH4AkyKo0+RWlL6W8WlduRnnkkt4 /W+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=/f3eXooBLy9WR9J3+1cl22B553PWn/Z/2lSTkU1UZiw=; b=faxMUT25r2fzVlkN1Agdl9Sju2Hr4mLh7gs0FW56EQ24EfeTpS4vN6+GlpNSLn3F3v XOV8I12Dlqgpb1cISxeQBu9SnJaafyGOUFjnFRWRskwvP3Y2kfKukspoL+DnqW9jJjkl VZF4Qp1D862lQITkvYgoUOZ/pqc+ZcHZjiOzPmao8W4NH4ncK73uboc+FVNjhrQ9kc3S zR6mqEI06hf1gHUYXcHl0h9D9P085spEBhDlib6aEZOrCsubeXgBTGkP4OkRSMNL2PT9 egHhOlDs8qJSbPkSIWqFnbZjbiRxJnfJBJLuSOtYQYFpQVYkkqsCbQCpKkZNUw2MSf9+ E4cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g98si4516465pje.92.2019.08.09.08.27.26; Fri, 09 Aug 2019 08:27:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407375AbfHIP0B (ORCPT + 99 others); Fri, 9 Aug 2019 11:26:01 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:53248 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfHIP0B (ORCPT ); Fri, 9 Aug 2019 11:26:01 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id C093628CFB2; Fri, 9 Aug 2019 16:25:59 +0100 (BST) Date: Fri, 9 Aug 2019 17:25:57 +0200 From: Boris Brezillon To: Tomer Maimon Cc: Mark Brown , Rob Herring , Mark Rutland , Vignesh Raghavendra , Boris Brezillon , Avi Fishman , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , linux-spi@vger.kernel.org, devicetree , OpenBMC Maillist , Linux Kernel Mailing List Subject: Re: [PATCH v2 2/2] spi: npcm-fiu: add NPCM FIU controller driver Message-ID: <20190809172557.346e7c41@collabora.com> In-Reply-To: References: <20190808131448.349161-1-tmaimon77@gmail.com> <20190808131448.349161-3-tmaimon77@gmail.com> <20190808173232.4d79d698@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Aug 2019 18:26:23 +0300 Tomer Maimon wrote: > Hi Boris, > > Thanks a lot for your comment. > > On Thu, 8 Aug 2019 at 18:32, Boris Brezillon > wrote: > > > On Thu, 8 Aug 2019 16:14:48 +0300 > > Tomer Maimon wrote: > > > > > > > + > > > +static const struct spi_controller_mem_ops npcm_fiu_mem_ops = { > > > + .exec_op = npcm_fiu_exec_op, > > > > No npcm_supports_op()? That's suspicious, especially after looking at > > the npcm_fiu_exec_op() (and the functions called from there) where the > > requested ->buswidth seems to be completely ignored... > > > > Sorry but I do not fully understand it, do you mean a support for the > buswidth? > If yes it been done in the UMA functions as follow: > > uma_cfg |= ilog2(op->cmd.buswidth); > uma_cfg |= ilog2(op->addr.buswidth) << > NPCM_FIU_UMA_CFG_ADBPCK_SHIFT; > uma_cfg |= ilog2(op->data.buswidth) << > NPCM_FIU_UMA_CFG_WDBPCK_SHIFT; > uma_cfg |= op->addr.nbytes << NPCM_FIU_UMA_CFG_ADDSIZ_SHIFT; > regmap_write(fiu->regmap, NPCM_FIU_UMA_ADDR, op->addr.val); > Hm, the default supports_op() implementation might be just fine for your use case. But there's one thing you still need to check: the number of addr cycles (or address size as you call it in this driver). Looks like your IP is limited to 4 address cycles, if I'm right, you should reject any operation that have op->addr.nbytes > 4. I also wonder if there's a limitation on the data size you can have on a single transfer. If there's one you should implement ->adjust_op() too.