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: <d7b1664f32f3ab7a3ec3e557ff957826ba396be0.camel@axis.com>
Date:   Mon, 9 Oct 2023 07:28:14 +0000
From:   Vincent Whitchurch <Vincent.Whitchurch@...s.com>
To:     Vincent Whitchurch <Vincent.Whitchurch@...s.com>,
        "wenchao.chen666@...il.com" <wenchao.chen666@...il.com>
CC:     "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        kernel <kernel@...s.com>
Subject: Re: [PATCH v2 2/2] mmc: debugfs: Allow host caps to be modified

On Sat, 2023-10-07 at 10:27 +0800, Wenchao Chen wrote:
> On Fri, 29 Sept 2023 at 21:17, Vincent Whitchurch
> <vincent.whitchurch@...s.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ