From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9D9AA21A19; Wed, 7 Feb 2024 09:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707298448; cv=none; b=t0nLnPPeN8ySq7vo4miutr/iaCFitPRzUcy+IFrVs2drRXdrkDQnJ5pUpfqJo2n+vQ0eNt+LcqYUU/tCDVb/XpNCL74VBPsP7w9WIDYrZFk56RxcEthCARACF68sTOYi9mPdZ0NdPffpjwKVnMV2WrHe5AaG+hxjQ7m964ElAQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707298448; c=relaxed/simple; bh=9R+OqVqHBHqXShJWLZL21KpJxHNGYryJFB0/wiYofsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mpc7nvWd8gxkRVMZMnKfzpz3ro5ADC8LHcUuxrKuhx15H+miSn8ciqR0memSUPupnD84w+2mPNHQ9TUJoA9qmVpPrIFXWlrM1T2SvsC+GeDdPV9T+v4jquroYP/FYCekmYEYtcFn+7fzTVUUhHBBex4h9kvAPIVfjXVQWN5X3HI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=q0tCTZHz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="q0tCTZHz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 426F5C4166B; Wed, 7 Feb 2024 09:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1707298447; bh=9R+OqVqHBHqXShJWLZL21KpJxHNGYryJFB0/wiYofsQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q0tCTZHzfz4ufqkHQuwMlNf6iCoTUGviJZAWNr6pCgQC721qmFl8AHu5w0SiUlwYJ /0/LkZWcqYDVffT+HArmOxVz5S9KqFTAd/S9Q84jwsj1/OfDRFVetlBd32odP0F800 5Cp0BzeUAIswopiMKi4qo7acj20qKrzg7i7kB8FQ= Date: Wed, 7 Feb 2024 09:34:02 +0000 From: Greg Kroah-Hartman To: Joy Chakraborty Cc: Srinivas Kandagatla , Rob Herring , Nicolas Saenz Julienne , linux-kernel@vger.kernel.org, manugautam@google.com, stable@vger.kernel.org Subject: Re: [PATCH v2] nvmem: rmem: Fix return value of rmem_read() Message-ID: <2024020734-curliness-licking-44c1@gregkh> References: <20240206042408.224138-1-joychakr@google.com> <2024020647-submarine-lucid-ea7b@gregkh> <2024020637-handpick-pamphlet-bacb@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Feb 06, 2024 at 05:22:15PM +0530, Joy Chakraborty wrote: > > > Userspace will see a false error with nvmem cell reads from > > > nvmem_cell_attr_read() in current code, which should be fixed on > > > returning 0 for success. > > > > So maybe fix this all up to allow the read to return the actual amount > > read? That feels more "correct" to me. > > > > If I change the behavior of the nvmem_reg_read_t callback to negative > for error and number of bytes actually read for success then, other > than the core driver I would also have to change all the > nvmem-provider drivers. > Is it okay to do so ? Sure, why not? That seems like the correct fix to me, right? thanks, greg k-h