aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/mellanox
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-14 16:30:30 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-14 16:30:30 +0900
commitf3b5020e168a383496e3096b754a1ad17f09df36 (patch)
treeabb453332c810fbec5abb7350b204b41991f5597 /drivers/platform/mellanox
parentMerge tag 'pwm/for-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm (diff)
parentplatform/x86: silead_dmi: Add entry for Chuwi Hi8 tablet touchscreen (diff)
downloadlinux-dev-f3b5020e168a383496e3096b754a1ad17f09df36.tar.xz
linux-dev-f3b5020e168a383496e3096b754a1ad17f09df36.zip
Merge tag 'platform-drivers-x86-v4.18-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Darren Hart: "Several incremental improvements including new keycodes, new models, new quirks, and related documentation. Adds LED platform driver activation for Mellanox systems. Some minor optimizations and cleanups. Includes several bug fixes, message silencing, mostly minor Automated summary: acer-wmi: - add another KEY_POWER keycode apple-gmux: - fix gmux_get_client_id()'s return type asus-laptop: - Simplify getting .drvdata asus-wireless: - Fix format specifier dell-laptop: - Fix keyboard backlight timeout on XPS 13 9370 dell-smbios: - Match on www.dell.com in OEM strings too dell-wmi: - Ignore new rfkill and fn-lock events - Set correct keycode for Fn + left arrow fujitsu-laptop: - Simplify soft key handling ideapad-laptop: - Add E42-80 to no_hw_rfkill - Add fn-lock setting - Add MIIX 720-12IKB to no_hw_rfkill lib/string_helpers: - Add missed declaration of struct task_struct intel_scu_ipc: - Replace mdelay with usleep_range in intel_scu_ipc_i2c_cntrl mlx-platform: - Add LED platform driver activation platform/mellanox: - Add new ODM system types to mlx-platform - mlxreg-hotplug: add extra cycle for hotplug work queue - mlxreg-hotplug: Document fixes for hotplug private data platform_data/mlxreg: - Document fixes for hotplug device silead_dmi: - Add entry for Chuwi Hi8 tablet touchscreen - Add touchscreen info for the Onda V891w tablet - Add info for the PoV mobii TAB-P800W (v2.0) - Add touchscreen info for the Jumper EZpad 6 Pro thinkpad_acpi: - silence false-positive-prone pr_warn - do not report thermal sensor state for tablet mode switch - silence HKEY 0x6032, 0x60f0, 0x6030" * tag 'platform-drivers-x86-v4.18-1' of git://git.infradead.org/linux-platform-drivers-x86: (30 commits) platform/x86: silead_dmi: Add entry for Chuwi Hi8 tablet touchscreen platform/x86: dell-laptop: Fix keyboard backlight timeout on XPS 13 9370 platform/x86: dell-wmi: Ignore new rfkill and fn-lock events platform/x86: mlx-platform: Add LED platform driver activation platform/mellanox: Add new ODM system types to mlx-platform platform/mellanox: mlxreg-hotplug: add extra cycle for hotplug work queue platform/x86: ideapad-laptop: Add E42-80 to no_hw_rfkill platform/x86: silead_dmi: Add touchscreen info for the Onda V891w tablet platform/x86: silead_dmi: Add info for the PoV mobii TAB-P800W (v2.0) platform/x86: silead_dmi: Add touchscreen info for the Jumper EZpad 6 Pro platform/x86: asus-wireless: Fix format specifier platform/x86: asus-wmi: Fix NULL pointer dereference platform/x86: dell-wmi: Set correct keycode for Fn + left arrow platform/x86: acer-wmi: add another KEY_POWER keycode platform/x86: ideapad-laptop: Add fn-lock setting platform/x86: ideapad-laptop: Add MIIX 720-12IKB to no_hw_rfkill lib/string_helpers: Add missed declaration of struct task_struct platform/x86: DELL_WMI use depends on instead of select for DELL_SMBIOS platform/mellanox: mlxreg-hotplug: Document fixes for hotplug private data platform_data/mlxreg: Document fixes for hotplug device ...
Diffstat (limited to 'drivers/platform/mellanox')
-rw-r--r--drivers/platform/mellanox/mlxreg-hotplug.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c
index 36a41ff506f0..ac97aa020db3 100644
--- a/drivers/platform/mellanox/mlxreg-hotplug.c
+++ b/drivers/platform/mellanox/mlxreg-hotplug.c
@@ -55,13 +55,16 @@
#define MLXREG_HOTPLUG_RST_CNTR 3
#define MLXREG_HOTPLUG_ATTRS_MAX 24
+#define MLXREG_HOTPLUG_NOT_ASSERT 3
/**
* struct mlxreg_hotplug_priv_data - platform private data:
* @irq: platform device interrupt number;
+ * @dev: basic device;
* @pdev: platform device;
* @plat: platform data;
- * @dwork: delayed work template;
+ * @regmap: register map handle;
+ * @dwork_irq: delayed work template;
* @lock: spin lock;
* @hwmon: hwmon device;
* @mlxreg_hotplug_attr: sysfs attributes array;
@@ -71,6 +74,8 @@
* @cell: location of top aggregation interrupt register;
* @mask: top aggregation interrupt common mask;
* @aggr_cache: last value of aggregation register status;
+ * @after_probe: flag indication probing completion;
+ * @not_asserted: number of entries in workqueue with no signal assertion;
*/
struct mlxreg_hotplug_priv_data {
int irq;
@@ -79,7 +84,6 @@ struct mlxreg_hotplug_priv_data {
struct mlxreg_hotplug_platform_data *plat;
struct regmap *regmap;
struct delayed_work dwork_irq;
- struct delayed_work dwork;
spinlock_t lock; /* sync with interrupt */
struct device *hwmon;
struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_MAX + 1];
@@ -91,6 +95,7 @@ struct mlxreg_hotplug_priv_data {
u32 mask;
u32 aggr_cache;
bool after_probe;
+ u8 not_asserted;
};
static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
@@ -409,6 +414,18 @@ static void mlxreg_hotplug_work_handler(struct work_struct *work)
aggr_asserted = priv->aggr_cache ^ regval;
priv->aggr_cache = regval;
+ /*
+ * Handler is invoked, but no assertion is detected at top aggregation
+ * status level. Set aggr_asserted to mask value to allow handler extra
+ * run over all relevant signals to recover any missed signal.
+ */
+ if (priv->not_asserted == MLXREG_HOTPLUG_NOT_ASSERT) {
+ priv->not_asserted = 0;
+ aggr_asserted = pdata->mask;
+ }
+ if (!aggr_asserted)
+ goto unmask_event;
+
/* Handle topology and health configuration changes. */
for (i = 0; i < pdata->counter; i++, item++) {
if (aggr_asserted & item->aggr_mask) {
@@ -419,27 +436,26 @@ static void mlxreg_hotplug_work_handler(struct work_struct *work)
}
}
- if (aggr_asserted) {
- spin_lock_irqsave(&priv->lock, flags);
+ spin_lock_irqsave(&priv->lock, flags);
- /*
- * It is possible, that some signals have been inserted, while
- * interrupt has been masked by mlxreg_hotplug_work_handler.
- * In this case such signals will be missed. In order to handle
- * these signals delayed work is canceled and work task
- * re-scheduled for immediate execution. It allows to handle
- * missed signals, if any. In other case work handler just
- * validates that no new signals have been received during
- * masking.
- */
- cancel_delayed_work(&priv->dwork_irq);
- schedule_delayed_work(&priv->dwork_irq, 0);
+ /*
+ * It is possible, that some signals have been inserted, while
+ * interrupt has been masked by mlxreg_hotplug_work_handler. In this
+ * case such signals will be missed. In order to handle these signals
+ * delayed work is canceled and work task re-scheduled for immediate
+ * execution. It allows to handle missed signals, if any. In other case
+ * work handler just validates that no new signals have been received
+ * during masking.
+ */
+ cancel_delayed_work(&priv->dwork_irq);
+ schedule_delayed_work(&priv->dwork_irq, 0);
- spin_unlock_irqrestore(&priv->lock, flags);
+ spin_unlock_irqrestore(&priv->lock, flags);
- return;
- }
+ return;
+unmask_event:
+ priv->not_asserted++;
/* Unmask aggregation event (no need acknowledge). */
ret = regmap_write(priv->regmap, pdata->cell +
MLXREG_HOTPLUG_AGGR_MASK_OFF, pdata->mask);