From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A31C0C43334 for ; Fri, 17 Jun 2022 05:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380032AbiFQFEy (ORCPT ); Fri, 17 Jun 2022 01:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233127AbiFQFEt (ORCPT ); Fri, 17 Jun 2022 01:04:49 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95650666BD; Thu, 16 Jun 2022 22:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655442288; x=1686978288; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=KlkNvpHU3FLlFN/0ZiH/YdtckeEa9++ioBrEqdPOl1k=; b=jmGdZedNcosBL8oDwbVkJCQ3fVhMifHbrIv4xl/0h7D0nZXl7ONQWRtM JGuwEhhteQeHQ7Gzt8L52UBCsxtdWLHit51w1A3M2cr6gvRfq3H9M9Ybi 6khxR4xkD/g+1YC8Ml2GFBJ6EU0hWnP5kdO5DfZ+16C6LFGA0pX0/lahk 0rVsjCUmzVLP8QnmNoovIwgeX1JtZjrgm/F3BNJ+VBriPmiCpJi/3OA00 oAnLcHn2ymyfmWATho6WL+Muaevv1VzuKE6a6+PbJMmm5+BMPjYlcGkZ9 8aJjCHkJbomTiWjP4F2lyw1WSGtXrzIrvQKhxeEtTh6DWVaPvd21dkA+/ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="280453126" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="280453126" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 22:04:47 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="619145570" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 22:04:43 -0700 Received: by lahna (sSMTP sendmail emulation); Fri, 17 Jun 2022 08:04:40 +0300 Date: Fri, 17 Jun 2022 08:04:40 +0300 From: Mika Westerberg To: "Oleksandr Ocheretnyi -X (oocheret - GLOBALLOGIC INC at Cisco)" Cc: "tudor.ambarus@microchip.com" , "miquel.raynal@bootlin.com" , "p.yadav@ti.com" , "michael@walle.cc" , "richard@nod.at" , "vigneshr@ti.com" , "broonie@kernel.org" , "linux-mtd@lists.infradead.org" , "linux-spi@vger.kernel.org" , "mauro.lima@eclypsium.com" , "lee.jones@linaro.org" , "linux-kernel@vger.kernel.org" , "xe-linux-external(mailer list)" Subject: Re: [PATCH v2] mtd: spi-nor: handle unsupported FSR opcodes properly Message-ID: References: <20220616121446.293408-1-oocheret@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jun 16, 2022 at 08:26:33PM +0000, Oleksandr Ocheretnyi -X (oocheret - GLOBALLOGIC INC at Cisco) wrote: > Hi Mika, > > > ​However I remember you caught situation where > micron_st_nor_read_fsr() > > returns -EOPNOTSUPP > > (intel_spi_exec_mem_op callback returns -EOPNOTSUPP), according to > your > > patch > > > [3]https://lore.kernel.org/linux-mtd/20220506105158.43613-1-mika.wester > > berg@linux.intel.com/ I've noted in description body. So I think I > have > > to cover both errorcodes, haven't I? > I was thinking that you change the both functions in Intel SPI to > return > > -ENOTSUPP, not just one. > > ​you know 'drivers/mtd/spi-nor' sources use -EOPNOTSUPP errorcode only, > however > > 'drivers/spi' modules (where intel driver is located as well as > spi-mem.c) use both errorcodes many times > > (-EOPNOTSUPP and -ENOTSUPP). Oh, indeed. I remembered that SPI-NOR core was using ENOTSUP but it was SPI-MEM instead. > So maybe it is better to use -EOPNOTSUPP for intel driver file (what > uses -EOPNOTSUPP everywhere) and > > update the spi-mem.c with -EOPNOTSUPP as return value, how do you > think? Yes, I think this is the correct approach. You need to be careful though to make sure the callers of SPI-MEM functions do not get unexpected values.