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 6E4BAC433EF for ; Thu, 16 Jun 2022 05:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358482AbiFPF3k (ORCPT ); Thu, 16 Jun 2022 01:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242913AbiFPF3j (ORCPT ); Thu, 16 Jun 2022 01:29:39 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ABDE583B9; Wed, 15 Jun 2022 22:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655357378; x=1686893378; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=yxLlY5sY3j1BaSU2opYF6e/oGGZzthY7yGLwx6OFor0=; b=hqARtr/2InaNKWRU1MWNr+JYvApy48j3efJxsK3Xb6+1DppqSMYSMvsc Q1LoZy7he+MXkNaooRB66H5xuDyDn98I2Nl9dHSB7A4Vgm7FTJXlhdLrA mxs1EcEyF+5RSh2APZf8v9yaT9kwFHib1oKBohBTXUrbrJqfgMGKi4JWb Rv2CLucntwjDyhSycdtJjOJWcrDLQERnZHvSfgiTmxT5It3iEAG7Xdlc1 CtpBUWoo+GJfQy4vomePRGF1jfQACFX2AAQkEO7l0pcwY+63eV6+H96uI 9Rn0hUcAWXW+dBl8I4mDbGXssKDHA+lIe9Mwdtj+xI0CMfwxMMoBIWQmB g==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="259024046" X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="259024046" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 22:29:38 -0700 X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="687664970" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 22:29:34 -0700 Received: by lahna (sSMTP sendmail emulation); Thu, 16 Jun 2022 08:29:31 +0300 Date: Thu, 16 Jun 2022 08:29:31 +0300 From: Mika Westerberg To: Michael Walle Cc: "Oleksandr Ocheretnyi -X (oocheret - GLOBALLOGIC INC at Cisco)" , "tudor.ambarus@microchip.com" , "miquel.raynal@bootlin.com" , "p.yadav@ti.com" , "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> <6A852B9E-D84C-4F80-9C17-62BFBB98CC8A@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6A852B9E-D84C-4F80-9C17-62BFBB98CC8A@walle.cc> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2022 at 08:10:13PM +0200, Michael Walle wrote: > Am 15. Juni 2022 11:49:22 OEZ schrieb Mika Westerberg : > >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. > > AFAIK ENOTSUPP is for nfs and shouldn't be used. Yes, but that's what the SPI-NOR core is using so I think we want to be consistent with it.