Lines Matching full:shared

51 	struct flchip_shared *shared;  in lpddr_cmdset()  local
83 shared = kmalloc(sizeof(struct flchip_shared) * lpddr->numchips, in lpddr_cmdset()
85 if (!shared) { in lpddr_cmdset()
94 shared[i].writing = shared[i].erasing = NULL; in lpddr_cmdset()
95 mutex_init(&shared[i].lock); in lpddr_cmdset()
100 chip->priv = &shared[i]; in lpddr_cmdset()
202 * - any write operation must own shared->writing. in get_chip()
204 * - any erase operation must own _both_ shared->writing and in get_chip()
205 * shared->erasing. in get_chip()
209 * The 'shared' struct can be read and/or written only when in get_chip()
212 struct flchip_shared *shared = chip->priv; in get_chip() local
214 mutex_lock(&shared->lock); in get_chip()
215 contender = shared->writing; in get_chip()
227 mutex_unlock(&shared->lock); in get_chip()
242 mutex_lock(&shared->lock); in get_chip()
256 if (mode == FL_ERASING && shared->erasing in get_chip()
257 && shared->erasing->oldstate == FL_ERASING) { in get_chip()
258 mutex_unlock(&shared->lock); in get_chip()
269 shared->writing = chip; in get_chip()
271 shared->erasing = chip; in get_chip()
272 mutex_unlock(&shared->lock); in get_chip()
339 struct flchip_shared *shared = chip->priv; in put_chip() local
340 mutex_lock(&shared->lock); in put_chip()
341 if (shared->writing == chip && chip->oldstate == FL_READY) { in put_chip()
343 shared->writing = shared->erasing; in put_chip()
344 if (shared->writing && shared->writing != chip) { in put_chip()
346 struct flchip *loaner = shared->writing; in put_chip()
348 mutex_unlock(&shared->lock); in put_chip()
356 shared->erasing = NULL; in put_chip()
357 shared->writing = NULL; in put_chip()
358 } else if (shared->erasing == chip && shared->writing != chip) { in put_chip()
366 mutex_unlock(&shared->lock); in put_chip()
370 mutex_unlock(&shared->lock); in put_chip()