Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1025003iob; Fri, 13 May 2022 20:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/BW0Yi4uSW5P8uT3VqppdDPG/zId+HDBJl/cBAY6zsoRcN1Gk59S1U2j7gjSwBpAOyviO X-Received: by 2002:a7b:ce07:0:b0:394:890e:9193 with SMTP id m7-20020a7bce07000000b00394890e9193mr7217985wmc.117.1652497555443; Fri, 13 May 2022 20:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652497555; cv=none; d=google.com; s=arc-20160816; b=m0+Cg6OJGfXV2AJZLyqdbagidR0r5L7BcVljZf2S1CoTRo20d+RunXfAzjyxsN4PsQ W+Bjh5k+L0zFb9KWcRlDXOJTLqy+AYnhYxaOxMmBnLBTnvgHzvJPJsA8vyFhc3yHH+zw wRSD3g+nq7Zfv0vLsSscyvYx2Z+Px7HtPhAhAwAoY1hdI3vq0+kS9FNX1ECIHyCtiuhx Q7ZZbefpRILUWJsU9jyS5nZ5EagS3wqzSZNfIRNjkdH8o7+qul6QJydQnVJSsOjg0CRz mbFkKGHwhmcehvG+DFvtoxAMedzspp0moBKIWQesKrUKckZW3+m1sXB68TjUYUsV4hbv Wv/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GEBVO526tGaBFhsEBcr7i0hn9kgknNzqkhTyUK/Hejk=; b=o1/qKXRUHrWVe0rrmi6iLpGbeOQ0z5006atN49Jzg77+9wOyhiCcibHSaa6abf5ZBF EH7YzI3DIX5zgxVqpvWN/+klv05bRyZRaqex76u4cbb8YrBynGrMg1PBR9mZvQM93SUe t8vggwwOY1bMvxLrsek8koIPDjgLfaNkbD+z18q3f8L3gZ/jdSrU+FA5KIoh6S4LVntr IWE8O810aoYFKYPezVykJbed07YStE/2HNaOwWaPmZtwDQ/k5Mjns1aObKfLVl5gx+hP wvGt3W6bEvgiE9YR32eIP5PVD1MX/u7cHQzfiaNBxE9/Gj4p5H5bJbloeLF+IHvvxTsf EAEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QgOU5oPx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i203-20020a1c3bd4000000b0038e6f1581e4si6996571wma.130.2022.05.13.20.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QgOU5oPx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C8DA3B3AD2; Fri, 13 May 2022 16:47:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381407AbiEMObX (ORCPT + 99 others); Fri, 13 May 2022 10:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380799AbiEMO13 (ORCPT ); Fri, 13 May 2022 10:27:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3199B39828; Fri, 13 May 2022 07:27:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 78DAAB8305B; Fri, 13 May 2022 14:27:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0543C34117; Fri, 13 May 2022 14:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652452024; bh=HFF/gg0eDw4LZavuZrPdCCTBbCiwwglPcIcU81h9Ij0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QgOU5oPx2BFbGY9OAJXKYpzJ/HzlQqVUDlei1NiCveRgYCSzcHFqKwTYZGiJGzeW3 2s2qxbg/62tavyob6MKIhSpnaw6c7ghRo1Uk7us4ggpQetq0NzoC3I/UciaUIAqrTE egoTy0Sx3aOpG7H6zRkWw4je7JBRLShacuB9vA2Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Larsson , Marc Kleine-Budde Subject: [PATCH 5.4 06/18] can: grcan: grcan_probe(): fix broken system id check for errata workaround needs Date: Fri, 13 May 2022 16:23:32 +0200 Message-Id: <20220513142229.343286299@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513142229.153291230@linuxfoundation.org> References: <20220513142229.153291230@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Larsson commit 1e93ed26acf03fe6c97c6d573a10178596aadd43 upstream. The systemid property was checked for in the wrong place of the device tree and compared to the wrong value. Fixes: 6cec9b07fe6a ("can: grcan: Add device driver for GRCAN and GRHCAN cores") Link: https://lore.kernel.org/all/20220429084656.29788-3-andreas@gaisler.com Cc: stable@vger.kernel.org Signed-off-by: Andreas Larsson Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/grcan.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- a/drivers/net/can/grcan.c +++ b/drivers/net/can/grcan.c @@ -241,7 +241,7 @@ struct grcan_device_config { .rxsize = GRCAN_DEFAULT_BUFFER_SIZE, \ } -#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 0x4100 +#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 4100 #define GRLIB_VERSION_MASK 0xffff /* GRCAN private data structure */ @@ -1656,6 +1656,7 @@ exit_free_candev: static int grcan_probe(struct platform_device *ofdev) { struct device_node *np = ofdev->dev.of_node; + struct device_node *sysid_parent; struct resource *res; u32 sysid, ambafreq; int irq, err; @@ -1665,10 +1666,15 @@ static int grcan_probe(struct platform_d /* Compare GRLIB version number with the first that does not * have the tx bug (see start_xmit) */ - err = of_property_read_u32(np, "systemid", &sysid); - if (!err && ((sysid & GRLIB_VERSION_MASK) - >= GRCAN_TXBUG_SAFE_GRLIB_VERSION)) - txbug = false; + sysid_parent = of_find_node_by_path("/ambapp0"); + if (sysid_parent) { + of_node_get(sysid_parent); + err = of_property_read_u32(sysid_parent, "systemid", &sysid); + if (!err && ((sysid & GRLIB_VERSION_MASK) >= + GRCAN_TXBUG_SAFE_GRLIB_VERSION)) + txbug = false; + of_node_put(sysid_parent); + } err = of_property_read_u32(np, "freq", &ambafreq); if (err) {