lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALHNRZ_oxOO_iekbKvN=5mJrR+UEh5jjkZ56UHGTaEAcs-BE3Q@mail.gmail.com>
Date: Sun, 4 May 2025 10:58:03 -0500
From: Aaron Kling <webgeek1234@...il.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Thierry Reding <thierry.reding@...il.com>, Jonathan Hunter <jonathanh@...dia.com>, 
	linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH] memory: tegra210-emc: Support Device Tree EMC Tables

On Sun, May 4, 2025 at 8:38 AM Krzysztof Kozlowski <krzk@...nel.org> wrote:
>
> On 30/04/2025 19:52, Aaron Kling via B4 Relay wrote:
> > +#undef EMC_READ_PROP
> > +#undef EMC_READ_STRING
> > +#undef EMC_READ_PROP_ARRAY
> > +
> > +     return 0;
> > +}
> > +
> > +#define NOMINAL_COMPATIBLE "nvidia,tegra21-emc-table"
> > +#define DERATED_COMPATIBLE "nvidia,tegra21-emc-table-derated"
>
> No, you cannot add undocumented compatibles. Missing bindings.
>
> > +static int tegra210_emc_load_timings_from_dt(struct tegra210_emc *emc,
> > +                                          struct device_node *node)
> > +{
> > +     struct tegra210_emc_timing *timing;
> > +     unsigned int num_nominal = 0, num_derated = 0;
> > +     int err;
> > +
> > +     emc->num_timings = 0;
> > +     for_each_child_of_node_scoped(node, child) {
> > +             if (of_device_is_compatible(child, NOMINAL_COMPATIBLE))
> > +                     emc->num_timings++;
> > +             else if (of_device_is_compatible(child, DERATED_COMPATIBLE))
> > +                     num_derated++;
> > +     }
> > +
> > +     if (!emc->num_timings || (num_derated && (emc->num_timings != num_derated)))
> > +             return -EINVAL;
> > +
> > +     emc->nominal = devm_kcalloc(emc->dev, emc->num_timings, sizeof(*timing),
> > +                                 GFP_KERNEL);
> > +     if (!emc->nominal)
> > +             return -ENOMEM;
> > +
> > +     if (num_derated) {
> > +             num_derated = 0;
> > +             emc->derated = devm_kcalloc(emc->dev, emc->num_timings, sizeof(*timing),
> > +                                         GFP_KERNEL);
> > +             if (!emc->derated)
> > +                     return -ENOMEM;
> > +     }
> > +
> > +     for_each_child_of_node_scoped(node, child) {
> > +             if (of_device_is_compatible(child, NOMINAL_COMPATIBLE))
> > +                     timing = &emc->nominal[num_nominal++];
> > +             else if (of_device_is_compatible(child, DERATED_COMPATIBLE))
> > +                     timing = &emc->derated[num_derated++];
> > +             else
> > +                     continue;
> > +
> > +             err = load_one_timing_from_dt(emc, timing, child);
> > +             if (err)
> > +                     return err;
> > +     }
> > +
> > +     return 0;
> > +}
> > +
> > +static int tegra210_emc_parse_dt(struct tegra210_emc *emc)
> > +{
> > +     struct device_node *node, *np = emc->dev->of_node;
> > +     int ram_code, ret = 0;
> > +
> > +     if (!np) {
> > +             dev_err(emc->dev, "Unable to find emc node\n");
> > +             return -ENODEV;
> > +     }
> > +
> > +     if (of_find_property(np, "nvidia,use-ram-code", NULL)) {
>
> I cannot find the bindings for this. Where is your DTS? Was it tested?
>
> It seems nothing here is documented.

The relevant nodes are filled in by the bootloader. I had hoped that
the early stage bootloader would be able to copy that into the
mainline dt without needing to prime said mainline dt, but that's not
working as hoped. I'll send a v2 with dt bindings and the first usage
of it in p2371-2180.

Sincerely,
Aaron

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ