~ubuntu-branches/ubuntu/raring/linux-ti-omap4/raring-proposed

« back to all changes in this revision

Viewing changes to drivers/ata/sata_promise.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.5.0-25.38
  • Date: 2013-02-20 22:03:31 UTC
  • mfrom: (74.1.1 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20130220220331-0ea4l33x3cr61nch
Tags: 3.5.0-220.28
* Release Tracking Bug
  - LP: #1130311

[ Paolo Pisati ]

* rebased on Ubuntu-3.5.0-25.38

[ Ubuntu: 3.5.0-25.38 ]

* Release Tracking Bug
  - LP: #1129472
* ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
  - LP: #1119885, #1129192
  - CVE-2013-0871
* ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
  - LP: #1119885, #1129192
  - CVE-2013-0871
* wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED
  task
  - LP: #1119885, #1129192
  - CVE-2013-0871

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        dma_addr_t              pkt_dma;
148
148
};
149
149
 
 
150
struct pdc_host_priv {
 
151
        spinlock_t hard_reset_lock;
 
152
};
 
153
 
150
154
static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
151
155
static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
152
156
static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
801
805
        void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR];
802
806
        void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1;
803
807
        unsigned int ata_no = pdc_ata_port_to_ata_no(ap);
 
808
        struct pdc_host_priv *hpriv = ap->host->private_data;
804
809
        u8 tmp;
805
810
 
806
 
        spin_lock(&ap->host->lock);
 
811
        spin_lock(&hpriv->hard_reset_lock);
807
812
 
808
813
        tmp = readb(pcictl_b1_mmio);
809
814
        tmp &= ~(0x10 << ata_no);
814
819
        writeb(tmp, pcictl_b1_mmio);
815
820
        readb(pcictl_b1_mmio); /* flush */
816
821
 
817
 
        spin_unlock(&ap->host->lock);
 
822
        spin_unlock(&hpriv->hard_reset_lock);
818
823
}
819
824
 
820
825
static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class,
1182
1187
        const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];
1183
1188
        const struct ata_port_info *ppi[PDC_MAX_PORTS];
1184
1189
        struct ata_host *host;
 
1190
        struct pdc_host_priv *hpriv;
1185
1191
        void __iomem *host_mmio;
1186
1192
        int n_ports, i, rc;
1187
1193
        int is_sataii_tx4;
1218
1224
                dev_err(&pdev->dev, "failed to allocate host\n");
1219
1225
                return -ENOMEM;
1220
1226
        }
 
1227
        hpriv = devm_kzalloc(&pdev->dev, sizeof *hpriv, GFP_KERNEL);
 
1228
        if (!hpriv)
 
1229
                return -ENOMEM;
 
1230
        spin_lock_init(&hpriv->hard_reset_lock);
 
1231
        host->private_data = hpriv;
1221
1232
        host->iomap = pcim_iomap_table(pdev);
1222
1233
 
1223
1234
        is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags);