From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Aureo Serrano de Souza <aureo.serrano@arctic.de>
Cc: linux-hwmon@vger.kernel.org, linux@roeck-us.net, corbet@lwn.net,
skhan@linuxfoundation.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6] hwmon: add driver for ARCTIC Fan Controller
Date: Fri, 10 Apr 2026 16:53:54 +0200 [thread overview]
Message-ID: <23c6211d-cdc7-4e26-bc7a-a0563c846a24@t-8ch.de> (raw)
In-Reply-To: <20260401153949.77488-1-aureo.serrano@arctic.de>
Hi Aureo,
On 2026-04-01 23:39:47+0800, Aureo Serrano de Souza wrote:
(...)
> +struct arctic_fan_data {
> + struct hid_device *hdev;
> + struct device *hwmon_dev; /* stored for explicit unregister in remove() */
> + spinlock_t in_report_lock; /* protects fan_rpm, ack_status, write_pending, pwm_duty */
> + struct completion in_report_received; /* ACK (ID 0x02) received in raw_event */
> + int ack_status; /* 0 = OK, negative errno on device error */
> + bool write_pending; /* true while an OUT report ACK is in flight */
> + u32 fan_rpm[ARCTIC_NUM_FANS];
> + u8 pwm_duty[ARCTIC_NUM_FANS]; /* 0-255 matching sysfs range; converted to 0-100 on send */
> + /*
> + * OUT report buffer. Cache-line aligned so it occupies its own cache
> + * line, preventing DMA cache-coherency issues with adjacent fields
> + * (fan_rpm[], pwm_duty[]) on non-coherent architectures.
> + * Embedded in the devm_kzalloc'd struct so it is heap-allocated and
> + * passes usb_hcd_map_urb_for_dma(). Serialized by the hwmon core.
> + */
> + u8 buf[ARCTIC_REPORT_LEN] ____cacheline_aligned;
I recently discovered __dma_from_device_group_begin() / _end().
These look like the correct solution to use here. It would also make
parts of the comment unnecessary, as the macro already expresses this
semantic.
> +};
(...)
Thomas
next prev parent reply other threads:[~2026-04-10 14:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 15:39 [PATCH v6] hwmon: add driver for ARCTIC Fan Controller Aureo Serrano de Souza
2026-04-01 17:34 ` Guenter Roeck
2026-04-10 14:53 ` Thomas Weißschuh [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-01 11:25 Aureo Serrano de Souza
2026-04-01 15:32 ` 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=23c6211d-cdc7-4e26-bc7a-a0563c846a24@t-8ch.de \
--to=linux@weissschuh.net \
--cc=aureo.serrano@arctic.de \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=skhan@linuxfoundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox