Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp539894lqi; Thu, 7 Mar 2024 05:04:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX571rXOXbWaMJH+UNoOPPGODGCzM81dfWw0wKIn3C1BYb5uBr2KO7hysbrUzDm5rSII1rFbbEIwRhXQF7TaNIQc6IOAKxIdUp3kbD7AA== X-Google-Smtp-Source: AGHT+IGdqL7d3abT3EY1dRBlo4T7RH/KkBHMiz/Gd1RMuga6ot5R/rUCkVajqDx21Oz9CXl+y5c3 X-Received: by 2002:a6b:6816:0:b0:7c8:3d06:5a3 with SMTP id d22-20020a6b6816000000b007c83d0605a3mr16156499ioc.9.1709816682915; Thu, 07 Mar 2024 05:04:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709816682; cv=pass; d=google.com; s=arc-20160816; b=SZaC6jaZCw1VTQXFCU2U+zfjn0HKD5EloqlXhbFertpv1vQA9ktLT21705sDmtSic6 WNRJO0/S+UeAlY5wXPVZrTDgnV/1ikOtF7Sy7C2eh/WPGtdfAl70Opo4Ul+64cpZtnwe K0MBylVyK1EqCDFLGg0GZDulUGIWXZN+PTkX5/1cJmvSL+Uz3kmGgYKRVOxitIt0gjdh ZxSSKcqL9O2ZdhBO3YcccIugf29GS47BKRvwu5RbWcHgG44JkUzKwKwsq9+yeLartidF q5NexflmVX7O/Ihc3d8y+iuxjakVVarF/3J3UT60C5ihcSqFkchLOpeb/qb/sN2kqE5o 2/Ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=l2WvFOkmwF1jOkrnyOGxbXM6/mrMgk3QYq0ncwk4EDo=; fh=LTuJJijNFnMDug7BoPZDQgyk+ilF/QBvC7ur1EIAlGo=; b=FkMFj53Y8SikTIWCFJ766uCIDiB0XH4F7rMwXBlxDbgDt4zXbO/vW3YV24F7Mefzu5 dfXVHToJ65xgexkrsR7zJRsJjadICiFujvHelKByYdMXJ4w3vTIVhnA6ybsghESSnn2Z yANWnbwit2nJw39b7TISizGZPj4AH11kv8ym9JKKnjSHa/+qQyQFNOQn9pWl4I/tqot7 RJuH3t3N+v+PTUqyqbx4BvlL7vzsGDNSsKvp1U+vwPHId5sBhwi2RhZ8RZ90xGGujjKn STUxXbpulhMB1k3kgZe4cKRtqmA+bvfyAfwzSxXmCS8oLt5SxvlQQBnR+cocTxcy8sMV svdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gS8ocZJF; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-95566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cn14-20020a0566383a0e00b00476bede39c4si154232jab.102.2024.03.07.05.04.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gS8ocZJF; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-95566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8C70B283276 for ; Thu, 7 Mar 2024 13:04:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAA1912BF07; Thu, 7 Mar 2024 13:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gS8ocZJF" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9C6A12BEBA for ; Thu, 7 Mar 2024 13:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709816676; cv=none; b=EbX41gtw5cmk3V+/miyuhLc5OWaBbqtwSL0cdBDlvicK+VJSvX4AQ+8O1n86pT80hn7xPAiSMA5ckmX/JBz6g0AhmV3DM0nYLbz09kOcqyuY16mfDcjfl2eQ4a4UXnV/4Fb4mwdSeWekRivHjwALUo5VFYUt4fd/2wt/6Wo4y/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709816676; c=relaxed/simple; bh=N+eRZXxN2eytANgfSbyduqZhkAXglYBQyinbb8Xem8k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nPh7IZcPxJfjitVpJ2LZYojZAt1zXfHmw7+u31KKv8z3or+ODz+Um6OpDQjXluXkM5i+1jAL8t4SRFHANXk8gc2sQOycxOvkUzfPokhi7GKVjjX+Wl6+ieddxRfWmqkOwODbpqsbRv6kIL//VtvpjdOymG+166xGktr+Pk8uD64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gS8ocZJF; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709816674; x=1741352674; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=N+eRZXxN2eytANgfSbyduqZhkAXglYBQyinbb8Xem8k=; b=gS8ocZJF1fek3UhKX+lKD/XOXz5j777kBii1V75aRVpzuz9ELVH+rxaG tqLWgfza1FLrvdlhL4Nla87E1MYx5q+3aYAo+xgDNZ1u/jU/Kpmu4/i/k 3jVTtdFHvjolKKiDBP8HynySLyif2GQ4lDx6EPl8Lq8HdJd8MHqhb3cHQ kVeC0jVXMQXK+Xd461IihShFc9buCMBvq0P6n8GguUHvTT3+Nn4G3BjZk q8gpDNeihGHiTfxTOznUen0lKfUbJ0Wzivp3hBtfqIW0IssV8n2mrtFZ+ Ye7+MC4fxW7UvjQCWWQmIbZh+MztbrTrwoifpSua4PD3INjokjrKLq7Qf w==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="5068053" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="5068053" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:04:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="14592300" Received: from unknown (HELO localhost) ([10.237.72.159]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:04:31 -0800 From: Aapo Vienamo To: Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Aapo Vienamo Subject: [PATCH 0/2] mtd: core: Handle unsupported OTP operations Date: Thu, 7 Mar 2024 15:04:16 +0200 Message-ID: <20240307130418.3131898-1-aapo.vienamo@linux.intel.com> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Make MTD core tolerate SPI controllers without OTP support and report an error from MTD core if OTP initialization fails early. These changes address the issue that occurs when an OTP capable SPI NOR device is initialized with the Intel SPI controller. The limited supported opcode set of the SPI controller leads to failure in the OTP initialization, which in turn fails the probe for the MTD device. By allowing the MTD core to tolerate unsupported OTP, the rest of the MTD functionality remains intact even if OTP initialization is unsupported. Aapo Vienamo (2): mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add() mtd: core: Don't fail mtd_device_parse_register() if OTP is unsupported drivers/mtd/mtdcore.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 2.41.0