Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp513533pxb; Thu, 5 Nov 2020 06:12:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJycF3Wn/0jD3KwOoyl0EyV3Z7hwpbMHh+aX6tfmTmdIUh551mKzMxaVew4cI/R7mUYaKg2o X-Received: by 2002:a17:906:b7cc:: with SMTP id fy12mr2589024ejb.458.1604585573375; Thu, 05 Nov 2020 06:12:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604585573; cv=none; d=google.com; s=arc-20160816; b=UYXaL18v4o4mx117Wqt1IdXifw7xKBjbtgbS8cuyLq6wsDInWoGM/R2lJJ5FZmLDG5 RISpE0A/kXHwODxtYF5CErbrtOlp+2x1AWtJWlawBmDd4Ftg9YFmXyGSKz5qOgDZ9qD4 0MiBvi4Bj6xNtIZW9QOijmMLjuESgi9tmu60z1EXpfH4BNr29FWNnxsKaWQGCbpRvLf6 kMwIfSX7edX51S+KpNN+X/s9lA3nFHnz56yIVzd2n2PiCs0iS75rXu1NOgz/OCuWL63e Nl7teTq18GjAqbAiqfnSw3nBn/ILq8jBI3ndgi/9w6ogCdJ8i3meJSlm669RXSIij9vB xL7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=baAXtX5vqppA7qCUlQzYOK8z1Lg9bB1n7PCPJI2CjKg=; b=uLiCiM2raHRgTXRsO03GaP+vJ557XmsZz+ucdfq4znhLwDwAuZCerbMhPVp4Pww/KS 7fR/WjaMmxRuffZg5d9+4G0UIGN0ULEV3Q7PsRFh/LlnKPwF1KHHgjPGlwqUGwbuzmnk hgDC+JXQAjtSo5jb2FZNOrwvgbPZjyXXUVRAnZumGjH2LSVlZhZFjleKg61tm1d9SbbP Dor9Iytbi6/xoXt2BGB+q6P9W/3JNBBtlPTvJhlXqBTISbHk12kfVJgOXL7kxH6uxY+W XwBUiNJxew1XoPThOwk4MckQavsnd5eXHDO1VApcRbRaEkBuW4L7SLh0ViXwVfIjUrSW yKMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lyXX8ctS; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp20si1046726ejc.620.2020.11.05.06.12.28; Thu, 05 Nov 2020 06:12:53 -0800 (PST) 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=@linaro.org header.s=google header.b=lyXX8ctS; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730687AbgKEOKz (ORCPT + 99 others); Thu, 5 Nov 2020 09:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbgKEOKz (ORCPT ); Thu, 5 Nov 2020 09:10:55 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1279C0613CF for ; Thu, 5 Nov 2020 06:10:53 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id ie6so136082pjb.0 for ; Thu, 05 Nov 2020 06:10:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=baAXtX5vqppA7qCUlQzYOK8z1Lg9bB1n7PCPJI2CjKg=; b=lyXX8ctS++5eZuxGljanX3e9s9d/koA/7pgJzBKy52Qb7A3S8W/gJhM4R6STGCY8dx dRUQOCMOMKLp4/3J9ae2YnrF5O0bVM1aOqWoayI+0vcXVTPVJ9LbbF0eXoCF4sjHFoIo ADGWXBUtpZYrb0lA6oGU4LiWNn2mzG003ja9WDMD7I+b9btpCDXyYbp1EcBCVH2R6y8t gAzekhBCrtWuh1TikNd5gsAzA+4jIVEDCYqUf1xF27gu4OxdrHTXEj+qwkIR7wq0TyAr A5nL/mpC9TNWZob2p7rLRrWuR7YkOAa63WS8kNjCq6+7ZNhBFb0BaWQehy7Qtf5s/GQ9 uBeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=baAXtX5vqppA7qCUlQzYOK8z1Lg9bB1n7PCPJI2CjKg=; b=VlZ4l1/2RSX5K+/BBhXcSvw6bWKKLjEuYgZwlGvMun8nY4TcKFJmVKUjJGI+Gutihk s6lYfrHBYHHYotLUHryGQxknzztqGpo6/no/BATDeWMvcEK2YAMiD+3hSlLTIDiB7occ AdbKvxH3dtDKpK2p8/cgUnYpLKw+wFhsN/7eaB7xFjMi3Xg1fGSZA7CDYzg4DAErFWEN nigVb9cdOsr4yJUJ3oKlwDHupCGi9ElgnNnOC1ykkwzV9N3Pkg2mGVeYVkgo0GWIDbk5 7kXy88xen5uV4QYwPwOS0c/JY3sDgd+FzWMgQ3kHcJzvySenO4rqKjmPvV8QMHs3feK5 yhpw== X-Gm-Message-State: AOAM532OmfSsJPYu4vJ03+M3lESw52VWNn3jdJIY0qs5+3xUDSBc3ZS6 ukxt9byn5UQFVdyUFZZy0viBhXNiscyb X-Received: by 2002:a17:902:8b89:b029:d6:df6e:54df with SMTP id ay9-20020a1709028b89b02900d6df6e54dfmr2642265plb.0.1604585453155; Thu, 05 Nov 2020 06:10:53 -0800 (PST) Received: from work ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id g14sm3037619pfk.90.2020.11.05.06.10.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 06:10:52 -0800 (PST) Date: Thu, 5 Nov 2020 19:40:46 +0530 From: Manivannan Sadhasivam To: Bhaumik Bhatt Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org Subject: Re: [PATCH] bus: mhi: core: Remove double locking from mhi_driver_remove() Message-ID: <20201105141046.GC7308@work> References: <1602787671-9497-1-git-send-email-bbhatt@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1602787671-9497-1-git-send-email-bbhatt@codeaurora.org> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 15, 2020 at 11:47:51AM -0700, Bhaumik Bhatt wrote: > There is double acquisition of the pm_lock from mhi_driver_remove() > function. Remove the read_lock_bh/read_unlock_bh calls for pm_lock > taken during a call to mhi_device_put() as the lock is acquired > within the function already. This will help avoid a potential > kernel panic. > > Fixes: 189ff97cca53 ("bus: mhi: core: Add support for data transfer") > Reported-by: Shuah Khan > Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Thanks, Mani > --- > drivers/bus/mhi/core/init.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c > index 0ffdebd..0a09f82 100644 > --- a/drivers/bus/mhi/core/init.c > +++ b/drivers/bus/mhi/core/init.c > @@ -1276,10 +1276,8 @@ static int mhi_driver_remove(struct device *dev) > mutex_unlock(&mhi_chan->mutex); > } > > - read_lock_bh(&mhi_cntrl->pm_lock); > while (mhi_dev->dev_wake) > mhi_device_put(mhi_dev); > - read_unlock_bh(&mhi_cntrl->pm_lock); > > return 0; > } > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >