Loading drivers/soc/qcom/smem.c +16 −5 Original line number Diff line number Diff line Loading @@ -306,6 +306,7 @@ static void *__smem_get_entry_nonsecure(unsigned id, unsigned *size, int use_spinlocks = spinlocks_initialized && use_rspinlock; void *ret = 0; unsigned long flags = 0; int rc; if (!skip_init_check && !smem_initialized_check()) return ret; Loading @@ -313,8 +314,12 @@ static void *__smem_get_entry_nonsecure(unsigned id, unsigned *size, if (id >= SMEM_NUM_ITEMS) return ret; if (use_spinlocks) remote_spin_lock_irqsave(&remote_spinlock, flags); if (use_spinlocks) { do { rc = remote_spin_trylock_irqsave(&remote_spinlock, flags); } while (!rc); } /* toc is in device memory and cannot be speculatively accessed */ if (toc[id].allocated) { phys_addr_t phys_base; Loading Loading @@ -394,8 +399,12 @@ static void *__smem_get_entry_secure(unsigned id, return NULL; } } if (use_rspinlock) remote_spin_lock_irqsave(&remote_spinlock, lflags); if (use_rspinlock) { do { rc = remote_spin_trylock_irqsave(&remote_spinlock, lflags); } while (!rc); } if (hdr->identifier != SMEM_PART_HDR_IDENTIFIER) { LOG_ERR( "%s: SMEM corruption detected. Partition %d to %d at %p\n", Loading Loading @@ -729,7 +738,9 @@ void *smem_alloc(unsigned id, unsigned size_in, unsigned to_proc, } a_size_in = ALIGN(size_in, 8); remote_spin_lock_irqsave(&remote_spinlock, lflags); do { rc = remote_spin_trylock_irqsave(&remote_spinlock, lflags); } while (!rc); ret = __smem_get_entry_secure(id, &size_out, to_proc, flags, true, false); Loading Loading
drivers/soc/qcom/smem.c +16 −5 Original line number Diff line number Diff line Loading @@ -306,6 +306,7 @@ static void *__smem_get_entry_nonsecure(unsigned id, unsigned *size, int use_spinlocks = spinlocks_initialized && use_rspinlock; void *ret = 0; unsigned long flags = 0; int rc; if (!skip_init_check && !smem_initialized_check()) return ret; Loading @@ -313,8 +314,12 @@ static void *__smem_get_entry_nonsecure(unsigned id, unsigned *size, if (id >= SMEM_NUM_ITEMS) return ret; if (use_spinlocks) remote_spin_lock_irqsave(&remote_spinlock, flags); if (use_spinlocks) { do { rc = remote_spin_trylock_irqsave(&remote_spinlock, flags); } while (!rc); } /* toc is in device memory and cannot be speculatively accessed */ if (toc[id].allocated) { phys_addr_t phys_base; Loading Loading @@ -394,8 +399,12 @@ static void *__smem_get_entry_secure(unsigned id, return NULL; } } if (use_rspinlock) remote_spin_lock_irqsave(&remote_spinlock, lflags); if (use_rspinlock) { do { rc = remote_spin_trylock_irqsave(&remote_spinlock, lflags); } while (!rc); } if (hdr->identifier != SMEM_PART_HDR_IDENTIFIER) { LOG_ERR( "%s: SMEM corruption detected. Partition %d to %d at %p\n", Loading Loading @@ -729,7 +738,9 @@ void *smem_alloc(unsigned id, unsigned size_in, unsigned to_proc, } a_size_in = ALIGN(size_in, 8); remote_spin_lock_irqsave(&remote_spinlock, lflags); do { rc = remote_spin_trylock_irqsave(&remote_spinlock, lflags); } while (!rc); ret = __smem_get_entry_secure(id, &size_out, to_proc, flags, true, false); Loading