2016-11-07 08:18:41

by Corentin Labbe

[permalink] [raw]
Subject: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

Hello

With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.

[ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
[ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
[ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
[ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
[ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
[ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16

Without it, all subsequent drivers fail to load.
Tested on Orange PI PC board.

Regards


2016-11-07 09:49:22

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

Hi,

On Mon, Nov 7, 2016 at 4:18 PM, LABBE Corentin
<[email protected]> wrote:
> Hello
>
> With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.
>
> [ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
> [ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
> [ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
> [ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
> [ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
> [ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
> [ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
> [ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16
>
> Without it, all subsequent drivers fail to load.
> Tested on Orange PI PC board.

I don't think the pinctrl drivers were designed to be removed.
And I thought the lack of a .remove callback in the driver blocks
the core from removing the device? Maybe I remember wrong...

ChenYu

>
> Regards

2016-11-07 09:56:31

by Maxime Ripard

[permalink] [raw]
Subject: Re: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

On Mon, Nov 07, 2016 at 05:48:43PM +0800, Chen-Yu Tsai wrote:
> Hi,
>
> On Mon, Nov 7, 2016 at 4:18 PM, LABBE Corentin
> <[email protected]> wrote:
> > Hello
> >
> > With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.
> >
> > [ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
> > [ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
> > [ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
> > [ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
> > [ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
> > [ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
> > [ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
> > [ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16
> >
> > Without it, all subsequent drivers fail to load.
> > Tested on Orange PI PC board.
>
> I don't think the pinctrl drivers were designed to be removed.
> And I thought the lack of a .remove callback in the driver blocks
> the core from removing the device? Maybe I remember wrong...

Using a builtin_platform_driver should be enough to prevent it to be
removed.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Attachments:
(No filename) (1.38 kB)
signature.asc (801.00 B)
Download all attachments

2016-11-07 09:59:46

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

On Mon, Nov 7, 2016 at 5:56 PM, Maxime Ripard
<[email protected]> wrote:
> On Mon, Nov 07, 2016 at 05:48:43PM +0800, Chen-Yu Tsai wrote:
>> Hi,
>>
>> On Mon, Nov 7, 2016 at 4:18 PM, LABBE Corentin
>> <[email protected]> wrote:
>> > Hello
>> >
>> > With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.
>> >
>> > [ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
>> > [ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
>> > [ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
>> > [ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
>> > [ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
>> > [ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
>> > [ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
>> > [ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16
>> >
>> > Without it, all subsequent drivers fail to load.
>> > Tested on Orange PI PC board.
>>
>> I don't think the pinctrl drivers were designed to be removed.
>> And I thought the lack of a .remove callback in the driver blocks
>> the core from removing the device? Maybe I remember wrong...
>
> Using a builtin_platform_driver should be enough to prevent it to be
> removed.

Labbe, can you test it again on linux-next? Or at least with this patch

0c8c6ba00cbf pinctrl: sunxi: make bool drivers explicitly non-modular

from linux-pinctrl applied. This should fix it.

ChenYu

2016-11-07 10:23:26

by Maxime Ripard

[permalink] [raw]
Subject: Re: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

On Mon, Nov 07, 2016 at 10:59:53AM +0100, Corentin Labbe wrote:
> On Mon, Nov 07, 2016 at 10:56:12AM +0100, Maxime Ripard wrote:
> > On Mon, Nov 07, 2016 at 05:48:43PM +0800, Chen-Yu Tsai wrote:
> > > Hi,
> > >
> > > On Mon, Nov 7, 2016 at 4:18 PM, LABBE Corentin
> > > <[email protected]> wrote:
> > > > Hello
> > > >
> > > > With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.
> > > >
> > > > [ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
> > > > [ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
> > > > [ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
> > > > [ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
> > > > [ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
> > > > [ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
> > > > [ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
> > > > [ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16
> > > >
> > > > Without it, all subsequent drivers fail to load.
> > > > Tested on Orange PI PC board.
> > >
> > > I don't think the pinctrl drivers were designed to be removed.
> > > And I thought the lack of a .remove callback in the driver blocks
> > > the core from removing the device? Maybe I remember wrong...
> >
> > Using a builtin_platform_driver should be enough to prevent it to be
> > removed.
> >
>
> The problem is that it is already builtin_platform_driver()

Then there's no way it can be removed in the first place.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Attachments:
(No filename) (1.74 kB)
signature.asc (801.00 B)
Download all attachments

2016-11-07 10:28:22

by Corentin Labbe

[permalink] [raw]
Subject: Re: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

On Mon, Nov 07, 2016 at 11:15:00AM +0100, Maxime Ripard wrote:
> On Mon, Nov 07, 2016 at 10:59:53AM +0100, Corentin Labbe wrote:
> > On Mon, Nov 07, 2016 at 10:56:12AM +0100, Maxime Ripard wrote:
> > > On Mon, Nov 07, 2016 at 05:48:43PM +0800, Chen-Yu Tsai wrote:
> > > > Hi,
> > > >
> > > > On Mon, Nov 7, 2016 at 4:18 PM, LABBE Corentin
> > > > <[email protected]> wrote:
> > > > > Hello
> > > > >
> > > > > With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.
> > > > >
> > > > > [ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
> > > > > [ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
> > > > > [ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
> > > > > [ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
> > > > > [ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
> > > > > [ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
> > > > > [ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
> > > > > [ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16
> > > > >
> > > > > Without it, all subsequent drivers fail to load.
> > > > > Tested on Orange PI PC board.
> > > >
> > > > I don't think the pinctrl drivers were designed to be removed.
> > > > And I thought the lack of a .remove callback in the driver blocks
> > > > the core from removing the device? Maybe I remember wrong...
> > >
> > > Using a builtin_platform_driver should be enough to prevent it to be
> > > removed.
> > >
> >
> > The problem is that it is already builtin_platform_driver()
>
> Then there's no way it can be removed in the first place.
>

I will send a patch for fixing CONFIG_DEBUG_TEST_DRIVER_REMOVE

2016-11-07 11:53:51

by Corentin Labbe

[permalink] [raw]
Subject: Re: [BUG] pinctrl: sunxi: sunxi-pinctrl fail to load with CONFIG_DEBUG_TEST_DRIVER_REMOVE

On Mon, Nov 07, 2016 at 10:56:12AM +0100, Maxime Ripard wrote:
> On Mon, Nov 07, 2016 at 05:48:43PM +0800, Chen-Yu Tsai wrote:
> > Hi,
> >
> > On Mon, Nov 7, 2016 at 4:18 PM, LABBE Corentin
> > <[email protected]> wrote:
> > > Hello
> > >
> > > With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y pinctrl-sunxi fail to load on the second try.
> > >
> > > [ 3.900061] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
> > > [ 3.916251] gpio gpiochip1: GPIO integer space overlap, cannot add chip
> > > [ 3.923016] gpiochip_add_data: GPIOs 0..223 (1c20800.pinctrl) failed to register
> > > [ 3.931099] sun8i-h3-pinctrl: probe of 1c20800.pinctrl failed with error -16
> > > [ 3.944709] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
> > > [ 3.960796] gpio gpiochip2: GPIO integer space overlap, cannot add chip
> > > [ 3.967594] gpiochip_add_data: GPIOs 352..383 (1f02c00.pinctrl) failed to register
> > > [ 3.975633] sun8i-h3-r-pinctrl: probe of 1f02c00.pinctrl failed with error -16
> > >
> > > Without it, all subsequent drivers fail to load.
> > > Tested on Orange PI PC board.
> >
> > I don't think the pinctrl drivers were designed to be removed.
> > And I thought the lack of a .remove callback in the driver blocks
> > the core from removing the device? Maybe I remember wrong...
>
> Using a builtin_platform_driver should be enough to prevent it to be
> removed.
>

The problem is that it is already builtin_platform_driver()