From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF2DCC4167D for ; Mon, 16 May 2022 14:58:08 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4L22Rz2yQ8z3cB4 for ; Tue, 17 May 2022 00:58:07 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Qb1ylrbJ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linaro.org (client-ip=2607:f8b0:4864:20::1131; helo=mail-yw1-x1131.google.com; envelope-from=peter.maydell@linaro.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Qb1ylrbJ; dkim-atps=neutral Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4L22Qy59NBz3cBv for ; Tue, 17 May 2022 00:57:13 +1000 (AEST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-2fefb051547so28107907b3.5 for ; Mon, 16 May 2022 07:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=N89Sx8/KAkUuHJ7/ED0/EHJX3wQIKDwFFofDvqvUYdA=; b=Qb1ylrbJTTk0hEbxeoTx+1+frF7XgddeLFuyHgIhrpSE8amy1lp7xo+1ugDvrw+A5F rDopXW/IziDBD9oMjoynND6tCYjWxU7j/yaFeFsxKK8wFQ1dL0x8H17Po2jxP/uoJ40V hXaGscsAEkm3Iq8B2evXID9UoP8iP1nqJzwAtxLsUOJvVoYrswNT2AuvTG0oqOUv7JAU nRD+aK9U+NmJMsN2fP0pPEnLvfP57Ax/b2nJ7XWrYSQxlrBTXaBPU7KKVviAhsjDoWhh okVQMwOVvlCI719OHSaWymZEOysY0vQcPy4OjNe+wnP0U+UaLWT1zsrlGbzuC5KPi38C xjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=N89Sx8/KAkUuHJ7/ED0/EHJX3wQIKDwFFofDvqvUYdA=; b=spNGEwIeE/KtWKq9C2sbz8yASyX7fJvEpK4JTQRgpNQuwW6I5345ntzWH9uOLaL43q B5YtLG9H8DGL+AGAcLl+YxB0bMfHJlvijQ8Mbjp1zqC92P36J7OhVTW6uYYfsUtbKutY hjCTS9is1SBx4hjkMyAzmdq5iMzAG/kbnDjZUVjkTDwT+FFOF5jBILEwYT0NYf6fw+Yf RJPDrXY5lBEUxKw+ZWzi0IJ+n47MLiWtJd5Ei5/PvIeRH9MrpedMGzeNrsgcPT/5+rTO w4tvawU/5KTV1Rl3TM4mhNNWM1lj1PQsXwN3Y4nArq8j8cOVDwI/BwDfBLcpQNzBPrEz mPZw== X-Gm-Message-State: AOAM5308ZGmdw7n4gA4WahGZ8CdLT3c3i3gQ6GN1Z1L8db3GdFLRNEpP jgOIeah3M0SIreow7jOfLf1YRtyU1wtbjOLK/E/VIg== X-Google-Smtp-Source: ABdhPJx6UX6fZ1Snft4Vi959h5AJ/FXZgcTqqQBXdY9caOMoWxN2tXK68Dt9WKI1n3zM5BWPcelErmxSccghbBcikYM= X-Received: by 2002:a81:6904:0:b0:2fe:e670:318a with SMTP id e4-20020a816904000000b002fee670318amr7743832ywc.329.1652713029278; Mon, 16 May 2022 07:57:09 -0700 (PDT) MIME-Version: 1.0 References: <20220513040220.3657135-1-pdel@fb.com> <20220513040220.3657135-3-pdel@fb.com> <443933f2-069f-df96-ec62-76c21fc644b2@kaod.org> <05F5C72F-8424-476C-82B7-7D30BA48CDEB@fb.com> In-Reply-To: <05F5C72F-8424-476C-82B7-7D30BA48CDEB@fb.com> From: Peter Maydell Date: Mon, 16 May 2022 15:56:58 +0100 Message-ID: Subject: Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices To: Peter Delevoryas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "zev@bewilderbeest.net" , Andrew Jeffery , Iris Chen , OpenBMC List , Cameron Esfahani via , qemu-arm , Joel Stanley , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Fri, 13 May 2022 at 22:09, Peter Delevoryas wrote > I was actually intentionally skipping that. If serial_hd(i) > doesn=E2=80=99t exist, the function will return NULL. > > Chardev *serial_hd(int i) > { > assert(i >=3D 0); > if (i < num_serial_hds) { > return serial_hds[i]; > } > return NULL; > } > > So then, the serial device=E2=80=99s CharBackend=E2=80=99s =E2=80=9CChard= ev *chr=E2=80=9D > will be initialized as NULL. Looking at all of the > usage of this attribute in =E2=80=9Chw/char/serial.c=E2=80=9D, I think > that=E2=80=99s ok, the read/write functions will just be no-ops. > They all have guards for =E2=80=9Cchr =3D=3D NULL=E2=80=9D. Yes, this is deliberate. We added these in commit 12051d82f0040 because otherwise lots of board/SoC code would have to create NullChardev dummy backends (or forget to and then crash depending on the user's commandline). thanks -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E355AC43217 for ; Mon, 16 May 2022 15:39:16 +0000 (UTC) Received: from localhost ([::1]:38728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqcoW-0003dj-0n for qemu-devel@archiver.kernel.org; Mon, 16 May 2022 11:39:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqc9o-0003ch-8z for qemu-devel@nongnu.org; Mon, 16 May 2022 10:57:12 -0400 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]:42309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqc9m-0001JN-Nq for qemu-devel@nongnu.org; Mon, 16 May 2022 10:57:11 -0400 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-2ef5380669cso156086297b3.9 for ; Mon, 16 May 2022 07:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=N89Sx8/KAkUuHJ7/ED0/EHJX3wQIKDwFFofDvqvUYdA=; b=Qb1ylrbJTTk0hEbxeoTx+1+frF7XgddeLFuyHgIhrpSE8amy1lp7xo+1ugDvrw+A5F rDopXW/IziDBD9oMjoynND6tCYjWxU7j/yaFeFsxKK8wFQ1dL0x8H17Po2jxP/uoJ40V hXaGscsAEkm3Iq8B2evXID9UoP8iP1nqJzwAtxLsUOJvVoYrswNT2AuvTG0oqOUv7JAU nRD+aK9U+NmJMsN2fP0pPEnLvfP57Ax/b2nJ7XWrYSQxlrBTXaBPU7KKVviAhsjDoWhh okVQMwOVvlCI719OHSaWymZEOysY0vQcPy4OjNe+wnP0U+UaLWT1zsrlGbzuC5KPi38C xjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=N89Sx8/KAkUuHJ7/ED0/EHJX3wQIKDwFFofDvqvUYdA=; b=AadhMhPhjt6b3c6/cD+rIDXfobm8/BpsXt2+1i7sllUy0a81Rz4rZCPCEHg5rmjJtJ YexiM84sr1uVkrc+fxOk7/qAbaUuWCBmYgRn2+6jlmeK6WfzG420DIz5mo/vOi1NSn9A HnrV1ZGCvGO4HohH9LclO3EOS/SdOlIvsSV71yx7l5l7GLF5plgsl7RPAcXfBxTSDrFK bI8Jv1J9LXfPMVOTPH5yEaHUorAq3STkB0Rg+N3IKftlvc4AbEpk9id/DFLlSu6s+BDe OtEZ2XR8riaoaTfIo9FGPOdns0jU+4wULuLOrcQ/LERav2K8zCgBt6YHf5OkGH5t9tk1 35Kw== X-Gm-Message-State: AOAM530ruAx1GBFZTTS8o0XzEtAqi6AtSD4mB5mOOKG4pR206OFZpdFC 6J53pBa63fuyg08K+zcKDjgUsRt/P9gs5mI8amBR9w== X-Google-Smtp-Source: ABdhPJx6UX6fZ1Snft4Vi959h5AJ/FXZgcTqqQBXdY9caOMoWxN2tXK68Dt9WKI1n3zM5BWPcelErmxSccghbBcikYM= X-Received: by 2002:a81:6904:0:b0:2fe:e670:318a with SMTP id e4-20020a816904000000b002fee670318amr7743832ywc.329.1652713029278; Mon, 16 May 2022 07:57:09 -0700 (PDT) MIME-Version: 1.0 References: <20220513040220.3657135-1-pdel@fb.com> <20220513040220.3657135-3-pdel@fb.com> <443933f2-069f-df96-ec62-76c21fc644b2@kaod.org> <05F5C72F-8424-476C-82B7-7D30BA48CDEB@fb.com> In-Reply-To: <05F5C72F-8424-476C-82B7-7D30BA48CDEB@fb.com> From: Peter Maydell Date: Mon, 16 May 2022 15:56:58 +0100 Message-ID: Subject: Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices To: Peter Delevoryas Cc: Iris Chen , "patrick@stwcx.xyz" , qemu-arm , Cameron Esfahani via , "zev@bewilderbeest.net" , OpenBMC List , Andrew Jeffery , Joel Stanley , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::112c; envelope-from=peter.maydell@linaro.org; helo=mail-yw1-x112c.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, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 13 May 2022 at 22:09, Peter Delevoryas wrote > I was actually intentionally skipping that. If serial_hd(i) > doesn=E2=80=99t exist, the function will return NULL. > > Chardev *serial_hd(int i) > { > assert(i >=3D 0); > if (i < num_serial_hds) { > return serial_hds[i]; > } > return NULL; > } > > So then, the serial device=E2=80=99s CharBackend=E2=80=99s =E2=80=9CChard= ev *chr=E2=80=9D > will be initialized as NULL. Looking at all of the > usage of this attribute in =E2=80=9Chw/char/serial.c=E2=80=9D, I think > that=E2=80=99s ok, the read/write functions will just be no-ops. > They all have guards for =E2=80=9Cchr =3D=3D NULL=E2=80=9D. Yes, this is deliberate. We added these in commit 12051d82f0040 because otherwise lots of board/SoC code would have to create NullChardev dummy backends (or forget to and then crash depending on the user's commandline). thanks -- PMM