Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp130785ybk; Tue, 19 May 2020 17:33:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJsXyLxugODJWJYUpJLqzj8VsbVTQrlHd5cktQKrmTp4XbX8MyWvtiOsOIkBk9OacSUim3 X-Received: by 2002:a17:906:ae93:: with SMTP id md19mr1725476ejb.4.1589934838362; Tue, 19 May 2020 17:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589934838; cv=none; d=google.com; s=arc-20160816; b=tGso2ZCSZqnjuNAt+sDjrBVssHdV5gRcmMpZ42ROtS613NaHMDAE9PlESizF6M0BhL hm8+0BGtyTalmELvxmJvVfTyDJzhc9SJf4xz5xz8nITxoAYBKioNcsovavsHo079lohZ Qmw+8wr1KcEuER5ZBRR0R1NI0wPgkY+XEKgYpwjnpIXLy47eHqLQD56+73By4rzxr4Lr 5bi/4bQ8hO+u6/gG6bBQakbQEHKi3uhLzCV7pVQdqu2b0IoH4Iwteyu25p50dnvUcNY6 2Riwbu8t2w+TX7rbw3d0SFzk1gkBsZPYRqgsCAxDJ2bph2yb9kzWibXtnAjSKCTEsr02 Doeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=N8SRGc2GG/bRxO90nDkMXhShKEgYKPZHfHtJ18nwhek=; b=MS6cDjJK0aXhEuV9RbvsZL8q+fsBbhsJiiqH89kKO0WsuGmbLUavYuZPR9fy88IGNb a/tr9hPma0eS4pqt/+4iUZL98IyDQaZiidsvsHv8Z2MVD/vU9q52wxvuvcfXBMOC4/3y qFxDH9ue4UKGZRRKH3PGl0J4ttIf9rDjvkd5IXpUbppTyWRknY5VgoY8kjiyXzzhq8nl Vno6imUO97JrGF1DzWoWHmVOwbulkTid0MGAjw1P+JqtxTWdlNts/nk7o5FrVZ7aGDpP 3wmPXfzNB0RtRv4BTyE2RRdlnM+cjatejXNXyG+2obeyF8GZFrd/lZTCbJUZILRMuqLb pTSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=N6J7KlVi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si847383eja.72.2020.05.19.17.33.35; Tue, 19 May 2020 17:33:58 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=N6J7KlVi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728491AbgETAbI (ORCPT + 99 others); Tue, 19 May 2020 20:31:08 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:17197 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728468AbgETAbG (ORCPT ); Tue, 19 May 2020 20:31:06 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1589934665; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=N8SRGc2GG/bRxO90nDkMXhShKEgYKPZHfHtJ18nwhek=; b=N6J7KlViu9i1SJamaNza5D398dtnQKYIP+6p73ZEN1tlgADCGFS7BDH5qHzF6+McNP9j+uYu Jd/tJFgVySgMnRNC0pUFY+uipgQRtnUSJofnvh5RC7jz9p9gHv0ooCFakvWXAscCibMKtgq/ biN8O7p8Bl3qeylOWeKmzmrq6zw= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5ec47a2f.7fb1f1439b90-smtp-out-n04; Wed, 20 May 2020 00:30:39 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7DCC3C43387; Wed, 20 May 2020 00:30:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=ham autolearn_force=no version=3.4.0 Received: from bbhatt-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id AD6D6C43391; Wed, 20 May 2020 00:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AD6D6C43391 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt Subject: [PATCH v1 3/6] bus: mhi: core: Check for RDDM support before forcing a device crash Date: Tue, 19 May 2020 17:30:28 -0700 Message-Id: <1589934631-22752-4-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1589934631-22752-1-git-send-email-bbhatt@codeaurora.org> References: <1589934631-22752-1-git-send-email-bbhatt@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check if the device supports RDDM from the mhi_force_rddm_mode() API before allowing a client to force a device crash. This will ensure that a client who is unaware does not misuse the API and expect the device to go to ramdump collection mode after a crash is forced. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index 1daed86..52c290c6 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -1114,6 +1114,10 @@ int mhi_force_rddm_mode(struct mhi_controller *mhi_cntrl) struct device *dev = &mhi_cntrl->mhi_dev->dev; int ret; + /* Check if device supports RDDM */ + if (!mhi_cntrl->rddm_image) + return -EINVAL; + /* Check if device is already in RDDM */ if (mhi_cntrl->ee == MHI_EE_RDDM) return 0; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project