Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1626631pxk; Fri, 18 Sep 2020 19:06:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQst15UUp3XK9j58AtNUwMNqvETX6aZWRnwoz0GI8OBO/JO+CfxtBms8nJ6a5I+vNHgxXk X-Received: by 2002:a05:6402:644:: with SMTP id u4mr40652247edx.182.1600481167453; Fri, 18 Sep 2020 19:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600481167; cv=none; d=google.com; s=arc-20160816; b=sL5bvekpiv3p60YLmInwsIMMNjqFIbRosz1hUU1sMg7AFvBbOKefdJoLM9PNo0MCas BhRLAeUwSTCgpdZcA/HeDMkRMxKn1SKWoqAUd5pUuvcCpkz/GHBUz3KrZVqsAPazftzK zbOGQcGCkX7H+E5MTsIVFpS4x5R6k6HZXvJtYm3vS8+waXEC9Tv63RM1UKu3npo4PjND DN3P9rdF6tzOu87/cMMwTIGA2VxuVfx02zJZOJGUo71nywboV55Z/Q9X8+Aezu8l5pPM wjsWwPVyVCMfLOhw2kr5ZN68h7vQTrOUqAGItCnYtU2xvZT7hyc7mOEFbF8eFJkhqY/o 5XHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=5/gpH+41gjffD6hpUwKvRo/De/Nf7sFSl2R2qixn3Qk=; b=LVZbEr8MYwo+pXcHpw4DR9j2RXccviWS0HU9M+W+AfN4bNvUOQxzsiloF1SKESIxep oKvXC9Nbbqtr5Sw6VPFLOMPUqAlyl/2Qf7XjxaNaGf+eaDLgm627g0fXdSXldJ+OiPPV cMgyLO/8ZxOrZlKupurxQauvrTWEF4fSGpsTNncknmtaoLi+dOHurzngx4MEYbqvQE0a QMuUa6Fy4Xk8qlLaoE8FFkGmWzwPjxZJQ0xGaAUkF/hUtlXoceewICiR+sLWruSJ95HX KP++D7d959ZT20yvBbu7tQjRWznuyvdLxkmuCFBKZx5+LenaVGfX0EoaUOLEPhjMg8fh gTFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=kfhk3Qur; 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 rl11si3989440ejb.701.2020.09.18.19.05.44; Fri, 18 Sep 2020 19:06:07 -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=@mg.codeaurora.org header.s=smtp header.b=kfhk3Qur; 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 S1726308AbgISCCu (ORCPT + 99 others); Fri, 18 Sep 2020 22:02:50 -0400 Received: from m42-11.mailgun.net ([69.72.42.11]:61379 "EHLO m42-11.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgISCCs (ORCPT ); Fri, 18 Sep 2020 22:02:48 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600480968; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=5/gpH+41gjffD6hpUwKvRo/De/Nf7sFSl2R2qixn3Qk=; b=kfhk3QurYr9CyfdRiVd8PCou/ur7OsXMxXMfUFLOroR5eeYue/PH3uz2xgLmf8E/uZkoc72e 5Uh9JUiRwe8kRpzK93h+dVZzlBXpFb8mZXsurF4+/h/HFALEj5y2DWFecKACN9Xye7mQwvdD OH+FEkAw9MdRuUFRnsaVTn11bk0= X-Mailgun-Sending-Ip: 69.72.42.11 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 smtp-out-n02.prod.us-east-1.postgun.com with SMTP id 5f6566c77334da8678b08f92 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 19 Sep 2020 02:02:47 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BD146C433FF; Sat, 19 Sep 2020 02:02:46 +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=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from malabar-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 E0682C433C8; Sat, 19 Sep 2020 02:02:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E0682C433C8 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=fail 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 05/10] bus: mhi: core: Disable IRQs when powering down Date: Fri, 18 Sep 2020 19:02:30 -0700 Message-Id: <1600480955-16827-6-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600480955-16827-1-git-send-email-bbhatt@codeaurora.org> References: <1600480955-16827-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While powering down, the device may or may not acknowledge the MHI RESET issued by host for graceful shutdown scenario which can lead to a rogue device sending an interrupt after the clean-up has been done. This can result in a tasklet being scheduled after it has been killed and access already freed memory causing a NULL pointer exception. Avoid this corner case by disabling the interrupts as a part of host clean up. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index 1862960..3462d82 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -517,6 +517,7 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl, for (i = 0; i < mhi_cntrl->total_ev_rings; i++, mhi_event++) { if (mhi_event->offload_ev) continue; + disable_irq(mhi_cntrl->irq[mhi_event->irq]); tasklet_kill(&mhi_event->task); } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project