Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7033484ybi; Thu, 13 Jun 2019 08:27:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+nZIH3NK2GsnwecoVdHnuVKVwwLEdvjaFNapkd7iAZY3QZWVUrLdrs0tc2QWLLkP3dVy+ X-Received: by 2002:a17:90a:2446:: with SMTP id h64mr6509636pje.0.1560439667156; Thu, 13 Jun 2019 08:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439667; cv=none; d=google.com; s=arc-20160816; b=FXfEESLzKvChDC8kJdnMY8lJUjDGu+IKM3nMPry3Jq5hDlNUiGVziP72BIq+pXV9KK VxyNWrR1M/qZqhvfJp6mOhpBTiIp8/qR+zYrIDZvte+wPcJbSEekKaGdnbjR4mR1GrKm YRWn1WQH64St3n6YUeG7vfMRjzmW0xsV+7hpdN2Peer3gEWDEnnZE/2OzgSNfFFqhrmD +OdOjnpD8/pPBbVT290xuuq80e4As8FymdzymB8/Nkuxph9fFJklGW6o89U0vz2U35GK cixp7fBI6fpwpnFepdXEvLWh2P3SY836yTuQmxWdWh+lTEgovZRr1OqD0Lb0ttF7sUDp 1yhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QQPcew8OO4uWb22KfzOtVt5mqOvY+NBIVgehiNO+p5g=; b=N1i9uJOTA+TuIil+z9Vw0ryAOa7m3pS+yfT0plV+poNc8+bFPNFXjIaDqXFaAHCgEm zqU7ifymHOkQxMe2ReDFr0fLo/DOlLIgQXryYyOsMfezwXW7q3d6xoAljA+ZgvvUHek+ 4GhLDrCJ3P/lGsHlktfj1RrlO6YD9hajavCSQAHM8XMEUgQAZqCAjBc61V22hrFTpyMt cOAFbFBJu52h2JLWTAyCc5vbfYjd5oyTkpp5RIZxCQ6Gm4tdKtte7X7WefNdT8aNaLhG NDqTqsYZgY3Dyk/tAKPXThkA2CUJJIsxC4FnC8U1vsojYNYVq1n28hfXX2DDVjGuJ51N SrFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intenta.de header.s=dkim1 header.b=MeM9nY7f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intenta.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si3413258pfi.91.2019.06.13.08.27.31; Thu, 13 Jun 2019 08:27:47 -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; dkim=pass header.i=@intenta.de header.s=dkim1 header.b=MeM9nY7f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intenta.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728762AbfFMP0Z (ORCPT + 99 others); Thu, 13 Jun 2019 11:26:25 -0400 Received: from mail.intenta.de ([178.249.25.132]:34947 "EHLO mail.intenta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729176AbfFMLoC (ORCPT ); Thu, 13 Jun 2019 07:44:02 -0400 X-Greylist: delayed 359 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Jun 2019 07:44:01 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=intenta.de; s=dkim1; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:CC:To:From:Date; bh=QQPcew8OO4uWb22KfzOtVt5mqOvY+NBIVgehiNO+p5g=; b=MeM9nY7f3cZ90lL4rVQxYVufUJWVijCGsM8VNa570Vmemc9Y+dPh2CCk5QfPO4GgEQUkL4OOlgOR4WhNgsmBoKs2WpSYk3Kg5aXldYB6IXl7JmJyoCOrpFeuO25V4zrTlJCrDErXf//tD2uVv+ns67OSh4os0L8yg52I4x1CGatCTdyIUC7XBlk0KBce244jX/LJEfkIb3Y+6aEnWG0PJBoDtWLmtDZDhY4Z5g4BCxHFamAOkk/A8HFC8oIWvFrfWAICoZf0GmntVxKisUifc3lPHOQV3USodD50SuOMP3ZkMXbNipcN+pxWQTz5pOJt2kmnNMJxxVROtECIevg8xg==; X-CTCH-RefID: str=0001.0A0C0201.5D023595.00A2,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Date: Thu, 13 Jun 2019 13:37:57 +0200 From: Helmut Grohne To: Naga Sureshkumar Relli CC: "bbrezillon@kernel.org" , "miquel.raynal@bootlin.com" , "richard@nod.at" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marek.vasut@gmail.com" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Michal Simek , "nagasureshkumarrelli@gmail.com" Subject: Re: [LINUX PATCH v14] mtd: rawnand: pl353: Add basic driver for arm pl353 smc nand interface Message-ID: <20190613113756.53nzb6o2vuurep2a@laureti-dev> References: <1555326613-26739-1-git-send-email-naga.sureshkumar.relli@xilinx.com> <20190425112338.dipgmqqfuj45gx6s@laureti-dev> <20190429121804.4jzspv4goehwdpez@laureti-dev> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-ClientProxiedBy: ICSMA002.intenta.de (10.10.16.48) To ICSMA002.intenta.de (10.10.16.48) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Naga, On Thu, Jun 13, 2019 at 10:18:00AM +0000, Naga Sureshkumar Relli wrote: > I spent much of time to address all your comments. > All are addressed and tested. except the above one(address offset calculation) > I didn't see any issue with the address calculation. Let me first point out that this comment was not trying to imply a bug. I was trying to understand the code by comparing it to similar code and that turned up an inconsistency, which can be intentional or a bug in either of the sides being compared. > for (i = 0; i < min_t(unsigned int, 4, naddrs); i++) { > nfc_op->addrs |= instr->ctx.addr.addrs[i] << > (8 * i); > } > If you go through the nand_base.c, there nand_fill_column_cycles() API, fills the first two or one address cycle > Based on bus width and page size. > That means, addrs[0]/[1] will be updated here. The problem at hand is that `addrs` is imprecise. In this code, there are `instr->ctx.addr.addrs`, `addrs`, and `nfc_op->addrs`. All of them are different. My original remark was targeting the possible confusion of these different `addrs`. > And the page is updated to the next offsets. > In the similar way we have to extract the offsets in driver. > So the first four address bytes are stored using the above for() loop and if the > Address cycles are more than 4, then store the remaining offsets as well. > > I just compared the offsets that are updated in driver with the offsets(page and column) that the frame work(nand_base.c) is sending, and the offsets are same. > I have also checked these offsets with older driver(not exec_op() implemented) and both are matching. > > So I didn't see any issue with this addrs calculation. > As per the statement mentioned by you, this driver consumes addr[0], addr[1], addr[2], addr[3] and > If more address cycles needed, then addr[4] and addr[5]. This is correct. Again, the lack of precision makes it difficult to discuss the matter. You refer to `addr`, but there is no `addr`. I assume that you meant `addrs` here. Based on that assumption, your second last statement is wrong. The driver consumes `addrs[0]|addrs[-offset]` rather than `addrs[0]` as the first byte. Then it proceeds consuming `addrs[1-offset]` instead of `addrs[1]`, `addrs[2-offset]` instead of `addrs[2]`, and `addrs[3-offset]` instead of `addrs[3]`. Finally it consumes `addrs[4]` and `addrs[5]` if more cycles are needed. I would not have commented the code if it were actually using `addrs[0]` through `addrs[5]`. Your description looks reasonable to me, but it doesn't match the code. I'm looking forward to the next version of the patch. Helmut