mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jens Wiklander" <jens.wiklander@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"kernel test robot" <lkp@intel.com>
Subject: Re: [PATCH] rpmb: use IS_REACHABLE instead of IS_ENABLED
Date: Mon, 02 Sep 2024 10:32:39 +0000	[thread overview]
Message-ID: <cc808e76-4c2d-4a52-996c-2ff6d955e0a1@app.fastmail.com> (raw)
In-Reply-To: <CAHUa44GgySmc=byL9_0vUuP2BKifpMHqMgvMHJpEukgFGRvVmg@mail.gmail.com>

On Mon, Sep 2, 2024, at 09:54, Jens Wiklander wrote:
>
> Thanks for the suggestion.
>
> I tried adding the dependency above for MMC_BLOCK and OPTEE.
>
> Setting CONFIG_RPMB to "y" works as expected CONFIG_MMC_BLOCK and
> CONFIG_OPTEE can be configured as both "y" or "m".
>
> Setting CONFIG_RPMB to "m" will make CONFIG_MMC_BLOCK and CONFIG_OPTEE
> "m" too, even if they are set as "y" in the defconfig. So the module
> status seems to spread to the options with the dependency. For
> tristate options, it guarantees that the expected features are
> available even if it changes from built-in to a loadable module.

Correct.

> It will do nothing for bool options, but that's a hypothetical case
> for now.  Wouldn't spreading the built-in status to CONFIG_RPMB be
> better? So CONFIG_RPMB turns into "y" if an option configured as
> built-in depends on it. I don't know how to do that though, so that
> could be saved for when it's needed.

That would require using 'select' instead of 'depends on', but that has
other problems.

If a symbol that uses RPMB is 'bool', you need to do one of two things:

- if this is a driver that is always built-in, it would instead need
  'depends on RPMB!=m' or 'depends on RPMB=y || !RPMB', both have
  the same effect.

- If there is a bool symbol that turns on an optional feature in
  a modular driver, it would have to be something like this:

config MMC_USE_RPMB
     bool "Build MMC support for RPMB"
     depends on MMC && RPMB
     depends on RPMB=y || RPMB=MMC

> I'll send out patches for MMC_BLOCK and OPTEE options shortly if we're
> happy with the "depends on RPMB || !RPMB" approach.

Sounds good, thanks.

      Arnd

      reply	other threads:[~2024-09-02 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02  8:07 Jens Wiklander
2024-09-02  8:31 ` Arnd Bergmann
2024-09-02  9:54   ` Jens Wiklander
2024-09-02 10:32     ` Arnd Bergmann [this message]

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=cc808e76-4c2d-4a52-996c-2ff6d955e0a1@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jens.wiklander@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=ulf.hansson@linaro.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

all inboxes | Powered by JetHome®