From patchwork Fri Jan 24 09:29:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABCAAC2D0DB for ; Fri, 24 Jan 2020 11:40:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80770206F0 for ; Fri, 24 Jan 2020 11:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579866025; bh=PGNn/rlQpo4urXbuzI6poAVhUyocjwhj6qJ14uRVfmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rdtjMwJjcPis+GhpRFYGnrlv/fes1x3phmI37tDWvG971DvmAe9wXCrfRTTlXAcJA TibhLaqaGICTk2hLDlexhbOTQj07veJ2ntgTQRQoTsDd4PjLgoqWhHtAT3L4W2F8kD WZsy1n/6snHTda+OBXlCLu0qN1yhjhrZ6uh+hehM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391244AbgAXLkV (ORCPT ); Fri, 24 Jan 2020 06:40:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:33826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390760AbgAXLWZ (ORCPT ); Fri, 24 Jan 2020 06:22:25 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 01B2021569; Fri, 24 Jan 2020 11:22:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864944; bh=PGNn/rlQpo4urXbuzI6poAVhUyocjwhj6qJ14uRVfmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wbu5ZXqIQBVagjkDu1hfvLpyn8pSbh09FUXdlfBOKlt/7507xpULTBFLs9MCRRlBu cLcoJ+LeXMklPQEykrUL1KkZeCgiFmsCIB5Kovz2SfXCL7taHpkI8eoP8QKu4abxx/ KW3jqVFjSynggRhjMGLnY23T5B+rwKYaf2X4x3L8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Markus Mayer , Viresh Kumar , Sasha Levin Subject: [PATCH 4.19 409/639] cpufreq: brcmstb-avs-cpufreq: Fix initial command check Date: Fri, 24 Jan 2020 10:29:39 +0100 Message-Id: <20200124093138.287358418@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli [ Upstream commit 22a26cc6a51ef73dcfeb64c50513903f6b2d53d8 ] There is a logical error in brcm_avs_is_firmware_loaded() whereby if the firmware returns -EINVAL, we will be reporting this as an error. The comment is correct, the code was not. Fixes: de322e085995 ("cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs") Signed-off-by: Florian Fainelli Acked-by: Markus Mayer Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/brcmstb-avs-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c index e6f9cbe5835f9..6ed53ca8aa980 100644 --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c @@ -446,8 +446,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv) rc = brcm_avs_get_pmap(priv, NULL); magic = readl(priv->base + AVS_MBOX_MAGIC); - return (magic == AVS_FIRMWARE_MAGIC) && (rc != -ENOTSUPP) && - (rc != -EINVAL); + return (magic == AVS_FIRMWARE_MAGIC) && ((rc != -ENOTSUPP) || + (rc != -EINVAL)); } static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)