All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Mark Pearson <mpearson-lenovo@squebb.ca>
Cc: Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>,
	Kurt Borja <kuurtb@gmail.com>
Subject: Re: [PATCH v3] platform/x86: thinkpad_acpi: Fix registration of tpacpi platform driver
Date: Wed, 12 Feb 2025 13:50:47 +0200 (EET)	[thread overview]
Message-ID: <6112b35f-fdb4-4beb-490e-03569ce9f17e@linux.intel.com> (raw)
In-Reply-To: <D7PSW9W74P7I.GBMKQD7EGPXT@gmail.com>

On Tue, 11 Feb 2025, Kurt Borja wrote:

> On Tue Feb 11, 2025 at 12:36 PM -05, Mark Pearson wrote:
> > When reviewing and testing the recent platform profile changes I had
> > missed that they prevent the tpacpi platform driver from registering.
> > This error is seen in the kernel logs, and the various tpacpi entries
> > are not created:
> > [ 7550.642171] platform thinkpad_acpi: Resources present before probing
> >
> > This happens because devm_platform_profile_register() is called before
> > tpacpi_pdev probes (thanks to Kurt Borja for identifying root cause)
> >
> > For now revert back to the old platform_profile_register to fix the
> > issue. Will work on re-implementing this later as more testing is needed
> > for full solution.

Hi Mark,

I've applied this to the review-ilpo-branch. I had to rewrite parts of 
your changelog though to not say "I did/will do this and that". In future,
please just state the simple facts. What the issue is and so on, do not 
write a story about how you came to find that out. :-)

-- 
 i.

> > Tested on X1 Carbon G12.
> >
> > Fixes: 31658c916fa6 ("platform/x86: thinkpad_acpi: Use devm_platform_profile_register()")
> >
> > Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> 
> I believe this is done now!
> 
> Reviewed-by: Kurt Borja <kuurtb@gmail.com>
> 
> > ---
> > Changes in v2:
> > Modified approach to instead revert to old platform_profile_register
> > method. Will revisit using devm_ version in the future as more testing
> > needed.
> > Changes in v3:
> > Add check if tpacpi_pprof is valid before releasing.
> >
> >  drivers/platform/x86/thinkpad_acpi.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> > index 1fcb0f99695a..9f6d7e26e700 100644
> > --- a/drivers/platform/x86/thinkpad_acpi.c
> > +++ b/drivers/platform/x86/thinkpad_acpi.c
> > @@ -10646,8 +10646,8 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
> >  			"DYTC version %d: thermal mode available\n", dytc_version);
> >  
> >  	/* Create platform_profile structure and register */
> > -	tpacpi_pprof = devm_platform_profile_register(&tpacpi_pdev->dev, "thinkpad-acpi",
> > -						      NULL, &dytc_profile_ops);
> > +	tpacpi_pprof = platform_profile_register(&tpacpi_pdev->dev, "thinkpad-acpi-profile",
> > +						 NULL, &dytc_profile_ops);
> >  	/*
> >  	 * If for some reason platform_profiles aren't enabled
> >  	 * don't quit terminally.
> > @@ -10665,8 +10665,15 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
> >  	return 0;
> >  }
> >  
> > +static void dytc_profile_exit(void)
> > +{
> > +	if (!IS_ERR_OR_NULL(tpacpi_pprof))
> > +		platform_profile_remove(tpacpi_pprof);
> > +}
> > +
> >  static struct ibm_struct  dytc_profile_driver_data = {
> >  	.name = "dytc-profile",
> > +	.exit = dytc_profile_exit,
> >  };
> >  
> >  /*************************************************************************
> 

  reply	other threads:[~2025-02-12 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 17:36 [PATCH v3] platform/x86: thinkpad_acpi: Fix registration of tpacpi platform driver Mark Pearson
2025-02-11 17:42 ` Kurt Borja
2025-02-12 11:50   ` Ilpo Järvinen [this message]
2025-02-12 16:18     ` Mark Pearson

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=6112b35f-fdb4-4beb-490e-03569ce9f17e@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=kuurtb@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.