From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2124F3CDBD9 for ; Wed, 3 Jun 2026 05:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780465733; cv=none; b=i5Ewrd5vyhFai0urTBuAOXVHdgleiB7ZID4TBQ79iT+41dyweFSWGwpXcsACLRre2wqTw+oRhiLrq+EQU2zi0rfJ+3m8d/Y/hphCpOZ5xlPInb8GJJEeMn+iadxgmaedKOIaKwLFCG9Ms2Y0gKJ0aW0S6rXLD2KmwIYeIfnalwY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780465733; c=relaxed/simple; bh=sdfCTJLoBvO8O+OJlMXr2ZCXbAbu5VtirQF2QdslXf8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OsznYGpMq3h9qutj2LK9py3Av02oi6dU5gBetAGftlgCPk5cMFLtWh5Gw9VovN9y9zaC0P+E6HHeCJK2g+gFX4OqMSrJvj2GzQg7/qu9YigZ38KIFyB4q2vH5QcbXSOGNRa/alPG4T92UPEw2ZvVvTTQs7oaFiZuH7bZlvi9MrY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sobrie.be; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XDO9vhrr; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sobrie.be Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XDO9vhrr" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-490388fd0dbso120898855e9.0 for ; Tue, 02 Jun 2026 22:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780465728; x=1781070528; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=pzDenIalDMAuiWeAwmJnmzeE6FqdHQUL/2zLEDLjuGk=; b=XDO9vhrrDRX9HOjA1FoQFtg7YpfGycEh9c8d86gHbXZBSBwiNtJ3bexwMH6z6U20Lt gGOiYD8Gr/Q23kcNwhfu7JO34eT0dleGdXAA64pIdFpQw1t0VBsanVYNS934VQ72cGC0 gasuClslGPCmXpq6rHK3yDDtmkQJ1rAdX4H6dtAnPZ6srmPY6ddNWwo94Nl1ZVV0oUrN OYPbCJ1zH3ZVX1XZQzHtLwWsnhSBuiVG9hSBue/yJtodCBAC3a2AB6//+K2hqkBZlUeQ TZhwsI27fcxzZQchxZmcja7SmqvgJjbOWd6q0ksTmDSHMo6mhrPwWbcCx9b+2InOaOLN WrJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780465728; x=1781070528; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pzDenIalDMAuiWeAwmJnmzeE6FqdHQUL/2zLEDLjuGk=; b=joYbTO6CxLgvYZ/UzYMak9pP8MXYgMM8s/lXq21YC3Wx+lDfdgMUEKY9SKHAPAqnHk PdUylZcibxOfyBAOxmv1jbqEjpeSDkGc6WcvuJfXXxdCKWU0t/WZ9SuAkgCh+dINjed/ ++ih5sPejBoncuFVzrhW6+dnB+vWD+KxBQYnZVSJon3DWVmu6EdXRrYFDx5TyaGpJjoq u8wiQgyubArKHnMflf90JrPmJ6ib9qNE2QA88M5+R00lrcd6PyMhO0NAN158KaqSdAe5 H1ZcHkSQ5RGAyna6aE5pgAsrioJJ7yXgxZQnYj5iLtvas8DKjcPRwJo3VEM9XTp8mXjp 7dqQ== X-Forwarded-Encrypted: i=1; AFNElJ+66N7i6RvW5z+K/1CrgL8bVj7s6z1JXC3zAwNmYux5PCJZq3rfNyMhKsx5Tt+h+dgjGVURzaTZt/qZ/9U=@vger.kernel.org X-Gm-Message-State: AOJu0YyGzwaJr8Ksyw7cldBAX7sdyWEWcAoTO5TbIoqqKi2BLCz56Yq/ zrCznKoWtERSWks7gbkErldYMeMBIY4QLL//MK3BOii+YaUb2tFvPaed X-Gm-Gg: Acq92OEw8Ccfk2arau2zZefG+Gp5TGxqz33gzPkYSY6JXTGaa/DbWzq4JG0DHjcH5Re /kP7NOJGMU/2tW9dRInOtNgYqIYFoqZRmhDFGoM09/BQgcbZnMTB7FOku1bgkNzKfP5LSqEkvua YxUxDGdfufrsBEaXwgNBa4bvDH6SUecmVLUeFgtq6xRn+NCCmoZKVRqNphdh28LZ/w6xGEXT5vf rqFCc/oPqWng5zY7Xj+189OgtPA0fy28ebwxR2aCr8MxUnId3bdvnleo73gsxZYMn+qdzJMCLfV gLrujcydc3wO+gOR3yDCUf7LmU3uiOUSQuIGOUATkFl7l4fZjHDTZXny2iEliIolMlQWrUc57gY +Co0OxAkQmNZQ8twRihDC67rdaCP4BIOk3nu38yQHSDUl3A/8QDR0En3GKG7op0q+wNg793oRI6 IoLm5EydGYfVoa+r/hotbrT6kWYM2jJ2JiXUYMTpRTqAOR1iYqMMY= X-Received: by 2002:a05:600c:698c:b0:48e:6db3:ff33 with SMTP id 5b1f17b1804b1-490b5d41d43mr30103945e9.14.1780465728174; Tue, 02 Jun 2026 22:48:48 -0700 (PDT) Received: from localhost ([2a02:a03f:b7dc:2b00:a97a:8551:7733:cb60]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f35eae5sm4752182f8f.33.2026.06.02.22.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 22:48:47 -0700 (PDT) Sender: Olivier Sobrie Date: Wed, 3 Jun 2026 07:48:47 +0200 From: Olivier Sobrie To: "Miquel Raynal (DAVE)" Cc: Michal Simek , Richard Weinberger , Vignesh Raghavendra , Andrea Scian , Thomas Petazzoni , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mtd: rawnand: pl353: Update timings at the right moment Message-ID: References: <20260529-dave-upstream-nand-fixes-v1-0-8c72aa23aee2@bootlin.com> <20260529-dave-upstream-nand-fixes-v1-1-8c72aa23aee2@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260529-dave-upstream-nand-fixes-v1-1-8c72aa23aee2@bootlin.com> Hello Miquel, On Fri, May 29, 2026 at 06:29:56PM +0200, Miquel Raynal (DAVE) wrote: > If several CE are wired, we would write the registers for every chip one > after the other, and reselect the correct timings for the first chip the > use wants to use after probe. This is not exactly efficient and could > slightly be improved since we already have a helper that applies the > configuration if there is a chip change. Instead of programming the > registers in ->setup_interface(), let's just drop the pointer to the > chip and let the nand_select_target() helper do its magic. > > Cc: Olivier Sobrie > Signed-off-by: Miquel Raynal (DAVE) > --- > Olivier, > > This is an enhancement to your previous patch which already > works. Can you please tell me if that change is okay for you? Yes it looks good. I tested the patch on one of my boards, it works as expected. Acked-by: Olivier Sobrie Tested-by: Olivier Sobrie Thanks, Olivier > > Thanks, > Miquèl > --- > drivers/mtd/nand/raw/pl35x-nand-controller.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c > index f2c65eb7a8d9..986019b42153 100644 > --- a/drivers/mtd/nand/raw/pl35x-nand-controller.c > +++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c > @@ -862,8 +862,11 @@ static int pl35x_nfc_setup_interface(struct nand_chip *chip, int cs, > PL35X_SMC_NAND_TAR_CYCLES(tmgs.t_ar) | > PL35X_SMC_NAND_TRR_CYCLES(tmgs.t_rr); > > - writel(plnand->timings, nfc->conf_regs + PL35X_SMC_CYCLES); > - pl35x_smc_update_regs(nfc); > + /* > + * Reset nfc->selected_chip so the next command will cause the timing > + * registers to be updated in ->*_select_target(). > + */ > + nfc->selected_chip = NULL; > > return 0; > } > > -- > 2.53.0 >