From owner-svn-src-head@freebsd.org Thu Nov 29 19:10:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40EA71149F09; Thu, 29 Nov 2018 19:10:49 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D6E57E019; Thu, 29 Nov 2018 19:10:48 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 9785ff3a; Thu, 29 Nov 2018 20:10:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=vGLCJJOu03f1 muIC7ZhuT1mpXqY=; b=P9tVMHQv/0pqLF3QTdL1t//B1bkCQOoS0L6759OqIiQo o43qpDccPoxwXaCRaNllbGUzC2cTFLNcQinALyEE8SL78QQ8+urzhHbRB/79V+Kx sM9jQlG++yJ8zpfU/0jYY2m5VssbVt6UnrSysucjwTwleqAtqrAE2H8Q4YJ9JMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=Hd3qmo QW0RaU63QPEhO9IcTQdRIiKhJYpYvGSlkX/M8Gr7GyO5tKmXWw8bxdQZlXCJ1sGx nPxna/hZ5nqNlo/MQRTIdqI08naJ5SyyZD5S5Nuj+KKWnxTi74+I8QXrI49vJW1t KQ6ASdSyn6yWI/tNA9VqwCM4JuFlvuqTZzLHI= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 07fd0337 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 29 Nov 2018 20:10:47 +0100 (CET) Date: Thu, 29 Nov 2018 20:10:46 +0100 From: Emmanuel Vadot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341254 - head/sys/dev/extres/clk Message-Id: <20181129201046.2f697637d45bf300a7e8341a@bidouilliste.com> In-Reply-To: <201811291906.wATJ666x011804@repo.freebsd.org> References: <201811291906.wATJ666x011804@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5D6E57E019 X-Spamd-Result: default: False [-0.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com]; NEURAL_HAM_MEDIUM(-0.97)[-0.966,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[bidouilliste.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.92)[-0.923,0]; NEURAL_SPAM_SHORT(0.69)[0.693,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; MX_GOOD(-0.01)[cached: mx-backup.blih.net]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.14)[ipnet: 212.83.160.0/19(0.74), asn: 12876(-0.02), country: FR(-0.02)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 19:10:49 -0000 On Thu, 29 Nov 2018 19:06:06 +0000 (UTC) Emmanuel Vadot wrote: > Author: manu > Date: Thu Nov 29 19:06:05 2018 > New Revision: 341254 > URL: https://svnweb.freebsd.org/changeset/base/341254 > > Log: > extres: clk: Fix clk_set_assigned > > ofw_bus_parse_xref_list_get_length doesn't returns the number of elements, fix this. > While here when setting the clock to the assigned freqeuncy, allow the clock > driver to round down or up the frequency as sometimes the exact frequency cannot > be obtain. MFC After: 3 days > Modified: > head/sys/dev/extres/clk/clk.c > > Modified: head/sys/dev/extres/clk/clk.c > ============================================================================== > --- head/sys/dev/extres/clk/clk.c Thu Nov 29 18:37:48 2018 (r341253) > +++ head/sys/dev/extres/clk/clk.c Thu Nov 29 19:06:05 2018 (r341254) > @@ -1297,7 +1297,7 @@ clk_set_assigned_rates(device_t dev, clk_t clk, uint32 > { > int rv; > > - rv = clk_set_freq(clk, freq, 0); > + rv = clk_set_freq(clk, freq, CLK_SET_ROUND_DOWN | CLK_SET_ROUND_UP); > if (rv != 0) { > device_printf(dev, "Failed to set %s to a frequency of %u\n", > clk_get_name(clk), freq); > @@ -1330,9 +1330,9 @@ clk_set_assigned(device_t dev, phandle_t node) > if (nrates <= 0) > nrates = 0; > > - nparents = ofw_bus_parse_xref_list_get_length(node, > - "assigned-clock-parents", "#clock-cells", &nparents); > - > + if (ofw_bus_parse_xref_list_get_length(node, > + "assigned-clock-parents", "#clock-cells", &nparents) != 0) > + nparents = -1; > for (i = 0; i < nclocks; i++) { > /* First get the clock we are supposed to modify */ > rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", -- Emmanuel Vadot