Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp986018iob; Fri, 13 May 2022 18:38:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQu6WUoMxQGfz9ZhJ53zTWozx5nhcQ2onkDSBsVin/PojuKUigPrHkRk5dlwiCabKoQWQx X-Received: by 2002:a7b:cb84:0:b0:382:a9b9:2339 with SMTP id m4-20020a7bcb84000000b00382a9b92339mr17637500wmi.91.1652492311617; Fri, 13 May 2022 18:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652492311; cv=none; d=google.com; s=arc-20160816; b=Pl0YgtN0ateMdiWG6RliAO8qHjeClJ0kja3M8u0UaR4Aclcp1705xCFIinIWnqXk+t JglMI5yMupl7qTm1h7rACjdt9E8MgIHj0yDRIe1qdhm9vcZ6iNqmIp1mX1ONnpnD7Hrm VQV7wj/xdSml8Ci2xSfJAO2WAjgILN7skGJ//QKrjLXf15drJlblPArxo4e7uI+5Cmti ywBreVT5RGUsjiaaDLDDoywN8YfjW1qW4a5FB8ZdOXlflqOGmQHysECVt9UhPiiTm/hG JsDOOa6coUp2Ps+euvlUTYL+zIoSmdNmuOfmHJ1VXKldgCUelpr+tqQzGHh5B15tb03s njOg== 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=8LxE/GhBU/Gqn1Oxy4zdI/N24gHyQisWRazUIR512Cw=; b=sz+7GN4sVcWEnfXDkUW8hGF2c2wi9ChxigumEKykbnoSsg0mG9dTbGxT6Kkmo9/ies Qgtd3QCWfrCj/MhsCcOhE59KPTWPJmC3R2mDUlKcKPuABmSBN4H6aItRBOftwdsbZEu3 zeLPGe5Ji6s/jSANQqQvOm9+YyV25U5Ceyxaz/AeDcTpB/TaOmxbRxat1gTu69Z57q+P FhkXeRCIdl+7/oGHlDuwBRGz6QDIHj+Ezn6hJbFzdGRGty3HKPx0S73PwB4U4/knf9X9 AUauocFTib7y2lo5vkYkaIXHYdXvVgcfVllnBBXc+iSgWURQtSztTxjf+SQBqcVnUOgi Zxrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BPotrmJ6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id 18-20020a05600c269200b0039437f4ca80si3127755wmt.153.2022.05.13.18.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:38:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BPotrmJ6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 9637A41BF9F; Fri, 13 May 2022 17:05:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380853AbiEMOam (ORCPT + 99 others); Fri, 13 May 2022 10:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357133AbiEMOZ6 (ORCPT ); Fri, 13 May 2022 10:25:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C1C25F8F6; Fri, 13 May 2022 07:25:10 -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 004B861F99; Fri, 13 May 2022 14:25:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2CCEC36AE2; Fri, 13 May 2022 14:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652451909; bh=fHimoKp/mXL+UxFA5uk5tI0L5eJ2S8lPXohgxQuYI1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPotrmJ6AaMsVWurexvTLRjRrnibAj0FMCbekjFUWkcq/OHbbGG1FFWUZkwNVpbsN OX50PZYJzYOpkmt3dZzmb3lUMUxXsYz5XK3BGL5GkwXS7yXENgNGYkIGqvH6hJUIG8 CYTGmuZ4szMgC6I7BRIZnDuTsZTXr9dzpQWZFbT8= 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.14 03/14] can: grcan: grcan_probe(): fix broken system id check for errata workaround needs Date: Fri, 13 May 2022 16:23:19 +0200 Message-Id: <20220513142227.483170199@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513142227.381154244@linuxfoundation.org> References: <20220513142227.381154244@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 */ @@ -1665,6 +1665,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; @@ -1674,10 +1675,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) {