From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07174C433EF for ; Fri, 27 May 2022 11:36:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F7398D0003; Fri, 27 May 2022 07:36:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A2718D0002; Fri, 27 May 2022 07:36:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58FDD8D0003; Fri, 27 May 2022 07:36:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 497AE8D0002 for ; Fri, 27 May 2022 07:36:38 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0FFC461415 for ; Fri, 27 May 2022 11:36:38 +0000 (UTC) X-FDA: 79511320476.04.D7DBACF Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) by imf29.hostedemail.com (Postfix) with ESMTP id 017F212003D for ; Fri, 27 May 2022 11:36:25 +0000 (UTC) Received: by mail-yb1-f170.google.com with SMTP id z7so7413746ybf.7 for ; Fri, 27 May 2022 04:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2I3hQXa2wguUKKHpEr9lzRtvv8oSEArMwe0oODAyyTE=; b=msgUO1QeXFPr+hkvzfvrxs4FoDJjLMTOA9M4A9Z94nPaT7bEArs6LoJWzUyk+X0P0A ONgQ5IqwOjrJAz1l62PSoRAj/a/qlwvLj/+zUtCaDVuXkuF81DNhPkOoGn2xO9sXme3n d3+RcmlmG1PzhVMvc5m7baJAfWeB6W4lRTVHmvdv/O81ucdVW6tqwR6M5nhC72sygqhn PVE2hUUJRjEQTGnICd0RdZQovQdAqMz9n8C+sgf3gemJdBsSdk17vZKnoEKvsdeBiNf9 buUVo7NLy8hRGRx5xfra0MHBDJhF3qkeHnCzZXQA97wnVeUl0bBti200R2k4Gc+6NE0m RMEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2I3hQXa2wguUKKHpEr9lzRtvv8oSEArMwe0oODAyyTE=; b=ZRABsIl/cKzGjDA6Tf8JDY1zzs33QI0+G6VQGyDxVy3awHCqO4xPnR+FlkF8eAhzhp ZhS+515QqMlquqvgCxd63L31/BKkn3osnPY8cpXmutHH+c0x3NPx3sEnjftIjx5kc9JI Af/aJi6cgqgy5406Ynhs048OTs1Ws543zn7IabUutG4PJnlBCaG8s0H7YeSl5vG5UoDs o8OlBnWrwK2pLm8r5iNvEwuakZwmpyWesoQvAES094yfuNOOdVPxxS9BfO1B3dFJDStl z2RQVjam9OmPcbHpY+Ki7AV4AFLFvTTDQfd2nhcmGPzNVsvFIrxlC+siEArk+7AjfDW8 Ig5Q== X-Gm-Message-State: AOAM5307YZVIWwTUkVKmfY6AG2I+s8luTjJw6tsy9za7QyHYLonpmmfU IzGL5pyfoqpoCJ9AwgbflfT3zkqWSo8ys1s/7X4= X-Google-Smtp-Source: ABdhPJxzyeow9Ugsr/D0jxn94+JebANkocWS3pkw2xrIkT7/YjpU4U9s7zkXbU3kv3N4U2XX9Jen+B+loZRNx6Q2nC4= X-Received: by 2002:a25:abd4:0:b0:65b:90a6:900f with SMTP id v78-20020a25abd4000000b0065b90a6900fmr1044493ybi.52.1653651396670; Fri, 27 May 2022 04:36:36 -0700 (PDT) MIME-Version: 1.0 References: <65f1b675-84ac-b5da-6075-2a9f0353ab37@quicinc.com> In-Reply-To: From: Pintu Agarwal Date: Fri, 27 May 2022 17:06:25 +0530 Message-ID: Subject: Re: Queries: Using ifdef CONFIG condition in dts files To: "T.Michael Turney" Cc: open list , robh+dt@kernel.org, devicetree@vger.kernel.org, frowand.list@gmail.com, linux-mm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 017F212003D X-Stat-Signature: 5feusyg9w34em1gqmx77a9gsrjgzptu9 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=msgUO1Qe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf29.hostedemail.com: domain of pintu.ping@gmail.com designates 209.85.219.170 as permitted sender) smtp.mailfrom=pintu.ping@gmail.com X-Rspam-User: X-HE-Tag: 1653651385-363579 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 27 May 2022 at 15:34, Pintu Agarwal wrote: > > Hi, > > On Thu, 26 May 2022 at 19:53, T.Michael Turney 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 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