| Message ID | 20260825171737.776052-16-s-k6@ti.com |
|---|---|
| State | New |
| Headers | show
Return-Path:
<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=pass (2048-bit key;
secure) header.d=lists.infradead.org header.i=@lists.infradead.org
header.a=rsa-sha256 header.s=bombadil.20210309 header.b=rZgZ9czl;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256
header.s=proofpoint-05-2026 header.b=Mu3/v3Fg;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256
header.s=selector1 header.b=AZ9iEad+;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org
(client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;
envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;
receiver=patchwork.ozlabs.org)
Received: from bombadil.infradead.org (bombadil.infradead.org
[IPv6:2607:7c80:54:3::133])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4hTvfg0Xvnz1xxf
for <incoming@patchwork.ozlabs.org>; Wed, 26 Aug 2026 03:19:55 +1000 (AEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.infradead.org; s=bombadil.20210309; h=Sender:
Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description:
Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
List-Owner; bh=agZhB7/yRV67tnni5v/7Gfg5GBcAlzoIheMu7E3DWbk=; b=rZgZ9czlCwnlPX
6ItAw16TfPJ46jKyagyB3ecCW5TEr3RMMzFEgaZ0vpWZFB61yA7Ov2hsSdJULXkVY9yQsOu5GIxoh
L/cHk4muuz4FY0IKltgTdNGLHDFP88V73UiVG9dI85KxJKMSmGbz7wSzbcB4Iz888bXAYsAQmQMNH
MV+bFNeCmFRIwwTXSfu+SLW//lwruzzZlH7lbcdWHLYSHwSAQnlkLg61IrtJvuNQE+tLtv0/hY0hl
k9ZLRu2v5ANNz/1T/WWDj7uaDqqem4Aqg7wAuVeGFrvzN9SuURTaVqXYWMZjjX9QAhoNITyTNYmRW
s7Srp8z6DhmwmCuOiv9Q==;
Received: from localhost ([::1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux))
id 1wyuoO-00000001CES-04JE;
Tue, 25 Aug 2026 17:19:48 +0000
Received: from mx0b-0002e601.pphosted.com ([148.163.154.28])
by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux))
id 1wyuoL-00000001CC3-2GnE
for linux-mtd@lists.infradead.org;
Tue, 25 Aug 2026 17:19:46 +0000
Received: from pps.filterd (m0374955.ppops.net [127.0.0.1])
by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
67PEVbZ72046023;
Tue, 25 Aug 2026 12:19:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc
:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=
proofpoint-05-2026; bh=Otz2lO7GjrwnPQrwz7VTA4tB78J3Rlz8nvNj1qbpc
F4=; b=Mu3/v3FgzPbz4ZuamY4ZCZ3Lbvfxspg72JkMyncR4kxJfblunSb7UOFEy
S3kXMqdpYKc3wUOd6C9qhmYtnS3Dp2Xc99BEHFxUkHiNhEfLqYLHM+qJaiJCtGuG
GUY2a096RruUI/46NLbZw765wZAW/tJKmSZsbE4Dp0/rs534GTYFhd9fI7qmXj66
Is7Wb/+vx5gyjFpbKkgRgDfU0BOKcWOreoL/iFMSrfHorQy8wz6Tki1gc3ZoKtT5
1JhLYc0nnXDRCg/2yi+c4g+4F7iazcHdidjo+NMlggBcpWPBRVcoqjYc07juH0va
gosJYX7R9fLJSAt0Q+gQ8f+sTCruw==
Received: from ch4pr04cu002.outbound.protection.outlook.com
(mail-northcentralusazon11013028.outbound.protection.outlook.com
[40.107.201.28])
by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4g92xnm9jv-1
(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
Tue, 25 Aug 2026 12:19:40 -0500 (CDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=GT0q9D3HGxE5TTBl7NpSEtwwCyQuzfdNbCgDZT9p3HIvAREPL/z8tUKIpSoRRb15MfsP8Np9cVRShClDprwCJBXVA5Aa99aiSO5mAZa0Q4vD/w6wjvDhaJKHP/MGRGYmRvIvmYlqPwP+pcuj4xfM3R8Zaz6oj/Mf38TLVGX3ZC7kfLZ+PW3a08zpfi7JexlsMyu8dJ7fPoH4sW8bqNThopmLCMvBFvXsOlNotQ0cIuikms1cUH/VDj1DvwpHIESHNanpYnuDvsMKpGyE/Yg/UNfmQvFfXEf8syLMmFkscPlC1j5fdJ/NFMYRBg/PdH8brQcjylxGSEcDyWTGAXL8rQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector10001;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=Otz2lO7GjrwnPQrwz7VTA4tB78J3Rlz8nvNj1qbpcF4=;
b=YolcincmGKS27Jb/sBefGIVDoMRecgdkxoxLtexVZLQsbeUNXie2m03w4tPJ7Kn82JZzNBQYcF6464tjssrDjBeER0jCr1EcR13ZEptpYFssS4JGScRd6gEmmlHL6y/gICGhNyDq5TazpkJWyRkUngHwvdNxTFkz73C0c1Z81TP3h9nf+j/bNT/nxKh0M6GuyNZsayga9YqWrXCHfYbBNPy73RkFEIHis469SYzwgAksQGZzLpDXSzHQlk6f1Pw4oWIzKs3WPSyRrVmngs2qTpmVPJK6zJCA1tJoTeCdD5dzufOL+9YCNaBrkqldJjo8+VqQhj5oD0OYXw2k2ape3g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
198.47.21.195) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=ti.com;
dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;
dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=Otz2lO7GjrwnPQrwz7VTA4tB78J3Rlz8nvNj1qbpcF4=;
b=AZ9iEad+p1tE2edSKijl9ZBYPtoSlM0CoIQUMAqY/uOkA7kP3f+D8jdf5xRurGLNrRztZnXR9/fkSRlyizUKMQ7DOboLZr8ntx7p/koFCIHzLDgZak7fgsH+CPWwjLaD3P/iEQKkIblzEHCs++GgSfQIFCvDQQVpyzNpwssP5WI=
Received: from CH5PR04CA0005.namprd04.prod.outlook.com (2603:10b6:610:1f4::22)
by SJ2PR10MB7109.namprd10.prod.outlook.com (2603:10b6:a03:4cd::9) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.339.12; Tue, 25 Aug
2026 17:19:37 +0000
Received: from CH2PEPF000000A0.namprd02.prod.outlook.com
(2603:10b6:610:1f4:cafe::8d) by CH5PR04CA0005.outlook.office365.com
(2603:10b6:610:1f4::22) with Microsoft SMTP Server (version=TLS1_3,
cipher=TLS_AES_256_GCM_SHA384) id 15.21.360.6 via Frontend Transport; Tue, 25
Aug 2026 17:19:36 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.195)
smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass
action=none header.from=ti.com;
Received-SPF: Pass (protection.outlook.com: domain of ti.com designates
198.47.21.195 as permitted sender) receiver=protection.outlook.com;
client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C
Received: from flwvzet201.ext.ti.com (198.47.21.195) by
CH2PEPF000000A0.mail.protection.outlook.com (10.167.244.26) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.21.360.3 via Frontend Transport; Tue, 25 Aug 2026 17:19:35 +0000
Received: from DFLE215.ent.ti.com (10.64.6.73) by flwvzet201.ext.ti.com
(10.248.192.32) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Tue, 25 Aug
2026 12:19:11 -0500
Received: from DFLE204.ent.ti.com (10.64.6.62) by DFLE215.ent.ti.com
(10.64.6.73) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Tue, 25 Aug
2026 12:19:11 -0500
Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE204.ent.ti.com
(10.64.6.62) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend
Transport; Tue, 25 Aug 2026 12:19:11 -0500
Received: from santhoshkumark.dhcp.ti.com (santhoshkumark.dhcp.ti.com
[10.24.52.55])
by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 67PHHf3e1436664;
Tue, 25 Aug 2026 12:19:06 -0500
From: Santhosh Kumar K <s-k6@ti.com>
To: <broonie@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
<conor+dt@kernel.org>, <miquel.raynal@bootlin.com>, <richard@nod.at>,
<vigneshr@ti.com>, <pratyush@kernel.org>, <mwalle@kernel.org>,
<takahiro.kuwano@infineon.com>
CC: <linux-spi@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-mtd@lists.infradead.org>,
<praneeth@ti.com>, <sebin.francis@ti.com>, <u-kumar1@ti.com>,
<a-dutta@ti.com>, <s-k6@ti.com>
Subject: [PATCH v9 15/18] mtd: spinand: extract variant ranking logic into
spinand_op_find_best_variant()
Date: Tue, 25 Aug 2026 22:47:34 +0530
Message-ID: <20260825171737.776052-16-s-k6@ti.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20260825171737.776052-1-s-k6@ti.com>
References: <20260825171737.776052-1-s-k6@ti.com>
MIME-Version: 1.0
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF000000A0:EE_|SJ2PR10MB7109:EE_
X-MS-Office365-Filtering-Correlation-Id: f6e1e170-539c-4308-bbb0-08df02cd094d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
BCL:0;ARA:13230040|376014|7416014|23010399003|1800799024|82310400026|36860700016|22082099003|18002099003|3023799007|56012099006|10067099003|921020;
X-Microsoft-Antispam-Message-Info:
8A8aYWvhI9xLNaCU9qO6IsyZ1+1Un88JsbSf8gZG6kNPYPq27SjOgRy3ouxm8KCi5bRNa5cBVMB1W/hOwTy8qPcecuvrHdtj5snoJRZHl8KsR05tDdh2FBkdG6LywhwdpnFbxSjEaZl6+wRlShK00YeUI9xbwmrHETYDo1SK9ROZBA23K0D7Mt2BWPb5ONkfb7xsWQgqMdRCQte28wUgiKu+B2qo+m/9LbrQCbFvDZ6aM54rb8BTGJFf8d9eUy2z8zr6DG3jCL37RafWEhLxQSpF9RK9eQuhhqiQK6BBXbcoh6H6nKPttjUszzY0iIBD3fyHbZobbZNHSUzUBLYS2C1Ed3T2vGi8LuRw0pJxuvV9jc4z0J50xJar0iEqWh8RO5IHKGmKoCQJ4CuxzupZVKxC/8q9vwmKawZ+9spYblRa6VoKT/J2parYBq5GBDzsUK5FEPPItHcpWRWX/HU47SG42WFjEADwq7oPkZR5RZiv/tsxjhodsp5MWa+ClfTyW57HfCorevdofeI0D//q6l1b6nxRK/0Ngs7DUiDAm+wQR5rYpExje3tRqqH663EwaiBvw66sO8vHgIBDR167B18R93TGTbAznbMytCqtEzArs2ZH/IObr2VeqI+zgnsRblG1QDnwmZRwqQxZCwq0m3nql5BI+5gfowFK1lYFGscPPzTRh5DpSCHb1EzJmSSBgFqAxUh4Jx1r9Vv9VSMrh9eLzKMgfrYbb2YVpfeJeK76an/uX3/hBOjETehdpgZb
X-Forefront-Antispam-Report:
CIP:198.47.21.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet201.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(376014)(7416014)(23010399003)(1800799024)(82310400026)(36860700016)(22082099003)(18002099003)(3023799007)(56012099006)(10067099003)(921020);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
UX7XubqdJ7CDEDWrRI4+DfplG9XmT0nN1Jh6yuIe8aGIdlsrmXDsacs0YFoiaz31S+4l5lZMgP/qul9uWmtLGg/VDJq9JXIfMXCbEjvq8DwoaT3fkGQ/YrYkJKXkjkxCb6cuTcThA88gzGvHe/CEIHi1m52i6imf0KollaI7h/vsAJ4+z6dMTRhFCYm78a2XyfnZHYRXWd/xgfCwSfwcbCNhNs68JALbrZO7kQCi8OaEc3QknWukoiRwUFAquJLMh4LftSh5YLXjZvKiwiTIOygmQxfs3pR/PANqT+Ds81mu0L2axzNQvZUMQRrmI3179Q4ndPhu1GjguWMNSMS5zWxAx4zNlf3MTC0Ysu9dOu1C7iEL2LrEv+sG7f/DAKe3wR5a/ABQ6PZ7z3Gk/y/eczuqIwIH+S6mdEUj1c8nFlUov5XsXMJgoRkF89ULUZVI
X-Exchange-RoutingPolicyChecked:
AydVVIBIZ2Kv8V+rAKOgmRD3BpdIV3TZr+ITJnMgKRKMCEv6aabxEpyRlr7wWQaH9XxXdbm2UR5OjSFEb6lZX6c5X5Mbyte4/XLoTi7ToRgiQSJ2fq7T2NfWOKykJ0zxGyqIH//03vX771B2YvtLTosYuYfZKoQSHZgxmWBVaaFGS/iQwzKf/cXaLxoBiiW+NXXnZAk7Vp1UVC22jkDScNo+GaNi4v+JbFM4xWTN/eYqdDLFVQO/0WcGUlRbMEDHvh/tFVOd+yMKxftXBo/Ak3GSflERcBpIBzga3EJR5gKdVh0oG8T36ybgVaYGO8bx5xQ3qyKAUJdo9SmEDo1Lfg==
X-OriginatorOrg: ti.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2026 17:19:35.6611
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id:
f6e1e170-539c-4308-bbb0-08df02cd094d
X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp:
TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.195];Helo=[flwvzet201.ext.ti.com]
X-MS-Exchange-CrossTenant-AuthSource:
CH2PEPF000000A0.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7109
X-Proofpoint-Spam-Info: AW1haW4tMjYwODI1MDE0NyBTYWx0ZWRfXwOEcoWBUgwBI
12qgkU4FX6WLUXrQC2ElBtiGFkGR94Xachhbi3zXRy2nsZuHv2smNTlnZDaqPZ4wRzKJbf1UWR4
b8tY+83ivVkfNWCUbnqSsdy53FSoj7I=
X-Proofpoint-GUID: sKs9ONK9DyYJhxdA5wWlt6GscgQ0Hevq
X-Proofpoint-ORIG-GUID: sKs9ONK9DyYJhxdA5wWlt6GscgQ0Hevq
X-Authority-Analysis: v=2.4 cv=PsijqQM3 c=1 sm=1 tr=0 ts=6a8dceac cx=c_pps
a=bKR93RD0qenpecP8xHJc8w==:117 a=tJyPKKxUohctrY4NYmUjkA==:17
a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=Sv0fKeRqtYgA:10 a=V5UXEbMT0ywA:10
a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22
a=P-IC7800AAAA:8 a=sozttTNsAAAA:8 a=mFCyQ4P7OL-0BhijAlUA:9
a=d3PnA9EDa4IxuAV0gXij:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODI1MDE0NyBTYWx0ZWRfXwzXa3kW4AKU1
Wzolu+Tc/7wH4PXrgTHuo2MVPHGYsKKumlGPREtnDoQgVWnPJK+kv3TPuskGsLKL7SMkJuEbuez
0Pi52r7dIiPKXFhSL5w6e2Xu3GVVMZEJ+FMDmOW4Z9YR4arandytNsZp79Uh+g/7gjv5S7/f23F
LZbmHAUXygRTbXHKeHxoqgFdkNT1Xn8DhWL0JLD+YxIN6QwgR2Xg2eUKq2B60uJU36Ax/LjB7no
rXTPeeWjHitbfs+8Dpk8TaZWwKvdXAbCKeRgo10bvD4B1RKnK1OojV4pEi/WIM39cqRXu8NrNeJ
Z0I4wNQjUd/lPedN4vrWT9ONROkzpJSuAfEJJktibNOH9nUAdI8wDKR1CkIa/1jN5B1OJi6eecm
mR0Au2sjDTKUXFjml2X9omxmQIriN5ScXXYdKxgqgImuoSfvJIIaj2XgrtzvwV6YdSa0+HFypKa
vNRn6gvmfH5TycSp+aA==
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49
definitions=2026-08-25_04,2026-08-24_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 impostorscore=0
suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 phishscore=0
classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608250147
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20260825_101945_699079_FA5103D1
X-CRM114-Status: GOOD ( 17.71 )
X-Spam-Score: -2.1 (--)
X-Spam-Report: Spam detection software,
running on the system "bombadil.infradead.org",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: Refactor spinand_select_op_variant() to extract the inner
loop into a shared helper spinand_op_find_best_variant(). The helper takes
a skip_mask bitmask of already-tried variant indices, enabling call [...]
Content analysis details: (-2.1 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
-0.0 SPF_PASS SPF: sender matches SPF record
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
author's
domain
-0.1 DKIM_VALID Message has at least one valid DKIM or DK
signature
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
-0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender
-0.0 DMARC_PASS DMARC pass policy
X-BeenThere: linux-mtd@lists.infradead.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>
List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>,
<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>
List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/>
List-Post: <mailto:linux-mtd@lists.infradead.org>
List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help>
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>,
<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org>
Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
|
| Series |
spi: cadence-quadspi: add PHY tuning support
|
expand
|
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 8bf9301f25e7..7c3341f1fca0 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1542,9 +1542,22 @@ static int spinand_init_odtr_instruction_set(struct spinand_device *spinand) return 0; } +/* + * spinand_op_find_best_variant() - Find the fastest eligible op variant. + * @spinand: SPI NAND device + * @variants: full variant list to search + * @iface: bus interface to consider (ODTR or SSDR) + * @skip_mask: bitmask of variant indices to skip (already tried) + * + * Iterates @variants, evaluates transfer duration for each eligible op, and + * returns a pointer to the fastest one not in @skip_mask. Returns NULL when + * no eligible variant remains. Used by both variant selection at init time + * (skip_mask == 0) and ranked PHY tuning iteration. + */ static const struct spi_mem_op * -spinand_select_op_variant(struct spinand_device *spinand, enum spinand_bus_interface iface, - const struct spinand_op_variants *variants) +spinand_op_find_best_variant(struct spinand_device *spinand, + const struct spinand_op_variants *variants, + enum spinand_bus_interface iface, u32 skip_mask) { struct nand_device *nand = spinand_to_nand(spinand); const struct spi_mem_op *best_variant = NULL; @@ -1552,15 +1565,16 @@ spinand_select_op_variant(struct spinand_device *spinand, enum spinand_bus_inter unsigned int i; for (i = 0; i < variants->nops; i++) { - struct spi_mem_op op = variants->ops[i]; + struct spi_mem_op op; u64 op_duration_ns = 0; unsigned int nbytes; int ret; - if ((iface == SSDR && spinand_op_is_odtr(&op)) || - (iface == ODTR && !spinand_op_is_odtr(&op))) + if ((skip_mask & BIT(i)) || + spinand_op_is_odtr(&variants->ops[i]) != (iface == ODTR)) continue; + op = variants->ops[i]; nbytes = nanddev_per_page_oobsize(nand) + nanddev_page_size(nand); @@ -1589,6 +1603,14 @@ spinand_select_op_variant(struct spinand_device *spinand, enum spinand_bus_inter return best_variant; } +static const struct spi_mem_op * +spinand_select_op_variant(struct spinand_device *spinand, + enum spinand_bus_interface iface, + const struct spinand_op_variants *variants) +{ + return spinand_op_find_best_variant(spinand, variants, iface, 0); +} + /** * spinand_match_and_init() - Try to find a match between a device ID and an * entry in a spinand_info table