lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7E101F4B-782A-4B8B-B6AB-3E7E282C9A9C@cirrus.com>
Date:   Thu, 4 May 2023 21:51:37 +0000
From:   Fred Treven <Fred.Treven@...rus.com>
To:     Jeff LaBundy <jeff@...undy.com>
CC:     Charles Keepax <ckeepax@...nsource.cirrus.com>,
        "dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
        Ben Bright <Ben.Bright@...rus.com>,
        James Ogletree <James.Ogletree@...rus.com>,
        "lee@...nel.org" <lee@...nel.org>,
        "jdelvare@...e.de" <jdelvare@...e.de>,
        "joel@....id.au" <joel@....id.au>,
        "cy_huang@...htek.com" <cy_huang@...htek.com>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "eajames@...ux.ibm.com" <eajames@...ux.ibm.com>,
        "ping.bai@....com" <ping.bai@....com>,
        "msp@...libre.com" <msp@...libre.com>,
        "arnd@...db.de" <arnd@...db.de>,
        "bartosz.golaszewski@...aro.org" <bartosz.golaszewski@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        "patches@...nsource.cirrus.com" <patches@...nsource.cirrus.com>
Subject: Re: [PATCH 1/2] Input: cs40l26: Support for CS40L26 Boosted Haptic
 Amplifier

Hi Jeff,

I had one last question for you before I send the next version of this submission.

>> +
>> + return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(cs40l26_remove);
>> +
>> +static int cs40l26_suspend(struct device *dev)
>> +{
>> + struct cs40l26_private *cs40l26 = dev_get_drvdata(dev);
>> + int ret;
>> +
>> + mutex_lock(&cs40l26->lock);
>> + dev_dbg(dev, "%s: Enabling hibernation\n", __func__);
>> +
>> + ret = cs40l26_allow_hiber(cs40l26);
>> +
>> + mutex_unlock(&cs40l26->lock);
>> +
>> + return ret;
>> +}
>> +
>> +static int cs40l26_sys_suspend(struct device *dev)
>> +{
>> + struct i2c_client *i2c_client = to_i2c_client(dev);
>> +
>> + dev_dbg(dev, "System suspend, disabling IRQ\n");
>> +
>> + disable_irq(i2c_client->irq);
>> +
>> + return 0;
>> +}
>> +
>> +static int cs40l26_sys_suspend_noirq(struct device *dev)
>> +{
>> + struct i2c_client *i2c_client = to_i2c_client(dev);
>> +
>> + dev_dbg(dev, "Late system suspend, re-enabling IRQ\n");
>> + enable_irq(i2c_client->irq);
>> +
>> + return 0;
>> +}
>> +
>> +static int cs40l26_resume(struct device *dev)
>> +{
>> + dev_dbg(dev, "%s: Disabling hibernation\n", __func__);
>> +
>> + return cs40l26_prevent_hiber(dev_get_drvdata(dev));
>> +}
>> +
>> +static int cs40l26_sys_resume(struct device *dev)
>> +{
>> + struct i2c_client *i2c_client = to_i2c_client(dev);
>> +
>> + dev_dbg(dev, "System resume, re-enabling IRQ\n");
>> +
>> + enable_irq(i2c_client->irq);
>> +
>> + return 0;
>> +}
>> +
>> +static int cs40l26_sys_resume_noirq(struct device *dev)
>> +{
>> + struct i2c_client *i2c_client = to_i2c_client(dev);
>> +
>> + dev_dbg(dev, "Early system resume, disabling IRQ\n");
>> +
>> + disable_irq(i2c_client->irq);
>> +
>> + return 0;
>> +}
>> +
>> +const struct dev_pm_ops cs40l26_pm_ops = {
>> + SET_RUNTIME_PM_OPS(cs40l26_suspend, cs40l26_resume, NULL)
>> + SET_SYSTEM_SLEEP_PM_OPS(cs40l26_sys_suspend, cs40l26_sys_resume)
>> + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(cs40l26_sys_suspend_noirq, cs40l26_sys_resume_noirq)
>> +};
>> +EXPORT_SYMBOL_GPL(cs40l26_pm_ops);
> 
> Please use latest macros (e.g. DEFINE_SIMPLE_DEV_PM_OPS).

When looking at these *_PM_OPS* macros that replace the deprecated versions, it is unclear to me how to maintain support for *_sys_* and
*_sys_*_noirq* functions. Would these all need to be separately defined via DEFINE_SIMPLE_DEV_PM_OPS?
Would the *_sys_* definitions still be defined through a struct i.e.
const struct dev_pm_ops cs40l26_sys_pm_ops which is then exported as it is in my initial submission? 
I’m unsure how to handle these cases with the latest macros.

Appreciate any guidance you can provide.

Best regards,
Fred

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ