Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp812069imm; Wed, 8 Aug 2018 06:14:19 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy/HEaIgAPSNyBMczX/kaBSIPgczzgCW/IOUvKK4uVN/D06uAzHxy6l7thriRnXFeGfc1xh X-Received: by 2002:a62:f208:: with SMTP id m8-v6mr2901584pfh.171.1533734059735; Wed, 08 Aug 2018 06:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533734059; cv=none; d=google.com; s=arc-20160816; b=ocQtN9d7oC1OQ4ej/hwgAskSjE2Sgr9yb/X1YOveGzcgGougCdIaHB+Es4dZfcKpWc 0ZOT01luseD9jMxfs9e5nd1BkYr8YbHS7d++q+SQhLWlghTy5sfHT5IY8Rqf1KqAyVJf Y8I4ORa+V4hFSQh/wZ2Elk+Ar4bXHyAvgNG0DLjfAixyDQ5m8OefcqLaId6YUCyfe6n7 2yS+o2S9t63d8SwUFTzvpMn7eJG3MX6VQDNBZiFMs6eqe/DYVj9Eqf8sOnUcy3BJXbCX jRA4a2MICOsuBeGonEYdzoccwSxheZjXbyA5yeZkivbGfL0wscDurcIIvpsEHWEydY8h r5HA== 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:arc-authentication-results; bh=8Jk7mrmzcxQhcsV2YZaiXJhXH9JSnRIIDy38Cg+EKHY=; b=lbl4/nf5cdHDiJCQ4K45EPr7tBStHHhENx38qm05qqc/R4z8Efic439bVZNKDtG1y8 TRTXlAfFVbtN3nROZjP+EsCu6/9hHPAL8qlKCb6WpXiHB508+tP8nw8OiDMjI4ELW+8R 9s+jF+8hnVqjqPGjsPulnXQ6/Ni3z/0gsF7mi4esXDtYk/9ir88V95qGZ9/G0f6aFKQN DdACMgsX00sgmnH/Vdk7i7fofw7VNKeCZIYaE0grcgpyrZqe22CTj0z+U3Y9hfJZSfHT H+RLVuN/NVGKqj8u1E3FJGq1sUQIky3hXZMElb3nyTQKVXDRmXO9D0MeOQLGwAoPI+df In/w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p187-v6si4849765pfp.27.2018.08.08.06.14.04; Wed, 08 Aug 2018 06:14:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727087AbeHHPcp (ORCPT + 99 others); Wed, 8 Aug 2018 11:32:45 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51789 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726745AbeHHPcp (ORCPT ); Wed, 8 Aug 2018 11:32:45 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fnOGh-0003Ch-NA; Wed, 08 Aug 2018 15:12:51 +0200 Date: Wed, 8 Aug 2018 15:12:51 +0200 From: Kurt Kanzenbach To: Miquel Raynal Cc: Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Masahiro Yamada , Gregory CLEMENT , Jane Wan , Jagdish Gediya , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mtd: nand: fsl-ifc: fixup SRAM init for newer ctrl versions Message-ID: <20180808131250.kmw2r6rco3huxeig@linutronix.de> References: <20180806092137.9287-1-kurt@linutronix.de> <20180806092137.9287-3-kurt@linutronix.de> <20180808114832.61d31c29@xps13> <20180808100909.anfi3qlfjnzb74p2@linutronix.de> <20180808143352.2f5b999c@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180808143352.2f5b999c@xps13> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miquel, On Wed, Aug 08, 2018 at 02:33:52PM +0200, Miquel Raynal wrote: > Hi Kurt, > > > > > > + u32 ncfgr, status; > > > > + int ret; > > > > + > > > > + /* Trigger auto initialization */ > > > > + ncfgr = ifc_in32(&ifc_runtime->ifc_nand.ncfgr); > > > > + ifc_out32(ncfgr | IFC_NAND_NCFGR_SRAM_INIT_EN, &ifc_runtime->ifc_nand.ncfgr); > > > > + > > > > + /* Wait until done */ > > > > + ret = readx_poll_timeout(ifc_in32, &ifc_runtime->ifc_nand.ncfgr, > > > > + status, !(status & IFC_NAND_NCFGR_SRAM_INIT_EN), > > > > + 10, 1000); > > > > > > Nit: I always prefer when delays/timeouts are defined (and may be > > > reused). > > > > Me too. I've missed that there is already a timeout constant > > IFC_TIMEOUT_MSECS (500). As it's huge, I'll add a second one. > > Well, I'm not bothered with huge timeouts, it's in the error path so we > don't really care. okay. I'll send a v2 next week addressing your comments. Thanks, Kurt