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 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 3E252C433F5 for ; Wed, 11 May 2022 15:48:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C2468433C; Wed, 11 May 2022 17:48: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="k40SzWgG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 432C884342; Wed, 11 May 2022 17:48:53 +0200 (CEST) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (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 49D738433C for ; Wed, 11 May 2022 17:48:50 +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=seanga2@gmail.com Received: by mail-qt1-x835.google.com with SMTP id k2so2306579qtp.1 for ; Wed, 11 May 2022 08:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XfiafkZzrdMYFzgpXaaHVwdJFCRH9q4up6QrkLUzCV4=; b=k40SzWgGlbOuKvQZM3mO8Wp5U0bjUFmAdn49cFQwwQIaoqKCoevrWkjX7J5T2YnqlE tByPm81ryM4v/l96uyizO+x4S2FXCo6nQyiMOSk8wb08RaLZ8mnTsN4HuZvnxNHBpyR9 f/WdrkpsrVm5PZstGIUPl2/MWvC9VwnPF5qAGkBpzqK7WQUXvFfP3xFGmAaAaOC4wnvg zluC3PcSmr4yh3dfVOp/vKmJTMua/rp3PCTnxEBYsvGah26oBt8Yu35Al8CtwSkPlYoH 5oYDD3kktYY0IPiS42T6eiHF4PBor0ex7rKbJtKs+wm6ngqiGl2zEQHSpwUL01V/1dNH vNrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XfiafkZzrdMYFzgpXaaHVwdJFCRH9q4up6QrkLUzCV4=; b=rlPS563GBu1e8GKUbPe7k3WNAKkL9aC6OFN7Y+R+Kc7pmynIrO3vvHdxHRBcOcjdfo Sgb8S01sFgRnbkor8qIdgWk+Uj6olyTrTQZK4XA57STxewmCxlPVTViuc93ZO/SXQUP/ qe0cUb9L7iOtXzGLHZQBKjlKLWkObLMggCk4QvCJKnl6Rufo5ZgRmNctc6PXemNABBxh EVrewe40DCpTEoyaQ+qianGg47SkhCRIEqMGQMgT9r6KZN7uc46jKgES3YANcuItRlIt 0pZfArRZJaKFTXHfdpqY51T6FIcCgQgjwde6Ycq+mHpWWRiTIE5ehWp0dm1RvofbGlEa 9pVQ== X-Gm-Message-State: AOAM533X6u5FK3mltsqtilEic+BVz9UQcMIFFkWmPVBeYjuh1/z1C8sA hJTMuKAr4bzATaSfou/BFIM= X-Google-Smtp-Source: ABdhPJzDqtEmKN3/oy2vN7qrF3N3jOnekqUGMiYOHj0Ag8N6GYqjqIirImOJH7Ho/FtHZMAQB0E4tA== X-Received: by 2002:ac8:7dd5:0:b0:2f3:d8bd:19e4 with SMTP id c21-20020ac87dd5000000b002f3d8bd19e4mr15081338qte.103.1652284128917; Wed, 11 May 2022 08:48:48 -0700 (PDT) Received: from [192.168.1.201] (pool-108-18-248-138.washdc.fios.verizon.net. [108.18.248.138]) by smtp.googlemail.com with ESMTPSA id j8-20020a05620a288800b006a05a6243d5sm1507855qkp.13.2022.05.11.08.48.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 May 2022 08:48:48 -0700 (PDT) Subject: Re: [PATCH 0/7] clk: sunxi: Out-of-bounds access fix and driver cleanup To: Samuel Holland , u-boot@lists.denx.de, Jagan Teki , Andre Przywara , Lukasz Majewski Cc: Bin Meng , Heinrich Schuchardt , Maxime Ripard References: <20220509052937.42283-1-samuel@sholland.org> From: Sean Anderson Message-ID: <2a6ea152-3143-4f06-66ff-110c568cab55@gmail.com> Date: Wed, 11 May 2022 11:48:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20220509052937.42283-1-samuel@sholland.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 5/9/22 1:29 AM, Samuel Holland wrote: > This series fixes an issue with out-of-bounds access to the gate array > (patches 1-2), uses the rearranged array size information to remove a > bunch of duplicate code (patches 3-4), and then simplifies how the reset > driver is bound (patches 5-7). > > The original motivation for these changes was adding a driver for the > legacy A31/A23/A33 PRCM binding (which I will send separately), and > trying to use OF_PLATDATA in SPL (which did not work out). But I think > at least some of the cleanup is worth applying on its own. > > Patch 4 is generally the same change I made between v1 and v2 of the > pinctrl series, using some #ifdefs to share a U_BOOT_DRIVER. It's not > quite as clean as the pinctrl case, because here the SoC-specific parts > are in different files, so all of the CCU descriptors have to be global. > > > Samuel Holland (7): > clk: sunxi: Store the array sizes in the CCU descriptor > clk: sunxi: Prevent out-of-bounds gate array access > reset: sunxi: Get the reset count from the CCU descriptor > clk: sunxi: Use a single driver for all variants > clk: sunxi: Convert driver private data to platform data > reset: sunxi: Convert driver private data to platform data > reset: sunxi: Reuse the platform data from the clock driver > > drivers/clk/sunxi/clk_a10.c | 27 +----- > drivers/clk/sunxi/clk_a10s.c | 27 +----- > drivers/clk/sunxi/clk_a23.c | 27 +----- > drivers/clk/sunxi/clk_a31.c | 25 +---- > drivers/clk/sunxi/clk_a31_r.c | 29 +----- > drivers/clk/sunxi/clk_a64.c | 25 +---- > drivers/clk/sunxi/clk_a80.c | 36 ++------ > drivers/clk/sunxi/clk_a83t.c | 25 +---- > drivers/clk/sunxi/clk_h3.c | 27 +----- > drivers/clk/sunxi/clk_h6.c | 25 +---- > drivers/clk/sunxi/clk_h616.c | 25 +---- > drivers/clk/sunxi/clk_h6_r.c | 27 +----- > drivers/clk/sunxi/clk_r40.c | 25 +---- > drivers/clk/sunxi/clk_sunxi.c | 168 ++++++++++++++++++++++++++++++---- > drivers/clk/sunxi/clk_v3s.c | 27 +----- > drivers/reset/reset-sunxi.c | 55 ++--------- > include/clk/sunxi.h | 21 +---- > 17 files changed, 208 insertions(+), 413 deletions(-) > For this series: Acked-by: Sean Anderson