Skip to content

Commit fb6379f

Browse files
amboarcminyard
authored andcommitted
ipmi: kcs_bmc: Enable IBF on open
This way devices don't get delivered IRQs when no-one is interested. Signed-off-by: Andrew Jeffery <[email protected]> Message-Id: <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 28651e6 commit fb6379f

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

drivers/char/ipmi/kcs_bmc.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,12 @@ EXPORT_SYMBOL(kcs_bmc_update_status);
5555
irqreturn_t kcs_bmc_handle_event(struct kcs_bmc_device *kcs_bmc)
5656
{
5757
struct kcs_bmc_client *client;
58-
irqreturn_t rc;
58+
irqreturn_t rc = IRQ_NONE;
5959

6060
spin_lock(&kcs_bmc->lock);
6161
client = kcs_bmc->client;
62-
if (client) {
62+
if (client)
6363
rc = client->ops->event(client);
64-
} else {
65-
u8 status;
66-
67-
status = kcs_bmc_read_status(kcs_bmc);
68-
if (status & KCS_BMC_STR_IBF) {
69-
/* Ack the event by reading the data */
70-
kcs_bmc_read_data(kcs_bmc);
71-
rc = IRQ_HANDLED;
72-
} else {
73-
rc = IRQ_NONE;
74-
}
75-
}
7664
spin_unlock(&kcs_bmc->lock);
7765

7866
return rc;
@@ -87,7 +75,10 @@ int kcs_bmc_enable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client
8775
if (kcs_bmc->client) {
8876
rc = -EBUSY;
8977
} else {
78+
u8 mask = KCS_BMC_EVENT_TYPE_IBF;
79+
9080
kcs_bmc->client = client;
81+
kcs_bmc_update_event_mask(kcs_bmc, mask, mask);
9182
rc = 0;
9283
}
9384
spin_unlock_irq(&kcs_bmc->lock);
@@ -99,8 +90,12 @@ EXPORT_SYMBOL(kcs_bmc_enable_device);
9990
void kcs_bmc_disable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client *client)
10091
{
10192
spin_lock_irq(&kcs_bmc->lock);
102-
if (client == kcs_bmc->client)
93+
if (client == kcs_bmc->client) {
94+
u8 mask = KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE;
95+
96+
kcs_bmc_update_event_mask(kcs_bmc, mask, 0);
10397
kcs_bmc->client = NULL;
98+
}
10499
spin_unlock_irq(&kcs_bmc->lock);
105100
}
106101
EXPORT_SYMBOL(kcs_bmc_disable_device);

drivers/char/ipmi/kcs_bmc_aspeed.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,7 @@ static int aspeed_kcs_probe(struct platform_device *pdev)
416416

417417
platform_set_drvdata(pdev, priv);
418418

419-
aspeed_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE),
420-
KCS_BMC_EVENT_TYPE_IBF);
419+
aspeed_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE), 0);
421420
aspeed_kcs_enable_channel(kcs_bmc, true);
422421

423422
rc = kcs_bmc_add_device(&priv->kcs_bmc);

drivers/char/ipmi/kcs_bmc_npcm7xx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ static int npcm7xx_kcs_probe(struct platform_device *pdev)
202202
if (rc)
203203
return rc;
204204

205-
npcm7xx_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE),
206-
KCS_BMC_EVENT_TYPE_IBF);
205+
npcm7xx_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE), 0);
207206
npcm7xx_kcs_enable_channel(kcs_bmc, true);
208207

209208
rc = kcs_bmc_add_device(kcs_bmc);

0 commit comments

Comments
 (0)