Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3322830pxf; Mon, 15 Mar 2021 07:07:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/jI0jvHMF9FvyNE45B+fsqZ7ltW8+CYyjqizjN9L8IZFwvsgcC+XfzzNxOe2L3Nk03KwC X-Received: by 2002:a17:906:2dda:: with SMTP id h26mr23518505eji.163.1615817268081; Mon, 15 Mar 2021 07:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817268; cv=none; d=google.com; s=arc-20160816; b=YRrwziWRR14o5svCqVO5JQAg67oS8SEWckW6OI17dYvg1rETBqcXBszwihLiMU2zv/ ttShBQGnaF616Gwl8tukRk/hRI46Paip1yNXOtHRre1vg8R19bjqCuhRqM/3W1SAd4qe VTtMrbksEpsQOP3ncjXyJhT+uTBTewtS4jmM6PZ7WBVPskklKxLXdP7Iq9fjBsE46R53 1UAQoIZcN9nSpVN7wdCavHBSORVrerWcUi7YPbB9lnGWrB0u7+OdQJif5XZkHBEiHbdv hTukONzCOHU8S1654BnHFaUF0f9c+JFLGfywjnrTRxjrwW9dx8NsN1GIvDUEowy+psgL 9pvQ== 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=LDm0ugD43NbJ4csyNkyP64fpcQF/xgJhgMwxqiP+OBU=; b=ZxRboS4QjNR7CAxbh+fCJ80zS4zOe5W4WuLiak8Hwm3RrvjFsGbaSVFmqr2vI9v9ot WyL+pnGykTlAp/baY8MtPRANyQWC/BAZxwPmQUKxOrmdf+W5n/ttJUQvceplGJq3rUYj CFurrF9RPBjEOgd1EdkujvtgAmYl4OMHkLangW98JiFlijr9ILIsi2O3RQH6mYuFRRO7 a1nOv+4t06QLUgOENoBlCMYgsFwEv4MsQizifUGI6xOVWbuLiraIpgJyJJRcOi7dCz4A 5FFaPz4XFnUdXgii4hRvFsCzuTBQJc86EcJDSf9yOpmJ7+FTwUHGo1eshhIxQJ8jdnEc o/vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sYTxbDui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si10838060ejk.68.2021.03.15.07.07.24; Mon, 15 Mar 2021 07:07:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sYTxbDui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234291AbhCOODK (ORCPT + 99 others); Mon, 15 Mar 2021 10:03:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:34306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231329AbhCON5J (ORCPT ); Mon, 15 Mar 2021 09:57:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E073F64EEC; Mon, 15 Mar 2021 13:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816626; bh=sujTiFdD43xDCjXbqoWEtCzs6XmK5ywQFXvpQXWecoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYTxbDui7/pqlhXu4B9ITe0Q/L8wZ93cFpCsbiot9hKKDKBMOR2AE6hY1Drvk8QBH 6hWTr80NJW0ddIZ3ai069qb9fi8dr9wZcAZhABdVnfwma8xxy0BEJAhYH1V5Dw1qXj rbofJ1G1v7eGfWDPkPgVZYR1UMYwK36p9l97AsbA= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joakim Zhang , Marc Kleine-Budde Subject: [PATCH 5.4 012/168] can: flexcan: invoke flexcan_chip_freeze() to enter freeze mode Date: Mon, 15 Mar 2021 14:54:04 +0100 Message-Id: <20210315135550.744268606@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Joakim Zhang commit c63820045e2000f05657467a08715c18c9f490d9 upstream. Invoke flexcan_chip_freeze() to enter freeze mode, since need poll freeze mode acknowledge. Fixes: e955cead03117 ("CAN: Add Flexcan CAN controller driver") Link: https://lore.kernel.org/r/20210218110037.16591-4-qiangqing.zhang@nxp.com Signed-off-by: Joakim Zhang Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/flexcan.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1057,10 +1057,13 @@ static int flexcan_chip_start(struct net flexcan_set_bittiming(dev); + /* set freeze, halt */ + err = flexcan_chip_freeze(priv); + if (err) + goto out_chip_disable; + /* MCR * - * enable freeze - * halt now * only supervisor access * enable warning int * enable individual RX masking @@ -1069,9 +1072,8 @@ static int flexcan_chip_start(struct net */ reg_mcr = priv->read(®s->mcr); reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); - reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT | FLEXCAN_MCR_SUPV | - FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_IRMQ | FLEXCAN_MCR_IDAM_C | - FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); + reg_mcr |= FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_IRMQ | + FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); /* MCR *