Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1403769ybx; Thu, 7 Nov 2019 11:24:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwoyVcQviDmbS9SQmGVn8y4i6qrIXKdivrK72H9Sqg9SuMz3ZEHeiYsH4H9m+XOCBuu7CzW X-Received: by 2002:a50:fb85:: with SMTP id e5mr5496181edq.274.1573154683069; Thu, 07 Nov 2019 11:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573154683; cv=none; d=google.com; s=arc-20160816; b=pl1bnZT7yGJ16p14ogbCFLFvKpALSHZoa5I9NF5/YO7YX/xXwjrsAmSD8/Ik2BeFX6 51WmW5zdqx1jyWC/OZ/1GhUOp6D/czdhHqXUgkaM5RmiRYOHaryeyHNLwGYWaOCKDK6G JtBiYQOA705/57PmhBtdjUT6xhCg8vBDCpY0MFMTzLyIyEP4umQO9gw9FtOjZeCvTmev aV6A3DhPq/iu03JfaNvoiuUrQEleIxH5GPOJeNw99J6c0xzht33DiZENekcur0qRWb+5 ZTj/WgjUM9mrRnAPn7vUX5WYZ1kwM5lIHaKsOV8JQtFB0Q4dg8CSGpkv/Xlv0tVOf+Kj p08Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:user-agent:subject:cc:to :from:references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=nT/x5vbY5GaSXLF8mJuoqc2h0wLLs7nbKFqndPOtBeQ=; b=0hp8eKBa7k9t6rJMX63MJHcUJfQv01/qnkLX9rIPQX9W04L4aEe2tYunt7rJ31U2T6 4uMv7Jg3FtyWRMXSr0jhw517YAC13g4sgGFHB6cYF/lX8q7XSbGjlOy960b9Ogf3fRJn pcrrFCJSfFkMuO9RrloCj8WZXUrl8UNTCOXN7oMaiSzac9iXb6T9pbE1r9fYo2I8Ck55 KJxRcKB/YFhxCKrvuBIPT30AoWJUxLWdhldEAu9sKqUVm0k8tqfmXfzVCP+xcG+5VYeR 8UcBUTuCuvtXgBwftvwWIVIQZLsgz9jM5hGgX1seo7tcQ89tZt+Q58TGZYIbhjklCODj e9PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0hfQhQvl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qu7si2217380ejb.79.2019.11.07.11.24.18; Thu, 07 Nov 2019 11:24:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0hfQhQvl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726726AbfKGTXT (ORCPT + 99 others); Thu, 7 Nov 2019 14:23:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:58486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbfKGTXT (ORCPT ); Thu, 7 Nov 2019 14:23:19 -0500 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E31B2084C; Thu, 7 Nov 2019 19:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573154598; bh=ftSd/7ehpdn2j3hx+l5leGMaV+fCv0vWroHDpGfHRto=; h=In-Reply-To:References:From:To:Cc:Subject:Date:From; b=0hfQhQvlAHgZvgSiYj3SqZoxBDYPhBwxS6V8lIJkE4gCKLNVwr8xFW/VnOTg57eas U5E6mrzmitJwEZL+uDSfwiAvFlvQcY6Fb59c8wJ2ZggGWcAqQMi/X77ePluNmW6djh BeIajKROeKq22+QdH6HG0wwx9TC+ayGA5ru8WZoU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1573120694-6015-1-git-send-email-rajan.vaja@xilinx.com> References: <1573120694-6015-1-git-send-email-rajan.vaja@xilinx.com> From: Stephen Boyd To: Rajan Vaja , jolly.shah@xilinx.com, michal.simek@xilinx.com, mturquette@baylibre.com, nava.manne@xilinx.com, shubhrajyoti.datta@xilinx.com, tejas.patel@xilinx.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rajan Vaja Subject: Re: [PATCH] clk: zynqmp: Warn user if clock user are more than allowed User-Agent: alot/0.8.1 Date: Thu, 07 Nov 2019 11:23:17 -0800 Message-Id: <20191107192318.3E31B2084C@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Rajan Vaja (2019-11-07 01:58:14) > Warn user if clock is used by more than allowed devices. > This check is done by firmware and returns respective > error code. Upon receiving error code for excessive user, > warn user for the same. >=20 > This change is done to restrict VPLL use count. It is > assumed that VPLL is used by one user only. >=20 > Signed-off-by: Rajan Vaja > Signed-off-by: Michal Simek This sign off chain is incorrect. > --- > drivers/clk/zynqmp/pll.c | 9 ++++++--- > drivers/firmware/xilinx/zynqmp.c | 2 ++ > include/linux/firmware/xlnx-zynqmp.h | 1 + > 3 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c > index a541397..2f4ccaa 100644 > --- a/drivers/clk/zynqmp/pll.c > +++ b/drivers/clk/zynqmp/pll.c > @@ -188,9 +188,12 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, un= signed long rate, > frac =3D (parent_rate * f) / FRAC_DIV; > =20 > ret =3D eemi_ops->clock_setdivider(clk_id, m); > - if (ret) > - pr_warn_once("%s() set divider failed for %s, ret= =3D %d\n", > - __func__, clk_name, ret); > + if (ret) { > + if (ret =3D=3D -EUSERS) > + WARN(1, "More than allowed devices are us= ing the %s, which is forbidden\n", clk_name); > + pr_err("%s() set divider failed for %s, ret =3D %= d\n", > + __func__, clk_name, ret); > + } Shouldn't we catch this much earlier when clk_get() is called or something like that? > =20 > eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_DATA, clk_id, f, NU= LL); > =20 > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/z= ynqmp.c > index 75bdfaa..74d9f13 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -48,6 +48,8 @@ static int zynqmp_pm_ret_code(u32 ret_status) > return -EACCES; > case XST_PM_ABORT_SUSPEND: > return -ECANCELED; > + case XST_PM_MULT_USER: > + return -EUSERS; This is for filesystem quotas? It's a weird error return value. > case XST_PM_INTERNAL: > case XST_PM_CONFLICT: > case XST_PM_INVALID_NODE: