Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp294782lqg; Thu, 11 Apr 2024 03:15:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqEWCwNU7WoL/H4xuAhXaOngKkhazXdtoNXzOfkS4m6AMsMcMcv7PKtKQvG9GrvT9IVj2b1xSQgh6Kz7wvlKaCnG17yqjJX77Mm11Jjw== X-Google-Smtp-Source: AGHT+IEfFcsEJRjKIpzQaIidGjIZmvNKS8R6MYnG8MdtkYtekBg/SFsN0wtDl7EV7K9b2iDpacD4 X-Received: by 2002:a17:903:188:b0:1e2:a162:6f7a with SMTP id z8-20020a170903018800b001e2a1626f7amr6366749plg.43.1712830508536; Thu, 11 Apr 2024 03:15:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712830508; cv=pass; d=google.com; s=arc-20160816; b=jXrhtGgpqNKtPBHr6aSse2Q3ugf3wqYdK4SAXkZ1dAGYVDNhmMueODXqPkocp8E9T3 AtgVMiIoHCsE/pD1ZFp+hImDWq7J/8qkxYC0DzWmBUzH6qKLH8zo3GcWZuibWpStNcSj f/Vi/o4DE54mk2IJnXNvJv+tjRIjvMJtUnVYx21dUmEYqZs/ByeIA6LISCXuh2cnETSL JWgFoPClDQ33EiELz8QrRTyPZ6gUJp2PbAa+KfrRSDPrspnT46hyUoiav3plJ/qtQ1Eb 2Rg81ccXSCQH4WxLNqq/djhvYP8v4zPtpM+6O5U3DaoFAFGhsZcVF0XxP8KFXbWHTPJC a7Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:from:to:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=r29/kIGqcmoe5Q56OOEiHGJ3bdPBa/zexDs6zdvg0A8=; fh=W6qp2aQAfSp6x+ZNnbZp26T510nr4zSLHz16AWptf18=; b=IOKXb2lcecAx9ZDi5tmHkVohjN9QrJMk3vnzmxKT7vnCt09UKh51Xa9P6icsEcnttw q2npcRu2d0ygrY0hS4hZ6DShEQWEqhLpFxpMSrLrIbgYJ/lsU9kWZ+C1+kIVhZe7+Dhv x2KqDSkpTdJga+eRsRXSabqtMxt3BVLOJfYx8cK27qmQHrDaIdfWd/zfO3sT0Sv66Uoz aK/4rPY0/nkYMuh4kflOu6wPFV0YOnt/sTd6QiB8+4Vj7cSUwBHxpDZRmxQMrS/tHGZz 9nO0PjymiPm3VYi+ysrTkeRebBFc4/fP/8PNLz0hazZgyl5Ewcc4XXwqsjporsqfXYeM PbiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NLOM82Oz; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-140227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140227-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q17-20020a170902f79100b001dd67c1b4e8si1043630pln.310.2024.04.11.03.15.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 03:15:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NLOM82Oz; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-140227-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140227-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2568528327F for ; Thu, 11 Apr 2024 10:14:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2AAA1465A4; Thu, 11 Apr 2024 10:14:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NLOM82Oz" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 DD84B145B3E; Thu, 11 Apr 2024 10:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712830455; cv=none; b=JzywzzFk/xRDjXQa92JdZY7bJOXgLJHGc4APjY4O/TZTOQr31+aTA3gznOKBaEm/rJSMP1UX/nbdlTfS6KEuwy0eg6q+/VOBsyCKj7GCufjNDprwjN1XAhbbrJwQ3/dm1LAwUu/F90C6ELFvIuxlQBRAFivLSGAzDPcVq8jJH3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712830455; c=relaxed/simple; bh=mIiR5+e+l2jTYUs6ji27JbnMDzbTv+h4m4icjPb7REY=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=swtyWE8qJORBcKNz3wipb4C0reU0/MxxzbdvOLv79rf+PZhs4NSrEjjuOlwwYc2EWdEwVO5dWFV+mZt+uh6zl1tY2ltS52SeZpuTITVgxwM06IdCVlHmbjBVwa7hiwBePG4rK3Xdkp6L8pzuyovXRb9LgcuHkLWLtCRgT7XjMmk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=NLOM82Oz; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 9D6D140006; Thu, 11 Apr 2024 10:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712830450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r29/kIGqcmoe5Q56OOEiHGJ3bdPBa/zexDs6zdvg0A8=; b=NLOM82OzTNpduyfXeECKXTy2l1KeB4TlDQ3Cyx24Vyacump5ak8yIbKinNuIb137lHQs4C s8qgGg3sScr3pz2epgdEt93tfcxUPdLOxg3GVW5ZgwvHqJ9CUCHiU33iLHqLACS8O+8GX3 97l7j4wjuwG/H+KoawgSxAiaWFMGHQJibLoU49OYXC6jqzzTl49mdniTDW9wS7pwraP6xU tP3wB4PKD0O3FFCVEMAQhBeTm3AjvF/VPkjO0pIijAesZhzTdvWwW/pJ+2ch2aB4HEzuw9 bABWQ1g+oHku3AnMKjjnLVB6bEFHzEk6I3thJ5a+G7YHc1IMY5OzLxQsi5WTrQ== 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 Content-Type: text/plain; charset=UTF-8 Date: Thu, 11 Apr 2024 12:14:09 +0200 Message-Id: Cc: , , , , , "Vladimir Kondratiev" , "Gregory CLEMENT" , "Thomas Petazzoni" , "Tawfik Bayouk" To: "Stephen Boyd" , "Conor Dooley" , "Krzysztof Kozlowski" , "Linus Walleij" , "Michael Turquette" , "Philipp Zabel" , "Rob Herring" From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH 04/11] clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag X-Mailer: aerc 0.15.2 References: <20240410-mbly-olb-v1-0-335e496d7be3@bootlin.com> <20240410-mbly-olb-v1-4-335e496d7be3@bootlin.com> <4ce9f3cea1ecd3777cf3e291cc865210.sboyd@kernel.org> In-Reply-To: <4ce9f3cea1ecd3777cf3e291cc865210.sboyd@kernel.org> X-GND-Sasl: theo.lebrun@bootlin.com Hello, 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 accesses= are used > > * for the divider register. Setting this flag makes the register= 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 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. > > > const struct clk_div_table *table; > > spinlock_t *lock; > > }; > > We should add a kunit test. 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. Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com