Skip to contentSkip to conversation

dcdbas: don't limit SMIs to cpu 0

PATCH New Juergen Gross 1 participant 1 message Jan 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dcdbas: don't limit SMIs to cpu 0

SMIs in the Dell dcdbas firmware driver don't need to be raised on cpu 0. So remove the binding of the current thread to cpu 0 before doing the SMI.

---
 drivers/firmware/dcdbas.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/firmware/dcdbas.c +1 -20
index 829eec8..3cde963 100644
@@ -245,28 +245,12 @@ static ssize_t host_control_on_shutdown_store(struct device *dev,
  */
 int dcdbas_smi_request(struct smi_cmd *smi_cmd)
 {
-	cpumask_var_t old_mask;
-	int ret = 0;
-
 	if (smi_cmd->magic != SMI_CMD_MAGIC) {
 		dev_info(&dcdbas_pdev->dev, "%s: invalid magic value\n",
 			 __func__);
 		return -EBADR;
 	}
 
-	/* SMI requires CPU 0 */
-	if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
-		return -ENOMEM;
-
-	cpumask_copy(old_mask, &current->cpus_allowed);
-	set_cpus_allowed_ptr(current, cpumask_of(0));
-	if (smp_processor_id() != 0) {
-		dev_dbg(&dcdbas_pdev->dev, "%s: failed to get CPU 0\n",
-			__func__);
-		ret = -EBUSY;
-		goto out;
-	}
-
 	/* generate SMI */
 	/* inb to force posted write through and make SMI happen now */
 	asm volatile (
@@ -280,10 +264,7 @@ int dcdbas_smi_request(struct smi_cmd *smi_cmd)
 		: "memory"
 	);
 
-out:
-	set_cpus_allowed_ptr(current, old_mask);
-	free_cpumask_var(old_mask);
-	return ret;
+	return 0;
 }
 
 /**
Signature · 1 line
2.6.2