From patchwork Wed Feb 3 16:33:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 375436 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp483962jah; Wed, 3 Feb 2021 08:26:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhLyrqXE+xXH69ILXWaIu8iLj8o9qH5ss6rndj7i5JqVlAHw7cQ1fRlN1B7Gtamj/1gPbV X-Received: by 2002:a17:906:30c4:: with SMTP id b4mr3922520ejb.456.1612369569532; Wed, 03 Feb 2021 08:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612369569; cv=none; d=google.com; s=arc-20160816; b=M69PJWHZpuhyhWtV3H20pWNOi81jIYqIcaW4CxZwZEm+QTKWB/TxHKQMVo+zfeDxMk bYFW8aTPsOq5KP5qMEHD4wU/vLJP0NdPyJCudp5OYNye4TqIDym2CvDrNiwG6gFzi/il twx8Q/d9w2ERt9B9fDbIbF3waq9x07LJFklaDfLsY1ubQRBKTZteA3dIP+BTRuk6H+0R TdFZUqkvrxum/5v4Pmm464eo63AMZ/kmQn3QGNgGsgkXOrLRjl8pJApaRPQdpGCQMe8N qMP66YQ1LvdXWmUXnoicit2tOsLNLUElzhRnxpN13e5vTEOrjVJWW37KhW5NiW1Y2asR DsbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=mZtKCFeSZ7YtgJTLNAMjO8CL16GchCOBM1eFkgbXiic=; b=hifCEVZMgDRVvXcCx5b7mlkcJ4raemcAi2ZWtJV2n6uBu0vo4XtjY/SqXr4gc+kGxM S0Iw6Z9gPTUXjtAn+2xrooGLVio7Cb/lxjjnapkju2L/KLbJQsj6FJUqgUDJ6zYs1lG+ cbwvGBV2+k9m7LXXlC/359KktzbTCS8OStzyZcAW+go21vyeBVINEzy1Gd8NjW7Wu2cU i3QrcY9HESKMxJ6/hgzHcnmouev2vYO7xd+mCZVw2qrUk1B0Uux1FU5rfbstsL4CpU1H 2Q/P5qgKHVl51GTh7YrBvgAa6+185iWK3OQZPNUu/BpX5/L5kwEwHoRPvdbYXA3aFxop aYjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o7DIE9/8"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si1669487ejr.305.2021.02.03.08.26.06; Wed, 03 Feb 2021 08:26:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b="o7DIE9/8"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbhBCQ0F (ORCPT + 15 others); Wed, 3 Feb 2021 11:26:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231571AbhBCQ0D (ORCPT ); Wed, 3 Feb 2021 11:26:03 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D60C061573 for ; Wed, 3 Feb 2021 08:25:22 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id l12so25103237wry.2 for ; Wed, 03 Feb 2021 08:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=mZtKCFeSZ7YtgJTLNAMjO8CL16GchCOBM1eFkgbXiic=; b=o7DIE9/86yqlIjZAuY+SLAlPzZG1X69Y8/F7VTZXZTVuTCHy65N5Q4nL7EhstALiXO ie7y0gACvDDIjaq6NSrO94SnKQ9nyps3K0d+K4hZhM66QIbeFJ+r7Bt5rrx3wiqXdnAd MUbxTHYoEWx8zwWKfjX5KZ6K8PwdjMwlgSQjXQdi8s2lvlzlLYTC/aHELwGaaCNCxisU GaWgOJd+hZeoMyTYz+GJvhW77hGEH7SzFP64/R9vR1BBYxyVukeud74SMhmD10P0zUl1 F8lBHPNR9dCBPIuHC40vq9Kb2aDYOZtjRNE/z+zc+7501Wv3039MhwQ8xnj2eRjLqmfW yhcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mZtKCFeSZ7YtgJTLNAMjO8CL16GchCOBM1eFkgbXiic=; b=aQiYVPGwtzJo+gT6WTnkRKPF4yMT3SmY1ajDwRzO189dZW65xTVdcma+IOTslNZGBG sxco5Rk7i35XZVT1DB/yATeqEtYUOuK0h07r8uwr+8JAFchRRwYMLoIJnQhUblwpfeoF 30Ix9c6wGoY17xpJXlgn88TqAwMArwoJo1STVIEBgdTBuUwSuJTruQOB9LhCUOWDlDG9 Q+X9ePqpf7DWtIFIdYAOmfXyZOd3yV0ltZxJqInUsRXS40KPUQoDESXT+N58MxtPX2DH cdbp4Z1QQhXbyK61vQT5ddEL/RJhF4Edjcq8+A25+yNNNL4UjZc7qF6d4BM2Q6vSixE4 g2IA== X-Gm-Message-State: AOAM5324zacYvgdlZXYrFswotojp3zVm18NSZlKzh74z98Vf1vtlgH+z equ9zgQKs2mdm4ttG18PRdiLGk3WA3rKfQ== X-Received: by 2002:adf:d4ce:: with SMTP id w14mr4326526wrk.89.1612369521214; Wed, 03 Feb 2021 08:25:21 -0800 (PST) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id r15sm4468350wrj.61.2021.02.03.08.25.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Feb 2021 08:25:20 -0800 (PST) From: Loic Poulain To: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH] mhi: pci_generic: Print warning in case of firmware crash Date: Wed, 3 Feb 2021 17:33:03 +0100 Message-Id: <1612369983-21013-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Print warning when MHI detects sys error. Signed-off-by: Loic Poulain --- drivers/bus/mhi/pci_generic.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.7.4 diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c index 444693e..81b1500 100644 --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -217,7 +217,19 @@ static void mhi_pci_write_reg(struct mhi_controller *mhi_cntrl, static void mhi_pci_status_cb(struct mhi_controller *mhi_cntrl, enum mhi_callback cb) { + struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev); + struct mhi_pci_device *mhi_pdev = pci_get_drvdata(pdev); + /* Nothing to do for now */ + switch (cb) { + case MHI_CB_FATAL_ERROR: + /* fallthrough */ + case MHI_CB_SYS_ERROR: + dev_warn(&pdev->dev, "firmware crashed (%u)\n", cb); + break; + default: + break; + } } static bool mhi_pci_is_alive(struct mhi_controller *mhi_cntrl)