From ed9b570c1a29a1b1083f3b69ac2c9a3ea3fed8e9 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 23 Nov 2005 22:07:56 +0000 Subject: [PATCH] --- yaml --- r: 14769 b: refs/heads/master c: 8bc3b3804a6123e634be26359558aa998102506a h: refs/heads/master i: 14767: b0bc287b32f7202f10d06106bcae1df785bc9fb0 v: v3 --- [refs] | 2 +- trunk/drivers/mtd/chips/cfi_cmdset_0001.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index ce06e65f9f8b..98fc25d73659 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7ac571f8d0f843fb818f7c70ec77784545e91bc4 +refs/heads/master: 8bc3b3804a6123e634be26359558aa998102506a diff --git a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c index 143f01a4c170..69c04945591f 100644 --- a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd * - * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $ + * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $ * * * 10/10/2000 Nicolas Pitre @@ -644,9 +644,8 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr * * - contension arbitration is handled in the owner's context. * - * The 'shared' struct can be read when its lock is taken. - * However any writes to it can only be made when the current - * owner's lock is also held. + * The 'shared' struct can be read and/or written only when + * its lock is taken. */ struct flchip_shared *shared = chip->priv; struct flchip *contender; @@ -675,14 +674,13 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr } timeo = jiffies + HZ; spin_lock(&shared->lock); + spin_unlock(contender->mutex); } /* We now own it */ shared->writing = chip; if (mode == FL_ERASING) shared->erasing = chip; - if (contender && contender != chip) - spin_unlock(contender->mutex); spin_unlock(&shared->lock); }