platform-drivers-x86 for v5.7-2

* Avoid loading asus-nb-wmi module on selected laptop models
 * Fix S0ix debug support for Jasper Lake PMC
 * Few fixes which have been reported by Hulk bot and others
 
 The following is an automated git shortlog grouped by driver:
 
 asus-nb-wmi:
  -  Do not load on Asus T100TA and T200TA
 
 intel_pmc_core:
  -  avoid unused-function warnings
  -  Change Jasper Lake S0ix debug reg map back to ICL
 
 platform/x86/intel-uncore-freq:
  -  make uncore_root_kobj static
 
 surface3_power:
  -  Fix a NULL vs IS_ERR() check in probe
 
 thinkpad_acpi:
  -  Remove always false 'value < 0' statement
 
 wmi:
  -  Make two functions static
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl6xn8kACgkQb7wzTHR8
 rCh18hAAuCiGju0d16WIUCA+wzdsJ2JONMRBTx2wp2HIkR+k1chIDYuVAWAAzRuP
 6tyk3/6X0dfD5cAvezQurGZCw9dc0/hN09zyceS1vcbsS3MC0xhGmRkB9TKiBir1
 nOLebSjuS+azRQ/y3rvfV7RkGL09gjigNGirxcDsQlQUXeiN6AVyfS7U2mNlnAMs
 TZSvOdqaCop0vGplX4c4KAMvxXC9tUxTTveNPxiYJV5PoE3OuGKKQtzznuMyfMuq
 P/Fw9YeTilN1NyoG20Qfcy9qHOdWYD729NmSkuU5uQ3qWZ4CJ5phDtQx/3fTz0Xz
 m6Mrm3+unyyl5JAjfSl8NCBSjz8WwxPWL72z1U1WE2dr+N7E2HwEL7yp/E59oih8
 yQahEy5omOZxWovLnzUvqw4CHaZr085T8ukgF/QwsixClEnhlsJlSnJaa8QakSan
 idDUd3KTzxA52jndWSKYM4AkVmGpe1ZLbhxszrOq4YETAesqo+tpzLMuOcdhOxry
 EMOAuBcINuBntzMeo9vFX9wpdyVTuCu49CHTESHrAt4LmJ84njVA0sgaouvAEOOe
 hpGMNSMU0e37/FTOUgwq6Sb28+XjDPW3BUF9QaukxTZacobKKmwmbj2j7z+44Utj
 DMEgC2KCngdPtMBRNj6OtybV0KXWT//BRxgQOV8Pf6Ihn1fcFrw=
 =u8gZ
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.7-2' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver fixes from Andy Shevchenko:

 - Avoid loading asus-nb-wmi module on selected laptop models

 - Fix S0ix debug support for Jasper Lake PMC

 - Few fixes which have been reported by Hulk bot and others

* tag 'platform-drivers-x86-v5.7-2' of git://git.infradead.org/linux-platform-drivers-x86:
  platform/x86: thinkpad_acpi: Remove always false 'value < 0' statement
  platform/x86: intel_pmc_core: avoid unused-function warnings
  platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA
  platform/x86: intel_pmc_core: Change Jasper Lake S0ix debug reg map back to ICL
  platform/x86/intel-uncore-freq: make uncore_root_kobj static
  platform/x86: wmi: Make two functions static
  platform/x86: surface3_power: Fix a NULL vs IS_ERR() check in probe
This commit is contained in:
Linus Torvalds 2020-05-05 16:29:03 -07:00
commit dc56c5acd8
7 changed files with 35 additions and 27 deletions

View file

@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
.detect_quirks = asus_nb_wmi_quirks,
};
static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = {
{
/*
* asus-nb-wm adds no functionality. The T100TA has a detachable
* USB kbd, so no hotkeys and it has no WMI rfkill; and loading
* asus-nb-wm causes the camera LED to turn and _stay_ on.
*/
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
},
},
{
/* The Asus T200TA has the same issue as the T100TA */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"),
},
},
{} /* Terminating entry */
};
static int __init asus_nb_wmi_init(void)
{
if (dmi_check_system(asus_nb_wmi_blacklist))
return -ENODEV;
return asus_wmi_register_driver(&asus_nb_wmi_driver);
}

View file

@ -53,7 +53,7 @@ static int uncore_max_entries __read_mostly;
/* Storage for uncore data for all instances */
static struct uncore_data *uncore_instances;
/* Root of the all uncore sysfs kobjs */
struct kobject *uncore_root_kobj;
static struct kobject *uncore_root_kobj;
/* Stores the CPU mask of the target CPUs to use during uncore read/write */
static cpumask_t uncore_cpu_mask;
/* CPU online callback register instance */

View file

@ -255,7 +255,7 @@ static const struct pmc_bit_map *ext_cnp_pfear_map[] = {
};
static const struct pmc_bit_map icl_pfear_map[] = {
/* Ice Lake generation onwards only */
/* Ice Lake and Jasper Lake generation onwards only */
{"RES_65", BIT(0)},
{"RES_66", BIT(1)},
{"RES_67", BIT(2)},
@ -274,7 +274,7 @@ static const struct pmc_bit_map *ext_icl_pfear_map[] = {
};
static const struct pmc_bit_map tgl_pfear_map[] = {
/* Tiger Lake, Elkhart Lake and Jasper Lake generation onwards only */
/* Tiger Lake and Elkhart Lake generation onwards only */
{"PSF9", BIT(0)},
{"RES_66", BIT(1)},
{"RES_67", BIT(2)},
@ -692,7 +692,6 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
kfree(lpm_regs);
}
#if IS_ENABLED(CONFIG_DEBUG_FS)
static bool slps0_dbg_latch;
static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset)
@ -1133,15 +1132,6 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
&pmc_core_substate_l_sts_regs_fops);
}
}
#else
static inline void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
{
}
static inline void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
{
}
#endif /* CONFIG_DEBUG_FS */
static const struct x86_cpu_id intel_pmc_core_ids[] = {
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, &spt_reg_map),
@ -1156,7 +1146,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &icl_reg_map),
{}
};
@ -1260,13 +1250,11 @@ static int pmc_core_remove(struct platform_device *pdev)
return 0;
}
#ifdef CONFIG_PM_SLEEP
static bool warn_on_s0ix_failures;
module_param(warn_on_s0ix_failures, bool, 0644);
MODULE_PARM_DESC(warn_on_s0ix_failures, "Check and warn for S0ix failures");
static int pmc_core_suspend(struct device *dev)
static __maybe_unused int pmc_core_suspend(struct device *dev)
{
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
@ -1318,7 +1306,7 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev)
return false;
}
static int pmc_core_resume(struct device *dev)
static __maybe_unused int pmc_core_resume(struct device *dev)
{
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
@ -1348,8 +1336,6 @@ static int pmc_core_resume(struct device *dev)
return 0;
}
#endif
static const struct dev_pm_ops pmc_core_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(pmc_core_suspend, pmc_core_resume)
};

View file

@ -282,9 +282,7 @@ struct pmc_dev {
u32 base_addr;
void __iomem *regbase;
const struct pmc_reg_map *map;
#if IS_ENABLED(CONFIG_DEBUG_FS)
struct dentry *dbgfs_dir;
#endif /* CONFIG_DEBUG_FS */
int pmc_xram_read_bit;
struct mutex lock; /* generic mutex lock for PMC Core */

View file

@ -522,8 +522,8 @@ static int mshw0011_probe(struct i2c_client *client)
strlcpy(board_info.type, "MSHW0011-bat0", I2C_NAME_SIZE);
bat0 = i2c_acpi_new_device(dev, 1, &board_info);
if (!bat0)
return -ENOMEM;
if (IS_ERR(bat0))
return PTR_ERR(bat0);
data->bat0 = bat0;
i2c_set_clientdata(bat0, data);

View file

@ -9548,7 +9548,7 @@ static ssize_t tpacpi_battery_store(int what,
if (!battery_info.batteries[battery].start_support)
return -ENODEV;
/* valid values are [0, 99] */
if (value < 0 || value > 99)
if (value > 99)
return -EINVAL;
if (value > battery_info.batteries[battery].charge_stop)
return -EINVAL;

View file

@ -23,7 +23,7 @@ struct xiaomi_wmi {
unsigned int key_code;
};
int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
static int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
{
struct xiaomi_wmi *data;
@ -48,7 +48,7 @@ int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
return input_register_device(data->input_dev);
}
void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
static void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
{
struct xiaomi_wmi *data;