From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 6D0F934CFCF for ; Tue, 31 Mar 2026 06:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774938278; cv=none; b=r3O7Fv1Z2iXhygBxJDYTX6CTci+KHqrPKWpbiL122WsUpZmB42+ZSAdBL+FT+edfkwh1J6AXGxGM0OQeksZ7wQowq3iic3feT5CWweIwwVA/a1BaKmKf+w+pl8yOe8LsBB6mWDKoVk56qTYHUlNPL4++Waasov5WxUmgXPokD00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774938278; c=relaxed/simple; bh=vWlAHWkTCyA7++NZ0O2EqtDYUYeKrn9fUAwZU7E8i7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GSbPytr3B+QZEPG6oygKolyoxNPmc1mhFvmAGAHUaiCGzXLWRUUXIGcpkAqiXGaVwEFbsrZaCV7fSj88J5A/OZvFRatDMhtUSk4NLm29YCz2dxxHKd5bGAnaUi7nj16ZahRwwF4ilQlDwX2lI3bIaYtHXWD29vRn91ZSlyyCq+s= 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=C2M3pV4O; arc=none smtp.client-ip=209.85.214.177 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="C2M3pV4O" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2b24fcc2b5dso13393015ad.1 for ; Mon, 30 Mar 2026 23:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774938277; x=1775543077; 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=vWlAHWkTCyA7++NZ0O2EqtDYUYeKrn9fUAwZU7E8i7s=; b=C2M3pV4Odr+GN1Pzxm/nYKp9vkvixRqq+dz4wFyJyIYCbZBgUZgjdPYYxpueZj2dWQ 6PpH6VflVENLOpBFC9x5G9hh1Ziky9Lu8OVsHabY4trwhdKqpcYxd179S/iq040ok6n5 gMzNQ4CnFDTD2+lSwa7DvELjbRfEgq5Ono3IYbkWhjTqJtEsrBjcrFeYTaNVbh/omWq5 lTZBkVVH/Ib7Y+ELM+WuOm5zT3+Pl9WdxTGj33A9whLyutc91Py4e6H3fkXk0d9FxryL 8jfnuRhNcR42usacAiYm4QkAKSQxIMHtqADlGMeOUi1P6pI88O3PfqLp21CVxDyr8vWm 9S7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774938277; x=1775543077; 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=vWlAHWkTCyA7++NZ0O2EqtDYUYeKrn9fUAwZU7E8i7s=; b=kBQoVx3fGm2TdK1dTt2wLDrPnYGZ8CSk0UFVXFgnWXdrB8gZJtzZZNMoSjLP/Nr9s6 f5or/Oa4L2/eAQT5CJfCgYf/s6xsj89QY99BHDBdq4ca0udbB1XQvEinE/yyYhorUcSy B3FIUTJIGAM6Y3r8LJdnFxbuyQ71hMDF9+YYx2+q3sbpNYR/BExbOwMufiLJ+t6rrDAz GQJ0Ug5bN4B6ZkWjHbbUHkWu+yT6Ch2waVDtNBDK8lPxosifkwigYpt9XPqVt0fpt8Z6 JsiHbZqStKvp21amZ4zyEBu51AoHKgid0xQHSCw17VRUuud6PYmIdFK3psZstA9rknOJ ONEw== X-Forwarded-Encrypted: i=1; AJvYcCW0popFSChATTcWwlMBxNDL+skwEg4QUmVh4BfDWYUX/mDAZ1tQgVUZOoLJoCBjc4PIIjDX2Zj4ejW4wT8=@vger.kernel.org X-Gm-Message-State: AOJu0YxivQEsTqm7f2++dg/IAfc3gj/9xcBjQ0LtoNowqMm5ESzBF3w8 wmGnN24NeV5NxtKljR9xL1qzJJFg+NfaNxlgBQkvHd1IWSf7iOu10lTQ X-Gm-Gg: ATEYQzzAcTlIH+Jy7hBJwOx2KYAWi2QlpAGFiYOXeMXZN1YebTcKyz/p5JIptO+UAWi cv/YBaSvC2qPSzWUVava6OEl3iqeF3wm2mvqpg9jEC4uW70mvoww0OAxaW/vl7MpwUc2s6WyILq 6bTU8BTmbTAz9wo2fLkzQMtbqNEnB9VPDH+/q/GUWG4234eL5SeCxlRRNu6zYJPZkKcBf2zDBGW z0FE5ejCnEGDKMLl11chnVgLNxGXFdjB8buLDpBp2qMIipj+1x9JGgk/QHByWKLqq9QfV/4VO7b m/pLZQLTsyLAz9uxW4h6QDChomesb+0UFV97CzimO1+GYkK12qZvlwfuRTx7hNfrqmOenJRc2S0 N0LFoIBfirF3MW3qMLh39HqgrUKYr5Nr6YFFtzhRY8E1f0f97bi7nP7Rf94D76YU+4clCj2lPdV MJZUtmW7YxWmk3Ir3ol1IS8s5ASUDIIuI= X-Received: by 2002:a17:902:e889:b0:2ae:d09c:5241 with SMTP id d9443c01a7336-2b0cdc0332dmr160886305ad.2.1774938276711; Mon, 30 Mar 2026 23:24:36 -0700 (PDT) Received: from f7eceb44c2db ([115.245.213.202]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b242676e13sm103873625ad.28.2026.03.30.23.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 23:24:36 -0700 (PDT) From: Sanjaikumar V S To: mwalle@kernel.org, pratyush@kernel.org Cc: hd@os-cillation.de, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at, sanjaikumar.vs@dicortech.com, sanjaikumarvs@gmail.com, stable@vger.kernel.org, tudor.ambarus@linaro.org, vigneshr@ti.com Subject: Re: [PATCH v4 2/2] mtd: spi-nor: core: Fix AAI mode when dirmap is not available Date: Tue, 31 Mar 2026 06:24:17 +0000 Message-ID: <20260331062417.26-1-sanjaikumarvs@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <2vxz1ph11jmq.fsf@kernel.org> References: <2vxz1ph11jmq.fsf@kernel.org> 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, > But if the controller does support direct mapping, won't it end up > using the wrong opcode? Would it be a better idea to update the > dirmap_info with the right opcodes? You're right. If the controller supports direct mapping, it would still use the wrong opcode from the template created at probe time. Updating dirmap_info at runtime is problematic because SST AAI mode requires dynamic changes per write: - cmd.opcode: SPINOR_OP_BP (single byte) vs SPINOR_OP_AAI_WP (word) - addr.nbytes: must be 0 for subsequent AAI writes Controllers may also cache the template at dirmap_create time, so modifying it at runtime could cause issues. A cleaner approach is to disable dirmap for SST AAI devices by setting nodirmap=1 in sst_nor_late_init(). This ensures all writes go through spi_nor_spimem_exec_op() which uses the runtime opcode. This only affects devices with SST_WRITE flag (sst25wf*, sst25vf016b, sst25vf032b, sst25vf040b, sst25vf080b). Other SST devices that use standard page program can still benefit from dirmap. I'll send a v5 with this change. Thanks, Sanjaikumar