From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0C2E71DED53 for ; Sun, 29 Jun 2025 19:04:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751223872; cv=none; b=oKBd7gbOVIDxPfBonTtWAgBUBhga9aLdZkxfCefJFaPY4HkcvA0FN+EK3HSnS8MW1Okfzw0E/yKE6VnhZpUec/1hmxSlp4vUMz2hmNp64O633Ax0SjU1N4w/177xKjDewOyjmo1YNUur+8gG0k3POzzsXL5EOv9CRCEeviv2gbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751223872; c=relaxed/simple; bh=M10Ctqs7hcuFcS2TexQxfgsXUncjchaWsO0PwT9D8GU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K8Pq4sPOkhW3hwWlmsYO6Bnuya/ozj6A/3UqTU2xSguWHN/ACxXccvzSSQ+O3m172qq0YhuBQ7yLy0UhSnEBNPOdImNHej+lv6N6/c4PJbb6pgGHx/DyfAzCNtgPM1HTYK/G4jqXZexnNHp58MgJsYb3BYctYuhQMRKE6ElhQ0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FXxYMawu; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FXxYMawu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751223870; 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=s49YQGftGKpHPbBrk+2AAdXS1ZVznQ5MfA7qQvDwtec=; b=FXxYMawuwOnswUh+fYYW3BYUwQOa/TYCv+t2UUUMcju2hPwfTGv/AeDVRKIx+dLXTIdncv eFSFdf0bygQIP7kextfXtOg8ZS/BjHGQmYYNRa0KnsUC78hv0vNwEIOzlbTJkpZE2dmtNk MxB8lNgI85JirQRu5QGE5icyd+xwHaw= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-hLuN9LUrNUaJhEg8GSdwOQ-1; Sun, 29 Jun 2025 15:04:25 -0400 X-MC-Unique: hLuN9LUrNUaJhEg8GSdwOQ-1 X-Mimecast-MFC-AGG-ID: hLuN9LUrNUaJhEg8GSdwOQ_1751223863 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BC31118001D1; Sun, 29 Jun 2025 19:04:22 +0000 (UTC) Received: from [10.45.224.33] (unknown [10.45.224.33]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 53DC618003FC; Sun, 29 Jun 2025 19:04:16 +0000 (UTC) Message-ID: <1e2997cd-6932-46bd-8d5b-35a98b52abae@redhat.com> Date: Sun, 29 Jun 2025 21:04:15 +0200 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v11 14/14] dpll: zl3073x: Add support to get/set frequency on output pins To: Paolo Abeni , netdev@vger.kernel.org Cc: Prathosh Satish , Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Simon Horman , Jonathan Corbet , Jason Gunthorpe , Shannon Nelson , Dave Jiang , Jonathan Cameron , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Michal Schmidt , Petr Oros References: <20250616201404.1412341-1-ivecera@redhat.com> <20250616201404.1412341-15-ivecera@redhat.com> <7fce273d-06f4-498c-a36a-d6828b4d4f30@redhat.com> Content-Language: en-US From: Ivan Vecera In-Reply-To: <7fce273d-06f4-498c-a36a-d6828b4d4f30@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 19. 06. 25 1:40 odp., Paolo Abeni wrote: > On 6/16/25 10:14 PM, Ivan Vecera wrote: >> +static int >> +zl3073x_dpll_output_pin_frequency_set(const struct dpll_pin *dpll_pin, >> + void *pin_priv, >> + const struct dpll_device *dpll, >> + void *dpll_priv, u64 frequency, >> + struct netlink_ext_ack *extack) >> +{ >> + struct zl3073x_dpll *zldpll = dpll_priv; >> + struct zl3073x_dev *zldev = zldpll->dev; >> + struct zl3073x_dpll_pin *pin = pin_priv; >> + struct device *dev = zldev->dev; >> + u32 output_n_freq, output_p_freq; >> + u8 out, signal_format, synth; >> + u32 cur_div, new_div, ndiv; >> + u32 synth_freq; >> + int rc; >> + >> + out = zl3073x_output_pin_out_get(pin->id); >> + synth = zl3073x_out_synth_get(zldev, out); >> + synth_freq = zl3073x_synth_freq_get(zldev, synth); >> + >> + /* Check the requested frequency divides synth frequency without >> + * remainder. >> + */ >> + if (synth_freq % (u32)frequency) { > > As the frequency comes from user-space and is validated only the DT > info, which in turn is AFAICS imported verbatim into the kernel, I > *think* it would be safer to check for 0 here or at DT info load time. This check is superfluous, the frequency from user-space is validated in DPLL core against frequency list provided for particular pin by the driver. And frequencies from DT are filtered/checked during load. So no check is needed here. Will fix. Ivan