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 X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23F59C12002 for ; Wed, 14 Jul 2021 20:53:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9C02B613CA for ; Wed, 14 Jul 2021 20:53:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C02B613CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A4FED82C08; Wed, 14 Jul 2021 22:53:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="Bk/CiTzm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D1B7382BD2; Wed, 14 Jul 2021 22:52:43 +0200 (CEST) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 8EB1A82B55 for ; Wed, 14 Jul 2021 22:52:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x730.google.com with SMTP id 201so3009645qkj.13 for ; Wed, 14 Jul 2021 13:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=et+K+IS8QegDU6xr0omiFn8VApUdDsjIA+UG8wKrMNc=; b=Bk/CiTzmEgvS87l7qAdGY8oMZ2C8Jx6mVmnAueQfJrpFamhqYkg57OfJ+jqEMYN6RG azGq66lGrnwCF6iY44z4fsstRisIR94x1vWnn/sLAIvoHVw+I/iG12Ehfb9yzhC4gtLO gfhGv5FpvNnhmnK6135RGg38ni1DD4ouFN9tU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=et+K+IS8QegDU6xr0omiFn8VApUdDsjIA+UG8wKrMNc=; b=F0qx//K9eScaI0jBlMeqm91MQM2ueRH1ojBEd/E6BMywGT393d8tLlKMNyI5t7giMp UY4xSb+C3YEWQkzbDgkVWDhp8zzxdTIFBuHEv4+xBBxsdqxkO41LEAcWrFSI1M4qNu/m RUocfdgjZ6ABb6nk/AyhH4Qi4rFsdwqmVcIEJqxZy7bA6wSDAyybKebZKkvvcO08KyJb szBAsdlgFkIY9WZkl+7W33ny6MvWoCAQFHMuvSu/fJGaMVAMojrIckWsdS4h1XMcblE1 AVf+MA+schAfLr29ahXnf78i4MM+4xAEZosHdH+Q+bxzRC5fE3VxKvmM3qCw+62D069c FbSw== X-Gm-Message-State: AOAM532o0WwrhiCrwVSdiu5kYqI8R1mGq6GMKBDhhP6A9avk+AvT2vG6 EL7WaDb2n3PuZG3Ot3+9oiGUZw== X-Google-Smtp-Source: ABdhPJx17Dsjp8N3YZa5eeo1m8/KZsfFRel+X3rTl03Vdq8F5cR7DcUw14uD8i2/8oUErV0jYtHqdg== X-Received: by 2002:a37:9f8d:: with SMTP id i135mr10700085qke.296.1626295954456; Wed, 14 Jul 2021 13:52:34 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-715c-901d-db03-e6e4.res6.spectrum.com. [2603:6081:7b01:cbda:715c:901d:db03:e6e4]) by smtp.gmail.com with ESMTPSA id g13sm1219711qtj.2.2021.07.14.13.52.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jul 2021 13:52:33 -0700 (PDT) Date: Wed, 14 Jul 2021 16:52:31 -0400 From: Tom Rini To: Stephan Gerhold Cc: u-boot@lists.denx.de, Jorge Ramirez-Ortiz , Nicolas Dechesne , Ramon Fried Subject: Re: [PATCH] arm: mach-snapdragon: pinctrl: Place pin_name in .data section Message-ID: <20210714205231.GW9516@bill-the-cat> References: <20210705121847.48432-1-stephan@gerhold.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wErLcDmSnr9YSaz4" Content-Disposition: inline In-Reply-To: <20210705121847.48432-1-stephan@gerhold.net> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --wErLcDmSnr9YSaz4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 05, 2021 at 02:18:47PM +0200, Stephan Gerhold wrote: > According to arch/arm/lib/crt0_64.S, the BSS section is "UNAVAILABLE" > and uninitialized before relocation. Also, it overlaps with the > appended DTB before relocation, so writing data into a variable > in the BSS section might corrupt the appended DTB. >=20 > Unfortunately, pinctrl-apq8016.c and pinctrl-apq8096.c do place the > "pin_name" variable in the BSS section (since it's uninitialized). > It's also used before relocation, when setting up the pinctrl for > the serial driver. >=20 > On DB410c this causes "GPIO_5" to be written into some part of an > appended DTB, e.g.: >=20 > 80111820: edfe0dd0 9f100000 38000000 c00e0000 ...........8.... > 80111830: 28000000 11000000 10000000 00000000 ...(............ > 80111840: 4f495047 8800355f 00000000 00000000 GPIO_5.......... > 80111850: 00000000 00000000 01000000 00000000 ................ > 80111860: 03000000 04000000 00000000 02000000 ................ > 80111870: 03000000 04000000 0f000000 02000000 ................ > 80111880: 03000000 2d000000 1b000000 6c617551 .......-....Qual > 80111890: 6d6d6f63 63655420 6c6f6e68 6569676f comm Technologie >=20 > Depending on the part of the DTB that is corrupted this might not > cause any problems, but it can also result in strange reboots > without any serial output. >=20 > Fortunately, in practice this does not cause issues on DB410c yet > because board_fdt_blob_setup() in dragonboard410c.c currently > overrides the appended DTB with the one passed by the previous > bootloader (LK) (which does not get corrupted). >=20 > DB820c does not have board_fdt_blob_setup() so I would expect it to > be affected by this problem. Perhaps everyone was just fortunate to > not compile an U-Boot configuration where the pin_name corrupts an > important part of the DTB. >=20 > Make sure "pin_name" is explicitly placed in the .data section > instead of .bss to fix this. >=20 > Cc: Ramon Fried > Signed-off-by: Stephan Gerhold > Reviewed-by: Ramon Fried Applied to u-boot/master, thanks! --=20 Tom --wErLcDmSnr9YSaz4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDvTo8ACgkQFHw5/5Y0 tyxBmgwAqL0so6ClXhz3aT17OVVYaHp1V4rqUsuOUMhpI572FcPulsq3L91u9vvx /IHTPjor43jFpz0u+KqcuaAfdMEi/ncIsO9f12HpiACs6GKqnNUTwlh9uQjxwR6d yEJz48AOj/y619g41Au0qn86zDav+P3NwXAlRpEm7y5KpOx8pafPRKs6cPYChntx WpS8V+eU9ymRYORrX64c4pI/uNJ3Ja0tcSh8+q+hCfRq9+xXELzQcXoa5SPpCHn7 1FsyW5rqQ0NhFQT8PxZU5myjUMdaDE7ggQlkmWN7i27AuaS5epth8VJOk3wgTe9g JBz1HlpGgnMhWf1YvDmqfEv+lEjgsUgcsYLHfBCph2vJbBVTdD1N3hj5NjWvy8rQ KpG2fkdiPCHfPv7Ws58i1jIFdAUptJt5kO18GCiKdtHTvlA390OxOc184chvwoSB RDqdWwW1jWfzh0yKuiovbikMYNaCx7xZn7X64aVsSQORtw4QysxmL+ZKN9jGqv2v v//cNXOH =0bot -----END PGP SIGNATURE----- --wErLcDmSnr9YSaz4--