Linux-i3c Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: alexandre.belloni@bootlin.com, linux-i3c@lists.infradead.org
Subject: Re: [PATCH V2 12/13] i3c: mipi-i3c-hci-pci: Add LTR support for Intel controllers
Date: Mon, 17 Nov 2025 13:56:52 -0500	[thread overview]
Message-ID: <aRtv9G3tD5D7EcjP@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <387c55f3-1ea7-43e8-aabd-1ff320a99eae@intel.com>

On Mon, Nov 17, 2025 at 08:09:41PM +0200, Adrian Hunter wrote:
> On 17/11/2025 19:54, Frank Li wrote:
> > On Mon, Nov 17, 2025 at 07:47:05PM +0200, Adrian Hunter wrote:
> >> On 17/11/2025 17:59, Frank Li wrote:
> >>> On Mon, Nov 17, 2025 at 01:36:36PM +0200, Adrian Hunter wrote:
> >>>> On 14/11/2025 22:09, Frank Li wrote:
> >>>>> On Fri, Nov 14, 2025 at 08:13:55PM +0200, Adrian Hunter wrote:
> >>>>>> Add support for Latency Tolerance Reporting (LTR) for Intel controllers.
> >>>>>>
> >>>>>> Implement PM ->set_latency_tolerance() callback to set LTR register values.
> >>>>>> Also expose LTR register values via debugfs.
> >>>>>>
> >>>>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> >>>>>> ---
> >>>>>>
> >>>>>>
> >>>>>> Changes in V2:
> >>>>>>
> >>>>>> 	Make use of FIELD_PREP()
> >>>>>> 	Improve handling of values that exceed the maximum
> >>>>>>
> >>>>>>
> >>>>>>  .../master/mipi-i3c-hci/mipi-i3c-hci-pci.c    | 125 ++++++++++++++++++
> >>>>>>  1 file changed, 125 insertions(+)
> >>>>>>
> >>>>> ...
> >>>>>> +static void intel_ltr_expose(struct device *dev)
> >>>>>> +{
> >>>>>> +	dev->power.set_latency_tolerance = intel_ltr_set;
> >>>>>> +	dev_pm_qos_expose_latency_tolerance(dev);
> >>>>>> +}
> >>>>>> +
> >>>>>> +static void intel_ltr_hide(struct device *dev)
> >>>>>> +{
> >>>>>> +	dev_pm_qos_hide_latency_tolerance(dev);
> >>>>>> +	dev->power.set_latency_tolerance = NULL;
> >>>>>> +}
> >>>>>> +
> >>>>>> +static struct dentry *intel_actualize_debugfs_root(bool add)
> >>>>>> +{
> >>>>>> +	static struct dentry *debugfs_root;
> >>>>>> +	static DEFINE_MUTEX(lock);
> >>>>>> +	static int ref_cnt;
> >>>>>> +
> >>>>>> +	guard(mutex)(&lock);
> >>>>>> +
> >>>>>> +	ref_cnt += add ? 1 : -1;
> >>>>>> +
> >>>>>> +	if (ref_cnt) {
> >>>>>> +		if (IS_ERR_OR_NULL(debugfs_root))
> >>>>>> +			debugfs_root = debugfs_create_dir("intel_i3c", NULL);
> >>>>>
> >>>>> I think it'd better to create common "i3c" debugfs root. So your device
> >>>>> use debugfs_create_dir(dev_name(&hci->pci->dev), ...) under this common
> >>>>> root.
> >>>>
> >>>> The debugfs files are being created for the PCI device to contain PCI
> >>>> LTR information.  The i3c module has nothing to do with that.
> >>>>
> >>>> Also, currently, there is no module dependency between this PCI driver
> >>>> and i3c, but a dependency would be necessary to coordinate the creation
> >>>> and deletion of an 'i3c' debugfs directory.
> >>>>
> >>>> The extra complexity can't be justified.
> >>>
> >>> Don't post new versin before we close open discussion. I see your post
> >>> patch before this message.
> >>
> >> Sorry, but it is late in the release cycle, and it saves time when we
> >> are in different time zones.
> >>
> >>>
> >>> So, I think not necessary to create to root, which cause complex, (need
> >>> lock, and refer counter).
> >>
> >> So you are OK with V3?
> >
> > In v3, still create "intel_i3c" root dir, how about direct create dev
> > under root
> >
> > 	debugfs_create_dir(dev_name(&hci->pci->dev), NULL);
> >
> > to reduce unneccesary complex, (like mutex lock and ref counter).
>
> Could do.  I added intel_i3c to match intel_lpss which is also
> PCI devices with LTR e.g.

You can use similar method to create root at module_init.

static int __init intel_lpss_init(void)
{
        intel_lpss_debugfs = debugfs_create_dir("intel_lpss", NULL);
        return 0;
}
module_init(intel_lpss_init);

Frank

>
> # tree /sys/kernel/debug/intel_lpss
> /sys/kernel/debug/intel_lpss
> |-- 0000:00:19.0
> |   |-- active_ltr
> |   |-- capabilities
> |   `-- idle_ltr
> `-- 0000:00:19.1
>     |-- active_ltr
>     |-- capabilities
>     `-- idle_ltr
>
> 3 directories, 6 files
> # tree /sys/kernel/debug/intel_i3c
> /sys/kernel/debug/intel_i3c
> |-- 0000:00:11.0
> |   |-- active_ltr
> |   `-- idle_ltr
> `-- 0000:00:11.1
>     |-- active_ltr
>     `-- idle_ltr
>
> 3 directories, 4 files
> #
>
>
> >
> > Frank
> >
> >>
> >>>
> >>> Frank
> >>>
> >>>>
> >>>>>
> >>>>> ...
> >>>>>
> >>>>>> +
> >>>>>>  static const struct mipi_i3c_hci_pci_info intel_info = {
> >>>>>>  	.init = intel_i3c_init,
> >>>>>> +	.exit = intel_exit,
> >>>>>>  };
> >>>>>>
> >>>>>>  static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
> >>>>>> --
> >>>>>> 2.51.0
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> linux-i3c mailing list
> >>>>>> linux-i3c@lists.infradead.org
> >>>>>> http://lists.infradead.org/mailman/listinfo/linux-i3c
> >>>>
> >>>>
> >>>> --
> >>>> linux-i3c mailing list
> >>>> linux-i3c@lists.infradead.org
> >>>> http://lists.infradead.org/mailman/listinfo/linux-i3c
> >>
> >>
> >> --
> >> linux-i3c mailing list
> >> linux-i3c@lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/linux-i3c
>
>
> --
> linux-i3c mailing list
> linux-i3c@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-i3c

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  reply	other threads:[~2025-11-17 18:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 18:13 [PATCH V2 00/13] i3c: mipi-i3c-hci-pci: Add LTR support for Intel controllers Adrian Hunter
2025-11-14 18:13 ` [PATCH V2 01/13] i3c: mipi-i3c-hci-pci: Set 64-bit DMA mask " Adrian Hunter
2025-11-14 19:43   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 02/13] i3c: mipi-i3c-hci-pci: Move all Intel-related definitions together Adrian Hunter
2025-11-14 18:13 ` [PATCH V2 03/13] i3c: mipi-i3c-hci-pci: Rename some Intel-related identifiers Adrian Hunter
2025-11-14 19:44   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 04/13] i3c: mipi-i3c-hci-pci: Use readl_poll_timeout() Adrian Hunter
2025-11-14 19:44   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 05/13] i3c: mipi-i3c-hci-pci: Constify driver data Adrian Hunter
2025-11-14 18:13 ` [PATCH V2 06/13] i3c: mipi-i3c-hci-pci: Factor out private registers ioremapping Adrian Hunter
2025-11-14 18:13 ` [PATCH V2 07/13] i3c: mipi-i3c-hci-pci: Factor out intel_reset() Adrian Hunter
2025-11-14 19:46   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 08/13] i3c: mipi-i3c-hci-pci: Allocate a structure for mipi_i3c_hci_pci device information Adrian Hunter
2025-11-14 18:13 ` [PATCH V2 09/13] i3c: mipi-i3c-hci-pci: Change callback parameter Adrian Hunter
2025-11-14 19:49   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 10/13] i3c: mipi-i3c-hci-pci: Add exit callback Adrian Hunter
2025-11-14 19:52   ` Frank Li
2025-11-14 19:59     ` Adrian Hunter
2025-11-17 15:33       ` Frank Li
2025-11-14 18:13 ` [PATCH V2 11/13] i3c: mipi-i3c-hci-pci: Allocate a structure for Intel controller information Adrian Hunter
2025-11-14 20:11   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 12/13] i3c: mipi-i3c-hci-pci: Add LTR support for Intel controllers Adrian Hunter
2025-11-14 20:09   ` Frank Li
2025-11-17 11:36     ` Adrian Hunter
2025-11-17 15:59       ` Frank Li
2025-11-17 17:47         ` Adrian Hunter
2025-11-17 17:54           ` Frank Li
2025-11-17 18:09             ` Adrian Hunter
2025-11-17 18:56               ` Frank Li [this message]
2025-11-17 19:07                 ` Adrian Hunter
2025-11-17 19:35                   ` Frank Li
2025-11-14 18:13 ` [PATCH V2 13/13] i3c: mipi-i3c-hci-pci: Set d3cold_delay to 0 " Adrian Hunter
2025-11-14 20:10   ` Frank Li

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=aRtv9G3tD5D7EcjP@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-i3c@lists.infradead.org \
    /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