neuron: ch_haven: Store haven label for future use

Store the haven label so it can be used for other haven resources such
as attaching it to memparcels that are shared.

Change-Id: I90717bc7d158fb73ecb4442ede3c5d476f3d2045
Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
Chris Lew 2020-06-11 12:05:44 -07:00
parent 0fc1e59781
commit 6826400d8d
3 changed files with 16 additions and 12 deletions

View File

@ -365,6 +365,12 @@ static int channel_hh_probe(struct neuron_channel *cdev)
return -ENOMEM;
priv->dev = cdev;
ret = of_property_read_u32(node, "haven-label", &priv->haven_label);
if (ret) {
dev_err(dev, "failed to read label info %d\n", ret);
return ret;
}
ret = channel_hh_map_memory(priv, dev);
if (ret) {
dev_err(dev, "failed to map memory %d\n", ret);
@ -372,12 +378,7 @@ static int channel_hh_probe(struct neuron_channel *cdev)
}
/* Get outgoing haven doorbell information */
ret = of_property_read_u32(node, "haven-label", &dbl_label);
if (ret) {
dev_err(dev, "failed to read label info %d\n", ret);
goto fail_tx_dbl;
}
dbl_label = priv->haven_label;
priv->tx_dbl = hh_dbl_tx_register(dbl_label);
if (IS_ERR_OR_NULL(priv->tx_dbl)) {
ret = PTR_ERR(priv->tx_dbl);

View File

@ -350,17 +350,18 @@ static int channel_hh_probe(struct neuron_channel *cdev)
return -ENOMEM;
priv->dev = cdev;
ret = of_property_read_u32(node, "haven-label", &priv->haven_label);
if (ret) {
dev_err(dev, "failed to read label info %d\n", ret);
return ret;
}
ret = channel_hh_map_memory(priv, dev);
if (ret)
return ret;
/* Get outgoing haven doorbell information */
ret = of_property_read_u32(node, "haven-label", &dbl_label);
if (ret) {
dev_err(dev, "failed to read label info %d\n", ret);
goto fail_tx_dbl;
}
dbl_label = priv->haven_label;
priv->tx_dbl = hh_dbl_tx_register(dbl_label);
if (IS_ERR_OR_NULL(priv->tx_dbl)) {
ret = PTR_ERR(priv->tx_dbl);

View File

@ -78,6 +78,8 @@ struct neuron_mq_data_priv {
u32 interrupt_counter;
/* name of peer vm */
u32 peer_name;
/* label to get haven resources like doorbell and shm */
u32 haven_label;
/* haven tx doorbell descriptor */
void *tx_dbl;
/* haven rx doorbell descriptor */