Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Hans Zhang <18255117159@163.com>
To: Shradha Todi <shradha.t@samsung.com>, jingoohan1@gmail.com
Cc: manivannan.sadhasivam@linaro.org, lpieralisi@kernel.org,
	kw@linux.com, robh@kernel.org, bhelgaas@google.com,
	Frank.Li@nxp.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, rockswang7@gmail.com
Subject: Re: [v2] PCI: dwc: Add the debugfs property to provide the LTSSM status of the PCIe link
Date: Wed, 12 Feb 2025 22:03:43 +0800	[thread overview]
Message-ID: <40c3d54b-677b-422d-b002-2155dc7ac66c@163.com> (raw)
In-Reply-To: <000001db7d42$d6b56fd0$84204f70$@samsung.com>



On 2025/2/12 19:39, Shradha Todi wrote:
>> @@ -463,6 +495,7 @@ struct dw_pcie {
>>   	struct reset_control_bulk_data	core_rsts[DW_PCIE_NUM_CORE_RSTS];
>>   	struct gpio_desc		*pe_rst;
>>   	bool			suspended;
>> +	struct dentry		*debugfs;
> 
> This pointer to main directory dentry is already present as rasdes_dir in struct dwc_pcie_rasdes_info.
> So struct dentry *debugfs is duplicating it.
> 
> We have a few options to solve this:
> 1. Remove struct dentry *rasdes_dir from dwc_pcie_rasdes_info and continue to have 2 pointers exposed
> in struct dw_pcie.
> 
> struct dwc_pcie_rasdes_info {
>          u32 ras_cap_offset;
>          struct mutex reg_lock;
> };
> struct dw_pcie {
>         .
>         .
>         struct dentry           *debugfs;
>          void                    *rasdes_info;
>   };
> 
> 2. Change rasdes_info to debugfs info:
> 
> struct dwc_pcie_rasdes_info {
>          u32 ras_cap_offset;
>          struct mutex reg_lock;
> };
> struct dwc_pcie_debugfs_info {
>          struct dwc_pcie_rasdes_info *rinfo;
>          struct dentry           *debugfs;
> };
> struct dw_pcie {
>         .
>         .
>          void                    *debugfs_info;
>   };
> 
> 3. Let ras related info get initialized to 0 even when rasdes cap is not present:
> 
> struct dwc_pcie_debugfs_info {
>          u32 ras_cap_offset;
>          struct mutex reg_lock;
>          struct dentry *debugfs;
> };
> struct dw_pcie {
>         .
>         .
>          void                    *debugfs_info;
>   };
> 
> I think option 2 would be the best, though it will need a bit of changes in my files. What do you suggest?
> 

I couldn't agree more. Can you build the debugfs framework? I or other 
developers can add some other debugfs nodes to this framework, not only 
dwc_pcie_rasdes_debugfs_init, but also dwc_pcie_debugfs_init.

I will add my patch with your next version. Please CC email me.

Best regards
Hans


  reply	other threads:[~2025-02-12 14:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250206151446epcas5p43a35270da73181b97deb628ff49f3ddd@epcas5p4.samsung.com>
2025-02-06 15:13 ` [v2] PCI: dwc: Add the debugfs property to provide the LTSSM status of the PCIe link Hans Zhang
2025-02-12 11:39   ` Shradha Todi
2025-02-12 14:03     ` Hans Zhang [this message]
2025-02-13 14:34   ` Niklas Cassel
2025-02-14  8:34     ` Hans Zhang
2025-02-14 17:05       ` Bjorn Helgaas
2025-02-14 17:14         ` Hans Zhang

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=40c3d54b-677b-422d-b002-2155dc7ac66c@163.com \
    --to=18255117159@163.com \
    --cc=Frank.Li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=jingoohan1@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=rockswang7@gmail.com \
    --cc=shradha.t@samsung.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