Re: [PATCH v4 3/3] platform/x86: thinkpad_acpi: Add platform profile support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi


2020. november 28., szombat 16:00 keltezéssel, Hans de Goede <hdegoede@xxxxxxxxxx> írta:

> [...]
> >> +static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
> >> +{
> >> +	int err, output;
> >> +
> >> +	dytc_profile_available = false;
> >> +	dytc_ignore_next_event = false;
> >> +
> >> +	err = dytc_command(DYTC_CMD_QUERY, &output);
> >> +	/*
> >> +	 * If support isn't available (ENODEV) then don't return an error
> >> +	 * and don't create the sysfs group
> >> +	 */
> >> +	if (err == -ENODEV)
> >> +		return 0;
> >> +	/* For all other errors we can flag the failure */
> >> +	if (err)
> >> +		return err;
> >> +
> >> +	/* Check DYTC is enabled and supports mode setting */
> >> +	if (output & BIT(DYTC_QUERY_ENABLE_BIT)) {
> >> +		/* Only DYTC v5.0 and later has this feature. */
> >> +		int dytc_version;
> >> +
> >> +		dytc_version = (output >> DYTC_QUERY_REV_BIT) & 0xF;
> >> +		if (dytc_version >= 5) {
> >> +			dbg_printk(TPACPI_DBG_INIT,
> >> +				   "DYTC version %d: thermal mode available\n", dytc_version);
> >> +			/* Create platform_profile structure and register */
> >> +			do {
> >> +				err = platform_profile_register(&dytc_profile);
> >> +			} while (err == -EINTR);
> >> [...]
> >
> > I'm wondering if this loop is really necessary?
>
> It is the result of using mutex_interruptible inside platform_profile_register(),
> once that is fixed (as I just requested in my review of patch 2/3) then this loop
> can go away.
>

Thank you, I see that, my question should've been "why not simply fail and
return the error?", but with your requested change the question is moot.


Regards,
Barnabás Pőcze





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux