Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1176345rwe; Thu, 1 Sep 2022 13:54:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR6oHTEaXpcAndwSld42x+LYff+oDxyUAypAFpFqxzmaVtq2/vkwfTIxJcIeMM2P6Hno5r7I X-Received: by 2002:a63:f446:0:b0:42a:a729:18f0 with SMTP id p6-20020a63f446000000b0042aa72918f0mr27452357pgk.589.1662065672655; Thu, 01 Sep 2022 13:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662065672; cv=none; d=google.com; s=arc-20160816; b=iWy8XcegeFXDYV+PbQbJApLtMzMMMDZq/ni6VzGChm5XhDJLozAmCBkide1eQQCKPx vnpHfrOufWR/7nSQbZBVc2qdwrUQC9fxW3uyYoyNYzHlMe0j7Al/gX4ef4SLjvZrvems VfTpiB5MbRb/XreUNmU/Bn+wr4DJiec/J0icVduaNxfXRb9WViW6IeTU/3wo9LeCnOaB R95bxpISSQ7ZseiOPTvusoBiydvNeZt8gI4E5pgAuUAiXGy5PXO0sIZ8TCT7Mt56RVhL Z0AiXKhZxeJ6EvgFF0LLOqU+J5lqWpA6Z1MemtzGZSSnq69aRqGEerRgr2SNRXkgvAlP He+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FVJU7QDxB181scONvUfqhnQgNTVeZjMDlPFSJ5gLWso=; b=U23S5ph9ugn5BQmTkyaSoey3+fBruGCvytNFTBgyOV5ZHgsw8Qq2AFuhTKlsuEaQ8X lt5mulbcBE6zdJ75QdgzEc932CnZ54lIaprzuqLtZa6UiC98pfEkZKRFOZNsTwtn/Mky A/fFhSb0oZZ0IJRoAsRitHsl/MsT5+RubUQXrR9U/UFHS6IcNQxuWmE/qutqFiMevyrU MajTdCBD/JJB2D3tBz7ACCuf2vSEX9Ev5sHB9vsTHjOX4BVhqSh5nbsSs/5kYnsrCMfk oAuEbBovlQFUe+FLBkF3gUvgV+xeYzqWSfGO65ltgKevysz4awOXKrgGdOH+3seK1u1C XlDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZMvFsflW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170903230300b00174e20a8f1esi44611plh.97.2022.09.01.13.54.20; Thu, 01 Sep 2022 13:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZMvFsflW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234695AbiIATvY (ORCPT + 99 others); Thu, 1 Sep 2022 15:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbiIATvW (ORCPT ); Thu, 1 Sep 2022 15:51:22 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E13D474D9; Thu, 1 Sep 2022 12:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662061881; x=1693597881; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=k5zr5cn7hQsp9fLMDnqTgBbt08cY9uQCohw6Rm0BqxI=; b=ZMvFsflWrWRlRo3AMQ/7bJvN0Ni4CAbAi4XH7R65BTO8iPxrWNOu7CW2 a16hubBIqCo4mm1wSerSYY7Po/+5YkgFcG6cy2F3Y7OwCmNJ4KVP1dV5j 8U2Ua+vG61kDbEaK2WSN1p6VUPUQ9GBlUCBObA+wjxO6g3XjTpLmX7aaa U5CxIBMO0yzS8pfn8PGITlGNuSOrwlw+jmZ6kqIDjxzW09IYoIihyoDDb /S0zN0SSCg3m7cQepPioMKxfv0zqsD9ElehYZp8t+7a7q+7xSyPBlxX2j q1Zk7kxz6YaBabvggqbBpyxu/z6EE0/FNn4U5oB1vSZRj0Cl4OOYkrn5V g==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="294554904" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="294554904" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 12:51:20 -0700 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="563598121" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 12:51:15 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oTqBQ-0071RD-3A; Thu, 01 Sep 2022 22:49:00 +0300 Date: Thu, 1 Sep 2022 22:49:00 +0300 From: Andy Shevchenko To: "Farber, Eliav" Cc: Guenter Roeck , jdelvare@suse.com, robh+dt@kernel.org, p.zabel@pengutronix.de, rtanwar@maxlinear.com, linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, talel@amazon.com, hhhawa@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, ronenk@amazon.com, itamark@amazon.com, shellykz@amazon.com, shorer@amazon.com, amitlavi@amazon.com, almogbs@amazon.com, dkl@amazon.com Subject: Re: [PATCH v3 02/19] hwmon: (mr75203) fix VM sensor allocation when "intel, vm-map" not defined Message-ID: References: <20220830192212.28570-1-farbere@amazon.com> <20220830192212.28570-3-farbere@amazon.com> <84a68eff-be64-71ce-1533-1e228d3da2a4@amazon.com> <71d6d57c-2165-5fe3-515d-9395022921e2@roeck-us.net> <2f5c5828-87b9-f3d2-e3d3-0200adbe830c@amazon.com> <20220901144434.GB3477025@roeck-us.net> 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 01, 2022 at 06:24:51PM +0300, Farber, Eliav wrote: > On 9/1/2022 5:44 PM, Guenter Roeck wrote: > > On Thu, Sep 01, 2022 at 11:39:58AM +0300, Farber, Eliav wrote: ... > > There should be some error handling to catch this case (ie if the number > > of entries does not match the expected count), or if a value in the array > > is larger or equal to vm_num. Today the latter is silently handled as end > > of entries (similar to 0xff), but that should result in an error. > > This would avoid situations like > >        intel,vm-map = [01 02 03 04 05]; > > ie where the person writing the devicetree file accidentally entered > > index values starting with 1 instead of 0. A mismatch between vm_num > > and the number of entries in the array is silently handled as if there > > was no property at all, which is at the very least misleading and > > most definitely unexpected and should also result in an error. > > I assume it is possible to tell according to the return value, if property > doesn’t exist at all, or if it does exists and size of array in > device-tree is smaller than vm_num. > In [PATCH v3 17/19] Andy wrote that “code shouldn't be a YAML validator. > Drop this and make sure you have correct DT schema” so I’m a bit confused > if code should validate “intel,bm-map” or if it is the user responsibility. > As this property was not added by me, I prefer not to fix it as part of > this series of patches. I'm just a messenger of Rob's words. If I'm mistaken I would like Rob to correct me. -- With Best Regards, Andy Shevchenko