Message ID | 20210625123355.11578-7-manivannan.sadhasivam@linaro.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
On Fri, Jun 25, 2021 at 06:03:51PM +0530, Manivannan Sadhasivam wrote: > From: Bhaumik Bhatt <bbhatt@codeaurora.org> > > 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. > > Cc: stable@vger.kernel.org Why is this needed for stable, but patch 5/10 is not? And what commit does this fix? How far back should it go? And is this really fixing anything? thanks, greg k-h
On Fri, Jun 25, 2021 at 02:38:58PM +0200, Greg KH wrote: > On Fri, Jun 25, 2021 at 06:03:51PM +0530, Manivannan Sadhasivam wrote: > > From: Bhaumik Bhatt <bbhatt@codeaurora.org> > > > > 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. > > > > Cc: stable@vger.kernel.org > > Why is this needed for stable, but patch 5/10 is not? > Shoot! This one relies on 5/10 and fixes a corner case where the BHI/BHIe pointers might be used after MHI powerdown. But this requires backporting the patches 5-10 cleanly (a series). So I guess the stable tag should be removed for this patch. We will test this series on stable kernels (on how far) and make sure this doesn't break anything. Then we can share the commit IDs to be backported with details? Thanks, Mani > And what commit does this fix? How far back should it go? > > And is this really fixing anything? > > thanks, > > greg k-h
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);