Bug 117068

Summary: 10.0 RC1: Promise PATA on SATA patch needed
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Robert Kesterson <robertk>
Component: KernelAssignee: Jens Axboe <axboe>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None    
Version: RC 1   
Target Milestone: RC 2   
Hardware: x86-64   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: PATA on SATA patch for 10.0 RC1
Proper unified diff of promise pata support

Description Robert Kesterson 2005-09-14 18:25:30 UTC
After installing OpenSUSE 10.0 RC1, the PATA drives attached to my Promise 
PDF20378 controller were no longer visible.  To make them visible again, I had 
to manually apply the diffs in a patch file I found through a web search.  After 
applying the patch, the drives are visible again and work as expected.  An 
updated patch is below.

---------------------patch follows------------------------
diff -r linux-2.6.13.9.suse/drivers/scsi/libata-core.c linux-2.6.13-9/drivers/
scsi/libata-core.c
4114a4115
> 	ap->flags |= ent->port_flags[port_no];
diff -r linux-2.6.13.9.suse/drivers/scsi/sata_promise.c linux-2.6.13-9/drivers/
scsi/sata_promise.c
82a83,84
> static void pdc_pata_phy_reset(struct ata_port *ap);
> static void pdc_pata_cbl_reset(struct ata_port *ap);
135c137
< 		.host_flags	= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
---
> 		.host_flags	= /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY |
278c280,308
< 	sata_phy_reset(ap);
---
> 	if (ap->flags & ATA_FLAG_SATA)
> 		sata_phy_reset(ap);
> 	else
> 		pdc_pata_phy_reset(ap);
> }
> 
> static void pdc_pata_cbl_detect(struct ata_port *ap)
> {
> 	u8 tmp;
> 	void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
> 
> 	tmp = readb(mmio);
> 
> 	if (tmp & 0x01)
> 	{
> 		ap->cbl = ATA_CBL_PATA40;
> 		ap->udma_mask &= ATA_UDMA_MASK_40C;
> 	}
> 	else
> 		ap->cbl = ATA_CBL_PATA80;
> }
> 
> static void pdc_pata_phy_reset(struct ata_port *ap)
> {
> 	pdc_pata_cbl_detect(ap);
> 
> 	ata_port_probe(ap);
> 
> 	ata_bus_reset(ap);
589a620
> 	u8 tmp;
649a681,683
> 	probe_ent->port_flags[0] = ATA_FLAG_SATA;
> 	probe_ent->port_flags[1] = ATA_FLAG_SATA;
> 
659a694,696
> 
> 		probe_ent->port_flags[2] = ATA_FLAG_SATA;
> 		probe_ent->port_flags[3] = ATA_FLAG_SATA;
662c699,712
<        		probe_ent->n_ports = 2;
---
> 		/* Some boards have also PATA port */
> 		tmp = readb(mmio_base + PDC_FLASH_CTL+1);
> 		if (!(tmp & 0x80))
> 		{
> 			probe_ent->n_ports = 3;
> 
> 			pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
> 
> 			probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
> 
> 			printk(KERN_INFO DRV_NAME " PATA port found\n");
> 		}
> 		else
> 		       probe_ent->n_ports = 2;
diff -r linux-2.6.13.9.suse/include/linux/libata.h linux-2.6.13-9/include/linux/
libata.h
214a215
> 	unsigned long		port_flags[ATA_MAX_PORTS];
diff -r linux-2.6.13.9.suse/include/linux/version.h linux-2.6.13-9/include/
linux/version.h
1c1
< #define UTS_RELEASE "2.6.13-9-default"
---
> #define UTS_RELEASE "2.6.13-9"
Comment 1 Hubert Mantel 2005-09-19 15:44:16 UTC
Please, never paste patches into the comment fields of bugzilla, as this renders
the patches totally useless for us. Please submit them as attachment.
Comment 2 Robert Kesterson 2005-09-19 17:11:56 UTC
Created attachment 50328 [details]
PATA on SATA patch for 10.0 RC1

Sorry about that.  I wasn't aware of the requirement that patches be
attachments.  Here it is.
Comment 3 Jens Axboe 2005-09-20 14:29:31 UTC
The promise pata patches are part of the development libata branch, so we have
not added them for SL10. SL10 final is already mastered and given this is a
feature request, there's not so much I can do about it at this point. Sorry.
Comment 4 Jens Axboe 2005-09-20 14:30:17 UTC
Created attachment 50426 [details]
Proper unified diff of promise pata support

For completeness, here's the proper patch for promise pata support.
Comment 5 Jens Axboe 2005-09-20 17:00:23 UTC
Talking to Robert in private, this is actually a regression from SL93. So I
think that warrants adding the patch, I have now done so.
Comment 6 Jens Axboe 2005-09-20 17:01:57 UTC
Patch committed.