|
@@ -65,6 +65,7 @@
|
|
#include <linux/mailbox_controller.h>
|
|
#include <linux/mailbox_controller.h>
|
|
#include <linux/mailbox_client.h>
|
|
#include <linux/mailbox_client.h>
|
|
#include <linux/io-64-nonatomic-lo-hi.h>
|
|
#include <linux/io-64-nonatomic-lo-hi.h>
|
|
|
|
+#include <acpi/pcc.h>
|
|
|
|
|
|
#include "mailbox.h"
|
|
#include "mailbox.h"
|
|
|
|
|
|
@@ -267,6 +268,8 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
|
|
if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
|
|
if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
|
|
chan->txdone_method |= TXDONE_BY_ACK;
|
|
chan->txdone_method |= TXDONE_BY_ACK;
|
|
|
|
|
|
|
|
+ spin_unlock_irqrestore(&chan->lock, flags);
|
|
|
|
+
|
|
if (pcc_doorbell_irq[subspace_id] > 0) {
|
|
if (pcc_doorbell_irq[subspace_id] > 0) {
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
@@ -275,12 +278,11 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
|
|
if (unlikely(rc)) {
|
|
if (unlikely(rc)) {
|
|
dev_err(dev, "failed to register PCC interrupt %d\n",
|
|
dev_err(dev, "failed to register PCC interrupt %d\n",
|
|
pcc_doorbell_irq[subspace_id]);
|
|
pcc_doorbell_irq[subspace_id]);
|
|
|
|
+ pcc_mbox_free_channel(chan);
|
|
chan = ERR_PTR(rc);
|
|
chan = ERR_PTR(rc);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- spin_unlock_irqrestore(&chan->lock, flags);
|
|
|
|
-
|
|
|
|
return chan;
|
|
return chan;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
|
|
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
|
|
@@ -304,20 +306,19 @@ void pcc_mbox_free_channel(struct mbox_chan *chan)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (pcc_doorbell_irq[id] > 0)
|
|
|
|
+ devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
|
|
|
|
+
|
|
spin_lock_irqsave(&chan->lock, flags);
|
|
spin_lock_irqsave(&chan->lock, flags);
|
|
chan->cl = NULL;
|
|
chan->cl = NULL;
|
|
chan->active_req = NULL;
|
|
chan->active_req = NULL;
|
|
if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
|
|
if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
|
|
chan->txdone_method = TXDONE_BY_POLL;
|
|
chan->txdone_method = TXDONE_BY_POLL;
|
|
|
|
|
|
- if (pcc_doorbell_irq[id] > 0)
|
|
|
|
- devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
|
|
|
|
-
|
|
|
|
spin_unlock_irqrestore(&chan->lock, flags);
|
|
spin_unlock_irqrestore(&chan->lock, flags);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
|
|
EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* pcc_send_data - Called from Mailbox Controller code. Used
|
|
* pcc_send_data - Called from Mailbox Controller code. Used
|
|
* here only to ring the channel doorbell. The PCC client
|
|
* here only to ring the channel doorbell. The PCC client
|