From dc06543ec3d0c1a9d9fdaf050a30c71e2eb64e9c Mon Sep 17 00:00:00 2001 From: Seiji Aguchi Date: Fri, 11 Jan 2013 18:10:05 +0000 Subject: [PATCH] --- yaml --- r: 352983 b: refs/heads/master c: e59310adf5eebce108f78b6c47bb330aae2e1666 h: refs/heads/master i: 352981: 4fd0f4609b774924d31328feb29931c1f12c0aad 352979: 0e7bcde455d21d1475f97200de43ea36f4211cd7 352975: a27f57ca297ca47fb62b65086c5bbe822c462076 v: v3 --- [refs] | 2 +- trunk/drivers/firmware/efivars.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 80811ed0742b..6e1bab55c6f5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9f244e9cfd70c7c0f82d3c92ce772ab2a92d9f64 +refs/heads/master: e59310adf5eebce108f78b6c47bb330aae2e1666 diff --git a/trunk/drivers/firmware/efivars.c b/trunk/drivers/firmware/efivars.c index 7b1c37497c9a..ef5070d86f88 100644 --- a/trunk/drivers/firmware/efivars.c +++ b/trunk/drivers/firmware/efivars.c @@ -1209,7 +1209,16 @@ static int efi_pstore_write(enum pstore_type_id type, u64 storage_space, remaining_space, max_variable_size; efi_status_t status = EFI_NOT_FOUND; - spin_lock(&efivars->lock); + if (pstore_cannot_block_path(reason)) { + /* + * If the lock is taken by another cpu in non-blocking path, + * this driver returns without entering firmware to avoid + * hanging up. + */ + if (!spin_trylock(&efivars->lock)) + return -EBUSY; + } else + spin_lock(&efivars->lock); /* * Check if there is a space enough to log.