2024-03-26 09:46:31

by Rouven Czerwinski

[permalink] [raw]
Subject: [PATCH 1/2] mmc: debugfs: convert permissions to octal

Convert the existing symbolic permissions to the octal presentation as
this is the preferred representation for debugfs permissions.

Signed-off-by: Rouven Czerwinski <[email protected]>
---
drivers/mmc/core/debugfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 1642ea72d22c..6dbab860e453 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -351,11 +351,11 @@ void mmc_add_host_debugfs(struct mmc_host *host)
root = debugfs_create_dir(mmc_hostname(host), NULL);
host->debugfs_root = root;

- debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops);
+ debugfs_create_file("ios", 0400, root, host, &mmc_ios_fops);
debugfs_create_file("caps", 0600, root, &host->caps, &mmc_caps_fops);
debugfs_create_file("caps2", 0600, root, &host->caps2,
&mmc_caps2_fops);
- debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host,
+ debugfs_create_file_unsafe("clock", 0600, root, host,
&mmc_clock_fops);

debugfs_create_file_unsafe("err_state", 0600, root, host,
@@ -388,7 +388,7 @@ void mmc_add_card_debugfs(struct mmc_card *card)
root = debugfs_create_dir(mmc_card_id(card), host->debugfs_root);
card->debugfs_root = root;

- debugfs_create_x32("state", S_IRUSR, root, &card->state);
+ debugfs_create_x32("state", 0400, root, &card->state);
}

void mmc_remove_card_debugfs(struct mmc_card *card)

base-commit: 928a87efa42302a23bb9554be081a28058495f22
--
2.44.0



2024-03-26 09:46:51

by Rouven Czerwinski

[permalink] [raw]
Subject: [PATCH 2/2] mmc: debugfs: add card entry for quirks

This is useful to check if a quirk has been applied for the connected
mmc card.

Signed-off-by: Rouven Czerwinski <[email protected]>
---
drivers/mmc/core/debugfs.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 6dbab860e453..f10a4dcf1f95 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -389,6 +389,7 @@ void mmc_add_card_debugfs(struct mmc_card *card)
card->debugfs_root = root;

debugfs_create_x32("state", 0400, root, &card->state);
+ debugfs_create_x32("quirks", 0400, root, &card->quirks);
}

void mmc_remove_card_debugfs(struct mmc_card *card)
--
2.44.0


2024-04-02 10:58:01

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH 1/2] mmc: debugfs: convert permissions to octal

On Tue, 26 Mar 2024 at 10:42, Rouven Czerwinski
<[email protected]> wrote:
>
> Convert the existing symbolic permissions to the octal presentation as
> this is the preferred representation for debugfs permissions.
>
> Signed-off-by: Rouven Czerwinski <[email protected]>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/core/debugfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 1642ea72d22c..6dbab860e453 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -351,11 +351,11 @@ void mmc_add_host_debugfs(struct mmc_host *host)
> root = debugfs_create_dir(mmc_hostname(host), NULL);
> host->debugfs_root = root;
>
> - debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops);
> + debugfs_create_file("ios", 0400, root, host, &mmc_ios_fops);
> debugfs_create_file("caps", 0600, root, &host->caps, &mmc_caps_fops);
> debugfs_create_file("caps2", 0600, root, &host->caps2,
> &mmc_caps2_fops);
> - debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host,
> + debugfs_create_file_unsafe("clock", 0600, root, host,
> &mmc_clock_fops);
>
> debugfs_create_file_unsafe("err_state", 0600, root, host,
> @@ -388,7 +388,7 @@ void mmc_add_card_debugfs(struct mmc_card *card)
> root = debugfs_create_dir(mmc_card_id(card), host->debugfs_root);
> card->debugfs_root = root;
>
> - debugfs_create_x32("state", S_IRUSR, root, &card->state);
> + debugfs_create_x32("state", 0400, root, &card->state);
> }
>
> void mmc_remove_card_debugfs(struct mmc_card *card)
>
> base-commit: 928a87efa42302a23bb9554be081a28058495f22
> --
> 2.44.0
>

2024-04-02 10:58:13

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH 2/2] mmc: debugfs: add card entry for quirks

On Tue, 26 Mar 2024 at 10:42, Rouven Czerwinski
<[email protected]> wrote:
>
> This is useful to check if a quirk has been applied for the connected
> mmc card.
>
> Signed-off-by: Rouven Czerwinski <[email protected]>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/core/debugfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 6dbab860e453..f10a4dcf1f95 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -389,6 +389,7 @@ void mmc_add_card_debugfs(struct mmc_card *card)
> card->debugfs_root = root;
>
> debugfs_create_x32("state", 0400, root, &card->state);
> + debugfs_create_x32("quirks", 0400, root, &card->quirks);
> }
>
> void mmc_remove_card_debugfs(struct mmc_card *card)
> --
> 2.44.0
>