All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vTPM: fix memory allocation flag for rtce buffer at kernel boot
@ 2015-10-08  0:11 Hon Ching(Vicky) Lo
  2015-10-08  0:11 ` [PATCH v2 1/3] vTPM: fix searching for the right vTPM node in device tree Hon Ching(Vicky) Lo
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hon Ching(Vicky) Lo @ 2015-10-08  0:11 UTC (permalink / raw)
  To: tpmdd-devel
  Cc: Peter Huewe, Ashley Lai, Mimi Zohar, Vicky Lo, linux-kernel,
	Hon Ching(Vicky) Lo

At ibm vtpm initialzation, tpm_ibmvtpm_probe() registers its interrupt
handler, ibmvtpm_interrupt, which calls ibmvtpm_crq_process to allocate
memory for rtce buffer.  The current code uses 'GFP_KERNEL' as the
type of kernel memory allocation, which resulted a warning at
kernel/lockdep.c.  This patch uses 'GFP_ATOMIC' instead so that the
allocation is high-priority and does not sleep.

Signed-off-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>
---
 drivers/char/tpm/tpm_ibmvtpm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index 27ebf95..3e6a226 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -491,7 +491,7 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
 			}
 			ibmvtpm->rtce_size = be16_to_cpu(crq->len);
 			ibmvtpm->rtce_buf = kmalloc(ibmvtpm->rtce_size,
-						    GFP_KERNEL);
+						    GFP_ATOMIC);
 			if (!ibmvtpm->rtce_buf) {
 				dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n");
 				return;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] vTPM: fix memory allocation flag for rtce buffer at kernel boot
@ 2015-10-08  0:10 Hon Ching(Vicky) Lo
  2015-10-08  0:10 ` [PATCH v2 2/3] vTPM: reformat event log to be byte-aligned Hon Ching(Vicky) Lo
  0 siblings, 1 reply; 9+ messages in thread
From: Hon Ching(Vicky) Lo @ 2015-10-08  0:10 UTC (permalink / raw)
  To: lo1; +Cc: linux-kernel, Hon Ching(Vicky) Lo

At ibm vtpm initialzation, tpm_ibmvtpm_probe() registers its interrupt
handler, ibmvtpm_interrupt, which calls ibmvtpm_crq_process to allocate
memory for rtce buffer.  The current code uses 'GFP_KERNEL' as the
type of kernel memory allocation, which resulted a warning at
kernel/lockdep.c.  This patch uses 'GFP_ATOMIC' instead so that the
allocation is high-priority and does not sleep.

Signed-off-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com>
---
 drivers/char/tpm/tpm_ibmvtpm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index 27ebf95..3e6a226 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -491,7 +491,7 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
 			}
 			ibmvtpm->rtce_size = be16_to_cpu(crq->len);
 			ibmvtpm->rtce_buf = kmalloc(ibmvtpm->rtce_size,
-						    GFP_KERNEL);
+						    GFP_ATOMIC);
 			if (!ibmvtpm->rtce_buf) {
 				dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n");
 				return;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-14 21:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08  0:11 [PATCH] vTPM: fix memory allocation flag for rtce buffer at kernel boot Hon Ching(Vicky) Lo
2015-10-08  0:11 ` [PATCH v2 1/3] vTPM: fix searching for the right vTPM node in device tree Hon Ching(Vicky) Lo
2015-10-08  0:11 ` [PATCH v2 2/3] vTPM: reformat event log to be byte-aligned Hon Ching(Vicky) Lo
2015-10-13 18:43   ` Ashley Lai
2015-10-13 21:27     ` Hon Ching(Vicky) Lo
2015-10-14 21:15       ` Ashley Lai
2015-10-14 21:20         ` Ashley Lai
2015-10-08  0:11 ` [PATCH v2 3/3] vTPM: get the buffer allocated for event log instead of the actual log Hon Ching(Vicky) Lo
  -- strict thread matches above, loose matches on Subject: below --
2015-10-08  0:10 [PATCH] vTPM: fix memory allocation flag for rtce buffer at kernel boot Hon Ching(Vicky) Lo
2015-10-08  0:10 ` [PATCH v2 2/3] vTPM: reformat event log to be byte-aligned Hon Ching(Vicky) Lo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.