Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp978827iob; Fri, 13 May 2022 18:23:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpATsD0dQ9XfaUwchrf+DjkY/e4SqFmP5XRm4AcCPx2vDqpk+1m121geVXW3pRKpA/Xrd8 X-Received: by 2002:a5d:64e7:0:b0:20c:5b42:a93c with SMTP id g7-20020a5d64e7000000b0020c5b42a93cmr6063248wri.619.1652491431269; Fri, 13 May 2022 18:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491431; cv=none; d=google.com; s=arc-20160816; b=IqZMkUOJJkLg26pMPCjUt416+dk/BWh5fR05ewR1HZY/UBYgYaBghBoa80lkPEx/0q GRUODF9T3m1Qu5LsiGv5Cs/XqjyjsaW0XCIP6IVDhjdD4wffSPR9jxKcXgOi8tXMOJb4 m86IeoJgoqAvHpJsViWFwN+UMoMpz4om8s6CL1P6DePupyGblmGI7W6HAwRfB6Op/gcx hooQSF9FAGOZeDx7eoD6hSBKn882Ve0NT017ZrpJxy5V6wzDNCGTZVHgUz2fPT5RyqHp zILP2f21qN0po0OFkK37KEb46lfLoAi9Qzxzs60nfc0E/BLk1IlvqGJFtST7qN0FwZ9M spCA== 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=yOxnS2WzyixGDerCK3vRLyDTw83miLcxKQTCMpHTpBErAuBB2Mp1WqbIqOohGZ5XEq MP1j6ZYCyAwD1uVtPrU58g5gdOhyJfypus/RjFIPDBa8xTuppP/8unADzAEjiy5kvdkG xx1D+YDOUx9qLcZ1ahJ+9SuntQm1tDrtBhJhxiMFVz1NYFRWN20utPxn6x7kjKaS6u3f c8C6NAynmhaExhwut2qVIcXjrtY/DWXrWbfntpaYPCfSUfL9PAoDt1e9Bs9gRwPKlTl7 wiut/oddZARsBE6GQa8q7UrFQ0K01e+5ZT5mcvlLf3SyxUDd7ln5/D2PSCnsPB/yLWAj XvVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LA2tCaDD; 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 n7-20020a5d4007000000b0020cd4d6d2fdsi3377610wrp.625.2022.05.13.18.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:23:51 -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=LA2tCaDD; 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 1C9D73D49E8; Fri, 13 May 2022 16:53:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380628AbiEMOZF (ORCPT + 99 others); Fri, 13 May 2022 10:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356878AbiEMOYj (ORCPT ); Fri, 13 May 2022 10:24:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ADCE50B24; Fri, 13 May 2022 07:24:32 -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 4B9B0B83066; Fri, 13 May 2022 14:24:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF9B3C34100; Fri, 13 May 2022 14:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652451870; bh=fHimoKp/mXL+UxFA5uk5tI0L5eJ2S8lPXohgxQuYI1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LA2tCaDDc27LI0fL/D/FqiHVrC1jjwQhSyyQ6+sGfEaRS2bwTvGnX9+NPT5rWufDL KzxvMY8OG6oOXhkzJ1Nd9qoVWPucC2XobL12u+BDUesWB15vTqZSxB9glHHxlx2Ag+ 97ISMop1FPc6XOpUH4+2lHRY5nEBfFOJOxBaAeNM= 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.9 3/7] can: grcan: grcan_probe(): fix broken system id check for errata workaround needs Date: Fri, 13 May 2022 16:23:18 +0200 Message-Id: <20220513142226.012724219@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220513142225.909697091@linuxfoundation.org> References: <20220513142225.909697091@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) {