Lines Matching full:shared

38 	struct flchip_shared *shared;  in lpddr_cmdset()  local
68 shared = kmalloc_array(lpddr->numchips, sizeof(struct flchip_shared), in lpddr_cmdset()
70 if (!shared) { in lpddr_cmdset()
78 shared[i].writing = shared[i].erasing = NULL; in lpddr_cmdset()
79 mutex_init(&shared[i].lock); in lpddr_cmdset()
84 chip->priv = &shared[i]; in lpddr_cmdset()
214 * - any write operation must own shared->writing. in get_chip()
216 * - any erase operation must own _both_ shared->writing and in get_chip()
217 * shared->erasing. in get_chip()
221 * The 'shared' struct can be read and/or written only when in get_chip()
224 struct flchip_shared *shared = chip->priv; in get_chip() local
226 mutex_lock(&shared->lock); in get_chip()
227 contender = shared->writing; in get_chip()
239 mutex_unlock(&shared->lock); in get_chip()
254 mutex_lock(&shared->lock); in get_chip()
268 if (mode == FL_ERASING && shared->erasing in get_chip()
269 && shared->erasing->oldstate == FL_ERASING) { in get_chip()
270 mutex_unlock(&shared->lock); in get_chip()
281 shared->writing = chip; in get_chip()
283 shared->erasing = chip; in get_chip()
284 mutex_unlock(&shared->lock); in get_chip()
351 struct flchip_shared *shared = chip->priv; in put_chip() local
352 mutex_lock(&shared->lock); in put_chip()
353 if (shared->writing == chip && chip->oldstate == FL_READY) { in put_chip()
355 shared->writing = shared->erasing; in put_chip()
356 if (shared->writing && shared->writing != chip) { in put_chip()
358 struct flchip *loaner = shared->writing; in put_chip()
360 mutex_unlock(&shared->lock); in put_chip()
368 shared->erasing = NULL; in put_chip()
369 shared->writing = NULL; in put_chip()
370 } else if (shared->erasing == chip && shared->writing != chip) { in put_chip()
378 mutex_unlock(&shared->lock); in put_chip()
382 mutex_unlock(&shared->lock); in put_chip()