diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2023-09-24 19:10:05 -0700 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2023-09-24 19:10:05 -0700 |
commit | 618888853d9b4ba1ca92a4cff60651e559fa9e46 (patch) | |
tree | 9672ce54e5069bd2d510ff594f45f1d744e4933e | |
parent | 6e354f04cd43d280617bfc0d6b12d54f4d30361c (diff) | |
parent | dc71a9f4dbf2084d29936fb04f31422d0a1ae794 (diff) | |
download | lwis-618888853d9b4ba1ca92a4cff60651e559fa9e46.tar.gz |
Merge android14-gs-pixel-5.15-udc-qpr1 into android14-gs-pixel-5.15-24Q1android-u-qpr2-beta-1_r0.7
SBMerger: 558810260
Change-Id: I887a7a9d8bbc883976a73c911f7493986f62fb48
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r-- | lwis_debug.c | 6 | ||||
-rw-r--r-- | lwis_device.c | 1 | ||||
-rw-r--r-- | lwis_device.h | 2 | ||||
-rw-r--r-- | lwis_transaction.c | 9 |
4 files changed, 11 insertions, 7 deletions
diff --git a/lwis_debug.c b/lwis_debug.c index 3678dc5..8fb0b88 100644 --- a/lwis_debug.c +++ b/lwis_debug.c @@ -160,7 +160,7 @@ static void list_enrolled_buffers(struct lwis_client *client, char *k_buf, size_ hash_for_each (client->enrolled_buffers, i, enrollment_list, node) { list_for_each (it_enrollment, &enrollment_list->list) { buffer = list_entry(it_enrollment, struct lwis_enrolled_buffer, list_node); - if (IS_ERR_OR_NULL((void *)buffer->info.dma_vaddr)) { + if (IS_ERR_VALUE(buffer->info.dma_vaddr)) { scnprintf(tmp_buf, sizeof(tmp_buf), "Enrolled buffers: dma_vaddr %pad is invalid\n", &buffer->info.dma_vaddr); @@ -303,15 +303,15 @@ static int generate_buffer_info(struct lwis_device *lwis_dev, char *buffer, size return 0; } - spin_lock_irqsave(&lwis_dev->lock, flags); list_for_each_entry (client, &lwis_dev->clients, node) { scnprintf(tmp_buf, sizeof(tmp_buf), "Client %d:\n", idx); strlcat(buffer, tmp_buf, buffer_size); + spin_lock_irqsave(&client->buffer_lock, flags); list_allocated_buffers(client, buffer, buffer_size); list_enrolled_buffers(client, buffer, buffer_size); + spin_unlock_irqrestore(&client->buffer_lock, flags); idx++; } - spin_unlock_irqrestore(&lwis_dev->lock, flags); return 0; } diff --git a/lwis_device.c b/lwis_device.c index 4196e29..e22f174 100644 --- a/lwis_device.c +++ b/lwis_device.c @@ -123,6 +123,7 @@ static int lwis_open(struct inode *node, struct file *fp) spin_lock_init(&lwis_client->periodic_io_lock); spin_lock_init(&lwis_client->event_lock); spin_lock_init(&lwis_client->flush_lock); + spin_lock_init(&lwis_client->buffer_lock); /* Empty hash table for client event states */ hash_init(lwis_client->event_states); diff --git a/lwis_device.h b/lwis_device.h index 3a3cf61..7d68991 100644 --- a/lwis_device.h +++ b/lwis_device.h @@ -349,6 +349,8 @@ struct lwis_client { enum lwis_client_flush_state flush_state; /* Lock to guard client's flush state changes */ spinlock_t flush_lock; + /* Lock to guard client's buffer changes */ + spinlock_t buffer_lock; }; /* diff --git a/lwis_transaction.c b/lwis_transaction.c index 0e99099..f19c53c 100644 --- a/lwis_transaction.c +++ b/lwis_transaction.c @@ -480,6 +480,7 @@ static void cancel_transaction(struct lwis_device *lwis_dev, struct lwis_transac void lwis_process_transactions_in_queue(struct lwis_client *client) { unsigned long flags; + unsigned long flush_flags; struct list_head *it_tran, *it_tran_tmp; struct list_head pending_events; struct list_head pending_fences; @@ -504,7 +505,7 @@ void lwis_process_transactions_in_queue(struct lwis_client *client) "Client is not ready to process transactions"); } spin_unlock_irqrestore(&client->transaction_lock, flags); - spin_lock_irqsave(&client->flush_lock, flags); + spin_lock_irqsave(&client->flush_lock, flush_flags); if (client->flush_state == NOT_FLUSHING) { if (i2c_bus_manager) { kthread_queue_work(&i2c_bus_manager->i2c_bus_worker, @@ -514,7 +515,7 @@ void lwis_process_transactions_in_queue(struct lwis_client *client) &client->transaction_work); } } - spin_unlock_irqrestore(&client->flush_lock, flags); + spin_unlock_irqrestore(&client->flush_lock, flush_flags); return; } @@ -554,7 +555,7 @@ void lwis_process_transactions_in_queue(struct lwis_client *client) * If the client is flushing, cancel the remaining transaction * and delete from the process queue node. */ - spin_lock_irqsave(&client->flush_lock, flags); + spin_lock_irqsave(&client->flush_lock, flush_flags); if (client->flush_state == NOT_FLUSHING) { if (lwis_transaction_debug) { dev_info( @@ -580,7 +581,7 @@ void lwis_process_transactions_in_queue(struct lwis_client *client) transaction->resp->error_code, &pending_events, &pending_fences, false); } - spin_unlock_irqrestore(&client->flush_lock, flags); + spin_unlock_irqrestore(&client->flush_lock, flush_flags); break; } } |