linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Whitchurch <Vincent.Whitchurch@axis.com>
To: Vincent Whitchurch <Vincent.Whitchurch@axis.com>,
	"wenchao.chen666@gmail.com" <wenchao.chen666@gmail.com>
Cc: "ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel <kernel@axis.com>
Subject: Re: [PATCH v2 2/2] mmc: debugfs: Allow host caps to be modified
Date: Mon, 9 Oct 2023 07:28:14 +0000	[thread overview]
Message-ID: <d7b1664f32f3ab7a3ec3e557ff957826ba396be0.camel@axis.com> (raw)
In-Reply-To: <CA+Da2qy=6CVEkuP5t2dPQVk_eHex-U4-BzJuQ2Y6ozZMfSEbuw@mail.gmail.com>

On Sat, 2023-10-07 at 10:27 +0800, Wenchao Chen wrote:
> On Fri, 29 Sept 2023 at 21:17, Vincent Whitchurch
> <vincent.whitchurch@axis.com> wrote:
> >  // MMC_CAP2_HS200_1_8V_SDR
> >  /sys/kernel/debug/mmc0# echo $(($(cat caps2) & ~(1 << 5))) > caps2
> 
> $(($(cat caps2) & ~(1 << 5))) looks complicated, does it use echo DDR52 > caps2?

1 << 5 is (as the comment above says) MMC_CAP2_HS200_1_8V_SDR.  The
read-modify-write is needed to not clear unrelated bits.  The MMC
framework picks the best possible mode supported by both the card and
the host controller, so disabling support for HS200 in the host
controller leads to DDR52 being picked in this case.

[...]
> >  void mmc_add_host_debugfs(struct mmc_host *host)
> >  {
> >         struct dentry *root;
> > @@ -306,8 +352,9 @@ void mmc_add_host_debugfs(struct mmc_host *host)
> >         host->debugfs_root = root;
> > 
> >         debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops);
> > -       debugfs_create_x32("caps", S_IRUSR, root, &host->caps);
> > -       debugfs_create_x32("caps2", S_IRUSR, root, &host->caps2);
> > +       debugfs_create_file("caps", 0600, root, &host->caps, &mmc_caps_fops);
> > +       debugfs_create_file("caps2", 0600, root, &host->caps2,
> > +                           &mmc_caps2_fops);
> 
> Would it be better to use "S_IRUSR | S_IWUSR" instead of "0600"?

No, not according to checkpatch which says that numeric permissions are
preferred.

  reply	other threads:[~2023-10-09  7:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  7:45 [PATCH v2 0/2] mmc: Allow speed modes to be adjusted dynamically Vincent Whitchurch
2023-09-29  7:45 ` [PATCH v2 1/2] mmc: core: Always reselect card type Vincent Whitchurch
2023-09-29  7:45 ` [PATCH v2 2/2] mmc: debugfs: Allow host caps to be modified Vincent Whitchurch
2023-10-07  2:27   ` Wenchao Chen
2023-10-09  7:28     ` Vincent Whitchurch [this message]
2023-10-10 14:27 ` [PATCH v2 0/2] mmc: Allow speed modes to be adjusted dynamically Ulf Hansson

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=d7b1664f32f3ab7a3ec3e557ff957826ba396be0.camel@axis.com \
    --to=vincent.whitchurch@axis.com \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=wenchao.chen666@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).