Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1037112iob; Fri, 13 May 2022 20:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnzv9Uk3WLVwZOG/8k1csaGZexvTOGU+FKW4avYkDMFm6em1vfjRHM2Ai4PjJ7EiNCQpQL X-Received: by 2002:a5d:6792:0:b0:20a:d352:10de with SMTP id v18-20020a5d6792000000b0020ad35210demr6379060wru.326.1652499267051; Fri, 13 May 2022 20:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652499267; cv=none; d=google.com; s=arc-20160816; b=TJhxwSdQO3PXUuWzQPCrWMlFwY/Qoo9NUmvg94PoIR68GKIXVRVj7v7MbdRX1k4ZM8 xWgwJas0w9TcqjWxnbvQZEzQBzKBWfe/Ne1xcx49qKuwNLdQ9n/RSkOgin8P+moGOdRr KdaG7QTjuj2oJQu0UPxHQOlNKS2P6OdE0bPHakwYBa1jLDAl8mENnUHGJkntcxxfcipa hJYtpS68n/C6wx4IUxI/qVh018RuuVR3ToXJP7ezr4lDpgj2G/++6QGA24qzCIMRosJP QBZr49Pnw4TqcS2g9bAxR6okR2gjcUHrFwS3xnOKwH3IWHVCcWKmD3pHTTvecuh58KV8 vZsA== 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=5ECltpUAgzdjO+jX7/XnBquV8XYiTZe13VVh1/McYvE=; b=K3xCPSYlLd1TMVCbIvTsRW3BFF/fMF2FfEr3unN1QsuZ6CzT1pF1998nAFGMcMP6Ap ZxPyAnaPuA5IMJwogCv4bEymt+fVUr7eI1Jn4NLtxQWyTudkpK3vkm0WwT5Arfd9G6b1 V+pVeMsgvJXdflAHe6HMjBhgQXJ4W9aInzdIGkCzh5QrAkNLf5oiMT/I9jjZTYnNcz9P Kz0O8UxsuXm7QRCBqj/BIWoyPN2TXI7bJZjnzUg1YCU6wyKokBct13wYwdaAPr2bXQTP LlHAU/rfC2QPBGGLhfZTLyqIWRw0cAzkJ+xv6APsZotF+RzwDu5VTjDw9vConj4kNIfD Dwew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rx+8XR/B"; 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 o40-20020a05600c512800b0038eb818f93fsi7626040wms.167.2022.05.13.20.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:34:27 -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="rx+8XR/B"; 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 154494360D5; Fri, 13 May 2022 17:10:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380935AbiEMO26 (ORCPT + 99 others); Fri, 13 May 2022 10:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381051AbiEMO02 (ORCPT ); Fri, 13 May 2022 10:26:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE778B0A8; Fri, 13 May 2022 07:26:05 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EB8DE62122; Fri, 13 May 2022 14:26:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0954C34100; Fri, 13 May 2022 14:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652451964; bh=Uc2tIDHiFzBQONuh97aDBwrWdOkXOiTES2GizRPUqH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rx+8XR/BoRBengrxMXOQgj7gnKgGY4mdnpjqBcXzzGydiF9ZRI/fh1yHMSzEwl01y enWTzkkvVVLqYFT3F6cH8MBzn87JLf4vmPk5UeFQYgDQjTJy4em1mgRx/MK/wP7c45 slc7U5GcIPlBx87CQ/xnohTLJyNlgsJ2Z67PsaVE= 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 4.19 05/15] can: grcan: grcan_probe(): fix broken system id check for errata workaround needs Date: Fri, 13 May 2022 16:23:27 +0200 Message-Id: <20220513142228.055226183@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513142227.897535454@linuxfoundation.org> References: <20220513142227.897535454@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 @@ -245,7 +245,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 */ @@ -1660,6 +1660,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; @@ -1669,10 +1670,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) {