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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D322C7EE22 for ; Wed, 10 May 2023 20:49:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7C5D58609D; Wed, 10 May 2023 22:49:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="EonoQHYu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6045F8609E; Wed, 10 May 2023 22:49:35 +0200 (CEST) Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0245D8609C for ; Wed, 10 May 2023 22:49:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-55a8e9e2c53so75174537b3.1 for ; Wed, 10 May 2023 13:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1683751772; x=1686343772; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3zbPDP1hy+vF7FC4A4M1F9spISd0ug593cGXArwuJPc=; b=EonoQHYuXv/m/OEcSjSKYKz7kN1lgeCswIwY0uXAz5AlNa9r2gqtOtIJwQ56oP1CF9 jb4havxCJtgfBc7LaLAn7ru1FAL4hI65rHThMlm5RPxFamaBMrFdE2Ob/EHueD2Sg3Dy INajeY3LbXvj40Y0FAweJwfiyu6lbwjtWzgng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683751772; x=1686343772; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3zbPDP1hy+vF7FC4A4M1F9spISd0ug593cGXArwuJPc=; b=h7PUuawVIj/tMMQ7Y6HvQvi0ORBSdSodbFEpqylyA307ZU2a7uRLPVHl1tc5ggwxEO TZ11I/J1Q5V2CXGwbV5mDe+MvN1NTnQ4j61RvSjOLPpKK9/kA8ipgUxGVeml92LO/oYO Wbd1MGRnskGq4QL8DcEOagP+WIx6vhtAcuT9ugduvc0Xn/A/Fof3sQBcVF3k0i+Wb2Wm QJ7ea+bP/LCI1RwW5sYUCj1nAEgfltBpfJyh/d9GhFPxSTWFhYUz/N9R4UpOkcIDr7Hd X7eHAPocMQBGhzdoGLoGwnFMAif70jbFeUsn0nuVLLbVscaZYvj1/eUI++uiPyTKdtBY 2L8Q== X-Gm-Message-State: AC+VfDxFua39CPNKgqPFqYo/lv/7d9Smy2eRzcuUSTW5rjt7pfmZzm/P DOyrZ5eIigwJzp6lLJU5RrJIZw== X-Google-Smtp-Source: ACHHUZ6Ar2yLcH/ntHJAZu6ZwiVp27Fq+EVDDug6W8ywt3h4l/9UCGBsaC24a5Jw+gAgS34HDix1kw== X-Received: by 2002:a0d:e616:0:b0:55b:72aa:e926 with SMTP id p22-20020a0de616000000b0055b72aae926mr19880226ywe.49.1683751771723; Wed, 10 May 2023 13:49:31 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-238a-0d17-77d4-33aa.res6.spectrum.com. [2603:6081:7b00:6400:238a:d17:77d4:33aa]) by smtp.gmail.com with ESMTPSA id y6-20020a0def06000000b00545a08184fdsm4293650ywe.141.2023.05.10.13.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 13:49:31 -0700 (PDT) Date: Wed, 10 May 2023 16:49:29 -0400 From: Tom Rini To: Simon Glass Cc: Troy Kisky , u-boot@lists.denx.de, gary.bisson@lairdconnect.com, Andre Przywara , Bin Meng Subject: Re: [PATCH v3 17/23] ns16550: match when to define bdf with uart code Message-ID: <20230510204929.GO2398826@bill-the-cat> References: <20230313213146.1775650-1-troykiskyboundary@gmail.com> <20230313213146.1775650-18-troykiskyboundary@gmail.com> <20230510204100.GA1757833@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pn9AXFu+iMY2yoLM" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean --pn9AXFu+iMY2yoLM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 10, 2023 at 02:46:14PM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Wed, 10 May 2023 at 14:41, Tom Rini wrote: > > > > On Mon, Mar 13, 2023 at 02:31:39PM -0700, Troy Kisky wrote: > > > > > When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI) > > > bdf is no longer accessible. So add preprocessor protection > > > to avoid access. > > > > > > Signed-off-by: Troy Kisky > > > Reviewed-by: Simon Glass > > > --- > > > > > > (no changes since v2) > > > > > > Changes in v2: > > > - changed condition of when to include field bdf > > > - added protection to another instance of bdf in uart.c > > > - Thanks to Simon for getting this corrected > > > > > > arch/x86/cpu/apollolake/uart.c | 4 ++++ > > > include/ns16550.h | 2 +- > > > 2 files changed, 5 insertions(+), 1 deletion(-) > > > > > > diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake= /uart.c > > > index a9362436000..878aa48ed76 100644 > > > --- a/arch/x86/cpu/apollolake/uart.c > > > +++ b/arch/x86/cpu/apollolake/uart.c > > > @@ -79,10 +79,12 @@ void apl_uart_init(pci_dev_t bdf, ulong base) > > > > > > static int apl_ns16550_probe(struct udevice *dev) > > > { > > > +#if IS_ENABLED(CONFIG_PCI) && defined(CONFIG_SPL_BUILD) > > > struct apl_ns16550_plat *plat =3D dev_get_plat(dev); > > > > > > if (!CONFIG_IS_ENABLED(PCI)) > > > apl_uart_init(plat->ns16550.bdf, plat->ns16550.base); > > > +#endif > > > > > > return ns16550_serial_probe(dev); > > > } > > > > Looking at this again, this hunk here doesn't make sense. Reading > > outloud, "if we have CONFIG_PCI enabled and CONFIG_SPL_BUILD, declare > > plat to be .. and then if we do not have PCI enabled ...". I really > > don't know what the code is supposed to be doing here. >=20 > This is because the bdf member is only present in SPL when PCI is enabled. >=20 > Perhaps it could be CONFIG_SPL instead of CONFIG_SPL_BUILD ? >=20 > You can apply whatever makes it build if you like. I can look at it > either tonight or when I get back. Digging at this when you get back is fine since it still makes no sense to say "If PCI is enabled, when PCI is not enabled actually do something". There's no side-effects on "dev" from the call to dev_get_plat which is the only thing that happens, in this case. --=20 Tom --pn9AXFu+iMY2yoLM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmRcA1kACgkQFHw5/5Y0 tyzecAwAimM1vQkNatsMm5p3aEbLQTlFy6uJag/7Yjgj3BfkiqUF1pj36WyBnspR SbFHJEvhWuuiXhxDnw0mawXepn7DVerzeBjsXugyMyUOQCuWv/Tsn/rMhZ6vQLEH toOlEG2xehpoWIE6lHaRPmggTJJSElvzse1RGpMfxDpd+3Mzm9hrsT85zL/inLuu p9nb/kYNeLpUfbElxJoeVflZbBLITuuOK4yznWBfcTsrEaWCDyp1LO3xUfioMrtn Qb7LJ8kMVGGs5FzHYQgS5E35Laa+pJdy8AxEG0bKvGcbIsUTK7DpPmgEOefxdgay +M8ipIYPM7FoRxBI6r8eXSr5GrhfOEgPWOrDMnQaA2G6V0tRJme/rinhPSED2rTH Rc2/K+GwJ8+yBNp0dOxlChXtIdFFBLTuxJi+NJNIloIJ+VB7TXk5AwkS2u5/RGzG oDB8BBsYnrvszu8no7jYgfIhuur++ocaZ5irPxpANr8racGdEUByFOsM38f+os2+ NRorEHL6 =Zojd -----END PGP SIGNATURE----- --pn9AXFu+iMY2yoLM--