diff mbox series

[v4,4/6] ath11k: set register access length for MHI driver

Message ID 1620330705-40192-5-git-send-email-bbhatt@codeaurora.org
State New
Headers show
Series BHI/BHIe improvements for MHI power purposes | expand

Commit Message

Bhaumik Bhatt May 6, 2021, 7:51 p.m. UTC
MHI driver requires register space length to add range checks and
prevent memory region accesses outside of that for MMIO space.
Set it before registering the MHI controller.

Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mhi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Manivannan Sadhasivam May 21, 2021, 1:51 p.m. UTC | #1
On Thu, May 06, 2021 at 12:51:43PM -0700, Bhaumik Bhatt wrote:
> MHI driver requires register space length to add range checks and
> prevent memory region accesses outside of that for MMIO space.
> Set it before registering the MHI controller.
> 
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
> Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Kalle, should we do immutable branch for this patch or I can pick it up via MHI
tree (if there are no other patches expected from ath11k for this controller)?

Thanks,
Mani

> ---
>  drivers/net/wireless/ath/ath11k/mhi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
> index 09858e5..c0f013c 100644
> --- a/drivers/net/wireless/ath/ath11k/mhi.c
> +++ b/drivers/net/wireless/ath/ath11k/mhi.c
> @@ -235,6 +235,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	mhi_ctrl->cntrl_dev = ab->dev;
>  	mhi_ctrl->fw_image = ab_pci->amss_path;
>  	mhi_ctrl->regs = ab->mem;
> +	mhi_ctrl->reg_len = ab->mem_len;
>  
>  	ret = ath11k_mhi_get_msi(ab_pci);
>  	if (ret) {
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Bhaumik Bhatt June 14, 2021, 5:49 p.m. UTC | #2
Hi Kalle,

On 2021-06-14 09:02 AM, Kalle Valo wrote:
> Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> writes:
> 
>> On Thu, May 06, 2021 at 12:51:43PM -0700, Bhaumik Bhatt wrote:
>>> MHI driver requires register space length to add range checks and
>>> prevent memory region accesses outside of that for MMIO space.
>>> Set it before registering the MHI controller.
>>> 
>>> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
>>> Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
>> 
>> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> 
>> Kalle, should we do immutable branch for this patch or I can pick it 
>> up via MHI
>> tree (if there are no other patches expected from ath11k for this 
>> controller)?
> 
> I'm not expecting any conflicts with this, and if there are, they 
> should
> be easy for Stephen or Linus to fix. So it's easiest to route this via
> your tree. But I'm not giving my ack yet, see below.
> 
> I'm worried that this patchset breaks bisect. Every patch in the
> patchset should not break existing functionality, what if only patches
> 1-3 are included in the tree but not patch 4? Wouldn't ath11k be broken
> then? I didn't review the whole patchset, but I suspect the fix is to
> include the ath11k change in the actual mhi patch which changes the
> functionality. So that way we would not have a separate ath11k patch at
> all.
> 
> Also I'm not able to test this patchset at the moment. Can someone else
> help and do a quick test with QCA6390 to verify these doesn't break
> ath11k?

I have requested someone to try and test this patch series with QCA6390.

I or the testers will get back to you with the test results when they 
are
available.

As far as your concerns go, you can choose to pick patches 1-3 and that 
would
be just fine.

Things will break if patchset 4 is _not_ in place with patchset 6 being 
part of
the tree.

It would, however, be nice to pick the whole series instead and ensure 
that
the functionality MHI introduces for boot-up sanity is in place for any
controllers such as ath11k.

Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
a Linux Foundation Collaborative Project
Bhaumik Bhatt June 16, 2021, 5:38 p.m. UTC | #3
Hi Kalle/Mani,

On 2021-06-14 10:49 AM, Bhaumik Bhatt wrote:
> Hi Kalle,
> 
> On 2021-06-14 09:02 AM, Kalle Valo wrote:
>> Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> writes:
>> 
>>> On Thu, May 06, 2021 at 12:51:43PM -0700, Bhaumik Bhatt wrote:
>>>> MHI driver requires register space length to add range checks and
>>>> prevent memory region accesses outside of that for MMIO space.
>>>> Set it before registering the MHI controller.
>>>> 
>>>> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
>>>> Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
>>> 
>>> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>>> 
>>> Kalle, should we do immutable branch for this patch or I can pick it 
>>> up via MHI
>>> tree (if there are no other patches expected from ath11k for this 
>>> controller)?
>> 
>> I'm not expecting any conflicts with this, and if there are, they 
>> should
>> be easy for Stephen or Linus to fix. So it's easiest to route this via
>> your tree. But I'm not giving my ack yet, see below.
>> 
>> I'm worried that this patchset breaks bisect. Every patch in the
>> patchset should not break existing functionality, what if only patches
>> 1-3 are included in the tree but not patch 4? Wouldn't ath11k be 
>> broken
>> then? I didn't review the whole patchset, but I suspect the fix is to
>> include the ath11k change in the actual mhi patch which changes the
>> functionality. So that way we would not have a separate ath11k patch 
>> at
>> all.
>> 
>> Also I'm not able to test this patchset at the moment. Can someone 
>> else
>> help and do a quick test with QCA6390 to verify these doesn't break
>> ath11k?
> 
> I have requested someone to try and test this patch series with 
> QCA6390.
> 
> I or the testers will get back to you with the test results when they 
> are
> available.
> 
> As far as your concerns go, you can choose to pick patches 1-3 and that 
> would
> be just fine.
> 
> Things will break if patchset 4 is _not_ in place with patchset 6 being 
> part of
> the tree.
> 
> It would, however, be nice to pick the whole series instead and ensure 
> that
> the functionality MHI introduces for boot-up sanity is in place for any
> controllers such as ath11k.
> 
> Thanks,
> Bhaumik
> ---
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
> Forum,
> a Linux Foundation Collaborative Project

Just got confirmation that the whole patch series was tested for 
functional sanity on
Dell E7590 + QCA6390 with Ubuntu18.04 and patch 4/6 is also good to go.

Can you please ACK and pick up this series?

Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
a Linux Foundation Collaborative Project
Manivannan Sadhasivam June 18, 2021, 6:45 a.m. UTC | #4
On Wed, Jun 16, 2021 at 10:38:01AM -0700, Bhaumik Bhatt wrote:
> Hi Kalle/Mani,
> 
> On 2021-06-14 10:49 AM, Bhaumik Bhatt wrote:
> > Hi Kalle,
> > 
> > On 2021-06-14 09:02 AM, Kalle Valo wrote:
> > > Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> writes:
> > > 
> > > > On Thu, May 06, 2021 at 12:51:43PM -0700, Bhaumik Bhatt wrote:
> > > > > MHI driver requires register space length to add range checks and
> > > > > prevent memory region accesses outside of that for MMIO space.
> > > > > Set it before registering the MHI controller.
> > > > > 
> > > > > Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
> > > > > Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
> > > > 
> > > > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > > 
> > > > Kalle, should we do immutable branch for this patch or I can
> > > > pick it up via MHI
> > > > tree (if there are no other patches expected from ath11k for
> > > > this controller)?
> > > 
> > > I'm not expecting any conflicts with this, and if there are, they
> > > should
> > > be easy for Stephen or Linus to fix. So it's easiest to route this via
> > > your tree. But I'm not giving my ack yet, see below.
> > > 
> > > I'm worried that this patchset breaks bisect. Every patch in the
> > > patchset should not break existing functionality, what if only patches
> > > 1-3 are included in the tree but not patch 4? Wouldn't ath11k be
> > > broken
> > > then? I didn't review the whole patchset, but I suspect the fix is to
> > > include the ath11k change in the actual mhi patch which changes the
> > > functionality. So that way we would not have a separate ath11k patch
> > > at
> > > all.
> > > 
> > > Also I'm not able to test this patchset at the moment. Can someone
> > > else
> > > help and do a quick test with QCA6390 to verify these doesn't break
> > > ath11k?
> > 
> > I have requested someone to try and test this patch series with QCA6390.
> > 
> > I or the testers will get back to you with the test results when they
> > are
> > available.
> > 
> > As far as your concerns go, you can choose to pick patches 1-3 and that
> > would
> > be just fine.
> > 
> > Things will break if patchset 4 is _not_ in place with patchset 6 being
> > part of
> > the tree.
> > 
> > It would, however, be nice to pick the whole series instead and ensure
> > that
> > the functionality MHI introduces for boot-up sanity is in place for any
> > controllers such as ath11k.
> > 
> > Thanks,
> > Bhaumik
> > ---
> > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> > Forum,
> > a Linux Foundation Collaborative Project
> 
> Just got confirmation that the whole patch series was tested for functional
> sanity on
> Dell E7590 + QCA6390 with Ubuntu18.04 and patch 4/6 is also good to go.
> 
> Can you please ACK and pick up this series?
> 

I can pick the series but I need an Ack from Kalle since it contains
ath11k changes. Kalle, can you please Ack this patch?

I'm planning to send the PR by this weekend.

Thanks,
Mani

> Thanks,
> Bhaumik
> ---
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
Kalle Valo June 23, 2021, 5:29 p.m. UTC | #5
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> writes:

> On Wed, Jun 16, 2021 at 10:38:01AM -0700, Bhaumik Bhatt wrote:
>> Hi Kalle/Mani,
>> 
>> On 2021-06-14 10:49 AM, Bhaumik Bhatt wrote:
>> Just got confirmation that the whole patch series was tested for functional
>> sanity on
>> Dell E7590 + QCA6390 with Ubuntu18.04 and patch 4/6 is also good to go.
>> 
>> Can you please ACK and pick up this series?
>> 
>
> I can pick the series but I need an Ack from Kalle since it contains
> ath11k changes. Kalle, can you please Ack this patch?
>
> I'm planning to send the PR by this weekend.

Sorry for the late reply. Yes, as this now tested with ath11k driver
please take this ath11k patch via the mhi tree:

Acked-by: Kalle Valo <kvalo@codeaurora.org>
Kalle Valo June 23, 2021, 5:34 p.m. UTC | #6
Bhaumik Bhatt <bbhatt@codeaurora.org> writes:

> Hi Kalle,

>

> On 2021-06-14 09:02 AM, Kalle Valo wrote:

>> Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> writes:

>>

>>> On Thu, May 06, 2021 at 12:51:43PM -0700, Bhaumik Bhatt wrote:

>>>> MHI driver requires register space length to add range checks and

>>>> prevent memory region accesses outside of that for MMIO space.

>>>> Set it before registering the MHI controller.

>>>>

>>>> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>

>>>> Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>

>>>

>>> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

>>>

>>> Kalle, should we do immutable branch for this patch or I can pick

>>> it up via MHI

>>> tree (if there are no other patches expected from ath11k for this

>>> controller)?

>>

>> I'm not expecting any conflicts with this, and if there are, they

>> should

>> be easy for Stephen or Linus to fix. So it's easiest to route this via

>> your tree. But I'm not giving my ack yet, see below.

>>

>> I'm worried that this patchset breaks bisect. Every patch in the

>> patchset should not break existing functionality, what if only patches

>> 1-3 are included in the tree but not patch 4? Wouldn't ath11k be broken

>> then? I didn't review the whole patchset, but I suspect the fix is to

>> include the ath11k change in the actual mhi patch which changes the

>> functionality. So that way we would not have a separate ath11k patch at

>> all.

>>

>> Also I'm not able to test this patchset at the moment. Can someone else

>> help and do a quick test with QCA6390 to verify these doesn't break

>> ath11k?

>

> I have requested someone to try and test this patch series with QCA6390.

>

> I or the testers will get back to you with the test results when they

> are available.

>

> As far as your concerns go, you can choose to pick patches 1-3 and

> that would be just fine.

>

> Things will break if patchset 4 is _not_ in place with patchset 6

> being part of the tree.

>

> It would, however, be nice to pick the whole series instead and ensure

> that the functionality MHI introduces for boot-up sanity is in place

> for any controllers such as ath11k.


Just to be clear, this is not about me picking up any patches
separately. I was instead making sure git-bisect works correctly, as it
can randomly choose to test any commit in the tree. But based on your
description everything seems to be in order in this patchset and bisect
will work correctly.

git-bisect is an important tool for me when I'm searching the root cause
for ath11k regressions, that's why I'm so careful to make sure it works.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Bhaumik Bhatt June 23, 2021, 9:33 p.m. UTC | #7
On 2021-06-23 10:34 AM, Kalle Valo wrote:
> Bhaumik Bhatt <bbhatt@codeaurora.org> writes:
> 
>> Hi Kalle,
>> 
>> On 2021-06-14 09:02 AM, Kalle Valo wrote:
>>> Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> writes:
>>> 
>>>> On Thu, May 06, 2021 at 12:51:43PM -0700, Bhaumik Bhatt wrote:
>>>>> MHI driver requires register space length to add range checks and
>>>>> prevent memory region accesses outside of that for MMIO space.
>>>>> Set it before registering the MHI controller.
>>>>> 
>>>>> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
>>>>> Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
>>>> 
>>>> Reviewed-by: Manivannan Sadhasivam 
>>>> <manivannan.sadhasivam@linaro.org>
>>>> 
>>>> Kalle, should we do immutable branch for this patch or I can pick
>>>> it up via MHI
>>>> tree (if there are no other patches expected from ath11k for this
>>>> controller)?
>>> 
>>> I'm not expecting any conflicts with this, and if there are, they
>>> should
>>> be easy for Stephen or Linus to fix. So it's easiest to route this 
>>> via
>>> your tree. But I'm not giving my ack yet, see below.
>>> 
>>> I'm worried that this patchset breaks bisect. Every patch in the
>>> patchset should not break existing functionality, what if only 
>>> patches
>>> 1-3 are included in the tree but not patch 4? Wouldn't ath11k be 
>>> broken
>>> then? I didn't review the whole patchset, but I suspect the fix is to
>>> include the ath11k change in the actual mhi patch which changes the
>>> functionality. So that way we would not have a separate ath11k patch 
>>> at
>>> all.
>>> 
>>> Also I'm not able to test this patchset at the moment. Can someone 
>>> else
>>> help and do a quick test with QCA6390 to verify these doesn't break
>>> ath11k?
>> 
>> I have requested someone to try and test this patch series with 
>> QCA6390.
>> 
>> I or the testers will get back to you with the test results when they
>> are available.
>> 
>> As far as your concerns go, you can choose to pick patches 1-3 and
>> that would be just fine.
>> 
>> Things will break if patchset 4 is _not_ in place with patchset 6
>> being part of the tree.
>> 
>> It would, however, be nice to pick the whole series instead and ensure
>> that the functionality MHI introduces for boot-up sanity is in place
>> for any controllers such as ath11k.
> 
> Just to be clear, this is not about me picking up any patches
> separately. I was instead making sure git-bisect works correctly, as it
> can randomly choose to test any commit in the tree. But based on your
> description everything seems to be in order in this patchset and bisect
> will work correctly.
> 
> git-bisect is an important tool for me when I'm searching the root 
> cause
> for ath11k regressions, that's why I'm so careful to make sure it 
> works.
OK. Understood.

Thanks,
Bhaumik
---
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
a Linux Foundation Collaborative Project
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
index 09858e5..c0f013c 100644
--- a/drivers/net/wireless/ath/ath11k/mhi.c
+++ b/drivers/net/wireless/ath/ath11k/mhi.c
@@ -235,6 +235,7 @@  int ath11k_mhi_register(struct ath11k_pci *ab_pci)
 	mhi_ctrl->cntrl_dev = ab->dev;
 	mhi_ctrl->fw_image = ab_pci->amss_path;
 	mhi_ctrl->regs = ab->mem;
+	mhi_ctrl->reg_len = ab->mem_len;
 
 	ret = ath11k_mhi_get_msi(ab_pci);
 	if (ret) {