Page 1 of 1
needing kernel patch for FitPC2i rev. 1.1
Posted: Fri Feb 24, 2012 11:57 pm
by Merhaba
Hi,
I've got a FitPC2i rev. 1.1 down in my cellar which runs fine under Ubuntu 10.04 LTS - with kernel 2.6.35.
Now that the next LTS Ubuntu release is due, I'd like to upgrade too - but there's a problem: That rev. 1.1 model got the hardware quirks which hinders the stock ubuntu kernel from finding my SATA disk.
A little back in time there was a patch available somewhere in the forum or the FitPC wiki, but I can't find it anymore. Back then the forum user axcoco provided an ISO with a patched kernel, but his server doesn't contain any files anymore
So - can someone from CompuLab please share the relevant patch code for the pata_sch.c file? And I'd appreciate if it worked with the 3.2 kernel that comes with Ubuntu 12.04
Thanks in advance,
Merhaba
Re: needing kernel patch for FitPC2i rev. 1.1
Posted: Sun Feb 26, 2012 10:41 am
by Denis
Hi, here is the patch. It has not been changed since 2.6.31 kernel.
Code: Select all
--- drivers/ata/pata_sch.c 2012-02-07 15:14:52.000000000 +0200
+++ drivers/ata/pata_sch.c 2012-02-26 10:31:07.314325150 +0200
@@ -75,13 +75,55 @@
ATA_BMDMA_SHT(DRV_NAME),
};
+/**
+ * sch_tf_read - input device's ATA taskfile shadow registers
+ * @ap: Port from which input is read
+ * @tf: ATA taskfile register set for storing input
+ *
+ * Note: Original code is ata_sff_tf_read().
+ */
+
+static void sch_tf_read (struct ata_port *ap, struct ata_taskfile *tf)
+{
+ struct ata_ioports *ioaddr = &ap->ioaddr;
+
+ tf->command = ata_sff_check_status(ap);
+ tf->feature = ioread8(ioaddr->error_addr);
+
+ if(tf->feature == 0x81)
+ tf->feature = 0x1;
+
+ tf->nsect = ioread8(ioaddr->nsect_addr);
+ tf->lbal = ioread8(ioaddr->lbal_addr);
+ tf->lbam = ioread8(ioaddr->lbam_addr);
+ tf->lbah = ioread8(ioaddr->lbah_addr);
+ tf->device = ioread8(ioaddr->device_addr);
+
+ if (tf->flags & ATA_TFLAG_LBA48) {
+ if (likely(ioaddr->ctl_addr)) {
+ iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
+ tf->hob_feature = ioread8(ioaddr->error_addr);
+ tf->hob_nsect = ioread8(ioaddr->nsect_addr);
+ tf->hob_lbal = ioread8(ioaddr->lbal_addr);
+ tf->hob_lbam = ioread8(ioaddr->lbam_addr);
+ tf->hob_lbah = ioread8(ioaddr->lbah_addr);
+ iowrite8(tf->ctl, ioaddr->ctl_addr);
+ ap->last_ctl = tf->ctl;
+ } else
+ WARN_ON(1);
+ }
+}
+
+
static struct ata_port_operations sch_pata_ops = {
.inherits = &ata_bmdma_port_ops,
.cable_detect = ata_cable_unknown,
.set_piomode = sch_set_piomode,
.set_dmamode = sch_set_dmamode,
+ .sff_tf_read = sch_tf_read,
};
+
static struct ata_port_info sch_port_info = {
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
Re: needing kernel patch for FitPC2i rev. 1.1
Posted: Wed Feb 29, 2012 11:08 pm
by Merhaba
Thanks a lot

Re: needing kernel patch for FitPC2i rev. 1.1
Posted: Sun Mar 18, 2012 12:32 am
by Merhaba
Hi Denis,
took me a while to try and apply the patch to the latest sources in precise repos, but my patch program keeps complaining that the patch you posted was malformed. I invoked patch with this command:
Code: Select all
patch --dry-run -F 10 -i ../../pata_sch-for-fitpc2i-rev1.1.patch
patch: **** malformed patch at line 5: };
Lokks like patch would like a few more lines of context to me.
Could you provide a patch with a few more lines of context above the inesertion point?
should do the job I think.
Thanks

Re: needing kernel patch for FitPC2i rev. 1.1
Posted: Fri Mar 29, 2013 3:09 pm
by Merhaba
Hm, didn't get a reply for this. Just in case others have this problem too:
Looks like the pasted code lacks a space in front of the non-patched context codelines. This at least helped me get rid of the malformed patch error.
Had to patch manually nevertheless :-/
Re: needing kernel patch for FitPC2i rev. 1.1
Posted: Fri Mar 29, 2013 7:01 pm
by Merhaba
Here's a working patch I made today. Patches flawlessly using the command
on my Ubuntu 10.04 box
Sorry for linking, but the board won't allow my to upload the diff. I'll try and keep it available.
Re: needing kernel patch for FitPC2i rev. 1.1
Posted: Tue Apr 02, 2013 5:39 pm
by gabrielh
You should zip your files if you want to attach them to your post.