{"action":"created","issue":{"url":"https://api.github.com/repos/ARM-software/tf-issues/issues/586","repository_url":"https://api.github.com/repos/ARM-software/tf-issues","labels_url":"https://api.github.com/repos/ARM-software/tf-issues/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/ARM-software/tf-issues/issues/586/comments","events_url":"https://api.github.com/repos/ARM-software/tf-issues/issues/586/events","html_url":"https://github.com/ARM-software/tf-issues/issues/586","id":318925359,"number":586,"title":"Question about `console_getc()`","user":{"login":"antonio-nino-diaz-arm","id":16819896,"avatar_url":"https://avatars3.githubusercontent.com/u/16819896?v=4","gravatar_id":"","url":"https://api.github.com/users/antonio-nino-diaz-arm","html_url":"https://github.com/antonio-nino-diaz-arm","followers_url":"https://api.github.com/users/antonio-nino-diaz-arm/followers","following_url":"https://api.github.com/users/antonio-nino-diaz-arm/following{/other_user}","gists_url":"https://api.github.com/users/antonio-nino-diaz-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/antonio-nino-diaz-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonio-nino-diaz-arm/subscriptions","organizations_url":"https://api.github.com/users/antonio-nino-diaz-arm/orgs","repos_url":"https://api.github.com/users/antonio-nino-diaz-arm/repos","events_url":"https://api.github.com/users/antonio-nino-diaz-arm/events{/privacy}","received_events_url":"https://api.github.com/users/antonio-nino-diaz-arm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-30T15:09:59Z","updated_at":"2018-04-30T20:11:10Z","closed_at":null,"author_association":"NONE","body":"@jwerner-chromium \r\n\r\nIs there any reason why the current implementation of `console_getc()` is blocking in the multi console driver? The old driver one wasn't blocking, and it isn't used anywhere in the upstream code, so we were thinking about just returning after the first iteration of the console linked list. It would be helpful to implement a `getc()` with a timeout, which can't be done with the current driver."},"comment":{"url":"https://api.github.com/repos/ARM-software/tf-issues/issues/comments/385514154","html_url":"https://github.com/ARM-software/tf-issues/issues/586#issuecomment-385514154","issue_url":"https://api.github.com/repos/ARM-software/tf-issues/issues/586","id":385514154,"user":{"login":"jwerner-chromium","id":17071764,"avatar_url":"https://avatars0.githubusercontent.com/u/17071764?v=4","gravatar_id":"","url":"https://api.github.com/users/jwerner-chromium","html_url":"https://github.com/jwerner-chromium","followers_url":"https://api.github.com/users/jwerner-chromium/followers","following_url":"https://api.github.com/users/jwerner-chromium/following{/other_user}","gists_url":"https://api.github.com/users/jwerner-chromium/gists{/gist_id}","starred_url":"https://api.github.com/users/jwerner-chromium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwerner-chromium/subscriptions","organizations_url":"https://api.github.com/users/jwerner-chromium/orgs","repos_url":"https://api.github.com/users/jwerner-chromium/repos","events_url":"https://api.github.com/users/jwerner-chromium/events{/privacy}","received_events_url":"https://api.github.com/users/jwerner-chromium/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T20:11:10Z","updated_at":"2018-04-30T20:11:10Z","author_association":"NONE","body":"The old drivers were blocking (e.g. see here: https://github.com/ARM-software/arm-trusted-firmware/blob/82cb2c1ad9897473743f08437d0a3995bed561b9/drivers/arm/pl011/aarch64/pl011_console.S#L123 ), so I tried to maintain that behavior. The difference is that previously every individual driver was implementing the loop to wait for content itself. With multiple consoles we cannot have that, because the reasonable behavior you'd expect is to get a char as soon as any of the registered consoles has one available. So I made the individual driver implementations non-blocking and moved the loop into the framework's console_getc().\r\n\r\nI don't particularly care about either behavior, so if Arm is okay with changing the behavior to non-blocking then go for it. I just didn't want to change the high-level behavior myself because I wanted the API change to be transparent to platforms (including out-of-tree). I agree that in general a non-blocking implementation is more useful (and the blocking behavior could easily be implemented with another small wrapper on top of that)."}}
{"actor":{"display_login":"jwerner-chromium"}}