All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
@ 2016-11-29 17:53 Matthew Whitehead
  2016-11-29 19:41 ` Tejun Heo
                   ` (3 more replies)
  0 siblings, 4 replies; 48+ messages in thread
From: Matthew Whitehead @ 2016-11-29 17:53 UTC (permalink / raw)
  To: linux-ide; +Cc: Matthew Whitehead

If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
and also their associated interrupts (14,15,11,10,8,12).

Unfortunately, on such systems those interrupt lines are at a premium because there is no
PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
a list of ports to skip allocating.

modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160

Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
---
 drivers/ata/pata_legacy.c |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 4fe9d21..753c7ce 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -130,6 +130,8 @@ static struct legacy_data legacy_data[NR_HOST];
 static struct ata_host *legacy_host[NR_HOST];
 static int nr_legacy_host;
 
+static int ignore_ports[NR_HOST];
+static int ignore_ports_count;
 
 static int probe_all;		/* Set to check all ISA port ranges */
 static int ht6560a;		/* HT 6560A on primary 1, second 2, both 3 */
@@ -1168,6 +1170,17 @@ static __init void probe_qdi_vlb(void)
 	}
 }
 
+int find_port(int port)
+{
+	int i;
+	for (i = 0 ; i < ignore_ports_count; i++) {
+		if (port == ignore_ports[i])
+			return 1;
+	}
+	return 0;
+}
+		
+
 /**
  *	legacy_init		-	attach legacy interfaces
  *
@@ -1212,17 +1225,22 @@ static __init int legacy_init(void)
 	if (winbond == 1)
 		winbond = 0x130;	/* Default port, alt is 1B0 */
 
-	if (primary == 0 || all)
+	if ((primary == 0 || all) && (!find_port(0x1F0)))
 		legacy_probe_add(0x1F0, 14, UNKNOWN, 0);
-	if (secondary == 0 || all)
+	if ((secondary == 0 || all) && (!find_port(0x170)))
 		legacy_probe_add(0x170, 15, UNKNOWN, 0);
 
 	if (probe_all || !pci_present) {
 		/* ISA/VLB extra ports */
-		legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
-		legacy_probe_add(0x168, 10, UNKNOWN, 0);
-		legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
-		legacy_probe_add(0x160, 12, UNKNOWN, 0);
+
+		if (!find_port(0x1E0))
+			legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
+		if (!find_port(0x168))
+			legacy_probe_add(0x168, 10, UNKNOWN, 0);
+		if (!find_port(0x1E0))
+			legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
+		if (!find_port(0x160))
+			legacy_probe_add(0x160, 12, UNKNOWN, 0);
 	}
 
 	if (opti82c46x)
@@ -1272,6 +1290,6 @@ module_param(qdi, int, 0);
 module_param(winbond, int, 0);
 module_param(pio_mask, int, 0);
 module_param(iordy_mask, int, 0);
-
+module_param_array(ignore_ports, int, &ignore_ports_count, 0444);
 module_init(legacy_init);
 module_exit(legacy_exit);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 17:53 [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Matthew Whitehead
@ 2016-11-29 19:41 ` Tejun Heo
  2016-11-29 20:12   ` tedheadster
  2016-11-30 13:11 ` Sergei Shtylyov
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-11-29 19:41 UTC (permalink / raw)
  To: Matthew Whitehead; +Cc: linux-ide, Bartlomiej Zolnierkiewicz

Hello, Matthew.

(cc'ing Bartlomiej)

On Tue, Nov 29, 2016 at 12:53:02PM -0500, Matthew Whitehead wrote:
> If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> and also their associated interrupts (14,15,11,10,8,12).
> 
> Unfortunately, on such systems those interrupt lines are at a premium because there is no
> PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> a list of ports to skip allocating.
> 
> modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160

Can you please give a concrete example of a machine and situation
where this would be useful?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 19:41 ` Tejun Heo
@ 2016-11-29 20:12   ` tedheadster
  2016-11-29 20:46     ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2016-11-29 20:12 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, Bartlomiej Zolnierkiewicz

Hello Tejun,

On Tue, Nov 29, 2016 at 2:41 PM, Tejun Heo <tj@kernel.org> wrote:
> Hello, Matthew.
>
> (cc'ing Bartlomiej)
>
> On Tue, Nov 29, 2016 at 12:53:02PM -0500, Matthew Whitehead wrote:
>> If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
>> common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
>> and also their associated interrupts (14,15,11,10,8,12).
>>
>> Unfortunately, on such systems those interrupt lines are at a premium because there is no
>> PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
>> a list of ports to skip allocating.
>>
>> modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160

>
> Can you please give a concrete example of a machine and situation
> where this would be useful?
>


Sure, my regression testing i486 system has this problem. It only has
an EISA bus, no PCI. I had to apply the patch to be able to put even
2-3 cards in it. It had run out of IRQs.

This testing helped uncover a long time kernel bug that now has a patch.

http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=fc0e81b2bea0ebceb71889b61d2240856141c9ee

Please check the linux-kernel mailing list thread "What exactly do
32-bit x86 exceptions push on the stack in the CS slot?" for more
details.

https://lkml.org/lkml/2016/11/19/308

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 20:12   ` tedheadster
@ 2016-11-29 20:46     ` Tejun Heo
  2016-11-30 13:06       ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-11-29 20:46 UTC (permalink / raw)
  To: whiteheadm; +Cc: linux-ide, Bartlomiej Zolnierkiewicz

Hello,

On Tue, Nov 29, 2016 at 03:12:31PM -0500, tedheadster wrote:
> > Can you please give a concrete example of a machine and situation
> > where this would be useful?
> >
> 
> 
> Sure, my regression testing i486 system has this problem. It only has
> an EISA bus, no PCI. I had to apply the patch to be able to put even
> 2-3 cards in it. It had run out of IRQs.
> 
> This testing helped uncover a long time kernel bug that now has a patch.
> 
> http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=fc0e81b2bea0ebceb71889b61d2240856141c9ee
> 
> Please check the linux-kernel mailing list thread "What exactly do
> 32-bit x86 exceptions push on the stack in the CS slot?" for more
> details.
> 
> https://lkml.org/lkml/2016/11/19/308

I see.  Yeah, I don't have any objections to the change although I do
wish it were easier / automatic.  That said, given how niche it is, it
most likely won't matter.  Bartlomiej, what do you think?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 20:46     ` Tejun Heo
@ 2016-11-30 13:06       ` Bartlomiej Zolnierkiewicz
  2016-11-30 17:13         ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2016-11-30 13:06 UTC (permalink / raw)
  To: Tejun Heo; +Cc: whiteheadm, linux-ide


Hi,

On Tuesday, November 29, 2016 03:46:02 PM Tejun Heo wrote:
> Hello,
> 
> On Tue, Nov 29, 2016 at 03:12:31PM -0500, tedheadster wrote:
> > > Can you please give a concrete example of a machine and situation
> > > where this would be useful?
> > >
> > 
> > 
> > Sure, my regression testing i486 system has this problem. It only has
> > an EISA bus, no PCI. I had to apply the patch to be able to put even
> > 2-3 cards in it. It had run out of IRQs.
> > 
> > This testing helped uncover a long time kernel bug that now has a patch.
> > 
> > http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=fc0e81b2bea0ebceb71889b61d2240856141c9ee
> > 
> > Please check the linux-kernel mailing list thread "What exactly do
> > 32-bit x86 exceptions push on the stack in the CS slot?" for more
> > details.
> > 
> > https://lkml.org/lkml/2016/11/19/308
> 
> I see.  Yeah, I don't have any objections to the change although I do
> wish it were easier / automatic.  That said, given how niche it is, it
> most likely won't matter.  Bartlomiej, what do you think?

I would also prefer to have such systems detected automatically
(i.e. by using DMI, please check dmidecode output on this board).
If this is not possible I'm fine with the change, though I have some
review comments to the patch itself (please see the other mail).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 17:53 [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Matthew Whitehead
  2016-11-29 19:41 ` Tejun Heo
@ 2016-11-30 13:11 ` Sergei Shtylyov
  2016-11-30 14:53   ` One Thousand Gnomes
  2016-11-30 13:12 ` Bartlomiej Zolnierkiewicz
  2016-11-30 13:15 ` Sergei Shtylyov
  3 siblings, 1 reply; 48+ messages in thread
From: Sergei Shtylyov @ 2016-11-30 13:11 UTC (permalink / raw)
  To: Matthew Whitehead, linux-ide

Hello.

On 11/29/2016 08:53 PM, Matthew Whitehead wrote:

> If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> and also their associated interrupts (14,15,11,10,8,12).
>
> Unfortunately, on such systems those interrupt lines are at a premium because there is no
> PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> a list of ports to skip allocating.
>
> modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160
>
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
> ---
>  drivers/ata/pata_legacy.c |   32 +++++++++++++++++++++++++-------
>  1 files changed, 25 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index 4fe9d21..753c7ce 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -130,6 +130,8 @@ static struct legacy_data legacy_data[NR_HOST];
>  static struct ata_host *legacy_host[NR_HOST];
>  static int nr_legacy_host;
>
> +static int ignore_ports[NR_HOST];
> +static int ignore_ports_count;
>
>  static int probe_all;		/* Set to check all ISA port ranges */
>  static int ht6560a;		/* HT 6560A on primary 1, second 2, both 3 */
> @@ -1168,6 +1170,17 @@ static __init void probe_qdi_vlb(void)
>  	}
>  }
>
> +int find_port(int port)

    *bool* instead please. And better rename it as port_ignored() I think.

> +{
> +	int i;
> +	for (i = 0 ; i < ignore_ports_count; i++) {
> +		if (port == ignore_ports[i])
> +			return 1;
> +	}
> +	return 0;
> +}
> +		
> +
>  /**
>   *	legacy_init		-	attach legacy interfaces
>   *
> @@ -1212,17 +1225,22 @@ static __init int legacy_init(void)
>  	if (winbond == 1)
>  		winbond = 0x130;	/* Default port, alt is 1B0 */
>
> -	if (primary == 0 || all)
> +	if ((primary == 0 || all) && (!find_port(0x1F0)))

    parens around !find_port() not needed.

>  		legacy_probe_add(0x1F0, 14, UNKNOWN, 0);
> -	if (secondary == 0 || all)
> +	if ((secondary == 0 || all) && (!find_port(0x170)))

    Same here.

>  		legacy_probe_add(0x170, 15, UNKNOWN, 0);
>
>  	if (probe_all || !pci_present) {
>  		/* ISA/VLB extra ports */
> -		legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
> -		legacy_probe_add(0x168, 10, UNKNOWN, 0);
> -		legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
> -		legacy_probe_add(0x160, 12, UNKNOWN, 0);
> +
> +		if (!find_port(0x1E0))

    0x1E8 maybe?

> +			legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
> +		if (!find_port(0x168))
> +			legacy_probe_add(0x168, 10, UNKNOWN, 0);
> +		if (!find_port(0x1E0))
> +			legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
> +		if (!find_port(0x160))
> +			legacy_probe_add(0x160, 12, UNKNOWN, 0);
>  	}
>
>  	if (opti82c46x)
[...]

MBR, Sergei


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 17:53 [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Matthew Whitehead
  2016-11-29 19:41 ` Tejun Heo
  2016-11-30 13:11 ` Sergei Shtylyov
@ 2016-11-30 13:12 ` Bartlomiej Zolnierkiewicz
  2016-11-30 13:15 ` Sergei Shtylyov
  3 siblings, 0 replies; 48+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2016-11-30 13:12 UTC (permalink / raw)
  To: Matthew Whitehead; +Cc: linux-ide, Tejun Heo


Hi,

On Tuesday, November 29, 2016 12:53:02 PM Matthew Whitehead wrote:
> If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> and also their associated interrupts (14,15,11,10,8,12).
> 
> Unfortunately, on such systems those interrupt lines are at a premium because there is no
> PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> a list of ports to skip allocating.
> 
> modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160
> 
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
> ---
>  drivers/ata/pata_legacy.c |   32 +++++++++++++++++++++++++-------
>  1 files changed, 25 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index 4fe9d21..753c7ce 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -130,6 +130,8 @@ static struct legacy_data legacy_data[NR_HOST];
>  static struct ata_host *legacy_host[NR_HOST];
>  static int nr_legacy_host;
>  
> +static int ignore_ports[NR_HOST];
> +static int ignore_ports_count;
>  
>  static int probe_all;		/* Set to check all ISA port ranges */
>  static int ht6560a;		/* HT 6560A on primary 1, second 2, both 3 */
> @@ -1168,6 +1170,17 @@ static __init void probe_qdi_vlb(void)
>  	}
>  }
>  
> +int find_port(int port)

this should be static

> +{
> +	int i;
> +	for (i = 0 ; i < ignore_ports_count; i++) {
> +		if (port == ignore_ports[i])
> +			return 1;
> +	}
> +	return 0;
> +}
> +		
> +
>  /**
>   *	legacy_init		-	attach legacy interfaces
>   *
> @@ -1212,17 +1225,22 @@ static __init int legacy_init(void)
>  	if (winbond == 1)
>  		winbond = 0x130;	/* Default port, alt is 1B0 */
>  
> -	if (primary == 0 || all)
> +	if ((primary == 0 || all) && (!find_port(0x1F0)))

extra parentheses are not necessary

>  		legacy_probe_add(0x1F0, 14, UNKNOWN, 0);
> -	if (secondary == 0 || all)
> +	if ((secondary == 0 || all) && (!find_port(0x170)))
>  		legacy_probe_add(0x170, 15, UNKNOWN, 0);

ditto

>  	if (probe_all || !pci_present) {
>  		/* ISA/VLB extra ports */
> -		legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
> -		legacy_probe_add(0x168, 10, UNKNOWN, 0);
> -		legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
> -		legacy_probe_add(0x160, 12, UNKNOWN, 0);
> +
> +		if (!find_port(0x1E0))

I believe it should be 0x1E8

> +			legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
> +		if (!find_port(0x168))
> +			legacy_probe_add(0x168, 10, UNKNOWN, 0);
> +		if (!find_port(0x1E0))
> +			legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
> +		if (!find_port(0x160))
> +			legacy_probe_add(0x160, 12, UNKNOWN, 0);
>  	}
>  
>  	if (opti82c46x)
> @@ -1272,6 +1290,6 @@ module_param(qdi, int, 0);
>  module_param(winbond, int, 0);
>  module_param(pio_mask, int, 0);
>  module_param(iordy_mask, int, 0);
> -
> +module_param_array(ignore_ports, int, &ignore_ports_count, 0444);

please leave a newline before module_init()

>  module_init(legacy_init);
>  module_exit(legacy_exit);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-29 17:53 [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Matthew Whitehead
                   ` (2 preceding siblings ...)
  2016-11-30 13:12 ` Bartlomiej Zolnierkiewicz
@ 2016-11-30 13:15 ` Sergei Shtylyov
  3 siblings, 0 replies; 48+ messages in thread
From: Sergei Shtylyov @ 2016-11-30 13:15 UTC (permalink / raw)
  To: Matthew Whitehead, linux-ide

On 11/29/2016 08:53 PM, Matthew Whitehead wrote:

> If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> and also their associated interrupts (14,15,11,10,8,12).
>
> Unfortunately, on such systems those interrupt lines are at a premium because there is no
> PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> a list of ports to skip allocating.
>
> modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160
>
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>

    Also scripts/checkpatch.pl would complain about too long lines if you 
would have run the patch thru it.

MBR, Sergei


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-30 13:11 ` Sergei Shtylyov
@ 2016-11-30 14:53   ` One Thousand Gnomes
  2016-11-30 15:03     ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: One Thousand Gnomes @ 2016-11-30 14:53 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Matthew Whitehead, linux-ide

On Wed, 30 Nov 2016 16:11:39 +0300
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:

> Hello.
> 
> On 11/29/2016 08:53 PM, Matthew Whitehead wrote:
> 
> > If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> > common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> > and also their associated interrupts (14,15,11,10,8,12).
> >
> > Unfortunately, on such systems those interrupt lines are at a premium because there is no
> > PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> > a list of ports to skip allocating.

In what situation do you actually hit this. The probes should fail so the
interrupt shouldn't end up allocated.

Alan

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-30 14:53   ` One Thousand Gnomes
@ 2016-11-30 15:03     ` tedheadster
  2016-11-30 18:15       ` One Thousand Gnomes
  2016-11-30 20:22       ` Tejun Heo
  0 siblings, 2 replies; 48+ messages in thread
From: tedheadster @ 2016-11-30 15:03 UTC (permalink / raw)
  To: One Thousand Gnomes; +Cc: Sergei Shtylyov, linux-ide

On Wed, Nov 30, 2016 at 9:53 AM, One Thousand Gnomes
<gnomes@lxorguk.ukuu.org.uk> wrote:
> On Wed, 30 Nov 2016 16:11:39 +0300
> Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:
>
>> Hello.
>>
>> On 11/29/2016 08:53 PM, Matthew Whitehead wrote:
>>
>> > If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
>> > common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
>> > and also their associated interrupts (14,15,11,10,8,12).
>> >
>> > Unfortunately, on such systems those interrupt lines are at a premium because there is no
>> > PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
>> > a list of ports to skip allocating.
>
> In what situation do you actually hit this. The probes should fail so the
> interrupt shouldn't end up allocated.
>

Alan,
  on my hardware it grabbed all those interrupts, showing up in
/proc/interrupts very clearly.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-30 13:06       ` Bartlomiej Zolnierkiewicz
@ 2016-11-30 17:13         ` tedheadster
  0 siblings, 0 replies; 48+ messages in thread
From: tedheadster @ 2016-11-30 17:13 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Tejun Heo, linux-ide

Bartlomiej,

> I would also prefer to have such systems detected automatically
> (i.e. by using DMI, please check dmidecode output on this board).
> If this is not possible I'm fine with the change, though I have some
> review comments to the patch itself (please see the other mail).
>

I will try dmidecode when I return from travel on Friday. I predict it
will have nothing, but I will verify. Assuming that turns out to be
correct, I'm posting my revised patch next.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-30 15:03     ` tedheadster
@ 2016-11-30 18:15       ` One Thousand Gnomes
  2016-12-02 13:37         ` tedheadster
  2016-11-30 20:22       ` Tejun Heo
  1 sibling, 1 reply; 48+ messages in thread
From: One Thousand Gnomes @ 2016-11-30 18:15 UTC (permalink / raw)
  To: tedheadster; +Cc: Sergei Shtylyov, linux-ide

On Wed, 30 Nov 2016 10:03:47 -0500
tedheadster <tedheadster@gmail.com> wrote:

> On Wed, Nov 30, 2016 at 9:53 AM, One Thousand Gnomes
> <gnomes@lxorguk.ukuu.org.uk> wrote:
> > On Wed, 30 Nov 2016 16:11:39 +0300
> > Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:
> >  
> >> Hello.
> >>
> >> On 11/29/2016 08:53 PM, Matthew Whitehead wrote:
> >>  
> >> > If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> >> > common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> >> > and also their associated interrupts (14,15,11,10,8,12).
> >> >
> >> > Unfortunately, on such systems those interrupt lines are at a premium because there is no
> >> > PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> >> > a list of ports to skip allocating.  
> >
> > In what situation do you actually hit this. The probes should fail so the
> > interrupt shouldn't end up allocated.
> >  
> 
> Alan,
>   on my hardware it grabbed all those interrupts, showing up in
> /proc/interrupts very clearly.

Do you have a dmesg of the boot ?

Alan

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-30 15:03     ` tedheadster
  2016-11-30 18:15       ` One Thousand Gnomes
@ 2016-11-30 20:22       ` Tejun Heo
       [not found]         ` <CAP8WD_bZWeLBhLXqJG5uDwBe+zBubw+A+ecSuaihOuwvw9QoCQ@mail.gmail.com>
  1 sibling, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-11-30 20:22 UTC (permalink / raw)
  To: whiteheadm; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

On Wed, Nov 30, 2016 at 10:03:47AM -0500, tedheadster wrote:
>   on my hardware it grabbed all those interrupts, showing up in
> /proc/interrupts very clearly.

Can you please see whether the following patch makes a difference?

Thanks.

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index bce2a8c..fdc2b4f 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -962,6 +962,9 @@ static __init int legacy_init_one(struct legacy_probe *probe)
 	if (IS_ERR(pdev))
 		return PTR_ERR(pdev);
 
+	if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL))
+		return -ENOMEM;
+
 	ret = -EBUSY;
 	if (devm_request_region(&pdev->dev, io, 8, "pata_legacy") == NULL ||
 	    devm_request_region(&pdev->dev, io + 0x0206, 1,
@@ -1008,12 +1011,14 @@ static __init int legacy_init_one(struct legacy_probe *probe)
 		if (!ata_dev_absent(dev)) {
 			legacy_host[probe->slot] = host;
 			ld->platform_dev = pdev;
+			devres_remove_group(&pdev->dev, NULL);
 			return 0;
 		}
 	}
 	ata_host_detach(host);
 fail:
 	platform_device_unregister(pdev);
+	devres_release_group(&pdev->dev, NULL);
 	return ret;
 }
 

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-11-30 18:15       ` One Thousand Gnomes
@ 2016-12-02 13:37         ` tedheadster
  2016-12-02 16:24           ` One Thousand Gnomes
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2016-12-02 13:37 UTC (permalink / raw)
  To: One Thousand Gnomes; +Cc: Tejun Heo, Sergei Shtylyov, linux-ide

Alan,

>> Alan,
>>   on my hardware it grabbed all those interrupts, showing up in
>> /proc/interrupts very clearly.
>
> Do you have a dmesg of the boot ?
>

Here is the relevant dmesg information and also the /proc/interrupts results:

dmesg info:

[   22.534587] scsi host0: pata_legacy
[   22.566618] ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
[   22.730639] ata1.00: ATA-4: QUANTUM FIREBALL CR8.4A, A5U.1200, max UDMA/66
[   22.730639] ata1.00: 16514064 sectors, multi 0: LBA
[   22.730639] ata1.00: configured for PIO
[   22.738601] scsi 0:0:0:0: Direct-Access     ATA      QUANTUM
FIREBALL 1200 PQ: 0 ANSI: 5
[   22.798627] sd 0:0:0:0: [sda] 16514064 512-byte logical blocks:
(8.45 GB/7.87 GiB)
[   22.818640] sd 0:0:0:0: [sda] Write Protect is off
[   22.818640] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[   22.830629] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[   22.934729]  sda: sda1 sda2 sda3 sda4
[   23.062648] sd 0:0:0:0: [sda] Attached SCSI disk
[   23.162640] scsi host1: pata_legacy
[   23.186648] ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
[   23.494643] scsi host2: pata_legacy
[   23.518656] ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
[   23.830691] scsi host3: pata_legacy
[   23.854692] ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
[   24.086711] genirq: Flags mismatch irq 8. 00000000 (pata_legacy.4)
vs. 00000000 (rtc0)
[   24.190692] scsi host4: pata_legacy
[   24.214697] ata5: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12

/proc/interrupts info :

           CPU0
  0:      49060    XT-PIC  timer
...
 10:          0    XT-PIC  pata_legacy.3
 11:          0    XT-PIC  pata_legacy.2
 12:          0    XT-PIC  pata_legacy.5
 14:      41233    XT-PIC  pata_legacy.0
 15:          0    XT-PIC  pata_legacy.1
...

Tejun: I will build a kernel with your patches today and let you know
the results.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-02 13:37         ` tedheadster
@ 2016-12-02 16:24           ` One Thousand Gnomes
  0 siblings, 0 replies; 48+ messages in thread
From: One Thousand Gnomes @ 2016-12-02 16:24 UTC (permalink / raw)
  To: tedheadster; +Cc: Tejun Heo, Sergei Shtylyov, linux-ide

On Fri, 2 Dec 2016 08:37:04 -0500
tedheadster <tedheadster@gmail.com> wrote:

> Alan,
> 
> >> Alan,
> >>   on my hardware it grabbed all those interrupts, showing up in
> >> /proc/interrupts very clearly.  
> >
> > Do you have a dmesg of the boot ?
> >  
> 
> Here is the relevant dmesg information and also the /proc/interrupts results:

That's very strange. The legacy code should be seeing that no devices are
present and then dropping the controller

        /* Nothing found means we drop the port as its probably not there */

        ret = -ENODEV;
        ata_for_each_dev(dev, &ap->link, ALL) {
                if (!ata_dev_absent(dev)) {
                        legacy_host[probe->slot] = host;
                        ld->platform_dev = pdev;
                        return 0;
                }
        }
        ata_host_detach(host);


so this ought to be triggered and free up the interface and the IRQ

Alan

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
       [not found]         ` <CAP8WD_bZWeLBhLXqJG5uDwBe+zBubw+A+ecSuaihOuwvw9QoCQ@mail.gmail.com>
@ 2016-12-02 17:07           ` Tejun Heo
  2016-12-05 14:19             ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-12-02 17:07 UTC (permalink / raw)
  To: whiteheadm; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

Sorry, I got the order of operation wrong.  Can you please test this
one?

Thanks.

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index bce2a8c..3a0bb89 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -962,6 +962,9 @@ static __init int legacy_init_one(struct legacy_probe *probe)
 	if (IS_ERR(pdev))
 		return PTR_ERR(pdev);
 
+	if (!devres_open_group(&pdev->dev, legacy_init_one, GFP_KERNEL))
+		return -ENOMEM;
+
 	ret = -EBUSY;
 	if (devm_request_region(&pdev->dev, io, 8, "pata_legacy") == NULL ||
 	    devm_request_region(&pdev->dev, io + 0x0206, 1,
@@ -1008,11 +1011,13 @@ static __init int legacy_init_one(struct legacy_probe *probe)
 		if (!ata_dev_absent(dev)) {
 			legacy_host[probe->slot] = host;
 			ld->platform_dev = pdev;
+			devres_remove_group(&pdev->dev, legacy_init_one);
 			return 0;
 		}
 	}
 	ata_host_detach(host);
 fail:
+	devres_release_group(&pdev->dev, legacy_init_one);
 	platform_device_unregister(pdev);
 	return ret;
 }

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-02 17:07           ` Tejun Heo
@ 2016-12-05 14:19             ` tedheadster
  2016-12-05 19:23               ` Tejun Heo
  2016-12-12 12:21               ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 48+ messages in thread
From: tedheadster @ 2016-12-05 14:19 UTC (permalink / raw)
  To: Tejun Heo; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Tejun,
  that new patch worked better.

Here is the dmesg output:

[   34.347350] scsi0 : pata_legacy
[   34.367366] ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
[   34.523330] ata1.00: ATA-4: QUANTUM FIREBALL CR8.4A, A5U.1200, max UDMA/66
[   34.524804] ata1.00: 16514064 sectors, multi 0: LBA
[   34.525747] ata1.00: configured for PIO
[   34.569330] scsi 0:0:0:0: Direct-Access     ATA      QUANTUM
FIREBALL A5U. PQ: 0 ANSI: 5
[   34.655313] sd 0:0:0:0: [sda] 16514064 512-byte logical blocks:
(8.45 GB/7.87 GiB)
[   34.674309] sd 0:0:0:0: [sda] Write Protect is off
[   34.675683] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[   34.689347] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[   34.691283] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   34.800293]  sda: sda1 sda2 sda3 sda4
[   34.890325] sd 0:0:0:0: [sda] Attached SCSI disk
[   34.976270] scsi1 : pata_legacy
[   34.999263] ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
[   35.448191] scsi2 : pata_legacy
[   35.486192] ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
[   35.997114] scsi3 : pata_legacy
[   36.051103] ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
[   36.384057] genirq: Flags mismatch irq 8. 00000000 (platform) vs.
00000000 (rtc0)
[   36.571024] scsi4 : pata_legacy
[   36.626014] ata5: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12
[   42.143223] EXT4-fs (sda4): mounting ext3 file system using the
ext4 subsystem

and /proc/interrupts looks good:

           CPU0
  0:     558552    XT-PIC-XT-PIC    timer
  1:        337    XT-PIC-XT-PIC    i8042
  2:          0    XT-PIC-XT-PIC    cascade
  4:          1    XT-PIC-XT-PIC
  8:          0    XT-PIC-XT-PIC    rtc0
 14:      51538    XT-PIC-XT-PIC    platform

I would still like to get my patch in. If you have a motherboard where
you cannot disable the secondary hard drive controllers, the
pata_legacy driver will detect them and allocate the interrupt. Some
way to disable this behavior is useful.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-05 14:19             ` tedheadster
@ 2016-12-05 19:23               ` Tejun Heo
       [not found]                 ` <CAP8WD_becq+h2=-g7t-6Pp1psmkCCvdB0YUcg+wYPocUP4dYdw@mail.gmail.com>
  2016-12-12 12:21               ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-12-05 19:23 UTC (permalink / raw)
  To: whiteheadm; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

Hmm... I'm a bit confused.  These resources are tied to the platform
device which is unregistered on probe failure which will invoke
devres_release_all().

Matthew, can you please apply the following patch and see whether
device_release() gets invoked?

Thanks.

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index bce2a8c..0dd72ce 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -1013,6 +1013,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
 	}
 	ata_host_detach(host);
 fail:
+	printk("XXX pata_legacy: unregistering platform dev %p\n", pdev);
 	platform_device_unregister(pdev);
 	return ret;
 }
diff --git a/drivers/base/core.c b/drivers/base/core.c
index ce057a5..a3d112d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -237,6 +237,7 @@ static void device_release(struct kobject *kobj)
 	 * is deleted but alive, so release devres here to avoid
 	 * possible memory leak.
 	 */
+	printk("XXX device_release: invoking devres_release_all\n");
 	devres_release_all(dev);
 
 	if (dev->release)


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-05 14:19             ` tedheadster
  2016-12-05 19:23               ` Tejun Heo
@ 2016-12-12 12:21               ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 48+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2016-12-12 12:21 UTC (permalink / raw)
  To: whiteheadm; +Cc: Tejun Heo, One Thousand Gnomes, Sergei Shtylyov, linux-ide


Hi,

On Monday, December 05, 2016 09:19:35 AM tedheadster wrote:
> Tejun,
>   that new patch worked better.
> 
> Here is the dmesg output:
> 
> [   34.347350] scsi0 : pata_legacy
> [   34.367366] ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
> [   34.523330] ata1.00: ATA-4: QUANTUM FIREBALL CR8.4A, A5U.1200, max UDMA/66
> [   34.524804] ata1.00: 16514064 sectors, multi 0: LBA
> [   34.525747] ata1.00: configured for PIO
> [   34.569330] scsi 0:0:0:0: Direct-Access     ATA      QUANTUM
> FIREBALL A5U. PQ: 0 ANSI: 5
> [   34.655313] sd 0:0:0:0: [sda] 16514064 512-byte logical blocks:
> (8.45 GB/7.87 GiB)
> [   34.674309] sd 0:0:0:0: [sda] Write Protect is off
> [   34.675683] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> [   34.689347] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [   34.691283] sd 0:0:0:0: Attached scsi generic sg0 type 0
> [   34.800293]  sda: sda1 sda2 sda3 sda4
> [   34.890325] sd 0:0:0:0: [sda] Attached SCSI disk
> [   34.976270] scsi1 : pata_legacy
> [   34.999263] ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
> [   35.448191] scsi2 : pata_legacy
> [   35.486192] ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
> [   35.997114] scsi3 : pata_legacy
> [   36.051103] ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
> [   36.384057] genirq: Flags mismatch irq 8. 00000000 (platform) vs.
> 00000000 (rtc0)
> [   36.571024] scsi4 : pata_legacy
> [   36.626014] ata5: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12
> [   42.143223] EXT4-fs (sda4): mounting ext3 file system using the
> ext4 subsystem
> 
> and /proc/interrupts looks good:
> 
>            CPU0
>   0:     558552    XT-PIC-XT-PIC    timer
>   1:        337    XT-PIC-XT-PIC    i8042
>   2:          0    XT-PIC-XT-PIC    cascade
>   4:          1    XT-PIC-XT-PIC
>   8:          0    XT-PIC-XT-PIC    rtc0
>  14:      51538    XT-PIC-XT-PIC    platform

Thank you for testing.

Tejun, is this information sufficient to fix the issue or do you still
want Matthew to test your last debug patch?

[ http://marc.info/?l=linux-ide&m=148096582017930&w=2 ]

> I would still like to get my patch in. If you have a motherboard where
> you cannot disable the secondary hard drive controllers, the
> pata_legacy driver will detect them and allocate the interrupt. Some

If there are no devices attached to the controller, the driver will
free the resources so I don't quite get what would be the issue here.
Could you please explain it more?

> way to disable this behavior is useful.
> 
> - Matthew

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
       [not found]                 ` <CAP8WD_becq+h2=-g7t-6Pp1psmkCCvdB0YUcg+wYPocUP4dYdw@mail.gmail.com>
@ 2016-12-12 17:01                   ` Tejun Heo
       [not found]                     ` <CAP8WD_YMtnsuYmJHGz1eLmrQNemsB1Z6Soyb6f72brAfMNUNeg@mail.gmail.com>
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-12-12 17:01 UTC (permalink / raw)
  To: whiteheadm; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

On Fri, Dec 09, 2016 at 12:57:02PM -0500, tedheadster wrote:
> ​Tejun,
>   here is the patch I applied:
> 
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index 4fe9d21..5c6c578 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -963,6 +963,9 @@ static __init int legacy_init_one(struct legacy_probe
> *probe)
>         if (IS_ERR(pdev))
>                 return PTR_ERR(pdev);
> 
> +       if (!devres_open_group(&pdev->dev, legacy_init_one, GFP_KERNEL))
> +               return -ENOMEM;

Can you please drop the explicit group open/remove/release?

>         ret = -EBUSY;
>         if (devm_request_region(&pdev->dev, io, 8, "pata_legacy") == NULL ||
>             devm_request_region(&pdev->dev, io + 0x0206, 1,
> @@ -1009,11 +1012,14 @@ static __init int legacy_init_one(struct
> legacy_probe *probe)
>                 if (!ata_dev_absent(dev)) {
>                         legacy_host[probe->slot] = host;
>                         ld->platform_dev = pdev;
> +                       devres_remove_group(&pdev->dev, legacy_init_one);
>                         return 0;
>                 }
>         }
>         ata_host_detach(host);
>  fail:
> +       devres_release_group(&pdev->dev, legacy_init_one);
> +       printk("XXX pata_legacy: unregistering platform dev %p\n", pdev);
>         platform_device_unregister(pdev);

So, the thing is that when the platform device is released here, it
should automatically trigger release of all resources attached to it
through...

>         return ret;
>  }
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index a235085..8e8948e 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -214,6 +214,7 @@ static void device_release(struct kobject *kobj)
>          * is deleted but alive, so release devres here to avoid
>          * possible memory leak.
>          */
> +       printk("XXX device_release: invoking devres_release_all\n");
>         devres_release_all(dev);

the devres_release_all() call here.

Can you please try to verify that devres_release_all() is being
invoked from platform device release?  I'll try to see if I can repro
the problem here.

thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
       [not found]                     ` <CAP8WD_YMtnsuYmJHGz1eLmrQNemsB1Z6Soyb6f72brAfMNUNeg@mail.gmail.com>
@ 2016-12-20  2:12                       ` tedheadster
  2016-12-22 16:37                         ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2016-12-20  2:12 UTC (permalink / raw)
  To: Tejun Heo, One Thousand Gnomes, Sergei Shtylyov, linux-ide
  Cc: Matthew Whitehead

Tejun,
  apologies this took a while. Here is the patch I _think_ you were
asking me to test:

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index bce2a8c..bfa63d1 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -1008,12 +1008,15 @@ static __init int legacy_init_one(struct
legacy_probe *probe)
        if (!ata_dev_absent(dev)) {
            legacy_host[probe->slot] = host;
            ld->platform_dev = pdev;
+                       devres_remove_group(&pdev->dev, legacy_init_one);
            return 0;
        }
    }
        ata_host_detach(host);
 fail:
          platform_device_unregister(pdev);
+       devres_release_group(&pdev->dev, legacy_init_one);
+       printk("XXX pata_legacy: unregistering platform dev %p\n", pdev);
    return ret;
 }

The /proc/interrupts entry is still bad:

           CPU0
  0:      95630    XT-PIC  timer
  1:       1028    XT-PIC  i8042
  2:          0    XT-PIC  cascade
  5:          0    XT-PIC  pnp0-3c509-0
  6:          3    XT-PIC  floppy
  7:          0    XT-PIC  eisa0-3c59x-0
  8:          0    XT-PIC  rtc0
  9:          7    XT-PIC  aha1542
 10:          0    XT-PIC  platform[pata_legacy.3]
 11:          0    XT-PIC  platform[pata_legacy.2]
 12:          0    XT-PIC  platform[pata_legacy.5]
 14:      66786    XT-PIC  platform[pata_legacy.0]
 15:          0    XT-PIC  platform[pata_legacy.1]

and we have several backtraces :

[   20.757765] SCSI subsystem initialized
[   21.025769] libata version 3.00 loaded.
[   21.925805] Floppy drive(s): fd0 is 1.44M
[   21.950114] FDC 0 is a post-1991 82077
[   23.625932] scsi host0: pata_legacy
[   23.645903] ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
[   23.815254] ata1.00: ATA-4: QUANTUM FIREBALL CR8.4A, A5U.1200, max UDMA/66
[   23.815254] ata1.00: 16514064 sectors, multi 0: LBA
[   23.815254] ata1.00: configured for PIO
[   23.822027] scsi 0:0:0:0: Direct-Access     ATA      QUANTUM
FIREBALL 1200 PQ: 0 ANSI: 5
[   23.877945] sd 0:0:0:0: [sda] 16514064 512-byte logical blocks:
(8.46 GB/7.87 GiB)
[   23.885910] sd 0:0:0:0: [sda] Write Protect is off
[   23.885910] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[   23.885910] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[   24.009948]  sda: sda1 sda2 sda3 sda4
[   24.117952] sd 0:0:0:0: [sda] Attached SCSI disk
[   24.117952] ------------[ cut here ]------------
[   24.117952] WARNING: CPU: 0 PID: 131 at drivers/base/devres.c:629
devres_remove_group+0xaf/0xc0
[   24.117952] Modules linked in: pata_legacy(+) sd_mod ext4 jbd2
crc16 ext2 mbcache floppy vfat msdos fat nls_cp437 ata_piix libata
scsi_mod uhci_hcd usbcore usb_common virtio_blk virtio_ring virtio
3c515 3c59x 3c509 mii
[   24.117952] CPU: 0 PID: 131 Comm: modprobe Not tainted 4.9.0-rc6-tejun4+ #15
[   24.117952]  c2afbc48 c101c9f8 c15c0f5a 00000000 c2afbc50 c123e756
c2afbc84 c1048326
[   24.117952]  c15a3c80 00000000 00000083 c15dc5e0 00000275 c134088f
c134088f 00000275
[   24.117952]  c2aa5d48 c4a07f20 c2afbcb8 c2afbc98 c104836a 00000009
00000000 00000000
[   24.117952] Call Trace:
[   24.117952]  [<c101c9f8>] show_stack+0x28/0x50
[   24.117952]  [<c123e756>] dump_stack+0x16/0x20
[   24.117952]  [<c1048326>] __warn+0xe6/0x100
[   24.117952]  [<c134088f>] ? devres_remove_group+0xaf/0xc0
[   24.117952]  [<c134088f>] ? devres_remove_group+0xaf/0xc0
[   24.117952]  [<c104836a>] warn_slowpath_null+0x2a/0x30
[   24.117952]  [<c134088f>] devres_remove_group+0xaf/0xc0
[   24.117952]  [<c49322ec>] legacy_init_one+0x2ec/0x2ee [pata_legacy]
[   24.117952]  [<c493291c>] legacy_init+0x62e/0xd12 [pata_legacy]
[   24.117952]  [<c1000410>] do_one_initcall+0x40/0x140
[   24.117952]  [<c49322ee>] ? legacy_init_one+0x2ee/0x2ee [pata_legacy]
[   24.117952]  [<c14c7e24>] ? preempt_schedule_common+0x14/0x20
[   24.117952]  [<c14c7e9a>] ? _cond_resched+0x1a/0x30
[   24.117952]  [<c10a61a9>] ? do_init_module+0x29/0x200
[   24.117952]  [<c10a61d7>] do_init_module+0x57/0x200
[   24.117952]  [<c10a90f5>] load_module+0x1085/0x12b0
[   24.117952]  [<c10a58e0>] ? do_free_init+0x20/0x20
[   24.117952]  [<c10a9491>] ? SyS_init_module+0x91/0x130
[   24.117952]  [<c10a94ef>] SyS_init_module+0xef/0x130
[   24.117952]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[   24.117952]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[   24.117952] ---[ end trace 5aa726e4811c5039 ]---
[   24.213926] scsi host1: pata_legacy
[   24.237957] ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
[   24.449955] ------------[ cut here ]------------
[   24.449955] WARNING: CPU: 0 PID: 131 at drivers/base/devres.c:667
devres_release_group+0x97/0xa0
[   24.449955] Modules linked in: pata_legacy(+) sd_mod ext4 jbd2
crc16 ext2 mbcache floppy vfat msdos fat nls_cp437 ata_piix libata
scsi_mod uhci_hcd usbcore usb_common virtio_blk virtio_ring virtio
3c515 3c59x 3c509 mii
[   24.449955] CPU: 0 PID: 131 Comm: modprobe Tainted: G        W
 4.9.0-rc6-tejun4+ #15
[   24.449955]  c2afbc50 c101c9f8 c15c0f5a 00000000 c2afbc58 c123e756
c2afbc8c c1048326
[   24.449955]  c15a3c80 00000000 00000083 c15dc5e0 0000029b c13407d7
c13407d7 0000029b
[   24.449955]  c4932000 c4a07f38 c2afbcb8 c2afbca0 c104836a 00000009
00000000 00000000
[   24.449955] Call Trace:
[   24.449955]  [<c101c9f8>] show_stack+0x28/0x50
[   24.449955]  [<c123e756>] dump_stack+0x16/0x20
[   24.449955]  [<c1048326>] __warn+0xe6/0x100
[   24.449955]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   24.449955]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   24.449955]  [<c4932000>] ? 0xc4932000
[   24.449955]  [<c104836a>] warn_slowpath_null+0x2a/0x30
[   24.449955]  [<c13407d7>] devres_release_group+0x97/0xa0
[   24.449955]  [<c133f0c4>] ? platform_device_put+0x14/0x20
[   24.449955]  [<c49322aa>] legacy_init_one+0x2aa/0x2ee [pata_legacy]
[   24.449955]  [<c493291c>] legacy_init+0x62e/0xd12 [pata_legacy]
[   24.449955]  [<c1000410>] do_one_initcall+0x40/0x140
[   24.449955]  [<c49322ee>] ? legacy_init_one+0x2ee/0x2ee [pata_legacy]
[   24.449955]  [<c14c7e24>] ? preempt_schedule_common+0x14/0x20
[   24.449955]  [<c14c7e9a>] ? _cond_resched+0x1a/0x30
[   24.449955]  [<c10a61a9>] ? do_init_module+0x29/0x200
[   24.449955]  [<c10a61d7>] do_init_module+0x57/0x200
[   24.449955]  [<c10a90f5>] load_module+0x1085/0x12b0
[   24.449955]  [<c10a58e0>] ? do_free_init+0x20/0x20
[   24.449955]  [<c10a9491>] ? SyS_init_module+0x91/0x130
[   24.449955]  [<c10a94ef>] SyS_init_module+0xef/0x130
[   24.449955]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[   24.449955]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[   24.449955] ---[ end trace 5aa726e4811c503a ]---
[   24.455942] XXX pata_legacy: unregistering platform dev c2aeea00
[   24.553972] scsi host2: pata_legacy
[   24.577962] ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
[   24.790171] ------------[ cut here ]------------
[   24.790171] WARNING: CPU: 0 PID: 131 at drivers/base/devres.c:667
devres_release_group+0x97/0xa0
[   24.790171] Modules linked in: pata_legacy(+) sd_mod ext4 jbd2
crc16 ext2 mbcache floppy vfat msdos fat nls_cp437 ata_piix libata
scsi_mod uhci_hcd usbcore usb_common virtio_blk virtio_ring virtio
3c515 3c59x 3c509 mii
[   24.790171] CPU: 0 PID: 131 Comm: modprobe Tainted: G        W
 4.9.0-rc6-tejun4+ #15
[   24.790171]  c2afbc50 c101c9f8 c15c0f5a 00000000 c2afbc58 c123e756
c2afbc8c c1048326
[   24.790171]  c15a3c80 00000000 00000083 c15dc5e0 0000029b c13407d7
c13407d7 0000029b
[   24.790171]  c4932000 c4a07f50 c2afbcb8 c2afbca0 c104836a 00000009
00000000 00000000
[   24.790171] Call Trace:
[   24.790171]  [<c101c9f8>] show_stack+0x28/0x50
[   24.790171]  [<c123e756>] dump_stack+0x16/0x20
[   24.790171]  [<c1048326>] __warn+0xe6/0x100
[   24.790171]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   24.790171]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   24.790171]  [<c4932000>] ? 0xc4932000
[   24.790171]  [<c104836a>] warn_slowpath_null+0x2a/0x30
[   24.790171]  [<c13407d7>] devres_release_group+0x97/0xa0
[   24.790171]  [<c133f0c4>] ? platform_device_put+0x14/0x20
[   24.790171]  [<c49322aa>] legacy_init_one+0x2aa/0x2ee [pata_legacy]
[   24.790171]  [<c493291c>] legacy_init+0x62e/0xd12 [pata_legacy]
[   24.790171]  [<c1000410>] do_one_initcall+0x40/0x140
[   24.790171]  [<c49322ee>] ? legacy_init_one+0x2ee/0x2ee [pata_legacy]
[   24.790171]  [<c14c7e24>] ? preempt_schedule_common+0x14/0x20
[   24.790171]  [<c14c7e9a>] ? _cond_resched+0x1a/0x30
[   24.790171]  [<c10a61a9>] ? do_init_module+0x29/0x200
[   24.790171]  [<c10a61d7>] do_init_module+0x57/0x200
[   24.790171]  [<c10a90f5>] load_module+0x1085/0x12b0
[   24.790171]  [<c10a58e0>] ? do_free_init+0x20/0x20
[   24.790171]  [<c10a9491>] ? SyS_init_module+0x91/0x130
[   24.790171]  [<c10a94ef>] SyS_init_module+0xef/0x130
[   24.790171]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[   24.790171]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[   24.790171] ---[ end trace 5aa726e4811c503b ]---
[   24.794770] XXX pata_legacy: unregistering platform dev c2623c00
[   24.881963] scsi host3: pata_legacy
[   24.905987] ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
[   25.122003] ------------[ cut here ]------------
[   25.122003] WARNING: CPU: 0 PID: 131 at drivers/base/devres.c:667
devres_release_group+0x97/0xa0
[   25.122003] Modules linked in: pata_legacy(+) sd_mod ext4 jbd2
crc16 ext2 mbcache floppy vfat msdos fat nls_cp437 ata_piix libata
scsi_mod uhci_hcd usbcore usb_common virtio_blk virtio_ring virtio
3c515 3c59x 3c509 mii
[   25.122003] CPU: 0 PID: 131 Comm: modprobe Tainted: G        W
 4.9.0-rc6-tejun4+ #15
[   25.122003]  c2afbc50 c101c9f8 c15c0f5a 00000000 c2afbc58 c123e756
c2afbc8c c1048326
[   25.122003]  c15a3c80 00000000 00000083 c15dc5e0 0000029b c13407d7
c13407d7 0000029b
[   25.122003]  c4932000 c4a07f68 c2afbcb8 c2afbca0 c104836a 00000009
00000000 00000000
[   25.122003] Call Trace:
[   25.122003]  [<c101c9f8>] show_stack+0x28/0x50
[   25.122003]  [<c123e756>] dump_stack+0x16/0x20
[   25.122003]  [<c1048326>] __warn+0xe6/0x100
[   25.122003]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   25.122003]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   25.122003]  [<c4932000>] ? 0xc4932000
[   25.122003]  [<c104836a>] warn_slowpath_null+0x2a/0x30
[   25.122003]  [<c13407d7>] devres_release_group+0x97/0xa0
[   25.122003]  [<c133f0c4>] ? platform_device_put+0x14/0x20
[   25.122003]  [<c49322aa>] legacy_init_one+0x2aa/0x2ee [pata_legacy]
[   25.122003]  [<c493291c>] legacy_init+0x62e/0xd12 [pata_legacy]
[   25.122003]  [<c1000410>] do_one_initcall+0x40/0x140
[   25.122003]  [<c49322ee>] ? legacy_init_one+0x2ee/0x2ee [pata_legacy]
[   25.122003]  [<c14c7e24>] ? preempt_schedule_common+0x14/0x20
[   25.122003]  [<c14c7e9a>] ? _cond_resched+0x1a/0x30
[   25.122003]  [<c10a61a9>] ? do_init_module+0x29/0x200
[   25.122003]  [<c10a61d7>] do_init_module+0x57/0x200
[   25.122003]  [<c10a90f5>] load_module+0x1085/0x12b0
[   25.122003]  [<c10a58e0>] ? do_free_init+0x20/0x20
[   25.122003]  [<c10a9491>] ? SyS_init_module+0x91/0x130
[   25.122003]  [<c10a94ef>] SyS_init_module+0xef/0x130
[   25.122003]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[   25.122003]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[   25.122003] ---[ end trace 5aa726e4811c503c ]---
[   25.126150] XXX pata_legacy: unregistering platform dev c2623e00
[   25.138001] genirq: Flags mismatch irq 8. 00000000
(platform[pata_legacy.4]) vs. 00000080 (rtc0)
[   25.146001] ------------[ cut here ]------------
[   25.146001] WARNING: CPU: 0 PID: 131 at drivers/base/devres.c:667
devres_release_group+0x97/0xa0
[   25.146001] Modules linked in: pata_legacy(+) sd_mod ext4 jbd2
crc16 ext2 mbcache floppy vfat msdos fat nls_cp437 ata_piix libata
scsi_mod uhci_hcd usbcore usb_common virtio_blk virtio_ring virtio
3c515 3c59x 3c509 mii
[   25.146001] CPU: 0 PID: 131 Comm: modprobe Tainted: G        W
 4.9.0-rc6-tejun4+ #15
[   25.146001]  c2afbc50 c101c9f8 c15c0f5a 00000000 c2afbc58 c123e756
c2afbc8c c1048326
[   25.146001]  c15a3c80 00000000 00000083 c15dc5e0 0000029b c13407d7
c13407d7 0000029b
[   25.146001]  c4932000 c4a07f80 c4a08010 c2afbca0 c104836a 00000009
00000000 00000000
[   25.146001] Call Trace:
[   25.146001]  [<c101c9f8>] show_stack+0x28/0x50
[   25.146001]  [<c123e756>] dump_stack+0x16/0x20
[   25.146001]  [<c1048326>] __warn+0xe6/0x100
[   25.146001]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   25.146001]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   25.146001]  [<c4932000>] ? 0xc4932000
[   25.146001]  [<c104836a>] warn_slowpath_null+0x2a/0x30
[   25.146001]  [<c13407d7>] devres_release_group+0x97/0xa0
[   25.146001]  [<c133f0c4>] ? platform_device_put+0x14/0x20
[   25.146001]  [<c49322aa>] legacy_init_one+0x2aa/0x2ee [pata_legacy]
[   25.146001]  [<c493291c>] legacy_init+0x62e/0xd12 [pata_legacy]
[   25.146001]  [<c1000410>] do_one_initcall+0x40/0x140
[   25.146001]  [<c49322ee>] ? legacy_init_one+0x2ee/0x2ee [pata_legacy]
[   25.146001]  [<c14c7e24>] ? preempt_schedule_common+0x14/0x20
[   25.146001]  [<c14c7e9a>] ? _cond_resched+0x1a/0x30
[   25.146001]  [<c10a61a9>] ? do_init_module+0x29/0x200
[   25.146001]  [<c10a61d7>] do_init_module+0x57/0x200
[   25.146001]  [<c10a90f5>] load_module+0x1085/0x12b0
[   25.146001]  [<c10a58e0>] ? do_free_init+0x20/0x20
[   25.146001]  [<c10a9491>] ? SyS_init_module+0x91/0x130
[   25.146001]  [<c10a94ef>] SyS_init_module+0xef/0x130
[   25.146001]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[   25.146001]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[   25.146001] ---[ end trace 5aa726e4811c503d ]---
[   25.151917] XXX pata_legacy: unregistering platform dev c2aee400
[   25.237998] scsi host4: pata_legacy
[   25.265989] ata5: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12
[   25.478021] ------------[ cut here ]------------
[   25.478021] WARNING: CPU: 0 PID: 131 at drivers/base/devres.c:667
devres_release_group+0x97/0xa0
[   25.478021] Modules linked in: pata_legacy(+) sd_mod ext4 jbd2
crc16 ext2 mbcache floppy vfat msdos fat nls_cp437 ata_piix libata
scsi_mod uhci_hcd usbcore usb_common virtio_blk virtio_ring virtio
3c515 3c59x 3c509 mii
[   25.478021] CPU: 0 PID: 131 Comm: modprobe Tainted: G        W
 4.9.0-rc6-tejun4+ #15
[   25.478021]  c2afbc50 c101c9f8 c15c0f5a 00000000 c2afbc58 c123e756
c2afbc8c c1048326
[   25.478021]  c15a3c80 00000000 00000083 c15dc5e0 0000029b c13407d7
c13407d7 0000029b
[   25.478021]  c4932000 c4a07f98 c2afbcb8 c2afbca0 c104836a 00000009
00000000 00000000
[   25.478021] Call Trace:
[   25.478021]  [<c101c9f8>] show_stack+0x28/0x50
[   25.478021]  [<c123e756>] dump_stack+0x16/0x20
[   25.478021]  [<c1048326>] __warn+0xe6/0x100
[   25.478021]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   25.478021]  [<c13407d7>] ? devres_release_group+0x97/0xa0
[   25.478021]  [<c4932000>] ? 0xc4932000
[   25.478021]  [<c104836a>] warn_slowpath_null+0x2a/0x30
[   25.478021]  [<c13407d7>] devres_release_group+0x97/0xa0
[   25.478021]  [<c133f0c4>] ? platform_device_put+0x14/0x20
[   25.478021]  [<c49322aa>] legacy_init_one+0x2aa/0x2ee [pata_legacy]
[   25.478021]  [<c493291c>] legacy_init+0x62e/0xd12 [pata_legacy]
[   25.478021]  [<c1000410>] do_one_initcall+0x40/0x140
[   25.478021]  [<c49322ee>] ? legacy_init_one+0x2ee/0x2ee [pata_legacy]
[   25.478021]  [<c14c7e24>] ? preempt_schedule_common+0x14/0x20
[   25.478021]  [<c14c7e9a>] ? _cond_resched+0x1a/0x30
[   25.478021]  [<c10a61a9>] ? do_init_module+0x29/0x200
[   25.478021]  [<c10a61d7>] do_init_module+0x57/0x200
[   25.478021]  [<c10a90f5>] load_module+0x1085/0x12b0
[   25.478021]  [<c10a58e0>] ? do_free_init+0x20/0x20
[   25.478021]  [<c10a9491>] ? SyS_init_module+0x91/0x130
[   25.478021]  [<c10a94ef>] SyS_init_module+0xef/0x130
[   25.478021]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[   25.478021]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[   25.478021] ---[ end trace 5aa726e4811c503e ]---
[   25.482482] XXX pata_legacy: unregistering platform dev c2aee600
[   26.990075] scsi host5: Adaptec AHA-1542 (SCSI-ID 7) at IO 0x330,
IRQ 9, DMA 5
[   27.014108] scsi host5: Adaptec 1542
[   27.062096] bounce: isa pool size: 16 pages
[   27.846164] random: crng init done
[   30.086292] device-mapper: uevent: version 1.0.3
[   30.094299] device-mapper: ioctl: 4.35.0-ioctl (2016-06-23)
initialised: dm-devel@redhat.com
[   30.618797] EXT4-fs (sda4): mounting ext3 file system using the
ext4 subsystem
[   30.762317] EXT4-fs (sda4): mounted filesystem with ordered data
mode. Opts: (null)
[   40.082846] udev[255]: starting version 164
[   42.478972] 3c509 3c509.0 isa0-3c509-0: renamed from eth3
[   44.055092] 3c509 00:02.00 pnp0-3c509-0: renamed from eth0
[   44.751104] 3c579 00:06 eisa0-3c509-0: renamed from eth4
[   44.823115] 3c579 00:07 eisa0-3c509-1: renamed from eth5
[   45.351161] 3c59x 00:08 eisa0-3c59x-0: renamed from eth2
[   47.343318] input: PC Speaker as /devices/platform/pcspkr/input/input1
[   56.759801] Error: Driver 'pcspkr' is already registered, aborting...
[   78.345031] Adding 124924k swap on /dev/sda2.  Priority:-1
extents:1 across:124924k
[   78.841040] EXT4-fs (sda4): re-mounted. Opts: (null)
[   81.189191] EXT4-fs (sda4): re-mounted. Opts: errors=remount-ro
[   89.245655] loop: module loaded
[  110.430862] eisa0-3c59x-0: first available media type: 100baseTX
[  110.430862] eisa0-3c59x-0:  setting half-duplex.
[  115.299125] pnp0-3c509-0: Setting 3c5x9/3c5x9B half-duplex mode
if_port: 0, sw_info: 3f31
[  116.283187] genirq: Flags mismatch irq 10. 00000000 (3c515) vs.
00000000 (platform[pata_legacy.3])
[  116.287197] ------------[ cut here ]------------
[  116.287197] WARNING: CPU: 0 PID: 1089 at lib/debugobjects.c:263
debug_print_object+0x85/0xa0
[  116.287197] ODEBUG: init active (active state 0) object type:
timer_list hint: corkscrew_timer+0x0/0x3b0 [3c515]
[  116.287197] Modules linked in: loop snd_pcm snd_timer snd
tpm_tis_core soundcore tpm evdev pcspkr dm_mod aha1542 sr_mod cdrom
isofs pata_legacy sd_mod ext4 jbd2 crc16 ext2 mbcache floppy vfat
msdos fat nls_cp437 ata_piix libata scsi_mod uhci_hcd usbcore
usb_common virtio_blk virtio_ring virtio 3c515 3c59x 3c509 mii
[  116.287197] CPU: 0 PID: 1089 Comm: ifconfig Tainted: G        W
  4.9.0-rc6-tejun4+ #15
[  116.287197]  c2707c74 c101c9f8 c15c0f5a 00000000 c2707c7c c123e756
c2707cb0 c1048326
[  116.287197]  c15cd08c c2707ce0 00000441 c15cdd5b 00000107 c125b6c5
c125b6c5 00000107
[  116.287197]  c2a0e780 c1664040 c15bb707 c2707ccc c10483eb 00000009
00000000 c2707cc4
[  116.287197] Call Trace:
[  116.287197]  [<c101c9f8>] show_stack+0x28/0x50
[  116.287197]  [<c123e756>] dump_stack+0x16/0x20
[  116.287197]  [<c1048326>] __warn+0xe6/0x100
[  116.287197]  [<c125b6c5>] ? debug_print_object+0x85/0xa0
[  116.287197]  [<c125b6c5>] ? debug_print_object+0x85/0xa0
[  116.287197]  [<c10483eb>] warn_slowpath_fmt+0x3b/0x40
[  116.287197]  [<c125b6c5>] debug_print_object+0x85/0xa0
[  116.287197]  [<c4963470>] ? init_module+0x320/0x320 [3c515]
[  116.287197]  [<c125be24>] __debug_object_init+0x1d4/0x330
[  116.287197]  [<c1377572>] ? cnic_netdev_event+0x312/0x390
[  116.287197]  [<c1042a85>] ? kmap_atomic_prot+0x35/0xc0
[  116.287197]  [<c125bfb7>] debug_object_init+0x17/0x20
[  116.287197]  [<c108ceac>] init_timer_key+0x1c/0x90
[  116.287197]  [<c49624ac>] corkscrew_open+0x4bc/0x6a0 [3c515]
[  116.287197]  [<c13d29c3>] ? call_netdevice_notifiers_info+0x33/0x70
[  116.287197]  [<c13d3df3>] __dev_open+0xc3/0x140
[  116.287197]  [<c104bb45>] ? __local_bh_enable_ip+0x75/0x80
[  116.287197]  [<c13d3bac>] __dev_change_flags+0x8c/0x150
[  116.287197]  [<c11c9713>] ? security_capable+0x43/0x50
[  116.287197]  [<c13d3c9e>] dev_change_flags+0x2e/0x70
[  116.287197]  [<c14491cb>] devinet_ioctl+0x60b/0x6d0
[  116.287197]  [<c13f1284>] ? dev_ioctl+0x504/0x640
[  116.287197]  [<c144ad25>] inet_ioctl+0x95/0xb0
[  116.287197]  [<c13bd92d>] sock_ioctl+0x6d/0x290
[  116.287197]  [<c13bd8c0>] ? sock_fasync+0x80/0x80
[  116.287197]  [<c1159585>] vfs_ioctl+0x15/0x30
[  116.287197]  [<c1159e48>] do_vfs_ioctl+0x158/0x680
[  116.287197]  [<c114953a>] ? __vfs_write+0x2a/0xc0
[  116.287197]  [<c1148c0a>] ? rw_verify_area+0x5a/0x130
[  116.287197]  [<c114907c>] ? fsnotify_modify+0x6c/0x80
[  116.287197]  [<c1149687>] ? vfs_write+0xb7/0x130
[  116.287197]  [<c115a3fa>] SyS_ioctl+0x8a/0x90
[  116.287197]  [<c1001813>] do_int80_syscall_32+0x63/0x130
[  116.287197]  [<c14cac5a>] entry_INT80_32+0x2a/0x2a
[  116.287197] ---[ end trace 5aa726e4811c503f ]---
[  116.291957] genirq: Flags mismatch irq 10. 00000000 (3c515) vs.
00000000 (platform[pata_legacy.3])

- Matthew

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-20  2:12                       ` tedheadster
@ 2016-12-22 16:37                         ` Tejun Heo
  2016-12-22 17:14                           ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-12-22 16:37 UTC (permalink / raw)
  To: whiteheadm; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

On Mon, Dec 19, 2016 at 09:12:49PM -0500, tedheadster wrote:
> Tejun,
>   apologies this took a while. Here is the patch I _think_ you were
> asking me to test:
> 
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index bce2a8c..bfa63d1 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -1008,12 +1008,15 @@ static __init int legacy_init_one(struct
> legacy_probe *probe)
>         if (!ata_dev_absent(dev)) {
>             legacy_host[probe->slot] = host;
>             ld->platform_dev = pdev;
> +                       devres_remove_group(&pdev->dev, legacy_init_one);
>             return 0;
>         }
>     }
>         ata_host_detach(host);
>  fail:
>           platform_device_unregister(pdev);
> +       devres_release_group(&pdev->dev, legacy_init_one);
> +       printk("XXX pata_legacy: unregistering platform dev %p\n", pdev);
>     return ret;

The thing I'm puzzled about and can't reproduce here is that the
platform_device_unregister() call on the fail path should release the
irq resources without the explicit devres group operations.  I can
write up tracking each step but it'd probably be easier on your side
to track down why it's not getting called.

So, pata_legacy doesn't need anything changed, but in the probe fail
path, platform_device_unregister() should trigger
driver/base/core.c::device_release() which calls devres_release_all()
and release the irqs.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-22 16:37                         ` Tejun Heo
@ 2016-12-22 17:14                           ` tedheadster
  2016-12-22 17:19                             ` Tejun Heo
  2016-12-22 18:30                             ` tedheadster
  0 siblings, 2 replies; 48+ messages in thread
From: tedheadster @ 2016-12-22 17:14 UTC (permalink / raw)
  To: Tejun Heo; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Tejun,
>
> The thing I'm puzzled about and can't reproduce here is that the
> platform_device_unregister() call on the fail path should release the
> irq resources without the explicit devres group operations.  I can
> write up tracking each step but it'd probably be easier on your side
> to track down why it's not getting called.
>
> So, pata_legacy doesn't need anything changed, but in the probe fail
> path, platform_device_unregister() should trigger
> driver/base/core.c::device_release() which calls devres_release_all()
> and release the irqs.
>

It looks to me that when something is 'platform' it is not expected to
ever go away, and that generally includes irqs. There are calls to
platform_get_irq() but there isn't even a function called
platform_put_irq() or platform_free_irq().

I do see some driver calls to failure conditions or 'remove' functions
where it calls:

free_irq(platform_get_irq(pdev, 0), var)

See:

drivers/mmc/host/atmel-mci.c
drivers/usb/gadget/udc/fotg210-udc.c
drivers/usb/gadget/udc/fusb300_udc.c
drivers/usb/gadget/udc/m66592-udc.c
drivers/video/fbdev/au1200fb.c
drivers/virtio/virtio_mmio.c
drivers/dma/at_hdmac.c
 drivers/input/keyboard/pxa930_rotary.c
drivers/input/keyboard/sh_keysc.c

I think this driver should either not be considered 'platform' or it
should make a call to free_irq() on failures.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-22 17:14                           ` tedheadster
@ 2016-12-22 17:19                             ` Tejun Heo
  2016-12-22 18:30                             ` tedheadster
  1 sibling, 0 replies; 48+ messages in thread
From: Tejun Heo @ 2016-12-22 17:19 UTC (permalink / raw)
  To: whiteheadm; +Cc: One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

On Thu, Dec 22, 2016 at 12:14:43PM -0500, tedheadster wrote:
> It looks to me that when something is 'platform' it is not expected to
> ever go away, and that generally includes irqs. There are calls to
> platform_get_irq() but there isn't even a function called
> platform_put_irq() or platform_free_irq().

But it works fine if we open and release an explicit devres group, so
the problem isn't there.  The problem is why platform device
destruction isn't triggering devres release of all associated
resources.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-22 17:14                           ` tedheadster
  2016-12-22 17:19                             ` Tejun Heo
@ 2016-12-22 18:30                             ` tedheadster
  2016-12-22 19:22                               ` Tejun Heo
  1 sibling, 1 reply; 48+ messages in thread
From: tedheadster @ 2016-12-22 18:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Tejun Heo, One Thousand Gnomes, Sergei Shtylyov, linux-ide

Greg,
  when calling drivers/ata/pata_legacy.c, it grabs four irq's even
though those legacy device probes fail:

root@i486:~# cat /proc/interrupts
           CPU0
  0:      95630    XT-PIC  timer
  1:       1028    XT-PIC  i8042
...
 10:          0    XT-PIC  platform[pata_legacy.3]
 11:          0    XT-PIC  platform[pata_legacy.2]
 12:          0    XT-PIC  platform[pata_legacy.5]
 14:      66786    XT-PIC  platform[pata_legacy.0]
 15:          0    XT-PIC  platform[pata_legacy.1]

Tejun believes that platform_device_unregister() should free the irqs:

>>
>> The thing I'm puzzled about and can't reproduce here is that the
>> platform_device_unregister() call on the fail path should release the
>> irq resources without the explicit devres group operations.  I can
>> write up tracking each step but it'd probably be easier on your side
>> to track down why it's not getting called.
>>
>> So, pata_legacy doesn't need anything changed, but in the probe fail
>> path, platform_device_unregister() should trigger
>> driver/base/core.c::device_release() which calls devres_release_all()
>> and release the irqs.
>>
>

I ponder if the driver should instead release the irq's from the failed probe:

> It looks to me that when something is 'platform' it is not expected to
> ever go away, and that generally includes irqs. There are calls to
> platform_get_irq() but there isn't even a function called
> platform_put_irq() or platform_free_irq().
>
...
> I think this driver should either not be considered 'platform' or it
> should make a call to free_irq() on failures.
>

The question is: who is responsible to free an irq from a device
registered using platform_device_register_simple()? Is it the driver
or the platform code?

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-22 18:30                             ` tedheadster
@ 2016-12-22 19:22                               ` Tejun Heo
  2017-01-03 17:34                                 ` One Thousand Gnomes
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2016-12-22 19:22 UTC (permalink / raw)
  To: whiteheadm
  Cc: Greg Kroah-Hartman, One Thousand Gnomes, Sergei Shtylyov, linux-ide

Hello,

On Thu, Dec 22, 2016 at 01:30:23PM -0500, tedheadster wrote:
> > I think this driver should either not be considered 'platform' or it
> > should make a call to free_irq() on failures.
> >
> 
> The question is: who is responsible to free an irq from a device
> registered using platform_device_register_simple()? Is it the driver
> or the platform code?

Sorry, I wasn't clear.  There's a rudimentary garbage collector devm
which tracks all the resources associated with a device.  The previous
patch that I sent you which created an explict resource group and
released it uses the same mechanism.  When any device gets destroyed,
it should release all associated resources and I was wondering why
that wasn't happening without the explicit group operations.  I'll
write up a debug patch to track down what's going on.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2016-12-22 19:22                               ` Tejun Heo
@ 2017-01-03 17:34                                 ` One Thousand Gnomes
       [not found]                                   ` <CAP8WD_bS61spyQkd7cvktFf_dPc0wgNZ8qEa7GVrXgUobHQdvw@mail.gmail.com>
  0 siblings, 1 reply; 48+ messages in thread
From: One Thousand Gnomes @ 2017-01-03 17:34 UTC (permalink / raw)
  To: Tejun Heo; +Cc: whiteheadm, Greg Kroah-Hartman, Sergei Shtylyov, linux-ide

On Thu, 22 Dec 2016 14:22:56 -0500
Tejun Heo <tj@kernel.org> wrote:

> Hello,
> 
> On Thu, Dec 22, 2016 at 01:30:23PM -0500, tedheadster wrote:
> > > I think this driver should either not be considered 'platform' or it
> > > should make a call to free_irq() on failures.
> > >  
> > 
> > The question is: who is responsible to free an irq from a device
> > registered using platform_device_register_simple()? Is it the driver
> > or the platform code?  
> 
> Sorry, I wasn't clear.  There's a rudimentary garbage collector devm
> which tracks all the resources associated with a device.  The previous
> patch that I sent you which created an explict resource group and
> released it uses the same mechanism.  When any device gets destroyed,
> it should release all associated resources and I was wondering why
> that wasn't happening without the explicit group operations.  I'll
> write up a debug patch to track down what's going on. 

Almost certainly libata leaking a reference to the device so it doesn't
think it's gone away.

Alan

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
       [not found]                                   ` <CAP8WD_bS61spyQkd7cvktFf_dPc0wgNZ8qEa7GVrXgUobHQdvw@mail.gmail.com>
@ 2017-01-19 21:37                                     ` Tejun Heo
  2017-01-20 17:08                                       ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-01-19 21:37 UTC (permalink / raw)
  To: whiteheadm
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov, linux-ide

On Wed, Jan 11, 2017 at 08:54:21PM -0500, tedheadster wrote:
> ​Tejun,
>   I'm interested in debugging this. What can I do to help?

Sorry about taking so long.  I suck. :)

Can you please try the following patch and post what the kernel prints
out?

Thanks.
---
 drivers/ata/pata_legacy.c |    2 ++
 drivers/base/core.c       |    9 +++++++++
 include/linux/kobject.h   |    1 +
 lib/kobject.c             |   22 ++++++++++++++++++++++
 4 files changed, 34 insertions(+)

--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -962,6 +962,8 @@ static __init int legacy_init_one(struct
 	if (IS_ERR(pdev))
 		return PTR_ERR(pdev);
 
+	pdev->dev.kobj.release_debug = true;
+
 	ret = -EBUSY;
 	if (devm_request_region(&pdev->dev, io, 8, "pata_legacy") == NULL ||
 	    devm_request_region(&pdev->dev, io + 0x0206, 1,
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -803,8 +803,17 @@ static void device_release(struct kobjec
 	 * is deleted but alive, so release devres here to avoid
 	 * possible memory leak.
 	 */
+	if (kobj->release_debug)
+		dev_info(dev, "XXX device_release: drel=%pf trel=%pf cdrel=%pf\n",
+			 dev->release,
+			 dev->type ? dev->type->release : NULL,
+			 dev->class ? dev->class->dev_release : NULL);
+
 	devres_release_all(dev);
 
+	if (kobj->release_debug)
+		dev_info(dev, "XXX device_release: devres_release_all() done\n");
+
 	if (dev->release)
 		dev->release(dev);
 	else if (dev->type && dev->type->release)
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -76,6 +76,7 @@ struct kobject {
 	unsigned int state_add_uevent_sent:1;
 	unsigned int state_remove_uevent_sent:1;
 	unsigned int uevent_suppress:1;
+	unsigned int release_debug:1;
 };
 
 extern __printf(2, 3)
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -595,6 +595,13 @@ struct kobject *kobject_get(struct kobje
 			WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
 			       "initialized, yet kobject_get() is being "
 			       "called.\n", kobject_name(kobj), kobj);
+		if (kobj->release_debug)
+			printk("XXX kobject_get(%s): ref=%d++ (%pf:%pf:%pf)\n",
+			       kobject_name(kobj),
+			       atomic_read(&kobj->kref.refcount),
+			       __builtin_return_address(1),
+			       __builtin_return_address(2),
+			       __builtin_return_address(3));
 		kref_get(&kobj->kref);
 	}
 	return kobj;
@@ -620,6 +627,14 @@ static void kobject_cleanup(struct kobje
 	pr_debug("kobject: '%s' (%p): %s, parent %p\n",
 		 kobject_name(kobj), kobj, __func__, kobj->parent);
 
+	if (kobj->release_debug)
+		printk("XXX kobject_cleanup(%s): rel=%pf (%pf:%pf:%pf)\n",
+		       kobject_name(kobj),
+		       (t && t->release) ? t->release : NULL,
+		       __builtin_return_address(1),
+		       __builtin_return_address(2),
+		       __builtin_return_address(3));
+
 	if (t && !t->release)
 		pr_debug("kobject: '%s' (%p): does not have a release() "
 			 "function, it is broken and must be fixed.\n",
@@ -688,6 +703,13 @@ void kobject_put(struct kobject *kobj)
 			WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
 			       "initialized, yet kobject_put() is being "
 			       "called.\n", kobject_name(kobj), kobj);
+		if (kobj->release_debug)
+			printk("XXX kobject_put(%s): ref=%d-- (%pf:%pf:%pf)\n",
+			       kobject_name(kobj),
+			       atomic_read(&kobj->kref.refcount),
+			       __builtin_return_address(1),
+			       __builtin_return_address(2),
+			       __builtin_return_address(3));
 		kref_put(&kobj->kref, kobject_release);
 	}
 }

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-19 21:37                                     ` Tejun Heo
@ 2017-01-20 17:08                                       ` tedheadster
  2017-01-20 19:19                                         ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2017-01-20 17:08 UTC (permalink / raw)
  To: Tejun Heo
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov, linux-ide

Tejun,
  here is the relevant output:

[   39.868755] XXX kobject_get(pata_legacy.0): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   39.875762] XXX kobject_get(pata_legacy.0): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   39.877885] XXX kobject_get(pata_legacy.0): ref=5++
(kobject_add:device_add:ata_tport_add)
[   39.971742] scsi host0: pata_legacy
[   39.999736] ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
[   40.157745] ata1.00: ATA-4: QUANTUM FIREBALL CR8.4A, A5U.1200, max UDMA/66
[   40.159149] ata1.00: 16514064 sectors, multi 0: LBA
[   40.160111] ata1.00: configured for PIO
[   40.236700] scsi 0:0:0:0: Direct-Access     ATA      QUANTUM
FIREBALL 1200 PQ: 0 ANSI: 5
[   40.337686] sd 0:0:0:0: [sda] 16514064 512-byte logical blocks:
(8.46 GB/7.87 GiB)
[   40.346688] sd 0:0:0:0: [sda] Write Protect is off
[   40.348681] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[   40.365678] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[   40.367688] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   40.540654]  sda: sda1 sda2 sda3 sda4
[   40.916596] sd 0:0:0:0: [sda] Attached SCSI disk
[   40.956594] XXX kobject_get(pata_legacy.1): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   40.968587] XXX kobject_get(pata_legacy.1): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   40.971139] XXX kobject_get(pata_legacy.1): ref=5++
(kobject_add:device_add:ata_tport_add)
[   41.152561] scsi host1: pata_legacy
[   41.227549] ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
[   41.690486] XXX kobject_put(pata_legacy.1): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   41.692548] XXX kobject_put(pata_legacy.1): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   41.719476] XXX kobject_put(pata_legacy.1): ref=4--
(klist_put:klist_del:device_del)
[   41.725471] XXX kobject_put(pata_legacy.1): ref=3--
(klist_devices_put:klist_put:klist_del)
[   41.745472] XXX kobject_put(pata_legacy.1): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   41.793466] XXX kobject_get(pata_legacy.2): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   41.807475] XXX kobject_get(pata_legacy.2): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   41.809848] XXX kobject_get(pata_legacy.2): ref=5++
(kobject_add:device_add:ata_tport_add)
[   41.991431] scsi host2: pata_legacy
[   42.036428] ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
[   42.357388] XXX kobject_put(pata_legacy.2): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   42.359786] XXX kobject_put(pata_legacy.2): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   42.447367] XXX kobject_put(pata_legacy.2): ref=4--
(klist_put:klist_del:device_del)
[   42.470362] XXX kobject_put(pata_legacy.2): ref=3--
(klist_devices_put:klist_put:klist_del)
[   42.510357] XXX kobject_put(pata_legacy.2): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   42.583346] XXX kobject_get(pata_legacy.3): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   42.592340] XXX kobject_get(pata_legacy.3): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   42.594415] XXX kobject_get(pata_legacy.3): ref=5++
(kobject_add:device_add:ata_tport_add)
[   42.815304] scsi host3: pata_legacy
[   42.881302] ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
[   43.292234] XXX kobject_put(pata_legacy.3): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   43.294228] XXX kobject_put(pata_legacy.3): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   43.340228] XXX kobject_put(pata_legacy.3): ref=4--
(klist_put:klist_del:device_del)
[   43.370225] XXX kobject_put(pata_legacy.3): ref=3--
(klist_devices_put:klist_put:klist_del)
[   43.411220] XXX kobject_put(pata_legacy.3): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   43.599193] genirq: Flags mismatch irq 8. 00000000
(platform[pata_legacy.4]) vs. 00000080 (rtc0)
[   43.645179] XXX kobject_put(pata_legacy.4): ref=3--
(klist_put:klist_del:device_del)
[   43.685178] XXX kobject_put(pata_legacy.4): ref=2--
(klist_devices_put:klist_put:klist_del)
[   43.733174] XXX kobject_put(pata_legacy.4): ref=1--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   43.736259] XXX kobject_cleanup(pata_legacy.4): rel=device_release
(put_device:platform_device_unregister:legacy_init [pata_legacy])
[   43.738417] platform pata_legacy.4: XXX device_release:
drel=platform_device_release trel=  (null) cdrel=  (null)
[   43.740160] platform pata_legacy.4: XXX device_release:
devres_release_all() done
[   43.950138] XXX kobject_get(pata_legacy.5): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   43.973137] XXX kobject_get(pata_legacy.5): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   43.975360] XXX kobject_get(pata_legacy.5): ref=5++
(kobject_add:device_add:ata_tport_add)
[   44.338072] scsi host4: pata_legacy
[   44.389071] ata5: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12
[   44.699020] XXX kobject_put(pata_legacy.5): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   44.701270] XXX kobject_put(pata_legacy.5): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   44.714021] XXX kobject_put(pata_legacy.5): ref=4--
(klist_put:klist_del:device_del)
[   44.731015] XXX kobject_put(pata_legacy.5): ref=3--
(klist_devices_put:klist_put:klist_del)
[   44.750009] XXX kobject_put(pata_legacy.5): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)

...

[  252.348369] genirq: Flags mismatch irq 10. 00000000 (3c515) vs.
00000000 (platform[pata_legacy.3])
[  252.379341] genirq: Flags mismatch irq 10. 00000000 (3c515) vs.
00000000 (platform[pata_legacy.3])

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-20 17:08                                       ` tedheadster
@ 2017-01-20 19:19                                         ` Tejun Heo
  2017-01-20 19:38                                           ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-01-20 19:19 UTC (permalink / raw)
  To: whiteheadm
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov, linux-ide

Hello,

Thanks for testing.

On Fri, Jan 20, 2017 at 12:08:10PM -0500, tedheadster wrote:
> kobject_get(pata_legacy.1): ref=3++ (ata_tport_add:ata_host_register:ata_host_activate)
> kobject_get(pata_legacy.1): ref=4++ (ata_tport_add:ata_host_register:ata_host_activate)
> XXX kobject_get(pata_legacy.1): ref=5++ (kobject_add:device_add:ata_tport_add)
> XXX kobject_put(pata_legacy.1): ref=6-- (device_del:ata_tport_delete:ata_host_detach)
> XXX kobject_put(pata_legacy.1): ref=5-- (ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
> XXX kobject_put(pata_legacy.1): ref=4-- (klist_put:klist_del:device_del)
> XXX kobject_put(pata_legacy.1): ref=3-- (klist_devices_put:klist_put:klist_del)
> XXX kobject_put(pata_legacy.1): ref=2-- (platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)

So, three gets from the transport path but only two puts.  That seems
to be the culprit.  Looking into it.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-20 19:19                                         ` Tejun Heo
@ 2017-01-20 19:38                                           ` Tejun Heo
  2017-01-23 23:36                                             ` Gwendal Grignou
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-01-20 19:38 UTC (permalink / raw)
  To: gwendal
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov,
	linux-ide, whiteheadm

Hello, Gwendal.

On Fri, Jan 20, 2017 at 02:19:46PM -0500, Tejun Heo wrote:
> On Fri, Jan 20, 2017 at 12:08:10PM -0500, tedheadster wrote:
> > kobject_get(pata_legacy.1): ref=3++ (ata_tport_add:ata_host_register:ata_host_activate)
> > kobject_get(pata_legacy.1): ref=4++ (ata_tport_add:ata_host_register:ata_host_activate)
> > XXX kobject_get(pata_legacy.1): ref=5++ (kobject_add:device_add:ata_tport_add)
> > XXX kobject_put(pata_legacy.1): ref=6-- (device_del:ata_tport_delete:ata_host_detach)
> > XXX kobject_put(pata_legacy.1): ref=5-- (ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
> > XXX kobject_put(pata_legacy.1): ref=4-- (klist_put:klist_del:device_del)
> > XXX kobject_put(pata_legacy.1): ref=3-- (klist_devices_put:klist_put:klist_del)
> > XXX kobject_put(pata_legacy.1): ref=2-- (platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
> 
> So, three gets from the transport path but only two puts.  That seems
> to be the culprit.  Looking into it.

So, Matthew discovered that pata_legacy isn't releasing resources
after probe failure.  After some debugging, it turns out that the
transport code is taking three refs but only putting two preventing
the ata port from going away.

Can you please explain why the libata transport code is explicitly
pinning the parent device and then putting it in the release methods?
device_add/del() already gets and puts the parent, so I don't get why
this part is necessary.  Is this intentional?

Also, it looks like there is a ref leak on the transport device
itself.  Its release function never gets called and thus the parent
device (ata_port) stays pinned too.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-20 19:38                                           ` Tejun Heo
@ 2017-01-23 23:36                                             ` Gwendal Grignou
  2017-01-23 23:57                                               ` tedheadster
  2017-01-24 15:57                                               ` [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Tejun Heo
  0 siblings, 2 replies; 48+ messages in thread
From: Gwendal Grignou @ 2017-01-23 23:36 UTC (permalink / raw)
  To: Tejun Heo
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov,
	IDE/ATA development list, whiteheadm

On Fri, Jan 20, 2017 at 11:38 AM, Tejun Heo <tj@kernel.org> wrote:
> Hello, Gwendal.
>
> On Fri, Jan 20, 2017 at 02:19:46PM -0500, Tejun Heo wrote:
>> On Fri, Jan 20, 2017 at 12:08:10PM -0500, tedheadster wrote:
>> > kobject_get(pata_legacy.1): ref=3++ (ata_tport_add:ata_host_register:ata_host_activate)
>> > kobject_get(pata_legacy.1): ref=4++ (ata_tport_add:ata_host_register:ata_host_activate)
>> > XXX kobject_get(pata_legacy.1): ref=5++ (kobject_add:device_add:ata_tport_add)
>> > XXX kobject_put(pata_legacy.1): ref=6-- (device_del:ata_tport_delete:ata_host_detach)
>> > XXX kobject_put(pata_legacy.1): ref=5-- (ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
>> > XXX kobject_put(pata_legacy.1): ref=4-- (klist_put:klist_del:device_del)
>> > XXX kobject_put(pata_legacy.1): ref=3-- (klist_devices_put:klist_put:klist_del)
>> > XXX kobject_put(pata_legacy.1): ref=2-- (platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
>>
>> So, three gets from the transport path but only two puts.  That seems
>> to be the culprit.  Looking into it.
>
> So, Matthew discovered that pata_legacy isn't releasing resources
> after probe failure.  After some debugging, it turns out that the
> transport code is taking three refs but only putting two preventing
> the ata port from going away.
>
> Can you please explain why the libata transport code is explicitly
> pinning the parent device and then putting it in the release methods?
> device_add/del() already gets and puts the parent, so I don't get why
> this part is necessary.  Is this intentional?
It was intentional. When I wrote the code, I used other transport as
inspiration, in particular drivers/scsi/scsi_transport_sas.c.
For instance, in sas_port_alloc, "port->dev.parent =
get_device(parent);", undo in sas_port_release().
>From your debug code, in case of ATA at least, it looks unnecessary.

Moreover, in the error path of ata_XXX_add, a put_device(&link->tdev)
Also,How ata_tport_add() increase the reference twice before calling
device_add()?
>
> Also, it looks like there is a ref leak on the transport device
> itself.  Its release function never gets called and thus the parent
> device (ata_port) stays pinned too.
That's the root cause of pata port not released. Can we run your debug
code one more time, enabling ap->tdev.kobj.release_debug?

Thanks,
Gwendal.
>
> Thanks.
>
> --
> tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-23 23:36                                             ` Gwendal Grignou
@ 2017-01-23 23:57                                               ` tedheadster
  2017-01-24 16:19                                                 ` Tejun Heo
  2017-01-24 15:57                                               ` [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Tejun Heo
  1 sibling, 1 reply; 48+ messages in thread
From: tedheadster @ 2017-01-23 23:57 UTC (permalink / raw)
  To: Gwendal Grignou
  Cc: Tejun Heo, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

Gwendal,

>> Also, it looks like there is a ref leak on the transport device
>> itself.  Its release function never gets called and thus the parent
>> device (ata_port) stays pinned too.
> That's the root cause of pata port not released. Can we run your debug
> code one more time, enabling ap->tdev.kobj.release_debug?
>

I'm building the debug kernel because I have the test hardware, but
I'm not quite sure what I need to do to enable
ap->tdev.kobj.release_debug. Tejun's patch enables kobj.release_debug,
but I'm not sure if that is the same thing you want. Please advise.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-23 23:36                                             ` Gwendal Grignou
  2017-01-23 23:57                                               ` tedheadster
@ 2017-01-24 15:57                                               ` Tejun Heo
  1 sibling, 0 replies; 48+ messages in thread
From: Tejun Heo @ 2017-01-24 15:57 UTC (permalink / raw)
  To: Gwendal Grignou
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov,
	IDE/ATA development list, whiteheadm

Hello,

On Mon, Jan 23, 2017 at 03:36:18PM -0800, Gwendal Grignou wrote:
> > Can you please explain why the libata transport code is explicitly
> > pinning the parent device and then putting it in the release methods?
> > device_add/del() already gets and puts the parent, so I don't get why
> > this part is necessary.  Is this intentional?
>
> It was intentional. When I wrote the code, I used other transport as
> inspiration, in particular drivers/scsi/scsi_transport_sas.c.
> For instance, in sas_port_alloc, "port->dev.parent =
> get_device(parent);", undo in sas_port_release().
> From your debug code, in case of ATA at least, it looks unnecessary.

kobjects release their parents on kobject_del() rather than release,
which I don't think is a good design, so if there are code paths which
try to walk up the hierarchy after being deleted but before released,
having the extra ref around release does make sense.  I don't know
whether that's the case for the transport code tho.

Anyways, I was curious but this is a bit tangential to the issue.
This code does make the ata device hang around till the transport
kobject is released and the problem is caused by the transport kobject
not being released, so there's linkage there, but we wanna find out
why the transport kobject isn't being released and fix it.

> Moreover, in the error path of ata_XXX_add, a put_device(&link->tdev)
> Also,How ata_tport_add() increase the reference twice before calling
> device_add()?

Dunno, attribute additions?

> > Also, it looks like there is a ref leak on the transport device
> > itself.  Its release function never gets called and thus the parent
> > device (ata_port) stays pinned too.
>
> That's the root cause of pata port not released. Can we run your debug
> code one more time, enabling ap->tdev.kobj.release_debug?

Yeah, I'll update the patch.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-23 23:57                                               ` tedheadster
@ 2017-01-24 16:19                                                 ` Tejun Heo
  2017-01-27  3:01                                                   ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-01-24 16:19 UTC (permalink / raw)
  To: whiteheadm
  Cc: Gwendal Grignou, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

Hello, Matthew.

On Mon, Jan 23, 2017 at 06:57:34PM -0500, tedheadster wrote:
> Gwendal,
> 
> >> Also, it looks like there is a ref leak on the transport device
> >> itself.  Its release function never gets called and thus the parent
> >> device (ata_port) stays pinned too.
> > That's the root cause of pata port not released. Can we run your debug
> > code one more time, enabling ap->tdev.kobj.release_debug?
> >
> 
> I'm building the debug kernel because I have the test hardware, but
> I'm not quite sure what I need to do to enable
> ap->tdev.kobj.release_debug. Tejun's patch enables kobj.release_debug,
> but I'm not sure if that is the same thing you want. Please advise.

The following patch should printout the same debug info for all
transport kobjects.

Thanks!

diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 7ef16c0..80d72a6 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -283,6 +283,7 @@ int ata_tport_add(struct device *parent,
 
 	device_initialize(dev);
 	dev->type = &ata_port_type;
+	dev->kobj.release_debug = true;
 
 	dev->parent = get_device(parent);
 	dev->release = ata_tport_release;
@@ -412,6 +413,7 @@ int ata_tlink_add(struct ata_link *link)
 	device_initialize(dev);
 	dev->parent = get_device(&ap->tdev);
 	dev->release = ata_tlink_release;
+	dev->kobj.release_debug = true;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "link%d", ap->print_id);
         else
@@ -664,6 +666,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)
 	device_initialize(dev);
 	dev->parent = get_device(&link->tdev);
 	dev->release = ata_tdev_release;
+	dev->kobj.release_debug = true;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
         else
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 53828b6c..074bb45 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -965,6 +965,8 @@ static __init int legacy_init_one(struct legacy_probe *probe)
 	if (IS_ERR(pdev))
 		return PTR_ERR(pdev);
 
+	pdev->dev.kobj.release_debug = true;
+
 	ret = -EBUSY;
 	if (devm_request_region(&pdev->dev, io, 8, "pata_legacy") == NULL ||
 	    devm_request_region(&pdev->dev, io + 0x0206, 1,
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 020ea7f..6666a49 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -803,8 +803,17 @@ static void device_release(struct kobject *kobj)
 	 * is deleted but alive, so release devres here to avoid
 	 * possible memory leak.
 	 */
+	if (kobj->release_debug)
+		dev_info(dev, "XXX device_release: drel=%pf trel=%pf cdrel=%pf\n",
+			 dev->release,
+			 dev->type ? dev->type->release : NULL,
+			 dev->class ? dev->class->dev_release : NULL);
+
 	devres_release_all(dev);
 
+	if (kobj->release_debug)
+		dev_info(dev, "XXX device_release: devres_release_all() done\n");
+
 	if (dev->release)
 		dev->release(dev);
 	else if (dev->type && dev->type->release)
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index e628459..e1740de 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -76,6 +76,7 @@ struct kobject {
 	unsigned int state_add_uevent_sent:1;
 	unsigned int state_remove_uevent_sent:1;
 	unsigned int uevent_suppress:1;
+	unsigned int release_debug:1;
 };
 
 extern __printf(2, 3)
diff --git a/lib/kobject.c b/lib/kobject.c
index 445dcae..058c486 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -595,6 +595,13 @@ struct kobject *kobject_get(struct kobject *kobj)
 			WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
 			       "initialized, yet kobject_get() is being "
 			       "called.\n", kobject_name(kobj), kobj);
+		if (kobj->release_debug)
+			printk("XXX kobject_get(%s): ref=%d++ (%pf:%pf:%pf)\n",
+			       kobject_name(kobj),
+			       atomic_read(&kobj->kref.refcount),
+			       __builtin_return_address(1),
+			       __builtin_return_address(2),
+			       __builtin_return_address(3));
 		kref_get(&kobj->kref);
 	}
 	return kobj;
@@ -620,6 +627,14 @@ static void kobject_cleanup(struct kobject *kobj)
 	pr_debug("kobject: '%s' (%p): %s, parent %p\n",
 		 kobject_name(kobj), kobj, __func__, kobj->parent);
 
+	if (kobj->release_debug)
+		printk("XXX kobject_cleanup(%s): rel=%pf (%pf:%pf:%pf)\n",
+		       kobject_name(kobj),
+		       (t && t->release) ? t->release : NULL,
+		       __builtin_return_address(1),
+		       __builtin_return_address(2),
+		       __builtin_return_address(3));
+
 	if (t && !t->release)
 		pr_debug("kobject: '%s' (%p): does not have a release() "
 			 "function, it is broken and must be fixed.\n",
@@ -688,6 +703,13 @@ void kobject_put(struct kobject *kobj)
 			WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
 			       "initialized, yet kobject_put() is being "
 			       "called.\n", kobject_name(kobj), kobj);
+		if (kobj->release_debug)
+			printk("XXX kobject_put(%s): ref=%d-- (%pf:%pf:%pf)\n",
+			       kobject_name(kobj),
+			       atomic_read(&kobj->kref.refcount),
+			       __builtin_return_address(1),
+			       __builtin_return_address(2),
+			       __builtin_return_address(3));
 		kref_put(&kobj->kref, kobject_release);
 	}
 }

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-24 16:19                                                 ` Tejun Heo
@ 2017-01-27  3:01                                                   ` tedheadster
  2017-02-07 20:21                                                     ` Gwendal Grignou
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2017-01-27  3:01 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Gwendal Grignou, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

Tejun and Gwendal,
  here is the patched output:

[   39.991201] pata_legacy: unknown parameter 'ignore_ports' ignored
[   40.046194] XXX kobject_get(pata_legacy.0): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   40.053193] XXX kobject_get(ata1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tport_add)
[   40.055348] XXX kobject_get(ata1): ref=2++
(ata_tport_add:ata_host_register:ata_host_activate)
[   40.061192] XXX kobject_get(pata_legacy.0): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   40.062719] XXX kobject_get(pata_legacy.0): ref=5++
(kobject_add:device_add:ata_tport_add)
[   40.072187] XXX kobject_get(ata1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   40.073713] XXX kobject_put(ata1): ref=4--
(ata_tport_add:ata_host_register:ata_host_activate)
[   40.077187] XXX kobject_get(ata1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   40.079618] XXX kobject_get(ata1): ref=4++
(kobject_add:get_device_parent:device_add)
[   40.101187] XXX kobject_get(ata1): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.103143] XXX kobject_get(link1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   40.108187] XXX kobject_get(link1): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.109736] XXX kobject_get(ata1): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.111386] XXX kobject_get(ata1): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   40.124186] XXX kobject_get(link1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   40.126633] XXX kobject_put(link1): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.132182] XXX kobject_get(link1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   40.134662] XXX kobject_get(link1): ref=4++
(kobject_add:get_device_parent:device_add)
[   40.149183] XXX kobject_get(link1): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.151480] XXX kobject_get(dev1.0): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   40.158178] XXX kobject_get(dev1.0): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.159613] XXX kobject_get(link1): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.161235] XXX kobject_get(link1): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   40.168177] XXX kobject_get(dev1.0): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   40.170398] XXX kobject_put(dev1.0): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.176178] XXX kobject_get(dev1.0): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   40.178417] XXX kobject_get(dev1.0): ref=4++
(kobject_add:get_device_parent:device_add)
[   40.199176] XXX kobject_get(link1): ref=8++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.201542] XXX kobject_get(dev1.1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   40.206171] XXX kobject_get(dev1.1): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.212164] XXX kobject_get(link1): ref=9++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.213618] XXX kobject_get(link1): ref=10++
(kobject_add:device_add:ata_tlink_add)
[   40.220168] XXX kobject_get(dev1.1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   40.222323] XXX kobject_put(dev1.1): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   40.227163] XXX kobject_get(dev1.1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   40.229391] XXX kobject_get(dev1.1): ref=4++
(kobject_add:get_device_parent:device_add)
[   40.255170] scsi host0: pata_legacy
[   40.257165] XXX kobject_get(ata1): ref=8++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   40.259517] XXX kobject_get(ata1): ref=9++
(kobject_add:device_add:scsi_add_host_with_dma)
[   40.274162] XXX kobject_get(ata1): ref=10++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   40.302150] ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
[   40.463135] ata1.00: ATA-4: QUANTUM FIREBALL CR8.4A, A5U.1200, max UDMA/66
[   40.464335] ata1.00: 16514064 sectors, multi 0: LBA
[   40.465312] ata1.00: configured for PIO
[   40.490131] scsi 0:0:0:0: Direct-Access     ATA      QUANTUM
FIREBALL 1200 PQ: 0 ANSI: 5
[   40.573144] sd 0:0:0:0: [sda] 16514064 512-byte logical blocks:
(8.46 GB/7.87 GiB)
[   40.589111] sd 0:0:0:0: [sda] Write Protect is off
[   40.590325] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[   40.602112] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[   40.607107] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   40.768078]  sda: sda1 sda2 sda3 sda4
[   40.971053] sd 0:0:0:0: [sda] Attached SCSI disk
[   41.049044] XXX kobject_get(pata_legacy.1): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   41.076039] XXX kobject_get(ata2): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tport_add)
[   41.094037] XXX kobject_get(ata2): ref=2++
(ata_tport_add:ata_host_register:ata_host_activate)
[   41.112037] XXX kobject_get(pata_legacy.1): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   41.114184] XXX kobject_get(pata_legacy.1): ref=5++
(kobject_add:device_add:ata_tport_add)
[   41.172020] XXX kobject_get(ata2): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   41.174175] XXX kobject_put(ata2): ref=4--
(ata_tport_add:ata_host_register:ata_host_activate)
[   41.198017] XXX kobject_get(ata2): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   41.212022] XXX kobject_get(ata2): ref=4++
(kobject_add:get_device_parent:device_add)
[   41.257012] XXX kobject_get(ata2): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.270036] XXX kobject_get(link2): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   41.284089] XXX kobject_get(link2): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.291005] XXX kobject_get(ata2): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.293024] XXX kobject_get(ata2): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   41.309004] XXX kobject_get(link2): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   41.311453] XXX kobject_put(link2): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.326995] XXX kobject_get(link2): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   41.333998] XXX kobject_get(link2): ref=4++
(kobject_add:get_device_parent:device_add)
[   41.364989] XXX kobject_get(link2): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.370994] XXX kobject_get(dev2.0): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   41.381992] XXX kobject_get(dev2.0): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.383603] XXX kobject_get(link2): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.385239] XXX kobject_get(link2): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   41.402993] XXX kobject_get(dev2.0): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   41.405381] XXX kobject_put(dev2.0): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.416984] XXX kobject_get(dev2.0): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   41.423992] XXX kobject_get(dev2.0): ref=4++
(kobject_add:get_device_parent:device_add)
[   41.454981] XXX kobject_get(link2): ref=8++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.465976] XXX kobject_get(dev2.1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   41.476971] XXX kobject_get(dev2.1): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.478472] XXX kobject_get(link2): ref=9++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.480093] XXX kobject_get(link2): ref=10++
(kobject_add:device_add:ata_tlink_add)
[   41.501976] XXX kobject_get(dev2.1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   41.504329] XXX kobject_put(dev2.1): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   41.519969] XXX kobject_get(dev2.1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   41.527970] XXX kobject_get(dev2.1): ref=4++
(kobject_add:get_device_parent:device_add)
[   41.569968] scsi host1: pata_legacy
[   41.575957] XXX kobject_get(ata2): ref=8++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   41.577985] XXX kobject_get(ata2): ref=9++
(kobject_add:device_add:scsi_add_host_with_dma)
[   41.611960] XXX kobject_get(ata2): ref=10++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   41.649951] ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
[   41.881913] XXX kobject_put(ata2): ref=11--
(device_del:scsi_remove_host:ata_host_detach)
[   41.883945] XXX kobject_put(ata2): ref=10--
(scsi_remove_host:ata_host_detach:legacy_init [pata_legacy])
[   41.951907] XXX kobject_put(dev2.0): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   41.953908] XXX kobject_put(dev2.0): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   41.971902] XXX kobject_put(dev2.0): ref=3-- (klist_put:klist_del:device_del)
[   41.977899] XXX kobject_put(link2): ref=11--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   41.979885] XXX kobject_put(link2): ref=10--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   41.985899] XXX kobject_put(dev2.0): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   41.987926] XXX kobject_put(dev2.0): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   41.989276] XXX kobject_cleanup(dev2.0): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   41.991118]  dev2.0: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   41.992454]  dev2.0: XXX device_release: devres_release_all() done
[   41.992853] XXX kobject_put(link2): ref=9--
(ata_tdev_release:device_release:kobject_cleanup)
[   42.036899] XXX kobject_put(dev2.1): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   42.038501] XXX kobject_put(dev2.1): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   42.051895] XXX kobject_put(dev2.1): ref=3-- (klist_put:klist_del:device_del)
[   42.057892] XXX kobject_put(link2): ref=8--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   42.060305] XXX kobject_put(link2): ref=7--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   42.069876] XXX kobject_put(dev2.1): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   42.071959] XXX kobject_put(dev2.1): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   42.073338] XXX kobject_cleanup(dev2.1): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   42.075102]  dev2.1: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   42.076439]  dev2.1: XXX device_release: devres_release_all() done
[   42.076841] XXX kobject_put(link2): ref=6--
(ata_tdev_release:device_release:kobject_cleanup)
[   42.125877] XXX kobject_put(link2): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   42.128309] XXX kobject_put(link2): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   42.141876] XXX kobject_put(link2): ref=3-- (klist_put:klist_del:device_del)
[   42.147875] XXX kobject_put(ata2): ref=9--
(device_del:ata_tlink_delete:ata_tport_delete)
[   42.149986] XXX kobject_put(ata2): ref=8--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   42.155874] XXX kobject_put(link2): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   42.158417] XXX kobject_put(link2): ref=1--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   42.160026] XXX kobject_cleanup(link2): rel=device_release
(put_device:ata_tlink_delete:ata_tport_delete)
[   42.161461]  link2: XXX device_release: drel=ata_tlink_release
trel=  (null) cdrel=  (null)
[   42.163103]  link2: XXX device_release: devres_release_all() done
[   42.164063] XXX kobject_put(ata2): ref=7--
(ata_tlink_release:device_release:kobject_cleanup)
[   42.207865] XXX kobject_put(ata2): ref=6--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   42.209822] XXX kobject_put(ata2): ref=5--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   42.216864] XXX kobject_put(ata2): ref=4-- (klist_put:klist_del:device_del)
[   42.218177] XXX kobject_put(pata_legacy.1): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   42.220050] XXX kobject_put(pata_legacy.1): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   42.229860] XXX kobject_put(ata2): ref=3--
(attribute_container_release:device_release:kobject_cleanup)
[   42.231811] XXX kobject_put(ata2): ref=2--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   42.239860] XXX kobject_put(pata_legacy.1): ref=4--
(klist_put:klist_del:device_del)
[   42.248860] XXX kobject_put(pata_legacy.1): ref=3--
(klist_devices_put:klist_put:klist_del)
[   42.269858] XXX kobject_put(pata_legacy.1): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   42.320845] XXX kobject_get(pata_legacy.2): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   42.328847] XXX kobject_get(ata3): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tport_add)
[   42.341846] XXX kobject_get(ata3): ref=2++
(ata_tport_add:ata_host_register:ata_host_activate)
[   42.349845] XXX kobject_get(pata_legacy.2): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   42.352101] XXX kobject_get(pata_legacy.2): ref=5++
(kobject_add:device_add:ata_tport_add)
[   42.372838] XXX kobject_get(ata3): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   42.375229] XXX kobject_put(ata3): ref=4--
(ata_tport_add:ata_host_register:ata_host_activate)
[   42.384853] XXX kobject_get(ata3): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   42.397823] XXX kobject_get(ata3): ref=4++
(kobject_add:get_device_parent:device_add)
[   42.438832] XXX kobject_get(ata3): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.444829] XXX kobject_get(link3): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   42.453826] XXX kobject_get(link3): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.463827] XXX kobject_get(ata3): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.466036] XXX kobject_get(ata3): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   42.478824] XXX kobject_get(link3): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   42.481283] XXX kobject_put(link3): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.495823] XXX kobject_get(link3): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   42.503819] XXX kobject_get(link3): ref=4++
(kobject_add:get_device_parent:device_add)
[   42.538815] XXX kobject_get(link3): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.545814] XXX kobject_get(dev3.0): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   42.552812] XXX kobject_get(dev3.0): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.554087] XXX kobject_get(link3): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.555430] XXX kobject_get(link3): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   42.568807] XXX kobject_get(dev3.0): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   42.570302] XXX kobject_put(dev3.0): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.585806] XXX kobject_get(dev3.0): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   42.598800] XXX kobject_get(dev3.0): ref=4++
(kobject_add:get_device_parent:device_add)
[   42.623809] XXX kobject_get(link3): ref=8++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.639876] XXX kobject_get(dev3.1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   42.646794] XXX kobject_get(dev3.1): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.648249] XXX kobject_get(link3): ref=9++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.649862] XXX kobject_get(link3): ref=10++
(kobject_add:device_add:ata_tlink_add)
[   42.655797] XXX kobject_get(dev3.1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   42.658043] XXX kobject_put(dev3.1): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   42.662792] XXX kobject_get(dev3.1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   42.664844] XXX kobject_get(dev3.1): ref=4++
(kobject_add:get_device_parent:device_add)
[   42.719788] scsi host2: pata_legacy
[   42.721787] XXX kobject_get(ata3): ref=8++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   42.723406] XXX kobject_get(ata3): ref=9++
(kobject_add:device_add:scsi_add_host_with_dma)
[   42.758793] XXX kobject_get(ata3): ref=10++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   42.790775] ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
[   43.045774] XXX kobject_put(ata3): ref=11--
(device_del:scsi_remove_host:ata_host_detach)
[   43.051965] XXX kobject_put(ata3): ref=10--
(scsi_remove_host:ata_host_detach:legacy_init [pata_legacy])
[   43.157723] XXX kobject_put(dev3.0): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   43.160135] XXX kobject_put(dev3.0): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   43.187717] XXX kobject_put(dev3.0): ref=3-- (klist_put:klist_del:device_del)
[   43.192724] XXX kobject_put(link3): ref=11--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   43.195158] XXX kobject_put(link3): ref=10--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   43.202721] XXX kobject_put(dev3.0): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   43.205150] XXX kobject_put(dev3.0): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   43.206846] XXX kobject_cleanup(dev3.0): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   43.208666]  dev3.0: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   43.209974]  dev3.0: XXX device_release: devres_release_all() done
[   43.210942] XXX kobject_put(link3): ref=9--
(ata_tdev_release:device_release:kobject_cleanup)
[   43.246712] XXX kobject_put(dev3.1): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   43.249147] XXX kobject_put(dev3.1): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   43.264709] XXX kobject_put(dev3.1): ref=3-- (klist_put:klist_del:device_del)
[   43.270710] XXX kobject_put(link3): ref=8--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   43.273093] XXX kobject_put(link3): ref=7--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   43.281705] XXX kobject_put(dev3.1): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   43.283940] XXX kobject_put(dev3.1): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   43.285672] XXX kobject_cleanup(dev3.1): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   43.287247]  dev3.1: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   43.288827]  dev3.1: XXX device_release: devres_release_all() done
[   43.289759] XXX kobject_put(link3): ref=6--
(ata_tdev_release:device_release:kobject_cleanup)
[   43.332691] XXX kobject_put(link3): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   43.335064] XXX kobject_put(link3): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   43.354687] XXX kobject_put(link3): ref=3-- (klist_put:klist_del:device_del)
[   43.359694] XXX kobject_put(ata3): ref=9--
(device_del:ata_tlink_delete:ata_tport_delete)
[   43.362203] XXX kobject_put(ata3): ref=8--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   43.417679] XXX kobject_put(link3): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   43.419878] XXX kobject_put(link3): ref=1--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   43.421245] XXX kobject_cleanup(link3): rel=device_release
(put_device:ata_tlink_delete:ata_tport_delete)
[   43.422985]  link3: XXX device_release: drel=ata_tlink_release
trel=  (null) cdrel=  (null)
[   43.424635]  link3: XXX device_release: devres_release_all() done
[   43.424635] XXX kobject_put(ata3): ref=7--
(ata_tlink_release:device_release:kobject_cleanup)
[   43.525666] XXX kobject_put(ata3): ref=6--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   43.527976] XXX kobject_put(ata3): ref=5--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   43.570660] XXX kobject_put(ata3): ref=4-- (klist_put:klist_del:device_del)
[   43.583663] XXX kobject_put(pata_legacy.2): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   43.585654] XXX kobject_put(pata_legacy.2): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   43.611650] XXX kobject_put(ata3): ref=3--
(attribute_container_release:device_release:kobject_cleanup)
[   43.613871] XXX kobject_put(ata3): ref=2--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   43.655645] XXX kobject_put(pata_legacy.2): ref=4--
(klist_put:klist_del:device_del)
[   43.673641] XXX kobject_put(pata_legacy.2): ref=3--
(klist_devices_put:klist_put:klist_del)
[   43.707640] XXX kobject_put(pata_legacy.2): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   43.829624] XXX kobject_get(pata_legacy.3): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   43.855618] XXX kobject_get(ata4): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tport_add)
[   43.872614] XXX kobject_get(ata4): ref=2++
(ata_tport_add:ata_host_register:ata_host_activate)
[   43.895613] XXX kobject_get(pata_legacy.3): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   43.897562] XXX kobject_get(pata_legacy.3): ref=5++
(kobject_add:device_add:ata_tport_add)
[   43.946597] XXX kobject_get(ata4): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   43.948847] XXX kobject_put(ata4): ref=4--
(ata_tport_add:ata_host_register:ata_host_activate)
[   43.978592] XXX kobject_get(ata4): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   43.995591] XXX kobject_get(ata4): ref=4++
(kobject_add:get_device_parent:device_add)
[   44.046587] XXX kobject_get(ata4): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.066583] XXX kobject_get(link4): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   44.081582] XXX kobject_get(link4): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.102584] XXX kobject_get(ata4): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.104839] XXX kobject_get(ata4): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   44.141572] XXX kobject_get(link4): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   44.143717] XXX kobject_put(link4): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.147579] XXX kobject_get(link4): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   44.150028] XXX kobject_get(link4): ref=4++
(kobject_add:get_device_parent:device_add)
[   44.174566] XXX kobject_get(link4): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.176960] XXX kobject_get(dev4.0): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   44.209557] XXX kobject_get(dev4.0): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.211137] XXX kobject_get(link4): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.212782] XXX kobject_get(link4): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   44.218586] XXX kobject_get(dev4.0): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   44.220774] XXX kobject_put(dev4.0): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.236560] XXX kobject_get(dev4.0): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   44.238937] XXX kobject_get(dev4.0): ref=4++
(kobject_add:get_device_parent:device_add)
[   44.283558] XXX kobject_get(link4): ref=8++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.340772] XXX kobject_get(dev4.1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   44.356589] XXX kobject_get(dev4.1): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.358638] XXX kobject_get(link4): ref=9++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.359978] XXX kobject_get(link4): ref=10++
(kobject_add:device_add:ata_tlink_add)
[   44.378534] XXX kobject_get(dev4.1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   44.380483] XXX kobject_put(dev4.1): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   44.383529] XXX kobject_get(dev4.1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   44.406525] XXX kobject_get(dev4.1): ref=4++
(kobject_add:get_device_parent:device_add)
[   44.483528] scsi host3: pata_legacy
[   44.484974] XXX kobject_get(ata4): ref=8++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   44.486951] XXX kobject_get(ata4): ref=9++
(kobject_add:device_add:scsi_add_host_with_dma)
[   44.527514] XXX kobject_get(ata4): ref=10++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   44.597505] ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
[   44.912457] XXX kobject_put(ata4): ref=11--
(device_del:scsi_remove_host:ata_host_detach)
[   44.914077] XXX kobject_put(ata4): ref=10--
(scsi_remove_host:ata_host_detach:legacy_init [pata_legacy])
[   44.938489] XXX kobject_put(dev4.0): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   44.940442] XXX kobject_put(dev4.0): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   44.963444] XXX kobject_put(dev4.0): ref=3-- (klist_put:klist_del:device_del)
[   44.968513] XXX kobject_put(link4): ref=11--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   44.970635] XXX kobject_put(link4): ref=10--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   44.977447] XXX kobject_put(dev4.0): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   44.979429] XXX kobject_put(dev4.0): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   44.980910] XXX kobject_cleanup(dev4.0): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   44.982694]  dev4.0: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   44.987578]  dev4.0: XXX device_release: devres_release_all() done
[   44.988509] XXX kobject_put(link4): ref=9--
(ata_tdev_release:device_release:kobject_cleanup)
[   45.014436] XXX kobject_put(dev4.1): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   45.017387] XXX kobject_put(dev4.1): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   45.041431] XXX kobject_put(dev4.1): ref=3-- (klist_put:klist_del:device_del)
[   45.043705] XXX kobject_put(link4): ref=8--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   45.048956] XXX kobject_put(link4): ref=7--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   45.068485] XXX kobject_put(dev4.1): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   45.070377] XXX kobject_put(dev4.1): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   45.071744] XXX kobject_cleanup(dev4.1): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   45.073554]  dev4.1: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   45.074878]  dev4.1: XXX device_release: devres_release_all() done
[   45.075833] XXX kobject_put(link4): ref=6--
(ata_tdev_release:device_release:kobject_cleanup)
[   45.109427] XXX kobject_put(link4): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   45.115436] XXX kobject_put(link4): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   45.127424] XXX kobject_put(link4): ref=3-- (klist_put:klist_del:device_del)
[   45.129606] XXX kobject_put(ata4): ref=9--
(device_del:ata_tlink_delete:ata_tport_delete)
[   45.131711] XXX kobject_put(ata4): ref=8--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   45.133372] XXX kobject_put(link4): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   45.134769] XXX kobject_put(link4): ref=1--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   45.139565] XXX kobject_cleanup(link4): rel=device_release
(put_device:ata_tlink_delete:ata_tport_delete)
[   45.141395]  link4: XXX device_release: drel=ata_tlink_release
trel=  (null) cdrel=  (null)
[   45.142703]  link4: XXX device_release: devres_release_all() done
[   45.143646] XXX kobject_put(ata4): ref=7--
(ata_tlink_release:device_release:kobject_cleanup)
[   45.183419] XXX kobject_put(ata4): ref=6--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   45.185423] XXX kobject_put(ata4): ref=5--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   45.191409] XXX kobject_put(ata4): ref=4-- (klist_put:klist_del:device_del)
[   45.194413] XXX kobject_put(pata_legacy.3): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   45.195905] XXX kobject_put(pata_legacy.3): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   45.197763] XXX kobject_put(ata4): ref=3--
(attribute_container_release:device_release:kobject_cleanup)
[   45.199619] XXX kobject_put(ata4): ref=2--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   45.201386] XXX kobject_put(pata_legacy.3): ref=4--
(klist_put:klist_del:device_del)
[   45.203674] XXX kobject_put(pata_legacy.3): ref=3--
(klist_devices_put:klist_put:klist_del)
[   45.229401] XXX kobject_put(pata_legacy.3): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   45.293400] genirq: Flags mismatch irq 8. 00000000
(platform[pata_legacy.4]) vs. 00000080 (rtc0)
[   45.339394] XXX kobject_put(pata_legacy.4): ref=3--
(klist_put:klist_del:device_del)
[   45.358483] XXX kobject_put(pata_legacy.4): ref=2--
(klist_devices_put:klist_put:klist_del)
[   45.399372] XXX kobject_put(pata_legacy.4): ref=1--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)
[   45.401859] XXX kobject_cleanup(pata_legacy.4): rel=device_release
(put_device:platform_device_unregister:legacy_init [pata_legacy])
[   45.403918] platform pata_legacy.4: XXX device_release:
drel=platform_device_release trel=  (null) cdrel=  (null)
[   45.405670] platform pata_legacy.4: XXX device_release:
devres_release_all() done
[   45.601350] XXX kobject_get(pata_legacy.5): ref=3++
(ata_tport_add:ata_host_register:ata_host_activate)
[   45.632345] XXX kobject_get(ata5): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tport_add)
[   45.661340] XXX kobject_get(ata5): ref=2++
(ata_tport_add:ata_host_register:ata_host_activate)
[   45.682333] XXX kobject_get(pata_legacy.5): ref=4++
(ata_tport_add:ata_host_register:ata_host_activate)
[   45.684390] XXX kobject_get(pata_legacy.5): ref=5++
(kobject_add:device_add:ata_tport_add)
[   45.756331] XXX kobject_get(ata5): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   45.758629] XXX kobject_put(ata5): ref=4--
(ata_tport_add:ata_host_register:ata_host_activate)
[   45.795316] XXX kobject_get(ata5): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   45.826312] XXX kobject_get(ata5): ref=4++
(kobject_add:get_device_parent:device_add)
[   45.910302] XXX kobject_get(ata5): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   45.930298] XXX kobject_get(link5): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   45.952295] XXX kobject_get(link5): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   45.972294] XXX kobject_get(ata5): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   45.974244] XXX kobject_get(ata5): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   46.040282] XXX kobject_get(link5): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   46.042361] XXX kobject_put(link5): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.086272] XXX kobject_get(link5): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   46.111266] XXX kobject_get(link5): ref=4++
(kobject_add:get_device_parent:device_add)
[   46.209257] XXX kobject_get(link5): ref=5++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.231257] XXX kobject_get(dev5.0): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   46.247255] XXX kobject_get(dev5.0): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.267250] XXX kobject_get(link5): ref=6++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.268783] XXX kobject_get(link5): ref=7++
(kobject_add:device_add:ata_tlink_add)
[   46.325247] XXX kobject_get(dev5.0): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   46.327468] XXX kobject_put(dev5.0): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.349234] XXX kobject_get(dev5.0): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   46.364234] XXX kobject_get(dev5.0): ref=4++
(kobject_add:get_device_parent:device_add)
[   46.414223] XXX kobject_get(link5): ref=8++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.422225] XXX kobject_get(dev5.1): ref=1++
(attribute_container_add_device:transport_setup_device:ata_tlink_add)
[   46.435220] XXX kobject_get(dev5.1): ref=2++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.447215] XXX kobject_get(link5): ref=9++
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.448509] XXX kobject_get(link5): ref=10++
(kobject_add:device_add:ata_tlink_add)
[   46.463231] XXX kobject_get(dev5.1): ref=3++
(klist_node_init:klist_add_tail:device_add)
[   46.465362] XXX kobject_put(dev5.1): ref=4--
(ata_tlink_add:ata_tport_add:ata_host_register)
[   46.481216] XXX kobject_get(dev5.1): ref=3++
(attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
[   46.494212] XXX kobject_get(dev5.1): ref=4++
(kobject_add:get_device_parent:device_add)
[   46.566197] scsi host4: pata_legacy
[   46.568205] XXX kobject_get(ata5): ref=8++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   46.569732] XXX kobject_get(ata5): ref=9++
(kobject_add:device_add:scsi_add_host_with_dma)
[   46.614194] XXX kobject_get(ata5): ref=10++
(scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
[   46.649192] ata5: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12
[   46.875155] XXX kobject_put(ata5): ref=11--
(device_del:scsi_remove_host:ata_host_detach)
[   46.877102] XXX kobject_put(ata5): ref=10--
(scsi_remove_host:ata_host_detach:legacy_init [pata_legacy])
[   46.919145] XXX kobject_put(dev5.0): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   46.921532] XXX kobject_put(dev5.0): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   46.931148] XXX kobject_put(dev5.0): ref=3-- (klist_put:klist_del:device_del)
[   46.934151] XXX kobject_put(link5): ref=11--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   46.935685] XXX kobject_put(link5): ref=10--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   46.937315] XXX kobject_put(dev5.0): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   46.939100] XXX kobject_put(dev5.0): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   46.940475] XXX kobject_cleanup(dev5.0): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   46.942299]  dev5.0: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   46.943635]  dev5.0: XXX device_release: devres_release_all() done
[   46.944590] XXX kobject_put(link5): ref=9--
(ata_tdev_release:device_release:kobject_cleanup)
[   46.959138] XXX kobject_put(dev5.1): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   46.961728] XXX kobject_put(dev5.1): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   46.971142] XXX kobject_put(dev5.1): ref=3-- (klist_put:klist_del:device_del)
[   46.973304] XXX kobject_put(link5): ref=8--
(device_del:ata_tdev_delete:ata_tlink_delete)
[   46.975117] XXX kobject_put(link5): ref=7--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   46.976474] XXX kobject_put(dev5.1): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   46.978331] XXX kobject_put(dev5.1): ref=1--
(ata_tdev_delete:ata_tlink_delete:ata_tport_delete)
[   46.979686] XXX kobject_cleanup(dev5.1): rel=device_release
(put_device:ata_tdev_delete:ata_tlink_delete)
[   46.981483]  dev5.1: XXX device_release: drel=ata_tdev_release
trel=  (null) cdrel=  (null)
[   46.983086]  dev5.1: XXX device_release: devres_release_all() done
[   46.983086] XXX kobject_put(link5): ref=6--
(ata_tdev_release:device_release:kobject_cleanup)
[   47.000131] XXX kobject_put(link5): ref=5--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   47.002478] XXX kobject_put(link5): ref=4--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   47.012135] XXX kobject_put(link5): ref=3-- (klist_put:klist_del:device_del)
[   47.013550] XXX kobject_put(ata5): ref=9--
(device_del:ata_tlink_delete:ata_tport_delete)
[   47.015311] XXX kobject_put(ata5): ref=8--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   47.016612] XXX kobject_put(link5): ref=2--
(attribute_container_release:device_release:kobject_cleanup)
[   47.018423] XXX kobject_put(link5): ref=1--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
[   47.019754] XXX kobject_cleanup(link5): rel=device_release
(put_device:ata_tlink_delete:ata_tport_delete)
[   47.021482]  link5: XXX device_release: drel=ata_tlink_release
trel=  (null) cdrel=  (null)
[   47.023082]  link5: XXX device_release: devres_release_all() done
[   47.023082] XXX kobject_put(ata5): ref=7--
(ata_tlink_release:device_release:kobject_cleanup)
[   47.041124] XXX kobject_put(ata5): ref=6--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
[   47.043468] XXX kobject_put(ata5): ref=5--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
[   47.049130] XXX kobject_put(ata5): ref=4-- (klist_put:klist_del:device_del)
[   47.051263] XXX kobject_put(pata_legacy.5): ref=6--
(device_del:ata_tport_delete:ata_host_detach)
[   47.053076] XXX kobject_put(pata_legacy.5): ref=5--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   47.054603] XXX kobject_put(ata5): ref=3--
(attribute_container_release:device_release:kobject_cleanup)
[   47.056389] XXX kobject_put(ata5): ref=2--
(ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])
[   47.059123] XXX kobject_put(pata_legacy.5): ref=4--
(klist_put:klist_del:device_del)
[   47.061079] XXX kobject_put(pata_legacy.5): ref=3--
(klist_devices_put:klist_put:klist_del)
[   47.073144] XXX kobject_put(pata_legacy.5): ref=2--
(platform_device_unregister:legacy_init [pata_legacy]:do_one_initcall)

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-01-27  3:01                                                   ` tedheadster
@ 2017-02-07 20:21                                                     ` Gwendal Grignou
  2017-02-08 19:43                                                       ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: Gwendal Grignou @ 2017-02-07 20:21 UTC (permalink / raw)
  To: whiteheadm
  Cc: Tejun Heo, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

link2, dev2.x are not leaking. pata_legacy.1 is not freed because of ata2.
I extracted some of the output where the ata port object is not freed properly:

 ref=1++ (attribute_container_add_device:transport_setup_device:ata_tport_add)
 ref=2++ (ata_tport_add:ata_host_register:ata_host_activate)
 ref=3++ (klist_node_init:klist_add_tail:device_add)
 ref=4-- (ata_tport_add:ata_host_register:ata_host_activate)
 ref=3++ (attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
 ref=4++ (kobject_add:get_device_parent:device_add)
 ref=5++ (ata_tlink_add:ata_tport_add:ata_host_register)
 ref=6++ (ata_tlink_add:ata_tport_add:ata_host_register)
 ref=7++ (kobject_add:device_add:ata_tlink_add)
 ref=8++ (scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
 ref=9++ (kobject_add:device_add:scsi_add_host_with_dma)
 ref=10++ (scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)


 ref=11-- (device_del:scsi_remove_host:ata_host_detach)
 ref=10-- (scsi_remove_host:ata_host_detach:legacy_init [pata_legacy])
 ref=9-- (device_del:ata_tlink_delete:ata_tport_delete)
 ref=8-- (ata_tlink_delete:ata_tport_delete:ata_host_detach)
 ref=7-- (ata_tlink_release:device_release:kobject_cleanup)
 ref=6-- (kobject_cleanup:kobject_put:cleanup_glue_dir)
 ref=5-- (attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
 ref=4-- (klist_put:klist_del:device_del)
 ref=3-- (attribute_container_release:device_release:kobject_cleanup)
 ref=2-- (ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])

Trying to match the put and get, I notice that scsi_add_host_with_dma
does 2 direct get, but scsi_remove_host only one direct put.
I did the following match:

 ref=1++ (attribute_container_add_device:transport_setup_device:ata_tport_add)
       --> ref=3-- (attribute_container_release:device_release:kobject_cleanup)
 ref=3++ (klist_node_init:klist_add_tail:device_add) -->  ref=4--
(klist_put:klist_del:device_del)
 ref=3++ (attribute_container_add_class_device:transport_add_class_device:attribute_container_device_trigger)
       --> ref=5--
(attribute_container_class_device_del:transport_remove_classdev:attribute_container_device_trigger)
 ref=4++ (kobject_add:get_device_parent:device_add) --> ref=6--
(kobject_cleanup:kobject_put:cleanup_glue_dir)
 ref=5++ (ata_tlink_add:ata_tport_add:ata_host_register) --> ref=7--
(ata_tlink_release:device_release:kobject_cleanup)
 ref=6++ (ata_tlink_add:ata_tport_add:ata_host_register)  -->  ref=8--
(ata_tlink_delete:ata_tport_delete:ata_host_detach)
 ref=7++ (kobject_add:device_add:ata_tlink_add)  --> ref=9--
(device_del:ata_tlink_delete:ata_tport_delete)
 ref=8++ (scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)
-->  ref=10-- (scsi_remove_host:ata_host_detach:..
 ref=9++ (kobject_add:device_add:scsi_add_host_with_dma)         -->
ref=11-- (device_del:scsi_remove_host:ata_host_detach)
 ref=10++ (scsi_add_host_with_dma:ata_scsi_add_hosts:ata_host_register)

Then the final call should have trigger destruction the port object:
 ref=2-- (ata_tport_delete:ata_host_detach:legacy_init [pata_legacy])

Looking at scsi_add_host_with_dma/scsi_remove_host, we need to do
get_device on shost->shost_gendev.parent because we will do put_device
in scsi_host_dev_release, the release function of shost_gendev (which
is not called).
We do get_device on shost->shost_gendev for scsi_host_cls_release()
put_device, the release function of shost->host_dev, so I think it is
fine.

I am wondering if we don't have a circular dependency:
We do the final put_device (in scsi_host_put) on ap->scsi_host in
ata_host_release(), but it is not called because
[scsi_host]->shost_gendev.parent is &ap->tdev which hold the put on
its parent, ap.

If my understanding is correct, as Tejun pointed out, removing the put
on ap in ata_tport_release and the get_device(parent) in ata_tport_add
should unlock the situation.

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-02-07 20:21                                                     ` Gwendal Grignou
@ 2017-02-08 19:43                                                       ` Tejun Heo
  2017-02-09 23:49                                                         ` Gwendal Grignou
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-02-08 19:43 UTC (permalink / raw)
  To: Gwendal Grignou
  Cc: whiteheadm, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

Hello,

On Tue, Feb 07, 2017 at 12:21:37PM -0800, Gwendal Grignou wrote:
> I am wondering if we don't have a circular dependency:
> We do the final put_device (in scsi_host_put) on ap->scsi_host in
> ata_host_release(), but it is not called because
> [scsi_host]->shost_gendev.parent is &ap->tdev which hold the put on
> its parent, ap.
> 
> If my understanding is correct, as Tejun pointed out, removing the put
> on ap in ata_tport_release and the get_device(parent) in ata_tport_add
> should unlock the situation.

Heh, I'm not quite sure I follow but something like the following, right?

Matthew, can you please give this a try?

Thanks.

diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 7ef16c0..20e2b7a 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_class,
 
 static void ata_tport_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent,
 	device_initialize(dev);
 	dev->type = &ata_port_type;
 
-	dev->parent = get_device(parent);
+	dev->parent = parent;
 	dev->release = ata_tport_release;
 	dev_set_name(dev, "ata%d", ap->print_id);
 	transport_setup_device(dev);
@@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_class,
 
 static void ata_tlink_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link)
 	int error;
 
 	device_initialize(dev);
-	dev->parent = get_device(&ap->tdev);
+	dev->parent = &ap->tdev;
 	dev->release = ata_tlink_release;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "link%d", ap->print_id);
@@ -589,7 +587,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_class,
 
 static void ata_tdev_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -662,7 +659,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)
 	int error;
 
 	device_initialize(dev);
-	dev->parent = get_device(&link->tdev);
+	dev->parent = &link->tdev;
 	dev->release = ata_tdev_release;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-02-08 19:43                                                       ` Tejun Heo
@ 2017-02-09 23:49                                                         ` Gwendal Grignou
  2017-02-10  0:36                                                           ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Gwendal Grignou @ 2017-02-09 23:49 UTC (permalink / raw)
  To: Tejun Heo
  Cc: whiteheadm, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

On Wed, Feb 8, 2017 at 11:43 AM, Tejun Heo <tj@kernel.org> wrote:
> Hello,
>
> On Tue, Feb 07, 2017 at 12:21:37PM -0800, Gwendal Grignou wrote:
>> I am wondering if we don't have a circular dependency:
>> We do the final put_device (in scsi_host_put) on ap->scsi_host in
>> ata_host_release(), but it is not called because
>> [scsi_host]->shost_gendev.parent is &ap->tdev which hold the put on
>> its parent, ap.
>>
>> If my understanding is correct, as Tejun pointed out, removing the put
>> on ap in ata_tport_release and the get_device(parent) in ata_tport_add
>> should unlock the situation.
>
> Heh, I'm not quite sure I follow but something like the following, right?
That's correct.
>
> Matthew, can you please give this a try?
>
> Thanks.
>
> diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> index 7ef16c0..20e2b7a 100644
> --- a/drivers/ata/libata-transport.c
> +++ b/drivers/ata/libata-transport.c
> @@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_class,
>
>  static void ata_tport_release(struct device *dev)
>  {
> -       put_device(dev->parent);
>  }
>
>  /**
> @@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent,
>         device_initialize(dev);
>         dev->type = &ata_port_type;
>
> -       dev->parent = get_device(parent);
> +       dev->parent = parent;
>         dev->release = ata_tport_release;
>         dev_set_name(dev, "ata%d", ap->print_id);
>         transport_setup_device(dev);
> @@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_class,
>
>  static void ata_tlink_release(struct device *dev)
>  {
> -       put_device(dev->parent);
>  }
>
>  /**
> @@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link)
>         int error;
>
>         device_initialize(dev);
> -       dev->parent = get_device(&ap->tdev);
> +       dev->parent = &ap->tdev;
>         dev->release = ata_tlink_release;
>         if (ata_is_host_link(link))
>                 dev_set_name(dev, "link%d", ap->print_id);
> @@ -589,7 +587,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_class,
>
>  static void ata_tdev_release(struct device *dev)
>  {
> -       put_device(dev->parent);
>  }
>
>  /**
> @@ -662,7 +659,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)
>         int error;
>
>         device_initialize(dev);
> -       dev->parent = get_device(&link->tdev);
> +       dev->parent = &link->tdev;
>         dev->release = ata_tdev_release;
>         if (ata_is_host_link(link))
>                 dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-02-09 23:49                                                         ` Gwendal Grignou
@ 2017-02-10  0:36                                                           ` tedheadster
  2017-02-10 13:19                                                             ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2017-02-10  0:36 UTC (permalink / raw)
  To: Gwendal Grignou
  Cc: Tejun Heo, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

I just tested this patch and it is working for me.

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-02-10  0:36                                                           ` tedheadster
@ 2017-02-10 13:19                                                             ` Tejun Heo
  2017-02-23 19:26                                                               ` tedheadster
  0 siblings, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-02-10 13:19 UTC (permalink / raw)
  To: whiteheadm, Gwendal Grignou
  Cc: One Thousand Gnomes, Greg Kroah-Hartman, Sergei Shtylyov,
	IDE/ATA development list

On Thu, Feb 09, 2017 at 07:36:59PM -0500, tedheadster wrote:
> I just tested this patch and it is working for me.

Awesome, Gwendal, care to write up the path description?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
  2017-02-10 13:19                                                             ` Tejun Heo
@ 2017-02-23 19:26                                                               ` tedheadster
  2017-03-03 17:00                                                                 ` [PATCH] libata: transport: Remove circular dependency at free time Gwendal Grignou
  0 siblings, 1 reply; 48+ messages in thread
From: tedheadster @ 2017-02-23 19:26 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Gwendal Grignou, One Thousand Gnomes, Greg Kroah-Hartman,
	Sergei Shtylyov, IDE/ATA development list

Gwendal,
  could you submit a formal patch so we can get it in the next kernel?

- Matthew

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH] libata: transport: Remove circular dependency at free time
  2017-02-23 19:26                                                               ` tedheadster
@ 2017-03-03 17:00                                                                 ` Gwendal Grignou
  2017-03-03 18:28                                                                   ` Sergei Shtylyov
  2017-03-06 20:09                                                                   ` Tejun Heo
  0 siblings, 2 replies; 48+ messages in thread
From: Gwendal Grignou @ 2017-03-03 17:00 UTC (permalink / raw)
  To: tj, gregkh, sergei.shtylyov, linux-ide, htejun

From: Tejun Heo <tj@kernel.org>

Without this patch, failed probe would not free resources like irq.

ata port tdev object currently hold a reference to the ata port object.
Therefore the ata port object release function will not get called until
the ata_tport_release is called. But that would never happen, releasing
the last reference of ata port dev is done by scsi_host_release, which
is called by ata_host_release when the ata port object is released.

The ata tranport device objects actually do not need to explicitly hold
a reference to their real counterpart, given the transport objects are
the children of these objects and device_add() is call for each child.
We know the parent will not be deleted until we call the child
device_del().

Reported-by: Matthew Whitehead <tedheadster@gmail.com>
Tested-by: Matthew Whitehead <tedheadster@gmail.com>
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
 drivers/ata/libata-transport.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 46698232e6bf..19e6e539a061 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_class,
 
 static void ata_tport_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent,
 	device_initialize(dev);
 	dev->type = &ata_port_type;
 
-	dev->parent = get_device(parent);
+	dev->parent = parent;
 	dev->release = ata_tport_release;
 	dev_set_name(dev, "ata%d", ap->print_id);
 	transport_setup_device(dev);
@@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_class,
 
 static void ata_tlink_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link)
 	int error;
 
 	device_initialize(dev);
-	dev->parent = get_device(&ap->tdev);
+	dev->parent = &ap->tdev;
 	dev->release = ata_tlink_release;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "link%d", ap->print_id);
@@ -589,7 +587,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_class,
 
 static void ata_tdev_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -662,7 +659,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)
 	int error;
 
 	device_initialize(dev);
-	dev->parent = get_device(&link->tdev);
+	dev->parent = &link->tdev;
 	dev->release = ata_tdev_release;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
-- 
2.12.0.rc1.440.g5b76565f74-goog


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] libata: transport: Remove circular dependency at free time
  2017-03-03 17:00                                                                 ` [PATCH] libata: transport: Remove circular dependency at free time Gwendal Grignou
@ 2017-03-03 18:28                                                                   ` Sergei Shtylyov
  2017-03-03 18:36                                                                     ` Tejun Heo
  2017-03-06 20:09                                                                   ` Tejun Heo
  1 sibling, 1 reply; 48+ messages in thread
From: Sergei Shtylyov @ 2017-03-03 18:28 UTC (permalink / raw)
  To: Gwendal Grignou, tj, gregkh, linux-ide, htejun

Hello!

On 03/03/2017 08:00 PM, Gwendal Grignou wrote:

> From: Tejun Heo <tj@kernel.org>
>
> Without this patch, failed probe would not free resources like irq.
>
> ata port tdev object currently hold a reference to the ata port object.
> Therefore the ata port object release function will not get called until
> the ata_tport_release is called. But that would never happen, releasing
> the last reference of ata port dev is done by scsi_host_release, which
> is called by ata_host_release when the ata port object is released.
>
> The ata tranport device objects actually do not need to explicitly hold

    Not ata_transport.

> a reference to their real counterpart, given the transport objects are
> the children of these objects and device_add() is call for each child.
> We know the parent will not be deleted until we call the child

    Child's?

> device_del().
>
> Reported-by: Matthew Whitehead <tedheadster@gmail.com>
> Tested-by: Matthew Whitehead <tedheadster@gmail.com>
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

    You're saying it's Tejun's patch but there's no sign-off from him?

MBR, Sergei


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] libata: transport: Remove circular dependency at free time
  2017-03-03 18:28                                                                   ` Sergei Shtylyov
@ 2017-03-03 18:36                                                                     ` Tejun Heo
  0 siblings, 0 replies; 48+ messages in thread
From: Tejun Heo @ 2017-03-03 18:36 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Gwendal Grignou, gregkh, linux-ide

On Fri, Mar 03, 2017 at 09:28:45PM +0300, Sergei Shtylyov wrote:
> > Reported-by: Matthew Whitehead <tedheadster@gmail.com>
> > Tested-by: Matthew Whitehead <tedheadster@gmail.com>
> > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> 
>    You're saying it's Tejun's patch but there's no sign-off from him?

It probably should have sth like Patch-originally-by: from me but
Gwendal as the author.  I'll address the review points when applying.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] libata: transport: Remove circular dependency at free time
  2017-03-03 17:00                                                                 ` [PATCH] libata: transport: Remove circular dependency at free time Gwendal Grignou
  2017-03-03 18:28                                                                   ` Sergei Shtylyov
@ 2017-03-06 20:09                                                                   ` Tejun Heo
  2017-03-06 20:11                                                                     ` Sergei Shtylyov
  1 sibling, 1 reply; 48+ messages in thread
From: Tejun Heo @ 2017-03-06 20:09 UTC (permalink / raw)
  To: Gwendal Grignou; +Cc: gregkh, sergei.shtylyov, linux-ide

Hello,

Applied the following to libata/for-4.11-fixes.

Thanks.
------ 8< ------
>From d4a32919c3d9c959af268d33bab24eb134dab0cc Mon Sep 17 00:00:00 2001
From: Gwendal Grignou <gwendal@chromium.org>
Date: Fri, 3 Mar 2017 09:00:09 -0800
Subject: [PATCH] libata: transport: Remove circular dependency at free time

Without this patch, failed probe would not free resources like irq.

ata port tdev object currently hold a reference to the ata port
object.  Therefore the ata port object release function will not get
called until the ata_tport_release is called. But that would never
happen, releasing the last reference of ata port dev is done by
scsi_host_release, which is called by ata_host_release when the ata
port object is released.

The ata_tranport device objects actually do not need to explicitly
hold a reference to their real counterpart, given the transport
objects are the children of these objects and device_add() is call for
each child.  We know the parent will not be deleted until we call the
child's device_del().

Reported-by: Matthew Whitehead <tedheadster@gmail.com>
Tested-by: Matthew Whitehead <tedheadster@gmail.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
---
 drivers/ata/libata-transport.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 4669823..19e6e53 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_class,
 
 static void ata_tport_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent,
 	device_initialize(dev);
 	dev->type = &ata_port_type;
 
-	dev->parent = get_device(parent);
+	dev->parent = parent;
 	dev->release = ata_tport_release;
 	dev_set_name(dev, "ata%d", ap->print_id);
 	transport_setup_device(dev);
@@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_class,
 
 static void ata_tlink_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link)
 	int error;
 
 	device_initialize(dev);
-	dev->parent = get_device(&ap->tdev);
+	dev->parent = &ap->tdev;
 	dev->release = ata_tlink_release;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "link%d", ap->print_id);
@@ -589,7 +587,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_class,
 
 static void ata_tdev_release(struct device *dev)
 {
-	put_device(dev->parent);
 }
 
 /**
@@ -662,7 +659,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)
 	int error;
 
 	device_initialize(dev);
-	dev->parent = get_device(&link->tdev);
+	dev->parent = &link->tdev;
 	dev->release = ata_tdev_release;
 	if (ata_is_host_link(link))
 		dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH] libata: transport: Remove circular dependency at free time
  2017-03-06 20:09                                                                   ` Tejun Heo
@ 2017-03-06 20:11                                                                     ` Sergei Shtylyov
  2017-03-06 20:26                                                                       ` Tejun Heo
  0 siblings, 1 reply; 48+ messages in thread
From: Sergei Shtylyov @ 2017-03-06 20:11 UTC (permalink / raw)
  To: Tejun Heo, Gwendal Grignou; +Cc: gregkh, linux-ide

Hello!

On 03/06/2017 11:09 PM, Tejun Heo wrote:

> Applied the following to libata/for-4.11-fixes.
>
> Thanks.
> ------ 8< ------
> From d4a32919c3d9c959af268d33bab24eb134dab0cc Mon Sep 17 00:00:00 2001
> From: Gwendal Grignou <gwendal@chromium.org>
> Date: Fri, 3 Mar 2017 09:00:09 -0800
> Subject: [PATCH] libata: transport: Remove circular dependency at free time
>
> Without this patch, failed probe would not free resources like irq.
>
> ata port tdev object currently hold a reference to the ata port
> object.  Therefore the ata port object release function will not get
> called until the ata_tport_release is called. But that would never
> happen, releasing the last reference of ata port dev is done by
> scsi_host_release, which is called by ata_host_release when the ata
> port object is released.
>
> The ata_tranport device objects actually do not need to explicitly

    Still tranport? :-/

> hold a reference to their real counterpart, given the transport
> objects are the children of these objects and device_add() is call for
> each child.  We know the parent will not be deleted until we call the
> child's device_del().
>
> Reported-by: Matthew Whitehead <tedheadster@gmail.com>
> Tested-by: Matthew Whitehead <tedheadster@gmail.com>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> Signed-off-by: Tejun Heo <tj@kernel.org>
[...]

MBR, Sergei


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] libata: transport: Remove circular dependency at free time
  2017-03-06 20:11                                                                     ` Sergei Shtylyov
@ 2017-03-06 20:26                                                                       ` Tejun Heo
  0 siblings, 0 replies; 48+ messages in thread
From: Tejun Heo @ 2017-03-06 20:26 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Gwendal Grignou, gregkh, linux-ide

On Mon, Mar 06, 2017 at 11:11:53PM +0300, Sergei Shtylyov wrote:
> > The ata_tranport device objects actually do not need to explicitly
> 
>    Still tranport? :-/

Oops, fixed.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2017-03-07  0:52 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-29 17:53 [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Matthew Whitehead
2016-11-29 19:41 ` Tejun Heo
2016-11-29 20:12   ` tedheadster
2016-11-29 20:46     ` Tejun Heo
2016-11-30 13:06       ` Bartlomiej Zolnierkiewicz
2016-11-30 17:13         ` tedheadster
2016-11-30 13:11 ` Sergei Shtylyov
2016-11-30 14:53   ` One Thousand Gnomes
2016-11-30 15:03     ` tedheadster
2016-11-30 18:15       ` One Thousand Gnomes
2016-12-02 13:37         ` tedheadster
2016-12-02 16:24           ` One Thousand Gnomes
2016-11-30 20:22       ` Tejun Heo
     [not found]         ` <CAP8WD_bZWeLBhLXqJG5uDwBe+zBubw+A+ecSuaihOuwvw9QoCQ@mail.gmail.com>
2016-12-02 17:07           ` Tejun Heo
2016-12-05 14:19             ` tedheadster
2016-12-05 19:23               ` Tejun Heo
     [not found]                 ` <CAP8WD_becq+h2=-g7t-6Pp1psmkCCvdB0YUcg+wYPocUP4dYdw@mail.gmail.com>
2016-12-12 17:01                   ` Tejun Heo
     [not found]                     ` <CAP8WD_YMtnsuYmJHGz1eLmrQNemsB1Z6Soyb6f72brAfMNUNeg@mail.gmail.com>
2016-12-20  2:12                       ` tedheadster
2016-12-22 16:37                         ` Tejun Heo
2016-12-22 17:14                           ` tedheadster
2016-12-22 17:19                             ` Tejun Heo
2016-12-22 18:30                             ` tedheadster
2016-12-22 19:22                               ` Tejun Heo
2017-01-03 17:34                                 ` One Thousand Gnomes
     [not found]                                   ` <CAP8WD_bS61spyQkd7cvktFf_dPc0wgNZ8qEa7GVrXgUobHQdvw@mail.gmail.com>
2017-01-19 21:37                                     ` Tejun Heo
2017-01-20 17:08                                       ` tedheadster
2017-01-20 19:19                                         ` Tejun Heo
2017-01-20 19:38                                           ` Tejun Heo
2017-01-23 23:36                                             ` Gwendal Grignou
2017-01-23 23:57                                               ` tedheadster
2017-01-24 16:19                                                 ` Tejun Heo
2017-01-27  3:01                                                   ` tedheadster
2017-02-07 20:21                                                     ` Gwendal Grignou
2017-02-08 19:43                                                       ` Tejun Heo
2017-02-09 23:49                                                         ` Gwendal Grignou
2017-02-10  0:36                                                           ` tedheadster
2017-02-10 13:19                                                             ` Tejun Heo
2017-02-23 19:26                                                               ` tedheadster
2017-03-03 17:00                                                                 ` [PATCH] libata: transport: Remove circular dependency at free time Gwendal Grignou
2017-03-03 18:28                                                                   ` Sergei Shtylyov
2017-03-03 18:36                                                                     ` Tejun Heo
2017-03-06 20:09                                                                   ` Tejun Heo
2017-03-06 20:11                                                                     ` Sergei Shtylyov
2017-03-06 20:26                                                                       ` Tejun Heo
2017-01-24 15:57                                               ` [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Tejun Heo
2016-12-12 12:21               ` Bartlomiej Zolnierkiewicz
2016-11-30 13:12 ` Bartlomiej Zolnierkiewicz
2016-11-30 13:15 ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.