Tejun Heo wrote:
> Peter Zijlstra wrote:
>> Indeed, quite easy to reproduce:
>>
>> diff --git a/kernel/lockdep.c b/kernel/lockdep.c
>> index 81a4e4a..33901ef 100644
>> --- a/kernel/lockdep.c
>> +++ b/kernel/lockdep.c
>> @@ -2434,6 +2434,13 @@ static int __lock_acquire(struct lockdep_map
>> *lock, unsigned int subclass,
>> * the hash, not class->key.
>> */
>> id = class - lock_classes;
>> + if (id >= MAX_LOCKDEP_KEYS) {
>> + spinlock_t *slock = container_of(lock, spinlock_t, dep_map);
>> +
>> + printk(KERN_EMERG "magic: %x\n", slock->magic);
>> + printk(KERN_EMERG "class: %p\n", class);
>> + printk(KERN_EMERG "id: %u\n", id);
>> + }
>> if (DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS))
>> return 0;
>>
>>
>>
>> gives me:
>>
>> ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
>> magic: c050cf60
>> class: c7c20e54
>> id: 2265185251
>> ------------[ cut here ]------------
>> WARNING: at /mnt/md0/src/linux-2.6-2/kernel/lockdep.c:2444
>> __lock_acquire+0x57b/0xfd0()
>>
>>
>> Looks like someone is stomping on the spinlock or just passing us
>> garbage.
>
> Does the attached patch help?
>
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index 7af4b29..f7ba234 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -1037,6 +1037,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
> return 0;
> }
> }
> + ata_host_detach(host);
> fail:
> platform_device_unregister(pdev);
> return ret;
(going through old, unresolved email)
It looks like this might still be needed? I never saw an "it works"
response to this email.
Jeff
Jeff Garzik wrote:
> (going through old, unresolved email)
>
> It looks like this might still be needed? I never saw an "it works"
> response to this email.
Indeed. Peter Zijlstra, can you please test it?
--
tejun
When pata_legacy can't detect any device, it unregisters the
platform_device and fails detection. However, it forgets to detach
ata host triggering weird failures as the host later gets freed by
devres while still attached. Fix it.
Signed-off-by: Tejun Heo <[email protected]>
Reported-by: Peter Zijlstra <[email protected]>
---
Well, with or without test verification, this patch is correct. Thanks.
drivers/ata/pata_legacy.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 3f830f0..0c6dde8 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -1032,6 +1032,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
return 0;
}
}
+ ata_host_detach(host);
fail:
platform_device_unregister(pdev);
return ret;
Tejun Heo wrote:
> When pata_legacy can't detect any device, it unregisters the
> platform_device and fails detection. However, it forgets to detach
> ata host triggering weird failures as the host later gets freed by
> devres while still attached. Fix it.
>
> Signed-off-by: Tejun Heo <[email protected]>
> Reported-by: Peter Zijlstra <[email protected]>
> ---
> Well, with or without test verification, this patch is correct. Thanks.
>
> drivers/ata/pata_legacy.c | 1 +
> 1 file changed, 1 insertion(+)
applied