Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1750617rbb; Mon, 26 Feb 2024 22:57:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtp2fCoRCZlyAMDLPdWQFHcUTwz8jf+4/RgecNAz1x/Y8YilffP7wcdDcrZ3OXiuPYl7QO5TNrPAkoaSZ6bTtbqBkQmiVkKBA9dYXIIg== X-Google-Smtp-Source: AGHT+IGYoayuP9z5bcGcr6Y9CR1FexA5NqTyWBlN3FdLAb9duzwJPWBa1hK17GE0UXFPm87kDmHq X-Received: by 2002:a05:622a:118a:b0:42e:8117:8798 with SMTP id m10-20020a05622a118a00b0042e81178798mr9685726qtk.8.1709017053853; Mon, 26 Feb 2024 22:57:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709017053; cv=pass; d=google.com; s=arc-20160816; b=XkqHIwwmtjzxxxjl7+OynKh/NUVXQ99wpPPXiWyA5r36zjMABVHuHBhYlxd65zBcQa y7yfwS3ZTLNtg04AHYWFFE2YQU8rFgYWM4MI7NfNF52qlLvgLffF8X2qwl1CE70cyot4 iQxJ/O0mMzwDdvMAc/Eu8hE4XJ7kZDMPoQKh+9aSYlGEX/+ZfqI4k/6XsQYDgCTdKmT9 S9g2GmJSFWal6Zz0PMLABRRDtCmYGEoQc+KmSguIm8rGXbireW9s+eSsew1givQFJaeZ pzuS48YAYIISB5Z8MsPHz8ffafnGHIRg0UC/xKhnD55E+uLnv+25u9TNtZ1L5lDoOzIb 88PA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=OYVZLW/axFzRuDYyrPmP2hajXo30/Cydh9CnWHBpngI=; fh=kwrbOZP3Rc9bqCV2A+NjMaWk5iHgtItGmZXlu/iK/2g=; b=Sgv6SdeyDIMZy/9kBiejptJbKPwhf6dUQhTWf/OdLs7Y/+3u0sKqqUNOYrGM5NPXLa WSULNZWJio6pyknlhfbgddXso5pOzKV9UGmsK979jItjZIhNjuKvxnhYwg9M29bvruew vkyYBQfydt/19YppjkZcRlHGusLjl6dMEjo0MwtVjo51N1gaXYaK6pJoC9vzJ4gomC2Y L5Atly+xGMOzHy1A5qN0osDnldF6B/aG/yjPyQ9ES5H35OYMmgGMg3ZXAoPUZTwQBVv1 VazgGDleGF5S4Ct6obipNrI/LvFFnx36fL/vT8NdctGzSNuPzVz/nwSlIYpkS3ng0zvK fRZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ZxQ2axHO; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-82766-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pn4-20020a056214130400b0068fe4983841si6975750qvb.490.2024.02.26.22.57.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 22:57:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82766-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ZxQ2axHO; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-82766-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A1C01C20FE1 for ; Tue, 27 Feb 2024 06:57:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02BD1537FE; Tue, 27 Feb 2024 06:57:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZxQ2axHO" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80CF853E00 for ; Tue, 27 Feb 2024 06:57:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709017046; cv=none; b=Q3H/JQz1PhljtpwWdhhucmlH3vhLTtQLkeJRRzBo8f1q4IsDt6G8SeQcbDO9U7xMufLlJ1XaGe3ZjUCVv8gnQHQzwknW1KfRbr/AAntlQTXKuWKBaeqcV8cc7uS9dzvk6cMmfvqEoZCyB5krf0HOdJPo2RhSTwN2PbiKTs4wlh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709017046; c=relaxed/simple; bh=CPG65n+GxI/uy0eM/O2KvuN3DhTq+x5b9cRnvJbLDFY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ohQW9VTLDdnVcJNpc+zkY4fQToJUFuTiq/nq8O4wpbRFAamzmW6HaSJ8C9lzW/3I/0q/1PXOFtNAPWJLdrlFeb5d3UmWB6D7dLEGXdq7tTYfgV5ArkvxSkq8c89OXk9LmNJ+ACxkCg9u4IbKPR4tlciBAUudSo5q/tFfUoei7SQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ZxQ2axHO; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-512e39226efso5335572e87.0 for ; Mon, 26 Feb 2024 22:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709017043; x=1709621843; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OYVZLW/axFzRuDYyrPmP2hajXo30/Cydh9CnWHBpngI=; b=ZxQ2axHO8NG3FnItsxegruRxMRzZy+EUVf+HXidsq/+BjMhGTvbzrIl6IbpZz8WkpB RzNvWKBWdlgT9p0YWwvZTVURNSCUGwpHfHEvj12KF93F2EoRISOGGItY0H+ZikqAc58N badCtj8jWvVAIJ31jlQE9X2miT5UVvr4cPoJsq8qAVbxq1VraUtFB8RemyFZOIZYs1xu XLlDYyfIzbZEyRj0hbS2mN93/DjKYbV8aM1AYYPpqPVm3s/s55pYPHt2qqrYiaUlwUTK ypVVb8w14nVMLWkblcwaQW5YvvwBqbLHmMvpEadaBT5A/TWM1KF5lAH7isW9XjDjqBQ8 LUBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709017043; x=1709621843; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OYVZLW/axFzRuDYyrPmP2hajXo30/Cydh9CnWHBpngI=; b=uyfsl3QrY79DsB1tyIUL7CpS14e8vE8kwkpiVJPDXQfVyh9fxYxBXnaLdDABgO5OqC moIVfVoQ7BveM414cBgRWd4pJAYrSIh7iQYcq5t9xtb1AzyMSc/Es59q0kYcahO8U6BN RXTuDPg+a2i6fy3vZ2QlZRqhnM/jjMmsfnaWYrfLQPJLiGAXJX4ocS7IhnWg4OI+T4hG UejSeNDDGSwcpg+EJebSSJGMGJTfhtAHWmb7UGmrdjNVJn1DmJef4ozgkPOUWwX//UKi N3aT3/99Fe34LStnhBE8RXUP4hhDMGMu/tFp8oPjs3na6blKLFqMNXon2HzwlJoeoWzc Yjfg== X-Forwarded-Encrypted: i=1; AJvYcCWGHaOQqfV4NNcvHD1ORPS8525lJDtP+FJdW7o10v/qFW05vLsQQzYzG6XamlhV7goCRPPi2K8f+y+rQJZ9BU2TJbmTWvqbdNMgIYTx X-Gm-Message-State: AOJu0YwGhJ0ELBpSWBIGa2ZA2cRtCJ9Y730IlV6IlaofBYzgh1PvnCLd s7Xi2BC2/mvemcrkR06U3lsnIdTLmJpt5oiQM9GXZmMsY0iJJPWwYLwdXEZBcrycrcCa+XNGsv+ bO+/81qM4tyb3sMDGdMar9oVGxO03oPpj7QSgeYYmvV8hZng9Xmrb X-Received: by 2002:ac2:518f:0:b0:512:d713:1de2 with SMTP id u15-20020ac2518f000000b00512d7131de2mr5515712lfi.40.1709017042492; Mon, 26 Feb 2024 22:57:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240206042408.224138-1-joychakr@google.com> <2024020647-submarine-lucid-ea7b@gregkh> <2024020637-handpick-pamphlet-bacb@gregkh> <2024020734-curliness-licking-44c1@gregkh> In-Reply-To: From: Joy Chakraborty Date: Tue, 27 Feb 2024 12:27:09 +0530 Message-ID: Subject: Re: [PATCH v2] nvmem: rmem: Fix return value of rmem_read() To: Greg Kroah-Hartman Cc: Srinivas Kandagatla , Rob Herring , Nicolas Saenz Julienne , linux-kernel@vger.kernel.org, manugautam@google.com, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 7, 2024 at 8:33=E2=80=AFPM Joy Chakraborty wrote: > > On Wed, Feb 7, 2024 at 3:04=E2=80=AFPM Greg Kroah-Hartman > wrote: > > > > 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 amo= unt > > > > 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? > > Sure, I can do that. > > Is it okay to change the if checks on the return code to "if (rc < 0)" > instead of "if (rc)" as a fix for the immediate issue with how return > value from rmem is handled which can be applied to older kernels. > In a separate patch I can change the definition of nvmem_reg_read_t() > to return ssize_t instead of int and make corresponding changes to > nvmem-provider drivers. > > Does that sound okay ? Hi Greg, Sent a patch https://lore.kernel.org/all/20240219113149.2437990-2-joychakr@= google.com/ to change the return type for read/write callbacks. Do I mark that with the "Fixes:" tag as well ? It affects a lot of files so might not be able to easily pick to an older kernel when needed. Thanks Joy > > > > thanks, > > > > greg k-h > > Thanks > Joy