Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3323336pxf; Mon, 15 Mar 2021 07:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws2yenicu71zwbECmn2iyOUohOv0WlbhKbJSjsjiPcQP0QZNIGii8019Mqy0Dn6Xd5LRvV X-Received: by 2002:a17:906:18aa:: with SMTP id c10mr23813476ejf.248.1615817304656; Mon, 15 Mar 2021 07:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817304; cv=none; d=google.com; s=arc-20160816; b=JmR11zwAwnpBVU5I0e3bry98R0E3a4okwXDLnD04Hi9AC/S+1YxwvVOKhpWrPARKgN cDJry6P8LktfI2MjAWNjWfvNtJ1SADbe3GjwVlSwxlpzdAfY8pDkQjX04gtBfxYlaE6U gAZBlk1YW45LZ5fUh73yJPH767JexKa+Q9WVhRpI3Cnu9/mQi+skuTo8Fy6LYdVKRHZe k08kIxI1SDDX3mxW45lqTCEtelmnl5KA8vV2lK1bQZzwcvSIjQIfq9HWHhZCHFEZvS4y ZVyJlvRk1cc3XtT1J9krvc46diWjF4amzkQZiThwUYNAN9lbM71Zt0CgZYiP5xKN5ivH 3gxA== 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=T8PBE7XfKLdWsnmSWvyYfpbB9wJA7tCkpjUm++f5geI=; b=gky9tBLWp2vjgn+kj/mq/kF76MmZY88RciX+3/057FhwMeEI+7LNbjhP2NmCHhh2P1 upaJz3NdhHt9F+s/XBMdsDoKk6o0QekBoOdVv6y3WyH9aeuflUr6LJ6cxBt4N/e+h6ii mpS5mV3oEharmwNwmhQaQ6nirLO6GreSkpewjB3cR1iIAv+8BKrQV2MlZOfyoolC3vuz jJQeR9d++l8RkHlGjz/lDGbCWF9q+Byl/gkmBH50zUFXA0DIZXGkqab7MW2mV9j8OpKf MMlyjhzVUkngOnaC/Yl+2vLc2OoVRCfn4cPedQKYIfbv8TEMySVJpP6y0fwF4MrVkVCu rCgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yHjgBdqV; 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 b15si11688865edz.247.2021.03.15.07.08.01; Mon, 15 Mar 2021 07:08:24 -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=yHjgBdqV; 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 S233905AbhCOOCg (ORCPT + 99 others); Mon, 15 Mar 2021 10:02:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:33964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231782AbhCON4x (ORCPT ); Mon, 15 Mar 2021 09:56:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6441E64F04; Mon, 15 Mar 2021 13:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816613; bh=/DvgIlr4ETpl8Cix5cKP/hiyEbzH3TloGFe7PpMYaXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yHjgBdqVku8rOQInFmq+OM/pxMHkkbvDXeqEM7hWU51jaRtAgGuA+SDa23p0zwek4 MQ+2On1479OnqGfDr03lpU650aufsPHs5haGJgBXBluJHJZQgtSjfhHsod4D8n9BOc 5CuS9b2/v2KFkiFOlm1qaeQVYO61jdGGNRlgTqZs= 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.11 021/306] can: flexcan: invoke flexcan_chip_freeze() to enter freeze mode Date: Mon, 15 Mar 2021 14:51:24 +0100 Message-Id: <20210315135508.340779488@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -1479,10 +1479,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 @@ -1491,9 +1494,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 *