Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6355747iob; Tue, 10 May 2022 16:58:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPtsdUSe0lDm+UUGhc1VXECeqsEeK4YaQPZ0vTmlRQpYGeMf+Y/oT+59ddwpBxnlSDGTGm X-Received: by 2002:a05:6402:484:b0:415:d931:cb2f with SMTP id k4-20020a056402048400b00415d931cb2fmr25939680edv.287.1652227108487; Tue, 10 May 2022 16:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652227108; cv=none; d=google.com; s=arc-20160816; b=FyqCOrMpAe7cZq4ihd0IcZm4Ju1BEt+92GBSy6ZshrLddm9BsprE/lLPSBTaCgQa+7 xWkIZEJvOlJzOGwtAu2qMyAc3OL6d+rpDS4HJ3DT49cMOT4++VVNooUao9vYDFgUk5Uy BMUP98Ia8eW4CBu2UOX51H6DFu+bk5YD9HJaJlYzUeY0pZwPjVjeKbC1yHfoZfKl+a0i +yla7NJT0T4/P4FeK5D49Hx2Dc75lHB1BLfFTc4lDgHHe9aWQIIX95VPEkaPNTI/gu+W DfUQp1c05LXo326AcCwhdf9aTVl2cHCcHEMi02Mr+Q+VSayzEhSBvMX/J8x5pHz+30qy ukQQ== 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=y+XWW0Vv2hwrZS/sms3EBQ6KZeHYsiNpP0V8ZzU8+wo=; b=OaGl7nxQCfaAFcXlGFw5G2RU/toUut4BF9G4yobFNyBwur/50GCFCHCx6lZaV3IH/W dnfA+ez06TDsk5WH6yVCLhuaiwfgVDUJ+2JJHIAoGFcJHCVO/jBWUdgTKch7p1GMJdy/ kgpE+USa7j+7xnCyfYbVmDi2K789yQVIM3c4o2cEfZd9ZQ0H/whvVcpVm8N5dXvFFnYd vMdhUStqF1xHwMjwbNbHRSs2TxvF70zpWy8/toK4kEyq8nOhyl0ya/oVLGWR1b4UVfLq 7N7BqFcOEzt69pdCwgteFG+4Yv43vLEupuAkIKYNm/EL5OtDGiVEyzobqhDw87+qc7x1 V0EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i91ykjz9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd16-20020a170907969000b006f424a70464si760473ejc.868.2022.05.10.16.58.05; Tue, 10 May 2022 16:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i91ykjz9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344349AbiEJO3B (ORCPT + 99 others); Tue, 10 May 2022 10:29:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343555AbiEJN7E (ORCPT ); Tue, 10 May 2022 09:59:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97666D8090; Tue, 10 May 2022 06:39:37 -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 44838B81D24; Tue, 10 May 2022 13:39:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0B9DC385A6; Tue, 10 May 2022 13:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189975; bh=xXJx6p9kaW3KxYiu/puI7rEWMdgmXgXQuAUB7kqjMFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i91ykjz9XoBSh/h8vwLsfvu7L8Hy8uiYkL8ZWBoHqGt5BaGfc+H9ja7diVSrKlvDw lc90Ewi+kjUtP7alhvjQ7pJ2z/XP/IEpbxZUesuhJGXy5IbwA0NsbdDlJbvAd+na/B wZCGCKWgpmIF2sjohb8/XJaU3voL/YcCb56q4Rfw= 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.17 048/140] can: grcan: grcan_probe(): fix broken system id check for errata workaround needs Date: Tue, 10 May 2022 15:07:18 +0200 Message-Id: <20220510130742.994114000@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130741.600270947@linuxfoundation.org> References: <20220510130741.600270947@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 */ @@ -1643,6 +1643,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; u32 sysid, ambafreq; int irq, err; void __iomem *base; @@ -1651,10 +1652,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) {