[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] xen/arm: vpl011: Fix misleading comments


  • To: Michal Orzel <michal.orzel@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Thu, 6 Apr 2023 11:38:33 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LWk4Hi1mF1FVJiebOCrXEQgZdKxWG/iAYVMdyPMXGEw=; b=N8CSQWbxBtrxUGLZRwDlbonfxKxV//WIZlPHbGH27KVWvLDL0QGz2EQQBlE+kxJkci+im1N8K4mxsGc2OS7OAZaVBTAKfi7/q7E1sDtFzdbX74G6osW2E9Bm9H0r1FGNbbyxPCOC0njFV0sIeHDHUmbSuwopHd4Ai8xDs22aQj0LzrldyDeyol5oCjqXen0XSFp0lPcufqTD4pEkw4ov48pdnwbX582Zc7+MA6kRdXd6VZNMp+mLjsdM6uCVdswVPwdQtvlEpnpEE+rmTno+jjP2hmqNyzRjMrosnd2e1XeqaPSq7mVyi3o1LyC38K8m/va+f3LMZseTMwwsA8bk4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ck/VP7+dRStZS8MyRj85qyc5ntU7HrUhkMjLWeSLsVvjRy8spyopnKIJzdudnmpYCK8v2xisC95TvVzjdNbWWxHzVZc2dT3KP15FdmPBHkSnqZtVEp/cfjNXYVTxaeaUTr7c4vaQ3xhGYm7sCjhkmh5B4MVln2ab+mmIrUTE+a0xMTpwQYOJHjMXNw+NYZIsKXPuwQRg4GxwviG2dEiDxuIiILn6kijCGdsEL3bB1vPhqVd2BB+3s1MgknqcJjpOMS4PftvuZJAcFGHUcj02amXqSUhe60QV8CAgfz56G3c0ol8sk47jpSRhGEvu2V8QyBAcOiN2jWSx3PDB2nR0sA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 06 Apr 2023 10:38:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 05/04/2023 12:17, Michal Orzel wrote:
In both vpl011_read_data() and vpl011_read_data_xen(), there is a comment
stating that the guest is expected to read the DR register only if the
TXFE bit of FR register is not set. This is obviously logically wrong and
it should be RXFE (i.e. RX FIFO empty bit set -> nothing to read).
NIT:- I will prefer if the PL011 TRM is mentioned with the relevant section.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
  xen/arch/arm/vpl011.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index 2fa80bc15ac4..0186d8a31834 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -143,8 +143,8 @@ static uint8_t vpl011_read_data_xen(struct domain *d)
      /*
       * It is expected that there will be data in the ring buffer when this
       * function is called since the guest is expected to read the data 
register
-     * only if the TXFE flag is not set.
-     * If the guest still does read when TXFE bit is set then 0 will be 
returned.
+     * only if the RXFE flag is not set.
+     * If the guest still does read when RXFE bit is set then 0 will be 
returned.
       */
      if ( xencons_queued(in_prod, in_cons, sizeof(intf->in)) > 0 )
      {
@@ -202,8 +202,8 @@ static uint8_t vpl011_read_data(struct domain *d)
      /*
       * It is expected that there will be data in the ring buffer when this
       * function is called since the guest is expected to read the data 
register
-     * only if the TXFE flag is not set.
-     * If the guest still does read when TXFE bit is set then 0 will be 
returned.
+     * only if the RXFE flag is not set.
+     * If the guest still does read when RXFE bit is set then 0 will be 
returned.
       */
      if ( xencons_queued(in_prod, in_cons, sizeof(intf->in)) > 0 )
      {



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.