All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugene Shalygin <eugene.shalygin@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Denis Pauk <pauk.denis@gmail.com>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 1/3] hwmon: (asus-ec-sensors) add driver for ASUS EC
Date: Fri, 17 Dec 2021 01:07:41 +0100	[thread overview]
Message-ID: <CAB95QARFT8V-kMTtdRJHPAhXFk2BrF=5jxY2+CT0DvMrn6vKOg@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VeERqjxrt7C4hrDnJpY1aCQPtF=CQ=MLY8e9Gik57P3DQ@mail.gmail.com>

On Thu, 16 Dec 2021 at 22:28, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > to the EC, in the same way as the WMI DSDT code does.
>
> How do you know that this way there is no race with any of ACPI code?

Because this mutex is exactly what the ACPI code uses to avoid races.

> _LOCK_DELAY_MS and drop useless comment
>
> I think I gave the very same comments before. Maybe you can check the
> reviews of another driver?

I understand your frustration, sorry. In all those similar reviews I
must have missed some emails. I'll fix what I can.

> > +static const struct ec_sensor_info known_ec_sensors[] = {
> > +       EC_SENSOR("Chipset", hwmon_temp, 1, 0x00, 0x3a), /* SENSOR_TEMP_CHIPSET */
> > +       EC_SENSOR("CPU", hwmon_temp, 1, 0x00, 0x3b), /* SENSOR_TEMP_CPU */
> > +       EC_SENSOR("Motherboard", hwmon_temp, 1, 0x00, 0x3c), /* SENSOR_TEMP_MB */
> > +       EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d), /* SENSOR_TEMP_T_SENSOR */
> > +       EC_SENSOR("VRM", hwmon_temp, 1, 0x00, 0x3e), /* SENSOR_TEMP_VRM */
> > +       EC_SENSOR("CPU_Opt", hwmon_fan, 2, 0x00, 0xb0), /* SENSOR_FAN_CPU_OPT */
> > +       EC_SENSOR("VRM HS", hwmon_fan, 2, 0x00, 0xb2), /* SENSOR_FAN_VRM_HS */
> > +       EC_SENSOR("Chipset", hwmon_fan, 2, 0x00, 0xb4), /* SENSOR_FAN_CHIPSET */
> > +       EC_SENSOR("Water_Flow", hwmon_fan, 2, 0x00, 0xbc), /* SENSOR_FAN_WATER_FLOW */
> > +       EC_SENSOR("CPU", hwmon_curr, 1, 0x00, 0xf4), /* SENSOR_CURR_CPU */
> > +       EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x00), /* SENSOR_TEMP_WATER_IN */
> > +       EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01), /* SENSOR_TEMP_WATER_OUT */
>
> Instead of comments, use form of
>
>   [FOO] = BAR(...),

Was unable do that because the SENSOR_ enum is a flag enum. But given
this suggestion and the one about bit foreach loop, I will convert the
enum to bitmap.

> What's wrong with post-decrement, and I think I already commented on this.
> So, I stopped here until you go and enforce all comments given against
> previous incarnation of this driver.

I missed these ones, sorry.

> > +       for (i = 1; i < SENSOR_END; i <<= 1) {
> > +               if ((i & ec->board->sensors) == 0
> > +                       continue;
>
> Interesting way of NIH for_each_set_bit().

Will convert to bitmap.

> > +       acpi_status status = acpi_get_handle(
> > +               NULL, (acpi_string)state->board->acpi_mutex_path, &res);
>
> It looks awful (indentation), Have you run checkpatch?

Yes, but some warnings remained.

Thanks,
Eugene

  parent reply	other threads:[~2021-12-17  0:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 20:53 [PATCH 1/3] hwmon: (asus-ec-sensors) add driver for ASUS EC Eugene Shalygin
2021-12-16 20:53 ` [PATCH 2/3] hwmon: update ASUS EC driver documentation Eugene Shalygin
2021-12-16 20:53 ` [PATCH 3/3] hwmon: remove asus_wmi_ec_sensors driver Eugene Shalygin
2021-12-16 21:40   ` Denis Pauk
2021-12-16 21:27 ` [PATCH 1/3] hwmon: (asus-ec-sensors) add driver for ASUS EC Andy Shevchenko
2021-12-16 22:04   ` Denis Pauk
2021-12-16 22:58     ` Eugene Shalygin
2021-12-18 18:48       ` Denis Pauk
2021-12-17  0:07   ` Eugene Shalygin [this message]
2021-12-17  4:35 ` kernel test robot
2021-12-17  4:35   ` kernel test robot
2021-12-17 16:43 PATCH v2 ASUS EC Sensors Eugene Shalygin
2021-12-17 16:43 ` [PATCH 1/3] hwmon: (asus-ec-sensors) add driver for ASUS EC Eugene Shalygin
2021-12-17 21:34   ` kernel test robot
2021-12-17 21:52   ` Guenter Roeck
2021-12-17 22:33     ` Eugene Shalygin
2021-12-17 23:47       ` Guenter Roeck
2022-01-11 16:08 PATCH v3 ASUS EC Sensors Eugene Shalygin
2022-01-11 16:08 ` [PATCH 1/3] hwmon: (asus-ec-sensors) add driver for ASUS EC Eugene Shalygin
2022-01-11 16:33   ` Guenter Roeck
2022-01-11 17:04   ` Guenter Roeck
2022-01-11 17:22     ` Eugene Shalygin
2022-01-11 18:43       ` Guenter Roeck
2022-01-11 18:52         ` Eugene Shalygin
2022-01-11 19:15           ` Guenter Roeck
2022-01-11 19:18             ` Eugene Shalygin

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='CAB95QARFT8V-kMTtdRJHPAhXFk2BrF=5jxY2+CT0DvMrn6vKOg@mail.gmail.com' \
    --to=eugene.shalygin@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pauk.denis@gmail.com \
    /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.