Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1212792lqa; Mon, 29 Apr 2024 01:19:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCD7ErrACfBkZEeLuRqXEv4NMi7bV3roPdZBPRUPSXZxdZQr50U9boKqL6JmxrjKDjuNXYL8DrjLHWkkhN/6bTwRHkjUAnVA5A9fupCw== X-Google-Smtp-Source: AGHT+IGOc+7y1p0XJP61eFyYVU+tismVOi7nrt6phfLI02Ankvgii+VOJdgPpvrWxANfs/3Mw4vM X-Received: by 2002:a05:6a20:4308:b0:1ad:92c1:9f23 with SMTP id h8-20020a056a20430800b001ad92c19f23mr12730201pzk.61.1714378790266; Mon, 29 Apr 2024 01:19:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714378790; cv=pass; d=google.com; s=arc-20160816; b=PBdmw7nHuRwOhSLs3gXw8nmfnmSzdhyXKv6u+e/lcDswWD5+JdgqtvDEqJHMlR7Dx1 l+QtpUM555iOXmsEoBcwkXxXkb/IXEfJ3lVpTvG2EoHQs3zGngQnAcBLdajCqtSkLKfO E36ZwTHx2BorWUMb0GcGWMJjZ4gPlgScaw6KTwl9yirroTxy2Bl4f0aj7Xz+pygZXicJ cWNIbaqzV3fpi+5EePAaqu5vYGPwgu3R+xt2kIhJnFB72qZjHVyfUY6bEu5OBpVxuJHc q0IiG7RAElS3rzXIvJ34+laF67D6iLeYYlYiSTXzvD+Vz0wohxKjxQTy8nBxfA1QSzzo Q4Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=HJCrgcZhDrCnnlgKgbh0+Alkxqfdxg/GoVvgeTAkMbU=; fh=ukAASxoiKsA3TgUuynPaHE43zR4xK7qDjPfCPVqB5L0=; b=XyH973dKcmscNgsUVyVKwJ+L5bBXTlwwRAuWoTZ6sAZYgcqcVoStnrWHtonBKd4SOV xg0/7FY9S1VrpX94BvajzLsGkRzRAh2Q2FzJ5TVh+1rAersXsnioF2VcVNgLZJ4fG5Kl F+428RK4HzrhlsMWXuZ/1fETkMlyVwtj7UnrZsAs1YHY28Ahy2UefoAiZ4J/+bIY93Ui w50NlMqPXWuis6h7jaFVtywZO7s0yuIogLfKRoH5HNtp5yhy4nZDTeMcS4J3lQmRS2UX II4I2BLcNj0SgDhEq0tg1ngGeL5U6dDIgAEM6OcmzQETCIj0KMOy1bCz8C0unl4T9lYp H/fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=UmPk4XYC; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-161900-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161900-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o3-20020a170902d4c300b001eb4ad5f0c2si4039246plg.480.2024.04.29.01.19.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 01:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161900-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=UmPk4XYC; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-161900-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161900-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DC5142823DA for ; Mon, 29 Apr 2024 08:19:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 623C8171C8; Mon, 29 Apr 2024 08:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b="UmPk4XYC" Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 1D20C15E86 for ; Mon, 29 Apr 2024 08:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714378783; cv=none; b=ptzQznP6J23iB2m+M2eoQ+s/rJrMN0u4xIflXeBpmWt+fMHox5KChpaSDCbdGI2eMV7zyEtkuNuy/5UEe3HaxFV7Nhy73oELgoIUXM2heXJwOeGfzyNh0cEyqT2e0O8J+dWBsMSkEMKSs1HAPSawrSCZaZCWLrppyh7386+uBMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714378783; c=relaxed/simple; bh=Po0tXE9Xskn5T/v0Ju783bkp3KwXGfxsxL0+wrC+g14=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fmX31MLwZ9uQWGvJgDk6Zqt6bzdtHe/lP7xZJhzb1scHFpeyk98zsW9Ip6/3l8wVDvl5ILirsqSAq01/U060DzsspRYPPjXuMge9SAkNPIl7U3Wi8xLcQZ6/zczxQR90tRnWHcfEs+YSq1Bi4S7oBGYUd395L7xOYI1wiLJAyEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com; spf=pass smtp.mailfrom=9elements.com; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b=UmPk4XYC; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=9elements.com Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2a564ca6f67so3698677a91.2 for ; Mon, 29 Apr 2024 01:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1714378781; x=1714983581; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HJCrgcZhDrCnnlgKgbh0+Alkxqfdxg/GoVvgeTAkMbU=; b=UmPk4XYCz3rLX2OUD+1tUx6Feky0f+h3xL4GvwnO9OJeWHhM9CsNhRMuKV4x+LqcVJ GG/tsNe03aBiu83F2dSorLPDwL/EQWiXYIWT8UcX5g5lEKrWfqxiAzrmx9oVhlqHXcRF 9cIE2NCDNzS2JsSSYvRjujr1bpBvLtD5smenUljj5nLPnqq84UiId2h4O/80+0OvisnP jNHY+KNF+VnTJMW/NS8XSFRz3xccFujvq+43gfUenR1Td9iHU0dHww8yEtUdUQNWJsT7 nJv0sLnNnERY0xak1oZldefY/as+trK2hoidocPzWYUg2ShLRYLQAD1jC/pgvJ3ixPTS cNJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714378781; x=1714983581; h=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=HJCrgcZhDrCnnlgKgbh0+Alkxqfdxg/GoVvgeTAkMbU=; b=ESFlAxngMBDgduVGwd8bTADmEu0gAxkI4V4vNWgKtxOeBRvqcTkUol4+oYLYjmfrx+ fWguEeTVqAhffEgOeGvi+XVGYwZeSwarQqRER5UxMfI+gjFnKinasL7w1Ohl8VFZcfoU tTZz5+8RTOPAjGfgUl3dXE1zsQx64yv/rUgxx8HxRSA60hwiol0RdhL06GVnXWDyynCz 60EkRbXaz9bG1fe23J0bDm9sZqJb43/xmm5Pvqn+L3eMBJ8/BQzwYtAt3qDf8/+QJgw/ 4D/3Vw4ww7sYw2CwEnMQAcG0z7nN++/Z2RB5WOKO02qvU51Gj/VSNf5Gl2dT4k+HPyE4 9ozw== X-Forwarded-Encrypted: i=1; AJvYcCWS+UPlndGadJfOsD922iUndfWBo2wr24TduoVl6Dj1dpXYfPVqYow6L4cBnA1jtFfVWdex+zTGmycZ/toS7jB7HrI6aUTyR1FC/UEi X-Gm-Message-State: AOJu0YxiEulcpHfNlCzn3J4hgOGTSbus/MDMg5pf63st867ToiIclfpA z+DhDi24nMsEzMdJ5+nt3SMiPPm4+9ItmU8+xIWpmNW6JKJHg1JIAlYmu/JUo7ZHDBjPCoqeUZn bMCQkshyXulLgaJH8otuaixO/AoxG9Ix3KJgmFiMYWt573hckv362Nw== X-Received: by 2002:a17:90a:d397:b0:2ac:86c6:fe with SMTP id q23-20020a17090ad39700b002ac86c600femr9473425pju.1.1714378781371; Mon, 29 Apr 2024 01:19:41 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416171720.2875916-1-naresh.solanki@9elements.com> <65607114-89f8-4f48-83fc-b89d87fee247@roeck-us.net> <116aeea1-c648-4abe-9ab2-693bf64000fc@roeck-us.net> <6d779d5b-b622-4e20-9449-64307b9b9582@roeck-us.net> In-Reply-To: <6d779d5b-b622-4e20-9449-64307b9b9582@roeck-us.net> From: Naresh Solanki Date: Mon, 29 Apr 2024 13:49:30 +0530 Message-ID: Subject: Re: [PATCH 1/4] hwmon (max6639): Use regmap To: Guenter Roeck Cc: krzysztof.kozlowski+dt@linaro.org, u.kleine-koenig@pengutronix.de, Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Guenter, On Sun, 28 Apr 2024 at 22:48, Guenter Roeck wrote: > > On 4/25/24 02:50, Naresh Solanki wrote: > ... > > This driver has 27 regmap accesses. Except volatile registers, others are > > cached by regmap. > > Some function which only access volatile registers will not be able to take > > advantage of caching. This is also the case in various other drivers for similar > > devices. > > Also regmap offers bit handling which makes the code much cleaner. > > > > Maybe I need to make it explicit in documentation. I will not accept regmap > conversions unless local caching is dropped. Yes, that means that volatile > registers will not be cached. I consider that a positive. I agree with you. Regmap conversion wouldn't make sense if local caching is present. Correct me if I'm wrong, but in this context, local caching points to the various variables in max6639_data ? i.e., bool valid; /* true if following fields are valid */ unsigned long last_updated; /* In jiffies */ /* Register values sampled regularly */ u16 temp[2]; /* Temperature, in 1/8 C, 0..255 C */ bool temp_fault[2]; /* Detected temperature diode failure */ u8 fan[2]; /* Register value: TACH count for fans >=30 */ u8 status; /* Detected channel alarms and fan failures */ /* Register values only written to */ u8 pwm[2]; /* Register value: Duty cycle 0..120 */ u8 temp_therm[2]; /* THERM Temperature, 0..255 C (->_max) */ u8 temp_alert[2]; /* ALERT Temperature, 0..255 C (->_crit) */ u8 temp_ot[2]; /* OT Temperature, 0..255 C (->_emergency) */ /* Register values initialized only once */ u8 ppr; /* Pulses per rotation 0..3 for 1..4 ppr */ u8 rpm_range; /* Index in above rpm_ranges table */ Are you asking for removal of all these variables & each read sysfs attribute read should access regmap cache directly ? Regards, Naresh > > Guenter >