Re: [PATCH v9 3/3] dmaengine: ptdma: Add debugfs entries for PTDMA

From: Sanjay R Mehta
Date: Tue Jun 15 2021 - 07:18:40 EST




On 6/9/2021 7:40 PM, Vinod Koul wrote:
> [CAUTION: External Email]
>
> 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?
>

This device will never go to sleep state as this DMA device is part of AMD server SOC.
Hence PM support is not implemented.

- Sanjay