diff mbox

pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems

Message ID 20161202170705.GB6033@htj.duckdns.org
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Tejun Heo Dec. 2, 2016, 5:07 p.m. UTC
Hello,

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

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

tedheadster Dec. 5, 2016, 2:19 p.m. UTC | #1
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
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bartlomiej Zolnierkiewicz Dec. 12, 2016, 12:21 p.m. UTC | #2
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

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }