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 7AEC8C77B61 for ; Mon, 24 Apr 2023 12:02:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6CF4E86065; Mon, 24 Apr 2023 14:01:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c1IYWMDL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2BA1085D38; Mon, 24 Apr 2023 09:11:12 +0200 (CEST) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 8EA5685746 for ; Mon, 24 Apr 2023 09:11:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=noname.nuno@gmail.com Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-956eacbe651so680553466b.3 for ; Mon, 24 Apr 2023 00:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682320269; x=1684912269; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=sW+xOmhD8lMyNWD2gjPqaMrrWSIid5ra7k4v2Olwio4=; b=c1IYWMDL3cjIdZWnpVsUOaZuAO7Zn5MJDIpRy0c6BHUkTXeUWS7wFhsOHvKJBeeN60 uCLM2Z3s6z/EkS2AzrBVD0AbsE5NjyghaxKYTVE09hnQQAvn6vV9Mh634IyAB+lMuK7B orLVASWA4+o6Wrh5SamNx6bAmM9Tgi8sCc7fGdiVekC3ZEhVdybmWF6SDlO/UIdM6m9u TvPNORxR4Le7jwPBx08wsAFbVDy5iHUoj6kZw6NEBn3JOKTqXo7BR7UoEBp2PXE23JxO rZJpO0tjWgS/flJkLMNuozQ73xgG52OLamFoWycCOUb3o5HVESa4+G2niKEhOtKuS/KK ib/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682320269; x=1684912269; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sW+xOmhD8lMyNWD2gjPqaMrrWSIid5ra7k4v2Olwio4=; b=jqp63AwlcCyhj4+BxxUXB5sNklCy5Yv2y+w8iTAzm9+KPtqj5YEQxFpJsoUvGh5vOk 3zH3qxmvZcCtcmHtk90pnPqat/c1yLV6c36sTtblbDV7wqhPgBM2fxLluYJYVAXx8Y4l 2h4h6VO7rjo502JTN5E55StPzsPIObKwfZ+ckdEGVbCN/Kx8aZKJtM05yoa6h6iFwGgp c+Y7K20t8BH+u1lW478y9kvEBNYM0z0gtgJatlWf0V4T8Osqr0XLQMFNF9dSes5iN6IB 9PB8YdsGQZCBMXmZ/ndxhjCBLaQa9fCUlQABTJBrtIc6WxzQXCgKrpT79+FRltcGLVvh Jsdg== X-Gm-Message-State: AAQBX9eW/qgj8dfLXbeDtsgQHc5vd+M3dle14SBuPdhRr+mRPCbwB1EW 1K4jlIcXei2qZDwtbp1zfwpkpCYBp0v08q2n X-Google-Smtp-Source: AKy350YkN1ueKEOr40XOM6c4PYYpxFkleCc6tZ30ZC3aYEzOWQ9s7LqcktUfOuslwSwLIZXlm9aYPQ== X-Received: by 2002:a17:906:37c9:b0:930:e9ee:c474 with SMTP id o9-20020a17090637c900b00930e9eec474mr10372293ejc.54.1682320268860; Mon, 24 Apr 2023 00:11:08 -0700 (PDT) Received: from ?IPv6:2003:f6:ef05:8700:853c:3ba5:d710:3c1d? (p200300f6ef058700853c3ba5d7103c1d.dip0.t-ipconnect.de. [2003:f6:ef05:8700:853c:3ba5:d710:3c1d]) by smtp.gmail.com with ESMTPSA id hy12-20020a1709068a6c00b0094f09cd4658sm5271684ejc.71.2023.04.24.00.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 00:11:08 -0700 (PDT) Message-ID: <2e91426339b0ab83dbc60fcdb0048d34f0d85caa.camel@gmail.com> Subject: Re: [PATCH v2 1/2] mtd: cfi: respect reg address length From: Nuno =?ISO-8859-1?Q?S=E1?= To: Stefan Roese , Nuno =?ISO-8859-1?Q?S=E1?= , u-boot@lists.denx.de Date: Mon, 24 Apr 2023 09:13:19 +0200 In-Reply-To: <45920b00-f93b-913c-28cd-ef1dbe9aa990@denx.de> References: <20230418130728.1456056-1-nuno.sa@analog.com> <45920b00-f93b-913c-28cd-ef1dbe9aa990@denx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 24 Apr 2023 14:01:51 +0200 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 On Mon, 2023-04-24 at 08:54 +0200, Stefan Roese wrote: Hi Stefan, > Hi Nuno S=C3=A1 >=20 > On 4/18/23 15:07, Nuno S=C3=A1 wrote: > > flash_get_size() will get the flash size from the device itself and go > > through all erase regions to read protection status. However, the devic= e > > mappable region (eg: devicetree reg property) might be lower than the > > device full size which means that the above cycle will result in a data > > bus exception. This change fixes it by reading the 'addr_size' during > > probe() and also use that as one possible upper limit. > >=20 > > Signed-off-by: Nuno S=C3=A1 > > --- > > v2: > > =C2=A0 * Fix compilation when CONFIG_CFI_FLASH is not set. Done by rede= fining > > cfi_flash_bank_size() when CONFIG_CFI_FLASH is set (by returning dts si= ze). >=20 > Unfortunately this does not work. Build fails on multiple targets. > Here an example: >=20 > $ make qemu_arm64_defconfig > $ make -sj > drivers/mtd/cfi_flash.c:120:13: error: conflicting types for=20 > 'cfi_flash_bank_size'; have 'phys_size_t(int)' {aka 'long long unsigned= =20 > int(int)'} > =C2=A0=C2=A0 120 | phys_size_t cfi_flash_bank_size(int i) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~~~~~~~~~~~~~~~~ > In file included from drivers/mtd/cfi_flash.c:36: > include/mtd/cfi_flash.h:178:15: note: previous declaration of=20 > 'cfi_flash_bank_size' with type 'long unsigned int(int)' > =C2=A0=C2=A0 178 | unsigned long cfi_flash_bank_size(int i); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~~~~~~~~~~~~~~~~ >=20 > Please run a world build next before sending out the next patchset > version. >=20 Arghh, sorry for this! I did run it for micoblaze_defconfig and integratorcp_cm926ejs_defconfig. S= hould I build it with V1 or something? Or is there somewhere where I can push my patchset to trigger some CI and look for these kind of things myself before sending v3? - Nuno S=C3=A1