From: Jonathan Cameron <jic23@kernel.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: mazziesaccount@gmail.com, linux-iio@vger.kernel.org
Subject: Re: max1363 : Warnings from iio_sanity_check_avail_scan_masks()
Date: Sat, 26 Apr 2025 16:00:09 +0100 [thread overview]
Message-ID: <20250426160009.161b9f08@jic23-huawei> (raw)
In-Reply-To: <CAOMZO5BXp38RMt5vQQWnZBQDzpN+SYB6NVU3c-Krk3po+2Zv7A@mail.gmail.com>
On Wed, 23 Apr 2025 17:23:28 -0300
Fabio Estevam <festevam@gmail.com> wrote:
> Hi,
>
> After upgrading the kernel from 6.1 to 6.12 (also tested with
> linux-next), I started seeing the following warnings on a board
> populated with a Maxim MAX11601 ADC:
>
> [ 1.554029] max1363 1-0064: available_scan_mask 8 subset of 0. Never used
> [ 1.563627] max1363 1-0064: available_scan_mask 9 subset of 0. Never used
> [ 1.570439] max1363 1-0064: available_scan_mask 10 subset of 0. Never used
> [ 1.577328] max1363 1-0064: available_scan_mask 11 subset of 0. Never used
> [ 1.584226] max1363 1-0064: available_scan_mask 12 subset of 0. Never used
> [ 1.591119] max1363 1-0064: available_scan_mask 13 subset of 0. Never used
> [ 1.598013] max1363 1-0064: available_scan_mask 8 subset of 1. Never used
> [ 1.604817] max1363 1-0064: available_scan_mask 9 subset of 1. Never used
> [ 1.611623] max1363 1-0064: available_scan_mask 10 subset of 1. Never used
> [ 1.618516] max1363 1-0064: available_scan_mask 11 subset of 1. Never used
> [ 1.625403] max1363 1-0064: available_scan_mask 12 subset of 1. Never used
> [ 1.632293] max1363 1-0064: available_scan_mask 13 subset of 1. Never used
> [ 1.639201] max1363 1-0064: available_scan_mask 8 subset of 2. Never used
> [ 1.646002] max1363 1-0064: available_scan_mask 9 subset of 2. Never used
> [ 1.652802] max1363 1-0064: available_scan_mask 10 subset of 2. Never used
> [ 1.659691] max1363 1-0064: available_scan_mask 11 subset of 2. Never used
> [ 1.666582] max1363 1-0064: available_scan_mask 12 subset of 2. Never used
> [ 1.673478] max1363 1-0064: available_scan_mask 13 subset of 2. Never used
> [ 1.680382] max1363 1-0064: available_scan_mask 8 subset of 3. Never used
> [ 1.687183] max1363 1-0064: available_scan_mask 9 subset of 3. Never used
> [ 1.693984] max1363 1-0064: available_scan_mask 10 subset of 3. Never used
> [ 1.700871] max1363 1-0064: available_scan_mask 11 subset of 3. Never used
> [ 1.707758] max1363 1-0064: available_scan_mask 12 subset of 3. Never used
> [ 1.714645] max1363 1-0064: available_scan_mask 13 subset of 3. Never used
> [ 1.721532] max1363 1-0064: available_scan_mask 8 subset of 4. Never used
> [ 1.728332] max1363 1-0064: available_scan_mask 9 subset of 4. Never used
> [ 1.735134] max1363 1-0064: available_scan_mask 10 subset of 4. Never used
> [ 1.742022] max1363 1-0064: available_scan_mask 11 subset of 4. Never used
> [ 1.748908] max1363 1-0064: available_scan_mask 12 subset of 4. Never used
> [ 1.755796] max1363 1-0064: available_scan_mask 13 subset of 4. Never used
> [ 1.762683] max1363 1-0064: available_scan_mask 8 subset of 5. Never used
> [ 1.769484] max1363 1-0064: available_scan_mask 9 subset of 5. Never used
> [ 1.776283] max1363 1-0064: available_scan_mask 10 subset of 5. Never used
> [ 1.783171] max1363 1-0064: available_scan_mask 11 subset of 5. Never used
> [ 1.790065] max1363 1-0064: available_scan_mask 12 subset of 5. Never used
> [ 1.796955] max1363 1-0064: available_scan_mask 13 subset of 5. Never used
> [ 1.803846] max1363 1-0064: available_scan_mask 7 subset of 6. Never used
> [ 1.810646] max1363 1-0064: available_scan_mask 8 subset of 6. Never used
> [ 1.817446] max1363 1-0064: available_scan_mask 9 subset of 6. Never used
> [ 1.824246] max1363 1-0064: available_scan_mask 10 subset of 6. Never used
> [ 1.831164] max1363 1-0064: available_scan_mask 11 subset of 6. Never used
> [ 1.838053] max1363 1-0064: available_scan_mask 12 subset of 6. Never used
> [ 1.844941] max1363 1-0064: available_scan_mask 13 subset of 6. Never used
> [ 1.851828] max1363 1-0064: available_scan_mask 8 subset of 7. Never used
> [ 1.858627] max1363 1-0064: available_scan_mask 9 subset of 7. Never used
> [ 1.865424] max1363 1-0064: available_scan_mask 10 subset of 7. Never used
> [ 1.872311] max1363 1-0064: available_scan_mask 11 subset of 7. Never used
> [ 1.879197] max1363 1-0064: available_scan_mask 12 subset of 7. Never used
> [ 1.886084] max1363 1-0064: available_scan_mask 13 subset of 7. Never used
> [ 1.892971] max1363 1-0064: available_scan_mask 9 subset of 8. Never used
> [ 1.899771] max1363 1-0064: available_scan_mask 10 subset of 8. Never used
> [ 1.906657] max1363 1-0064: available_scan_mask 11 subset of 8. Never used
> [ 1.913544] max1363 1-0064: available_scan_mask 12 subset of 8. Never used
> [ 1.920430] max1363 1-0064: available_scan_mask 13 subset of 8. Never used
> [ 1.927322] max1363 1-0064: available_scan_mask 10 subset of 9. Never used
> [ 1.934210] max1363 1-0064: available_scan_mask 11 subset of 9. Never used
> [ 1.941096] max1363 1-0064: available_scan_mask 12 subset of 9. Never used
> [ 1.947980] max1363 1-0064: available_scan_mask 13 subset of 9. Never used
> [ 1.954867] max1363 1-0064: available_scan_mask 11 subset of 10. Never used
> [ 1.961841] max1363 1-0064: available_scan_mask 12 subset of 10. Never used
> [ 1.968815] max1363 1-0064: available_scan_mask 13 subset of 10. Never used
> [ 1.975789] max1363 1-0064: available_scan_mask 12 subset of 11. Never used
> [ 1.982762] max1363 1-0064: available_scan_mask 13 subset of 11. Never used
> [ 1.989735] max1363 1-0064: available_scan_mask 13 subset of 12. Never used
>
> What is the correct way to fix these warnings?
Ah. I think we have an order of modes bug.. Later entries should never be a subset
of earlier ones and we only recently added a sanity check on that.
static const enum max1363_modes max11607_mode_list[] = {
_s0, _s1, _s2, _s3,
s0to1, s0to2, s0to3,
s2to3,
d0m1, d2m3, d1m0, d3m2,
d0m1to2m3, d1m0to3m2,
};
Is used to build available_scan_masks for this device.
I'm failing to correlate with the warnings but clearly s2to3 is a subset of s0to3
channels 2,3 vs 0,1,2,3
In general we should do a few things in here.
Reorder the enum max1363 to reflect the subset rule correctly (may be
fine from a quick look).
Use that to set the entries in the max1363_mode_table.
(I think it's fine today but we can enforce that).
Finally ensure we obey the rules for the individual mode_list tables.
With that stuff fixed we should remove possibility of enabling more
channels than strictly necessary (which is what that print is moaning about.)
As a trivial test, just reorder max11607_mode_list[] it might fix your warning.
I'm a bit unconvinced that this is the only issue though as we should have
only seen 7 is a subset of 6.
If you can dump the available_modes table that is generated that might let
us see what is causing there to be so many warnings.
Jonathan
>
> Thanks,
>
> Fabio Estevam
next prev parent reply other threads:[~2025-04-26 15:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 20:23 max1363 : Warnings from iio_sanity_check_avail_scan_masks() Fabio Estevam
2025-04-26 15:00 ` Jonathan Cameron [this message]
2025-04-26 21:00 ` Fabio Estevam
2025-04-27 10:23 ` Jonathan Cameron
2025-04-28 19:03 ` Fabio Estevam
2025-04-28 21:16 ` Fabio Estevam
2025-04-29 3:59 ` Matti Vaittinen
2025-04-29 10:42 ` Fabio Estevam
2025-04-29 14:29 ` Fabio Estevam
2025-04-28 5:38 ` Matti Vaittinen
2025-04-28 19:04 ` Fabio Estevam
2025-04-29 3:50 ` Matti Vaittinen
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=20250426160009.161b9f08@jic23-huawei \
--to=jic23@kernel.org \
--cc=festevam@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=mazziesaccount@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox