[MTD] cfi_cmdset_0001: relax locking rules for multi hardware partition support

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by Nicolas Pitre and committed by Thomas Gleixner 8bc3b380 7ac571f8

+4 -6
+4 -6
drivers/mtd/chips/cfi_cmdset_0001.c
··· 4 * 5 * (C) 2000 Red Hat. GPL'd 6 * 7 - * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $ 8 * 9 * 10 * 10/10/2000 Nicolas Pitre <nico@cam.org> ··· 644 * 645 * - contension arbitration is handled in the owner's context. 646 * 647 - * The 'shared' struct can be read when its lock is taken. 648 - * However any writes to it can only be made when the current 649 - * owner's lock is also held. 650 */ 651 struct flchip_shared *shared = chip->priv; 652 struct flchip *contender; ··· 674 } 675 timeo = jiffies + HZ; 676 spin_lock(&shared->lock); 677 } 678 679 /* We now own it */ 680 shared->writing = chip; 681 if (mode == FL_ERASING) 682 shared->erasing = chip; 683 - if (contender && contender != chip) 684 - spin_unlock(contender->mutex); 685 spin_unlock(&shared->lock); 686 } 687
··· 4 * 5 * (C) 2000 Red Hat. GPL'd 6 * 7 + * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $ 8 * 9 * 10 * 10/10/2000 Nicolas Pitre <nico@cam.org> ··· 644 * 645 * - contension arbitration is handled in the owner's context. 646 * 647 + * The 'shared' struct can be read and/or written only when 648 + * its lock is taken. 649 */ 650 struct flchip_shared *shared = chip->priv; 651 struct flchip *contender; ··· 675 } 676 timeo = jiffies + HZ; 677 spin_lock(&shared->lock); 678 + spin_unlock(contender->mutex); 679 } 680 681 /* We now own it */ 682 shared->writing = chip; 683 if (mode == FL_ERASING) 684 shared->erasing = chip; 685 spin_unlock(&shared->lock); 686 } 687