Message ID | 20250220092903.3726-5-philmd@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1f85:b0:38f:210b:807b with SMTP id hj5csp106987wrb; Thu, 20 Feb 2025 01:30:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUYDyf5B65quU7pmkvLE3lkNW7h0lP2nmjMDtYNaMIJA+naB2cot51Nak7xT9OUtlz+I6ngHw==@linaro.org X-Google-Smtp-Source: AGHT+IE141a6LHhunEIqFTWMpt2bzOI2iKAIq58BpZDHEwmpcfPTCYlKhWSfz/IkBC9MuJBQgTVO X-Received: by 2002:a05:622a:1445:b0:471:c35f:fc62 with SMTP id d75a77b69052e-472081562e0mr98265431cf.0.1740043836763; Thu, 20 Feb 2025 01:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740043836; cv=none; d=google.com; s=arc-20240605; b=evCjhzgx+1XB42WATm7nhypkpFE+TZcb2vhM2JGh39z9cbOTDRc0iQkQOqsJYiqT/E xOEGLLeCS8MNxaf5A+YoMuwAnpIVuofrBVD8BagdvGLXH+BmMio4A4Y5jQi9wHbre1uO a0YUB5o0dXx96ihTgwSh2SB5tgl5XbF/kypoZJ4cNwJBJJpNufHRKT1A6iyEFYvNcIRL qb2gh5AVIY3mL6c8u7V9tgSjv1iLRXO+y6WfWT2Cleehs9upy/3ZpaOTr1wXTgdJh2O2 h5wys8CSWLGBq89UrlSjnz/d0MpagOqCme3NkTReqdeKILW62x7WqhNDS/MqQEO55Dn0 E2yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XvVsiU9gHWUTHtLBaCZuBn83g9TL7f813w+LHlaQeOA=; fh=SmfC3sO/Je+MRtxTrJqoqGWQJjYliq56u/HVO0sNWv8=; b=Gi7ajSTvpcLQrYyF3LIsiNhzvndECgm2BmITL337+Qw7vRQKKf9BeJ1+0ClmVdnzoE wC6Sun8euXBqTxqbVMBsnSOePRbRGIFTy0HII7Gon6rrGT9kEwJ0OQS2wPAG4RjUukF5 0oDkEjrFjcfbdWRG3Cxn477RYb8fL7vR+JGaU1ZSjSLYX9CLmjmclVf4WyMdNDhfSw0n pFqowaR0bOP0Trfe72w1+QFhn7H0gWDNQrbbWwkhSYH5g3pg2DqeHr+AECbNRakRaLku LTiSsZ7Ng6vd+ga44PhQnBa8weT8buw+9HlZMK7909SX+tNL1uNTH/vn4BkyHlwRrGZ0 wZLw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKvcOZhL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-471f11a2f1esi75477651cf.479.2025.02.20.01.30.36 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Feb 2025 01:30:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKvcOZhL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1tl2t6-0000rj-2R; Thu, 20 Feb 2025 04:30:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1tl2sv-0000Zq-UT for qemu-devel@nongnu.org; Thu, 20 Feb 2025 04:30:22 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1tl2st-0003lA-CX for qemu-devel@nongnu.org; Thu, 20 Feb 2025 04:30:21 -0500 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2f9d3d0f55dso1064016a91.1 for <qemu-devel@nongnu.org>; Thu, 20 Feb 2025 01:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740043818; x=1740648618; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XvVsiU9gHWUTHtLBaCZuBn83g9TL7f813w+LHlaQeOA=; b=TKvcOZhL1f2Ri8icb+KZTXIiYzEOWqglsWUVncYMVmyN1+ZoMhqMbxU+IchVkDOP4A gbkZTRtMO2qZPaTRDpWDyhx6TBL7fnRyafsIpIaZMX6xL0JKJqZtTpI9NMtXF8KbUtdI RBF5JxT+aNKEzoMyzbbGogl3c7hq63st4HVXDJuRMiWlYpjM8TvuzRJ/l0sF8g6yb7fn oPVy0MYgwP9VTm1RF29qUUsZc54YwVNH5SqiD3afcUketqu2ek1LfqV9stF7nT3dgXY8 4bStXaNNbraoP6S5vpZvZY+ko9ujG4hhGcm5TOSSWiuuAXvl55CFW/RSVfVXrrRu7kct CSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740043818; x=1740648618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XvVsiU9gHWUTHtLBaCZuBn83g9TL7f813w+LHlaQeOA=; b=ku0qMN2eNPBc6CWidYSI+WBxFlBjnFdG4ku13fSYDajjuhtJLbrgn5mUtcN6+6i8L/ Ahl8thLbOweyGce8UdfwppAb5VryfBE3NmPg2q3YEbFWyNK1tf6CxzhzBQGm5fms7geW yg6/zYPb0+CnBxvGbyeiy4n1rJ52EZElKpnYdQMdpHhWI+O2nAUolG/ZbI6YkultdTA7 2ZLa8mvYCUfRDw55ceit+66LHRcbYxH9lR3EHpzidEb0Nnr/UKOhb9tZfycej5s3VLpk fxI1NM12LDFYKY4FN1Ty65CVpG2J1BQQnw3B1WG9QplKA34acdoWlyUPpxhV6QJ80wwE Qq8A== X-Gm-Message-State: AOJu0YwEwGNuC5RwPtAZbNz0p3RVNsPK5AUYvL5BQ6AjY3uC/w13i93x 2KiiZZiQa1zKTTvgPN75+9oBLMYBppz0IAETENZtNDEfGil80J8V+k6SZ071OzJpL/Lm5M70qoi dMI0= X-Gm-Gg: ASbGnctY27/L/RSJaNHpIVtQCvFoen8v5DmMo52saWXOFb6Bef3zD5KE3vQrFmo/xUD 1WSUPw1xJb87SNKkg7spIOxZkrWgwMRKU5A2JbHFOeUoXPpD/ly+VsnAgQEJv3i30SjLKXP5Eh6 V/YumplQl7tR5Gv2Zc95Pk4ptufxuwAe8XVJ2Bwx0j8AGVnkhgSqCfurlG4wEkRIXE7sIhoiCob ghhpGpSXjOMFgQFpgipZXEkfjNHLlimAGhmqnsAEyuyVi1U7uqoZNZ4+jF3EG1mDeRkk1jfYqpM S+p+6QgNm8l4uRyt0xSb1Bs0w/4de5kJqLGlur1D/nnEcavu/oOoQ/+6WV0cO3O1Sg== X-Received: by 2002:a17:90b:2e45:b0:2ee:cdea:ad91 with SMTP id 98e67ed59e1d1-2fcb5a3681dmr11780241a91.15.1740043817688; Thu, 20 Feb 2025 01:30:17 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2fbf98b4c45sm15328183a91.2.2025.02.20.01.30.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 20 Feb 2025 01:30:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com> Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Magnus Damm <magnus.damm@gmail.com>, Thomas Huth <huth@tuxfamily.org>, Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>, Rayhan Faizel <rayhan.faizel@gmail.com>, qemu-arm@nongnu.org, Evgeny Iakovlev <eiakovlev@linux.microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Luc Michel <luc.michel@amd.com>, Yoshinori Sato <ysato@users.sourceforge.jp> Subject: [PATCH v2 4/9] hw/char/pl011: Really use RX FIFO depth Date: Thu, 20 Feb 2025 10:28:57 +0100 Message-ID: <20250220092903.3726-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250220092903.3726-1-philmd@linaro.org> References: <20250220092903.3726-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=philmd@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/char: Improve RX FIFO depth uses
|
expand
|
diff --git a/hw/char/pl011.c b/hw/char/pl011.c index f7485e7c541..23a9db8c57c 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -489,7 +489,6 @@ static int pl011_can_receive(void *opaque) PL011State *s = (PL011State *)opaque; unsigned fifo_depth = pl011_get_fifo_depth(s); unsigned fifo_available = fifo_depth - s->read_count; - int r = fifo_available ? 1 : 0; if (!(s->cr & CR_UARTEN)) { qemu_log_mask(LOG_GUEST_ERROR, @@ -500,7 +499,8 @@ static int pl011_can_receive(void *opaque) "PL011 receiving data on disabled RX UART\n"); } trace_pl011_can_receive(s->lcr, s->read_count, fifo_depth, fifo_available); - return r; + + return fifo_available; } static void pl011_receive(void *opaque, const uint8_t *buf, int size) @@ -515,7 +515,9 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size) return; } - pl011_fifo_rx_put(opaque, *buf); + for (int i = 0; i < size; i++) { + pl011_fifo_rx_put(opaque, buf[i]); + } } static void pl011_event(void *opaque, QEMUChrEvent event)