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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56638C00140 for ; Wed, 10 Aug 2022 15:51:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbiHJPvj (ORCPT ); Wed, 10 Aug 2022 11:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbiHJPvi (ORCPT ); Wed, 10 Aug 2022 11:51:38 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ECAD4B4BC for ; Wed, 10 Aug 2022 08:51:37 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id z12so18222189wrs.9 for ; Wed, 10 Aug 2022 08:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc; bh=de1bfIeCzht/PqANgMdEHr89VgLf+QFh5U3BT1EWLbA=; b=BTpT3e1IHvP3qZibGNSre2fvR3R4RZDlEChu2oxdCo8+w163kWUdzxwWt+S6XxwKl0 fh5l/JAO4Zr3ojSmGQwE/RGhvehU4kerq0S8VN3szDU4JpTxhc5AxIy4OnUthI0WTb3C sOzSS5BDklAOGjIeHLdmqQokLG2gd4b7PB8Yv4Zs6yFPnJg0LzierVnzZZoTUNZXtr3F sdyswUaVZV9wUZjN/zjcuOeJ8fPO6TxXf5FvNib1kn2sUDKMBn3JEMBMY3GHs50arRXX rqImfwqZV+MaGStHCPAeBXcfVVqhK/3RzLlRWKN2iHDtUkugHz2Em2I62nhTArbGDo6d z0Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc; bh=de1bfIeCzht/PqANgMdEHr89VgLf+QFh5U3BT1EWLbA=; b=XWE9sl3DmJFgCVHiH5fRwGEDN69kPdC7i/3sOmQFzvPCMstyQLk6JtYunsseMAkMrF 33MuhwvggayuywlQ0LFgfb6p3nQrrS8K7RWE5NZSHScOKwXMPX2jG61NMIwNM9E1KQ8c tjOgRndEl/xR47LzMFYZXsBrnvoAWezrSbcW0pxjBHeATF4z4vlU6fLWemCrKlFNfoLS 0f2zisuA3jqCOpK0saIRZ2LP0tc4CBEPRmL83uYlz9m+OoRleM87z1E7jyDoXoohfAE3 GwqJB/iMBHmLtZtPLDmPG9eM8oWtIH0PYniAP7dAZ2Cqw0uhWuGSOo7uZcEnbIKmfP3w Q6Rw== X-Gm-Message-State: ACgBeo0cQV3LMEeiy47tE07Yvy0UFRkyJq0ScqhU1uD+c6USWCLMnltm yQjP7pSNF86tUfTCJg2Jpx4CJg== X-Google-Smtp-Source: AA6agR7Q5Mp3w9f9/hxYT2JWYltgiLUYBmJ093avPRRW1qIQyFWlA5lbd3ieExjR2ZNFGI9kCBxmeQ== X-Received: by 2002:a5d:6248:0:b0:222:cd3b:94c8 with SMTP id m8-20020a5d6248000000b00222cd3b94c8mr9557443wrv.97.1660146695304; Wed, 10 Aug 2022 08:51:35 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:bbf0:b69d:fecb:8006? ([2a01:e0a:982:cbb0:bbf0:b69d:fecb:8006]) by smtp.gmail.com with ESMTPSA id g9-20020a05600c4ec900b003a325bd8517sm4164965wmq.5.2022.08.10.08.51.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 08:51:34 -0700 (PDT) Message-ID: Date: Wed, 10 Aug 2022 17:51:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] spi: meson-spicc: save pow2 datarate between messages Content-Language: en-US To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Da Xue References: <20220809152019.461741-1-narmstrong@baylibre.com> <39c2f53b-8f53-ceb1-ae0c-81e5e53d01aa@baylibre.com> <518f22f4-1582-924c-9eaa-28ebbe53a632@baylibre.com> <9dabe979-f6b5-329d-f017-a8f0c00adeca@baylibre.com> From: Neil Armstrong Organization: Baylibre In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On 10/08/2022 16:49, Mark Brown wrote: > On Wed, Aug 10, 2022 at 04:40:04PM +0200, Neil Armstrong wrote: > >> I don't think it's worth adding so much code for this since we already > > I don't recall the code for clock providers being that hard? They're > generally pretty small, some of the ASoC CODEC drivers did something > similar. Seems over-engineering to me, but I can explore this path if it's the best route to follow. > >> had an open-coded function which perfectly worked before. > > Except in the cases it didn't... It did but wasn't generic enough to take the new clock path introduced in the new SoCs. > >> I'm perfectly OK to remove the CCF driver for the legacy clock path >> and return back to the old open coded calculation since it perfectly >> worked and stop using the legacy clock path for new SoCs since it would >> never be selected anyway... > > It does seem better to go the clock provider route TBH. I'm afraid this won't fix the problem since CCF won't set the clock again if the rate is already ok in it's cache, we'd still need to save the divider value and restore it after the reset as I did on this exact patch. > >> ... but GX SoCs are broken so it would need an intermediate fix until >> I push the refactoring to cleanup all this. > > I'm trying to figure out if this is actually fixing the problem or just > papering over one case where things happened to go badly. It does, when clk_set_rate() is called, the datarate field would be the same as after the previous call. Neil