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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOuPNLgk8zRHwq7PP56NYpFagjnf_+1j1c_TYvdo6kmWQBwwuQ@mail.gmail.com>
Date:   Fri, 27 May 2022 17:06:25 +0530
From:   Pintu Agarwal <pintu.ping@...il.com>
To:     "T.Michael Turney" <quic_mturney@...cinc.com>
Cc:     open list <linux-kernel@...r.kernel.org>, robh+dt@...nel.org,
        devicetree@...r.kernel.org, frowand.list@...il.com,
        linux-mm <linux-mm@...ck.org>
Subject: Re: Queries: Using ifdef CONFIG condition in dts files

On Fri, 27 May 2022 at 15:34, Pintu Agarwal <pintu.ping@...il.com> wrote:
>
> Hi,
>
> On Thu, 26 May 2022 at 19:53, T.Michael Turney <quic_mturney@...cinc.com> wrote:
> >
> > Kernel developers correct me where I go astray, but this seems like the
> > CONFIG_XYZ value is not available in this file.  This would explain why
> > the disable case works.
> >
> > At top of dtsi file are you #include <config.h> or whatever the correct
> > syntax is to see the CONFIG values?
>
> Thanks for your comments.
> No, I could not find any specific config,h to be included to make the
> CONFIG values visible to dts.
>

BTW, I tried another approach but this also doesn't work when CONFIG is enabled.
a) I have created a new header file such as myxyz.h and defined a new
macro with config check.
=> myxyz.h
+#ifdef CONFIG_XYZ
+#define XYZ_CMA
+#endif

b) Then I included the header file in my dtsi file and used ifdef with
the new macro.

#include "myxyz.h"

#ifdef CONFIG_XYZ
&reserved_mem {
        xyz_region: xyz_region {
                compatible = "shared-dma-pool";
                reusable;
                size = <0x600000>;
        };
};
#endif

But unfortunately this approach also did not work when CONFIG is
enabled. So, when config enable/disable its same behavior.
However, if I put the #define in the dtsi file itself then it works as expected.


Thanks,
Pintu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ