2019-06-25 12:17:57

by Wei Xu

[permalink] [raw]
Subject: [GIT PULL] Hisilicon fixes for v5.2

Hi ARM-SoC team,

Please consider to pull the following changes.
Thanks!

Best Regards,
Wei

---

The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:

Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)

are available in the Git repository at:

git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2

for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:

lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)

----------------------------------------------------------------
Hisilicon fixes for v5.2-rc

- fixed RCU usage in logical PIO
- Added a function to unregister a logical PIO range in logical PIO
to support the fixes in the hisi-lpc driver
- fixed and optimized hisi-lpc driver to avoid potential use-after-free
and driver unbind crash

----------------------------------------------------------------
John Garry (6):
lib: logic_pio: Fix RCU usage
lib: logic_pio: Avoid possible overlap for unregistering regions
lib: logic_pio: Add logic_pio_unregister_range()
bus: hisi_lpc: Unregister logical PIO range to avoid potential use-after-free
bus: hisi_lpc: Add .remove method to avoid driver unbind crash
lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration

drivers/bus/hisi_lpc.c | 43 ++++++++++++++++++++----
include/linux/logic_pio.h | 1 +
lib/logic_pio.c | 86 +++++++++++++++++++++++++++++++++--------------
3 files changed, 99 insertions(+), 31 deletions(-)


2019-06-25 12:31:35

by Wei Xu

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

Hi ARM-SoC team,

Sorry, I forgot to mention that one or two patches in this patch set
are not pure fix.
We are also OK to queue for v5.3.
Thanks!

Best Regards,
Wei

On 6/25/2019 11:23 AM, Wei Xu wrote:
> Hi ARM-SoC team,
>
> Please consider to pull the following changes.
> Thanks!
>
> Best Regards,
> Wei
>
> ---
>
> The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:
>
> Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)
>
> are available in the Git repository at:
>
> git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
>
> for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
>
> lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
>
> ----------------------------------------------------------------
> Hisilicon fixes for v5.2-rc
>
> - fixed RCU usage in logical PIO
> - Added a function to unregister a logical PIO range in logical PIO
> to support the fixes in the hisi-lpc driver
> - fixed and optimized hisi-lpc driver to avoid potential use-after-free
> and driver unbind crash
>
> ----------------------------------------------------------------
> John Garry (6):
> lib: logic_pio: Fix RCU usage
> lib: logic_pio: Avoid possible overlap for unregistering regions
> lib: logic_pio: Add logic_pio_unregister_range()
> bus: hisi_lpc: Unregister logical PIO range to avoid potential use-after-free
> bus: hisi_lpc: Add .remove method to avoid driver unbind crash
> lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration
>
> drivers/bus/hisi_lpc.c | 43 ++++++++++++++++++++----
> include/linux/logic_pio.h | 1 +
> lib/logic_pio.c | 86 +++++++++++++++++++++++++++++++++--------------
> 3 files changed, 99 insertions(+), 31 deletions(-)
>

2019-06-25 12:37:02

by John Garry

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

On 25/06/2019 11:39, Wei Xu wrote:
> Hi ARM-SoC team,
>
> Sorry, I forgot to mention that one or two patches in this patch set
> are not pure fix.
> We are also OK to queue for v5.3.
> Thanks!
>

Yes, specifically patch "lib: logic_pio: Enforce LOGIC_PIO_INDIRECT
region ops are set at registration" is a minor tidy/optimisation.

Others are fixes or required for fixes.

And adding for v5.3 is fine, then we can ensure that the necessary is
backported to stable when in mainline.

Thanks,
John

> Best Regards,
> Wei
>
> On 6/25/2019 11:23 AM, Wei Xu wrote:
>> Hi ARM-SoC team,
>>
>> Please consider to pull the following changes.
>> Thanks!
>>
>> Best Regards,
>> Wei
>>
>> ---
>>
>> The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:
>>
>> Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)
>>
>> are available in the Git repository at:
>>
>> git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
>>
>> for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
>>
>> lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
>>
>> ----------------------------------------------------------------
>> Hisilicon fixes for v5.2-rc
>>
>> - fixed RCU usage in logical PIO
>> - Added a function to unregister a logical PIO range in logical PIO
>> to support the fixes in the hisi-lpc driver
>> - fixed and optimized hisi-lpc driver to avoid potential use-after-free
>> and driver unbind crash
>>
>> ----------------------------------------------------------------
>> John Garry (6):
>> lib: logic_pio: Fix RCU usage
>> lib: logic_pio: Avoid possible overlap for unregistering regions
>> lib: logic_pio: Add logic_pio_unregister_range()
>> bus: hisi_lpc: Unregister logical PIO range to avoid potential use-after-free
>> bus: hisi_lpc: Add .remove method to avoid driver unbind crash
>> lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration
>>
>> drivers/bus/hisi_lpc.c | 43 ++++++++++++++++++++----
>> include/linux/logic_pio.h | 1 +
>> lib/logic_pio.c | 86 +++++++++++++++++++++++++++++++++--------------
>> 3 files changed, 99 insertions(+), 31 deletions(-)
>>
>
>
> .
>


2019-06-25 13:19:39

by Olof Johansson

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

On Tue, Jun 25, 2019 at 11:23:21AM +0100, Wei Xu wrote:
> Hi ARM-SoC team,
>
> Please consider to pull the following changes.
> Thanks!
>
> Best Regards,
> Wei
>
> ---
>
> The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:
>
> Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)
>
> are available in the Git repository at:
>
> git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
>
> for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
>
> lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
>
> ----------------------------------------------------------------
> Hisilicon fixes for v5.2-rc
>
> - fixed RCU usage in logical PIO
> - Added a function to unregister a logical PIO range in logical PIO
> to support the fixes in the hisi-lpc driver
> - fixed and optimized hisi-lpc driver to avoid potential use-after-free
> and driver unbind crash

Merged to fixes, thanks.


-Olof

2019-06-25 13:41:13

by Olof Johansson

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

Hi,

On Tue, Jun 25, 2019 at 2:04 PM Olof Johansson <[email protected]> wrote:
>
> On Tue, Jun 25, 2019 at 11:23:21AM +0100, Wei Xu wrote:
> > Hi ARM-SoC team,
> >
> > Please consider to pull the following changes.
> > Thanks!
> >
> > Best Regards,
> > Wei
> >
> > ---
> >
> > The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:
> >
> > Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)
> >
> > are available in the Git repository at:
> >
> > git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
> >
> > for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
> >
> > lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
> >
> > ----------------------------------------------------------------
> > Hisilicon fixes for v5.2-rc
> >
> > - fixed RCU usage in logical PIO
> > - Added a function to unregister a logical PIO range in logical PIO
> > to support the fixes in the hisi-lpc driver
> > - fixed and optimized hisi-lpc driver to avoid potential use-after-free
> > and driver unbind crash
>
> Merged to fixes, thanks.


This broke arm64 allmodconfig:

arm64.allmodconfig:
drivers/bus/hisi_lpc.c:656:3: error: implicit declaration of function
'hisi_lpc_acpi_remove'; did you mean 'hisi_lpc_acpi_probe'?
[-Werror=implicit-function-declaration]



Please build and test your branches before you send pull requests, Wei.

I've dropped the branch again; please re-submit when fixed. I think
it's probably 5.3 material now.


-Olof

2019-06-25 13:43:51

by John Garry

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

On 25/06/2019 14:03, Olof Johansson wrote:
>>> are available in the Git repository at:
>>> > >
>>> > > git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
>>> > >
>>> > > for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
>>> > >
>>> > > lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
>>> > >
>>> > > ----------------------------------------------------------------
>>> > > Hisilicon fixes for v5.2-rc
>>> > >
>>> > > - fixed RCU usage in logical PIO
>>> > > - Added a function to unregister a logical PIO range in logical PIO
>>> > > to support the fixes in the hisi-lpc driver
>>> > > - fixed and optimized hisi-lpc driver to avoid potential use-after-free
>>> > > and driver unbind crash
>> >
>> > Merged to fixes, thanks.
>
> This broke arm64 allmodconfig:
>
> arm64.allmodconfig:
> drivers/bus/hisi_lpc.c:656:3: error: implicit declaration of function
> 'hisi_lpc_acpi_remove'; did you mean 'hisi_lpc_acpi_probe'?
> [-Werror=implicit-function-declaration]
>
>

Uhhh, that's my fault - I didn't provide a stub for !ACPI. Sorry. I'll
send a fixed v3 series.

>
> Please build and test your branches before you send pull requests, Wei.
>
> I've dropped the branch again; please re-submit when fixed. I think
> it's probably 5.3 material now.
>

Thanks,
John

>
> -Olof
>
> .
>


2019-06-26 15:24:09

by John Garry

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

On 25/06/2019 14:31, John Garry wrote:
> On 25/06/2019 14:03, Olof Johansson wrote:
>>>> are available in the Git repository at:
>>>> > >
>>>> > > git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
>>>> > >
>>>> > > for you to fetch changes up to
>>>> 07c811af1c00d7b4212eac86900b023b6405a954:
>>>> > >
>>>> > > lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set
>>>> at registration (2019-06-25 09:40:42 +0100)
>>>> > >
>>>> > > ----------------------------------------------------------------
>>>> > > Hisilicon fixes for v5.2-rc
>>>> > >
>>>> > > - fixed RCU usage in logical PIO
>>>> > > - Added a function to unregister a logical PIO range in logical PIO
>>>> > > to support the fixes in the hisi-lpc driver
>>>> > > - fixed and optimized hisi-lpc driver to avoid potential
>>>> use-after-free
>>>> > > and driver unbind crash
>>> >
>>> > Merged to fixes, thanks.
>>
>> This broke arm64 allmodconfig:
>>
>> arm64.allmodconfig:
>> drivers/bus/hisi_lpc.c:656:3: error: implicit declaration of function
>> 'hisi_lpc_acpi_remove'; did you mean 'hisi_lpc_acpi_probe'?
>> [-Werror=implicit-function-declaration]

As an aside, I find it a little strange that arm64 allmodconfig does not
have CONFIG_ACPI set. It used to have it set, and this patch stopped that:

5bcd44083a082f314032969cd6db1eb8275ac77a is the first bad commit
commit 5bcd44083a082f314032969cd6db1eb8275ac77a
Author: AKASHI Takahiro <[email protected]>
Date: Mon Jul 23 10:57:29 2018 +0900

drivers: acpi: add dependency of EFI for arm64

As Ard suggested, CONFIG_ACPI && !CONFIG_EFI doesn't make sense on
arm64,
while CONFIG_ACPI and CONFIG_CPU_BIG_ENDIAN doesn't make sense either.

As CONFIG_EFI already has a dependency of !CONFIG_CPU_BIG_ENDIAN, it is
good enough to add a dependency of CONFIG_EFI to avoid any useless
combination of configuration.

This bug, reported by Will, will be revealed when my patch series,
"arm64: kexec,kdump: fix boot failures on acpi-only system," is applied
and the kernel is built under allmodconfig.

Signed-off-by: AKASHI Takahiro <[email protected]>
Suggested-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Will Deacon <[email protected]>

That patch stopped many configs being set for allmodconfig.

With this change, CONFIG_EFI is not set. I think that this is because
CONFIG_CPU_BIG_ENDIAN is set for arm64 allmodconfig.

Any opinion on this? Could we change CONFIG_CPU_BIG_ENDIAN to be unset
for arm64?

>>
>>
>
> Uhhh, that's my fault - I didn't provide a stub for !ACPI. Sorry. I'll
> send a fixed v3 series.
>
>>
>> Please build and test your branches before you send pull requests, Wei.
>>
>> I've dropped the branch again; please re-submit when fixed. I think
>> it's probably 5.3 material now.
>>
>
> Thanks,
> John
>
>>
>> -Olof
>>
>> .
>>
>


2019-06-27 02:34:12

by Olof Johansson

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

On Tue, Jun 25, 2019 at 02:31:26PM +0100, John Garry wrote:
> On 25/06/2019 14:03, Olof Johansson wrote:
> > > > are available in the Git repository at:
> > > > > >
> > > > > > git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
> > > > > >
> > > > > > for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
> > > > > >
> > > > > > lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
> > > > > >
> > > > > > ----------------------------------------------------------------
> > > > > > Hisilicon fixes for v5.2-rc
> > > > > >
> > > > > > - fixed RCU usage in logical PIO
> > > > > > - Added a function to unregister a logical PIO range in logical PIO
> > > > > > to support the fixes in the hisi-lpc driver
> > > > > > - fixed and optimized hisi-lpc driver to avoid potential use-after-free
> > > > > > and driver unbind crash
> > > >
> > > > Merged to fixes, thanks.
> >
> > This broke arm64 allmodconfig:
> >
> > arm64.allmodconfig:
> > drivers/bus/hisi_lpc.c:656:3: error: implicit declaration of function
> > 'hisi_lpc_acpi_remove'; did you mean 'hisi_lpc_acpi_probe'?
> > [-Werror=implicit-function-declaration]
> >
> >
>
> Uhhh, that's my fault - I didn't provide a stub for !ACPI. Sorry. I'll send
> a fixed v3 series.

No worries, it happens -- but it's good if maintainers do at least a few test
builds before sending in pull requests so we don't catch all of it at our end.


-Olof

2019-07-01 06:23:36

by Wei Xu

[permalink] [raw]
Subject: Re: [GIT PULL] Hisilicon fixes for v5.2

Hi Olof,

On 2019/6/27 10:19, Olof Johansson wrote:
> On Tue, Jun 25, 2019 at 02:31:26PM +0100, John Garry wrote:
>> On 25/06/2019 14:03, Olof Johansson wrote:
>>>>> are available in the Git repository at:
>>>>>>> git://github.com/hisilicon/linux-hisi.git tags/hisi-fixes-for-5.2
>>>>>>>
>>>>>>> for you to fetch changes up to 07c811af1c00d7b4212eac86900b023b6405a954:
>>>>>>>
>>>>>>> lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration (2019-06-25 09:40:42 +0100)
>>>>>>>
>>>>>>> ----------------------------------------------------------------
>>>>>>> Hisilicon fixes for v5.2-rc
>>>>>>>
>>>>>>> - fixed RCU usage in logical PIO
>>>>>>> - Added a function to unregister a logical PIO range in logical PIO
>>>>>>> to support the fixes in the hisi-lpc driver
>>>>>>> - fixed and optimized hisi-lpc driver to avoid potential use-after-free
>>>>>>> and driver unbind crash
>>>>> Merged to fixes, thanks.
>>> This broke arm64 allmodconfig:
>>>
>>> arm64.allmodconfig:
>>> drivers/bus/hisi_lpc.c:656:3: error: implicit declaration of function
>>> 'hisi_lpc_acpi_remove'; did you mean 'hisi_lpc_acpi_probe'?
>>> [-Werror=implicit-function-declaration]
>>>
>>>
>> Uhhh, that's my fault - I didn't provide a stub for !ACPI. Sorry. I'll send
>> a fixed v3 series.
> No worries, it happens -- but it's good if maintainers do at least a few test
> builds before sending in pull requests so we don't catch all of it at our end.

Sorry for the late reply!
I had a trip last week and did the pull request in a hurry that forgot
to do the some building
test like allmodconfig, allyesconfig and so on.
In the future, I will do more testing before sending out to avoid this
kind fault.

Best Regards,
Wei

>
> -Olof
>
> .
>