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 0A2B1C433EF for ; Wed, 15 Jun 2022 09:49:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243233AbiFOJtd (ORCPT ); Wed, 15 Jun 2022 05:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347658AbiFOJtb (ORCPT ); Wed, 15 Jun 2022 05:49:31 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFF8549695; Wed, 15 Jun 2022 02:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655286569; x=1686822569; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fgoP/mzTE5gjuDZ8g87/11obiI4NZu5ZOraq//7+Q64=; b=JocYUTMKdwhiWynLO13suZIe9lUH5gs9DtMczfQOPoD6anOd1cw+xy6k NwPVZ/t0pI82uEO07/oR6gS9PJZosa5kXya7QKH4io2mhIKqECsIYjuyQ ZuTNk+oBF8mrUU/LWABE+vaV9Pq3Gv5wo8Cj1j+Ze9pDlTJ0xz0mhXOrs EnIpC+wBnix3KjVkF+ZghfbmhhTricdpda4MTq0AHV1SgD1f/ifRVQGFo uj+qrm+Y9pbawIabWFg1MSyZpkDO94yqZC7bW36qD1A1JWSUcZ9pdEylR jZFKK9keXMsXGF+3Ka3DqhIi1V3Lp4G03XwUObZA4Hp09L57R6mDMdu0E w==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="365250969" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="365250969" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 02:49:29 -0700 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="618386934" 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; 15 Jun 2022 02:49:24 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 15 Jun 2022 12:49:22 +0300 Date: Wed, 15 Jun 2022 12:49:22 +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] mtd: spi-nor: handle unsupported FSR opcodes properly Message-ID: References: <20220610191548.3626218-1-oocheret@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hi, On Tue, Jun 14, 2022 at 05:56:54PM +0000, Oleksandr Ocheretnyi -X (oocheret - GLOBALLOGIC INC at Cisco) wrote: > Hello Mika, > > in my case (I work with memory chip n25q128a13 for recent kernels) I'm > getting return value -ENOTSUPP from spi_mem_exec_op() call in the > micron_st_nor_read_fsr() method > [[1]https://elixir.bootlin.com/linux/v5.19-rc2/source/drivers/spi/spi-m > em.c#L326]. So I decided to provide the same errorcode to > intel_spi_hw_cycle() method because older kernel versions throw the > error there. It is fine to use -EOPNOTSUPP return value instead. > > I suspect we need to cover both cases to check -ENOTSUPP as well as > -EOPNOTSUPP to let the driver work properly. > > if (ret == -ENOTSUPP || ret == -EOPNOTSUPP) I think we should follow the same in the Intel driver and return -ENOTSUPP too.