* [PATCH] Bluetooth: hci_vhci: Report write readiness with queued input
@ 2026-11-12 8:26 raoxu
2026-11-12 13:35 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: raoxu @ 2026-11-12 8:26 UTC (permalink / raw)
To: marcel; +Cc: luiz.dentz, linux-bluetooth, linux-kernel, raoxu
From: Xu Rao <raoxu@uniontech.com>
vhci_poll() returns only EPOLLIN and EPOLLRDNORM when readq is nonempty,
dropping the write readiness bits it reports when the queue is empty.
However, vhci_write() does not wait for readq to drain: incoming frames
are handled independently by vhci_get_user().
As a result, userspace polling only for write readiness can time out or
remain asleep while input is queued, even though it could submit a
frame. Applications that drain input before waiting to write avoid this
case.
Always include EPOLLOUT and EPOLLWRNORM in the readiness mask, and add
EPOLLIN and EPOLLRDNORM when readq contains data. Keep the existing wait
queue registration and empty-queue behavior unchanged.
Signed-off-by: Xu Rao <raoxu@uniontech.com>
---
drivers/bluetooth/hci_vhci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 771ad9893c44..0b427c65ce59 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -636,13 +636,14 @@ static ssize_t vhci_write(struct kiocb *iocb, struct iov_iter *from)
static __poll_t vhci_poll(struct file *file, poll_table *wait)
{
struct vhci_data *data = file->private_data;
+ __poll_t mask = EPOLLOUT | EPOLLWRNORM;
poll_wait(file, &data->read_wait, wait);
if (!skb_queue_empty(&data->readq))
- return EPOLLIN | EPOLLRDNORM;
+ mask |= EPOLLIN | EPOLLRDNORM;
- return EPOLLOUT | EPOLLWRNORM;
+ return mask;
}
static void vhci_open_timeout(struct work_struct *work)
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: Bluetooth: hci_vhci: Report write readiness with queued input
2026-11-12 8:26 [PATCH] Bluetooth: hci_vhci: Report write readiness with queued input raoxu
@ 2026-11-12 13:35 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-12 13:35 UTC (permalink / raw)
To: linux-bluetooth, raoxu
[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1209275/
---Test result---
Test Summary:
CheckPatch PASS 0.73 seconds
VerifyFixes PASS 0.11 seconds
VerifySignedoff PASS 0.11 seconds
GitLint PASS 0.30 seconds
SubjectPrefix PASS 0.10 seconds
BuildKernel PASS 31.65 seconds
CheckAllWarning PASS 35.41 seconds
CheckSparse PASS 38.40 seconds
BuildKernel32 PASS 31.50 seconds
CheckKernelLLVM PASS 35.55 seconds
TestRunnerSetup PASS 755.26 seconds
TestRunner_l2cap-tester PASS 12.53 seconds
TestRunner_iso-tester PASS 10.83 seconds
TestRunner_bnep-tester PASS 3.17 seconds
TestRunner_mgmt-tester PASS 88.63 seconds
TestRunner_rfcomm-tester PASS 4.55 seconds
TestRunner_sco-tester PASS 5.69 seconds
TestRunner_ioctl-tester PASS 4.73 seconds
TestRunner_mesh-tester PASS 5.57 seconds
TestRunner_smp-tester PASS 4.41 seconds
TestRunner_userchan-tester PASS 3.24 seconds
TestRunner_6lowpan-tester PASS 4.49 seconds
IncrementalBuild PASS 29.60 seconds
https://github.com/bluez/bluetooth-next/pull/1120
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-12 13:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 8:26 [PATCH] Bluetooth: hci_vhci: Report write readiness with queued input raoxu
2026-11-12 13:35 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox