All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Naresh Solanki <naresh.solanki@9elements.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: krzysztof.kozlowski+dt@linaro.org,
	u.kleine-koenig@pengutronix.de,  Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] hwmon (max6639): Use regmap
Date: Mon, 29 Apr 2024 13:49:30 +0530	[thread overview]
Message-ID: <CABqG17inSB8stBf=ObaYKj4FREpXKWSy=7XXO9O3RhEx_v74vg@mail.gmail.com> (raw)
In-Reply-To: <6d779d5b-b622-4e20-9449-64307b9b9582@roeck-us.net>

Hi Guenter,


On Sun, 28 Apr 2024 at 22:48, Guenter Roeck <linux@roeck-us.net> 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
>

  reply	other threads:[~2024-04-29  8:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 17:17 [PATCH 1/4] hwmon (max6639): Use regmap Naresh Solanki
2024-04-16 17:17 ` [PATCH 2/4] hwmon: (max6639) : Utilise pwm subsystem Naresh Solanki
2024-04-16 21:22   ` Guenter Roeck
2024-04-22 10:39     ` Naresh Solanki
2024-04-22 12:37       ` Guenter Roeck
2024-05-06 10:05         ` Naresh Solanki
2024-05-06 13:49           ` Guenter Roeck
2024-04-17  7:04   ` Uwe Kleine-König
2024-04-16 17:17 ` [PATCH 3/4] hwmon: (max6639) : Add hwmon init using info Naresh Solanki
2024-04-16 17:17 ` [PATCH 4/4] hwmon (max6639): Remove hwmon init with group Naresh Solanki
2024-04-16 21:23   ` Guenter Roeck
2024-04-16 21:25 ` [PATCH 1/4] hwmon (max6639): Use regmap Guenter Roeck
2024-04-22 10:36   ` Naresh Solanki
2024-04-22 16:02     ` Guenter Roeck
2024-04-25  9:50       ` Naresh Solanki
2024-04-28 17:18         ` Guenter Roeck
2024-04-29  8:19           ` Naresh Solanki [this message]
2024-04-29 13:49             ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABqG17inSB8stBf=ObaYKj4FREpXKWSy=7XXO9O3RhEx_v74vg@mail.gmail.com' \
    --to=naresh.solanki@9elements.com \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.