Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp232331lqn; Thu, 11 Apr 2024 22:20:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8r+dY3irU4/vJe7VkeVpPlbGazZm/sAnuXWa+bYkp+v39kC00rli9NisLhirjaHGK1Rm8elWP/rI05R4yDNO/RAeRll+AumEb/8v8Eg== X-Google-Smtp-Source: AGHT+IHcSsDjE1CZi+Qe7W/XX4XqVc84YKwP7sT+cW+aejMkiodvuvwVFpan1tPL20j3ESuMlk6g X-Received: by 2002:a17:907:1b1d:b0:a52:2b39:879b with SMTP id mp29-20020a1709071b1d00b00a522b39879bmr871386ejc.46.1712899201351; Thu, 11 Apr 2024 22:20:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712899201; cv=pass; d=google.com; s=arc-20160816; b=coPwzVWQXQ7a5PbDlEJQ/X6ez+ndvCoynteQYlb2ayiN0aoTo6VdSkc8Da0DnroeUF 7CMCR7vtr00r6azA8AV7BRfUbtBa3D2iMaVojSMrQqFs4GbSzrvMJa6qWnl5fcSYu+Y6 arOgM+8g3+A/ZI4o9ks4F1WRURt5oCzV305q+onRlmk5FQKPw5STCI7J83718NU2lolC fUb/bXqXWacwPRSX/1rySLCQwo0qblhkof34/B3EMtU2M2swQ7pLqY7LOKkXL3AMEt6m wnMghA8Rm6S40ASxFiaOh0B5EHed71hZ1TTkEm6QDlXlXEgEaEpnyzhii/LfeppUy9ZE wVsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=jLBMiARM2R3VWZpHYrey6oo1ebGDdxd+s31Yc6Xajbw=; fh=Jy2HNXjX8SiLbFVkgY6HlttvjO3R+RPPPl8bmBsIKFg=; b=eyKkVDREfYyvjAi9tZfCKV4ACxbDfjVQYBLH4Us/HBk0CYFuRv8kiVyQOQSZvd7qp3 gduA7hcor+hZdNbo2Y1RvCDkrKobmqmEIHODe2rTNVXX5h/41tP2yahFcNPvjTErzYeP o9z5IijFyhv5iSUmbddfprnfh3ge6GnWnwJsjV6ZhpN1daG/i2vaHSGX2pTEv5ljQd4J D2f9SWRqVLO2XyAYgkEuVqNS9Vff17wCCpJBMw/PGiJbuZkkyAhxGu9X0F4Y1xpuLoR3 wN09OJWjejnU0/1w1NcGMUJOso7P4YTkOLB0lU8YTTC967jxWmqsoTJAaXMqETR02Kdj ffdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J0eg+fB9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141971-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s8-20020a1709060c0800b00a522d16222dsi665150ejf.321.2024.04.11.22.20.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 22:20:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141971-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J0eg+fB9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141971-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 192081F22C06 for ; Fri, 12 Apr 2024 05:20:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A21241B968; Fri, 12 Apr 2024 05:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J0eg+fB9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B57F317BCE; Fri, 12 Apr 2024 05:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712899191; cv=none; b=uSACbe4/8teJa2BcNgNp/+Rr0kv3oiqm0T4fW4TzsS/o1FX+jOkHIJtoUU4OHZRZhMksTzdWSWbYF7lFILI4KQyHotC42iEg3gWSlTY0X+bR/SsKn+pKSCgKGstKRuqRxaViCrpCJX4K+AziqkUAjc+/DUHof9x6kpfvy7BODW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712899191; c=relaxed/simple; bh=JnUwlu3hA8OWMeLa8KCW3yju2ShEzFTZuW+pPMy4qJU=; h=Message-ID:Content-Type:MIME-Version:In-Reply-To:References: Subject:From:Cc:To:Date; b=QD2AMySp98HsoFUKv2W8V/6aVpSEjD+finfvHo5DEfL/X3g7sxuu5vhxX2qA6xIWE4JdqP8z0+dGefnpKxtUHqtqHQboIU6zNamvfkeGONL8QWbjzls2IclmloUB6ffMH7GbnP+UcJQ9FPJrYFO9HhWxnF2UL9zU7ivt/x0oFRg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J0eg+fB9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6608AC2BBFC; Fri, 12 Apr 2024 05:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712899191; bh=JnUwlu3hA8OWMeLa8KCW3yju2ShEzFTZuW+pPMy4qJU=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=J0eg+fB9JaQywMndycZ6ohhjdQC1DvGQG//bGfPBvI17dD7Fh7ivnskva2zGeo78F g8r6mVScCv0aNZvOmVfY5nyDDruzh/GLJKQwTvKzE8AbrfxxOcgbsbCW+t3t+zxYj7 xhaXcAVZCpKt5viKAByf8mv62xRXoYMcMQKeEIMLHq04iN47t7p4IMXXkbRyMvlEUm 2PweoigGphpnbm30iCN0k7+gBtjMFwofoKKLAi8R+Qy3hdyEupHBtzO+qR7pvgDv+k DWYbiV4ilGXM3qv2dPtYyiOvf3BI6iDFVZLWZk8x8JPdOJ4rzWSAhqBb14m8qE4oFb W/F8WDlR+Mhjg== Message-ID: <32dec29a9a29ad204930fbf9eefd2b89.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20240410-mbly-olb-v1-0-335e496d7be3@bootlin.com> <20240410-mbly-olb-v1-4-335e496d7be3@bootlin.com> <4ce9f3cea1ecd3777cf3e291cc865210.sboyd@kernel.org> Subject: Re: [PATCH 04/11] clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag From: Stephen Boyd Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk To: Conor Dooley , Krzysztof Kozlowski , Linus Walleij , Michael Turquette , Philipp Zabel , Rob Herring , =?utf-8?q?Th=C3=A9o?= Lebrun Date: Thu, 11 Apr 2024 22:19:49 -0700 User-Agent: alot/0.10 Quoting Th=C3=A9o Lebrun (2024-04-11 03:14:09) > Hello, >=20 > On Thu Apr 11, 2024 at 5:06 AM CEST, Stephen Boyd wrote: > > Quoting Th=C3=A9o Lebrun (2024-04-10 10:12:33) > > > index 4a537260f655..cb348e502e41 100644 > > > --- a/include/linux/clk-provider.h > > > +++ b/include/linux/clk-provider.h > > > @@ -675,13 +675,15 @@ struct clk_div_table { > > > * CLK_DIVIDER_BIG_ENDIAN - By default little endian register access= es are used > > > * for the divider register. Setting this flag makes the regist= er accesses > > > * big endian. > > > + * CLK_DIVIDER_EVEN_INTEGERS - clock divisor is 2, 4, 6, 8, 10, etc. > > > + * Formula is 2 * (value read from hardware + 1). > > > */ > > > struct clk_divider { > > > struct clk_hw hw; > > > void __iomem *reg; > > > u8 shift; > > > u8 width; > > > - u8 flags; > > > + u16 flags; > > > > This can stay u8 >=20 > It is unclear to me why it can stay u8? __clk_hw_register_divider() puts > clk_divider_flags into flags field of struct clk_divider. > BIT(8) overflows u8. Oh, I missed that part. >=20 > > > > > const struct clk_div_table *table; > > > spinlock_t *lock; > > > }; > > > > We should add a kunit test. >=20 > Will look into how this works and try something for next revision. I > guess you are talking about adding clk_divider tests, not only tests > for this flag? I cannot find any existing kunit tests for clk_divider. >=20 Right, there aren't any tests today. Thanks.