From patchwork Mon Aug 2 05:12:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 490302 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp1600401jas; Sun, 1 Aug 2021 22:13:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywE5JvSoYyV5FMbgdcG5GGIEYakzEHO25d71x/cJPZ3/3hcDsKUBXsdA1pqRlZDmWLhGXv X-Received: by 2002:a5e:c803:: with SMTP id y3mr1297855iol.107.1627881217661; Sun, 01 Aug 2021 22:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627881217; cv=none; d=google.com; s=arc-20160816; b=T5ZH8GA/e0ees9xddDIKd5Xwaid+wfC2qVaK+owydbVfc3nzQSMKucnHhNoMyGR1Su /ek7pejrruqg/yvDK8Key1ilskB4+KdQaWBar4MHbmx2BhoNB98VLYSkeTMD/QMLOTNS N4T6CGsIDpsmoj1Z12RvAZ/T6Ru4wdvfXB0Gdu4EqA0XGzEHiMgnQCRta7wO514i/qMR 0QRGq1vMrdfLRJgtS11IdwHsaMShiUpXlaWYASPIsVKWkzAmwuLP/OeW86JLs2nhOZ8a amHA3wdi4ke1HYfC0SdZX0elI/vS2PAQ2xZpD9TJVgpSN1QBsm0uUR53rNePLq/0VgUP 39aw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YH9RqDwj3Hxwa7+6WVhzvigR5j4AY8ETFRKdu6OaqBQ=; b=Mznsf9hRCZE7ZFiFtmkcnsE83XMMkE4/kxM7IfbbUr7+uOlb79PD7+dQK9/Q+jICue K0hCH8KT6gDOgfC9LbwaYBcC8k+toYiQ/N3P/qugdVfT7JaLd65ukW51VyeE8tJgeTRb NyqQaD68iHO7a1HwuHOwSAqjPron4/khCRKP53WDA4SXLdb9NfR27kTVszaTpiwxqU8H sfLObaGqjHxxI7S1deCP+Y253GhtBCZlgLtvS+M0/p5tOBkJ9i+VsgVGay7WwpP+AxKl mHffrRUEAfJwWwDEVl8WCT9PYwf4lS3DEap4J4UxDyYDkC9Pz0N8F9fT4osc3SkGbfph Epdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=blOinbp2; 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 z7si11282125ilq.32.2021.08.01.22.13.37; Sun, 01 Aug 2021 22:13:37 -0700 (PDT) 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=blOinbp2; 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 S229881AbhHBFNn (ORCPT + 17 others); Mon, 2 Aug 2021 01:13:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232145AbhHBFNm (ORCPT ); Mon, 2 Aug 2021 01:13:42 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D809C061799 for ; Sun, 1 Aug 2021 22:13:33 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id l19so23731316pjz.0 for ; Sun, 01 Aug 2021 22:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YH9RqDwj3Hxwa7+6WVhzvigR5j4AY8ETFRKdu6OaqBQ=; b=blOinbp2TXOPDqv6bdBdL2rd9HvkvFhk10+RA5xVfJb0q5wIFEquiNAQxfMLAFtb7R uPzskefIAJPHB2MiKNoBRURViB7EmYKTygEoSQ70T3hbWIjLGHdoCzXr/b2NqVvNAWLU 3xaw97BfrrpFv/PHOoCgvoQGKY9z3lzK2JghsIipMcHOChzRNSW3jLZMWAAKJew1E7Io 3NEb92j9eycwBW4azyxzIKrFb8jNrUUSFUu3J7GyBGKXi7YTtWRc92FzHUBMUiKaF/mR RucnPzfY17O2X/fcr8LnEgpBaw7hYczFGX2o1oq3QRWBrCWtS6XrrI9AnuNi27FeB3mc hhsg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YH9RqDwj3Hxwa7+6WVhzvigR5j4AY8ETFRKdu6OaqBQ=; b=iOeimKDE1vIs/FL0DhI+rFjjwWM3dc+cK0m/kL0Y3Z0ZhUB8g6VcU5segQw5ZvJ3pr SNiCvIZV+i1g7k620oqEiEDqRUQCeaKbD50X6ZvSlIHtoLAUTQGATqLEEnlccfzSuMav p+NHU5cWkHEgbS+hbz93xTqnrTlKlMcjkhzYQcA3IVpCSNaJq2EGK8Alvv9DaOWVyZVR 2oo7YdQwIPG17qTsh7PFAk0HLtqRZUI59HibchH23DLlI/FQUElWF60vjJ360OlqZDSe 5/pp6QaNLm0oqUfOqzQLm2jjoV5UYvrPvJvuTcUXFemlKQ/S9jWw1M+iWf/Ry/V0Z/ef 6Xhg== X-Gm-Message-State: AOAM533mIrnkuTvejMrVDgXxprPudPjnUUOYFsYTuNM9qAcpL51pSthC EB1GJULSJTn7g/aTu3gAE2ML X-Received: by 2002:a17:90a:df05:: with SMTP id gp5mr15562702pjb.165.1627881213065; Sun, 01 Aug 2021 22:13:33 -0700 (PDT) Received: from localhost.localdomain ([2409:4072:6e99:242f:6391:b1b4:1ad8:fbdf]) by smtp.gmail.com with ESMTPSA id x26sm9947000pfm.77.2021.08.01.22.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 22:13:32 -0700 (PDT) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, bbhatt@codeaurora.org, linux-arm-msm@vger.kernel.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, loic.poulain@linaro.org, Jeffrey Hugo , Manivannan Sadhasivam Subject: [PATCH 04/10] bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up Date: Mon, 2 Aug 2021 10:42:49 +0530 Message-Id: <20210802051255.5771-5-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210802051255.5771-1-manivannan.sadhasivam@linaro.org> References: <20210802051255.5771-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bhaumik Bhatt Set the BHI and BHIe pointers to NULL as part of clean-up. This makes sure that stale pointers are not accessed after powering MHI down. Suggested-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1620330705-40192-3-git-send-email-bbhatt@codeaurora.org Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.25.1 diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 11c7a3d3c9bf..1cc2f225d3d1 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -1132,6 +1132,9 @@ void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl) mhi_cntrl->rddm_image = NULL; } + mhi_cntrl->bhi = NULL; + mhi_cntrl->bhie = NULL; + mhi_deinit_dev_ctxt(mhi_cntrl); } EXPORT_SYMBOL_GPL(mhi_unprepare_after_power_down);