Skip to content

Commit

Permalink
powerpc/powernv: Add new opal message type
Browse files Browse the repository at this point in the history
We have OPAL_MSG_PRD message type to pass prd related messages from
OPAL to `opal-prd`. It can handle messages upto 64 bytes. We have a
requirement to send bigger than 64 bytes of data from OPAL to
`opal-prd`. Lets add new message type (OPAL_MSG_PRD2) to pass bigger
data.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[mpe: Make the error string clear that it's the PRD2 event that failed]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190826065701.8853-2-hegdevasant@linux.vnet.ibm.com
  • Loading branch information
Vasant Hegde authored and mpe committed Sep 11, 2019
1 parent 2be1d5d commit 587164c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/opal-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ enum opal_msg_type {
OPAL_MSG_DPO = 5,
OPAL_MSG_PRD = 6,
OPAL_MSG_OCC = 7,
OPAL_MSG_PRD2 = 8,
OPAL_MSG_TYPE_MAX,
};

Expand Down
8 changes: 7 additions & 1 deletion arch/powerpc/platforms/powernv/opal-prd.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static int opal_prd_msg_notifier(struct notifier_block *nb,
int msg_size, item_size;
unsigned long flags;

if (msg_type != OPAL_MSG_PRD)
if (msg_type != OPAL_MSG_PRD && msg_type != OPAL_MSG_PRD2)
return 0;

/* Calculate total size of the message and item we need to store. The
Expand Down Expand Up @@ -393,6 +393,12 @@ static int opal_prd_probe(struct platform_device *pdev)
return rc;
}

rc = opal_message_notifier_register(OPAL_MSG_PRD2, &opal_prd_event_nb);
if (rc) {
pr_err("Couldn't register PRD2 event notifier\n");
return rc;
}

rc = misc_register(&opal_prd_dev);
if (rc) {
pr_err("failed to register miscdev\n");
Expand Down

0 comments on commit 587164c

Please sign in to comment.