From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 998D615E5BB for ; Mon, 23 Feb 2026 09:17:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771838274; cv=none; b=oAd4LCntgRGbuV1fVEozHWAOqDAXb+gds+JENqgSml3bsh6pKXTC4gFz2Lqu75MB9pKsYa/T+GPdoCfMiZJbfc5RzHFjun/zSflHsboVFHLcTAF078uG3QUipwKZMrZSZlT33gvfkE/6rx/e4yv2birD/55nlnW3MF7UJti6a/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771838274; c=relaxed/simple; bh=4PioQTE1/pn/cSvWasq9vsu4M69jf5y8EpRedJOKuQM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HRhApxltp2YenSad8ynkIaeuO5OzbQHOCOBs+4dHSja7YcPCkjjzuDLqs83A60hueFeH3wpItjKpUOzhbZmutBH0mvwUg+rYq2gOoTeYjj2Xh9mMogP+vtQEY/aywGgWswk3w1vs45umpnMLknvtRt7nWZJyi82E4H4j4J2Szoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nYVdD+vV; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="nYVdD+vV" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8249aca0affso2086090b3a.3 for ; Mon, 23 Feb 2026 01:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771838273; x=1772443073; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vsAzAZV+vDh9kg6mWOSA63o6/YiuK/GmIL99VmqCAg8=; b=nYVdD+vVJtvQ5Zpq7TUYNiy1J7DlojfNhE5/z169rvyAVE7LJpDVEsY0PFwTlRQ0H+ mWhY3q442sHNntSG00C2nwCb6ep86Ip4c2BFpf4+MNzK8488LJeLCqoB+rkVuCBkdWYX 4lW85RcX2ZXQacQwFbAmHSX7Ax6m4XLbqEvCr+hfy9qGDAIQbX/dX9GxXR25LcIE1P+Q ybWamskq2BKAEE6WjmQbPdsphBPQs+NwGk4EnMvigej7A37MkNqxp90lmyqJiPv8OBPp i4XpZzjYLWzCWjfQ5XZlmizeaJqwpRJdxbe7AytDrdXRLzqXt8wUCClN5a+V2T4sm6uY jFOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771838273; x=1772443073; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vsAzAZV+vDh9kg6mWOSA63o6/YiuK/GmIL99VmqCAg8=; b=h0YZN84qR0zJpruW1PIHgy7mKfksnC+BTE4L8b01GwYxMigDH+BsTBVEYccGahnxR2 P/3gwTh8HWBS8BWWHC2YgHJXHFpZxnjdtFu9g2wpTyTRjQ1GOmPP2krEoWs6iM9XFR4b nTmrh+U93NO6WPijcqnsrJOAu3p3vtNPFjNwu20F40kP4dLhwzLas0lobmL2BRIkQ9l7 SbN8IMSegKuFUWIF31XEGex9+TQ/JyrE/TrMlMCAYhCIr/SxJFImnNUKuxkXbRmcScyY WqoDu5Jt8k04BiPUYVUydGNDMmaTvGMHlJSfAtTcxN/y0RAid4dI8Ja+NKhRYtOQAui4 AypQ== X-Gm-Message-State: AOJu0YzyYodEOWgna+GT8sn60mynrQsAW4hvj4kBQ4AyR/9tsGRUL3yB w1QuYRzaY3CbSdVfib19mfAIQCd+MQIzl8QkeVrrKgkeRiaq2+G9SzSmun1WcA== X-Gm-Gg: AZuq6aIRUNnlvHvNI69axBKV3aipFZ0yKuQ2DuZyySxEhFdGHuG0KSrYEiBjgMMsWxI GQDXjrtxwBROItJOiW673TA/TFwjw95tUXQ5p0TaDMB4mfyFiYODdpmKDYSEIGic5LSC/IX5l8x jXGYa8yvjH9PibG7Uzw/yLk4zUUuJw9foVKWxhCsZDj79QcAWcXObpMpH7Y/hREhQ5TN9oH/KzK ygHub+7xa/L0E3RW8om5dVItnFP5XcsUDHID86mEnDmf6dBlbUfW3b49laTNZv8OBjNMb7sDbQY UDks9ZISRZ6Z+9BJGi0nBGQavVmEdEbnSS8aofQNSNhE5CrUMZ87qm6AqJ4MGhCjz1lFyCCy61/ O6yD5sBS5cqoYb6oXP83PoIiBhi1ogYJ+OdiSmxytXrPvexkNOXC9nGyvM+Aby/mSFjO5FBEOA3 kta6Gbxzw6C4hR+M+f2t8VeeZqLMAf2sl1uKxO/q6M X-Received: by 2002:a05:6a00:2389:b0:81f:3f03:6832 with SMTP id d2e1a72fcca58-826daa62853mr6926447b3a.44.1771838272905; Mon, 23 Feb 2026 01:17:52 -0800 (PST) Received: from e50dbb8e4021 ([115.245.213.202]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-826dd689474sm6353180b3a.15.2026.02.23.01.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 01:17:52 -0800 (PST) From: Sanjaikumar V S To: mwalle@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, pratyush@kernel.org, richard@nod.at, sanjaikumar.vs@dicortech.com, sanjaikumarvs@gmail.com, stable@vger.kernel.org, tudor.ambarus@linaro.org, vigneshr@ti.com Subject: Re: [PATCH v2 1/2] mtd: spi-nor: sst: Fix write enable before AAI sequence Date: Mon, 23 Feb 2026 09:17:33 +0000 Message-ID: <20260223091733.47-1-sanjaikumarvs@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Michael, Thank you for the review. > Raises concern about writes ending at odd offsets potentially having the same issue The odd end address case (trailing byte) is already handled in the existing code at lines 243-255: /* Write out trailing byte if it exists. */ if (actual != len) { ret = spi_nor_write_enable(nor); ... ret = sst_nor_write_data(nor, to, 1, buf + actual); } So write_enable is already called before writing the trailing byte. My patch only addresses the odd start case where BP clears WEL before the AAI sequence begins. > Suggests simplifying the conditional logic by removing the length check The condition `if (actual < len - 1)` avoids an unnecessary write_enable when len == 1 (single byte write at odd address, no AAI follows). But if you prefer unconditional write_enable for simplicity, I can change it in v3. > Notes the patch lacks runtime testing I don't have the hardware setup to test odd-address writes at the moment. The fix is based on code analysis. I have tested patch 2/2 (dirmap fallback) on hardware. Please let me know if you'd like me to send a v3 with the simplified unconditional write_enable. Thanks, Sanjaikumar