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]
Date:   Wed, 9 Jun 2021 19:40:06 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Sanjay R Mehta <Sanju.Mehta@....com>
Cc:     gregkh@...uxfoundation.org, dan.j.williams@...el.com,
        Thomas.Lendacky@....com, Shyam-sundar.S-k@....com,
        Nehal-bakulchandra.Shah@....com, robh@...nel.org,
        mchehab+samsung@...nel.org, davem@...emloft.net,
        linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org
Subject: Re: [PATCH v9 3/3] dmaengine: ptdma: Add debugfs entries for PTDMA

On 02-06-21, 12:22, Sanjay R Mehta wrote:

> +/* DebugFS helpers */
> +#define	MAX_NAME_LEN	20
> +#define	RI_VERSION_NUM	0x0000003F
> +
> +#define	RI_NUM_VQM	0x00078000
> +#define	RI_NVQM_SHIFT	15
> +
> +static DEFINE_MUTEX(pt_debugfs_lock);

unused?

> +
> +static int pt_debugfs_info_show(struct seq_file *s, void *p)
> +{
> +	struct pt_device *pt = s->private;
> +	unsigned int regval;
> +
> +	if (!pt)
> +		return 0;

better return an error code?

> +
> +	seq_printf(s, "Device name: %s\n", pt->name);
> +	seq_printf(s, "   # Queues: %d\n", 1);
> +	seq_printf(s, "     # Cmds: %d\n", pt->cmd_count);
> +
> +	regval = ioread32(pt->io_regs + CMD_PT_VERSION);

how do you ensure your device is not sleeping or you can access iomem
safely?

> +void ptdma_debugfs_setup(struct pt_device *pt)
> +{
> +	struct pt_cmd_queue *cmd_q;
> +	char name[MAX_NAME_LEN + 1];
> +	struct dentry *debugfs_q_instance;
> +
> +	if (!debugfs_initialized())
> +		return;
> +
> +	debugfs_create_file("info", 0400, pt->dma_dev.dbg_dev_root, pt,
> +			    &pt_debugfs_info_fops);
> +
> +	debugfs_create_file("stats", 0600, pt->dma_dev.dbg_dev_root, pt,

why 600 here?
-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ