1212 * performance Alessandro Zummo <alessandro.zummo@towertech.it>
1313 *
1414 * TODO
15- * 850 serialization once the core supports it
1615 * Investigate no_dsc on 850R
1716 * Clock detect
1817 */
2928#include <linux/ata.h>
3029
3130#define DRV_NAME "pata_artop"
32- #define DRV_VERSION "0.4.4 "
31+ #define DRV_VERSION "0.4.5 "
3332
3433/*
3534 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
@@ -283,6 +282,31 @@ static void artop6260_set_dmamode (struct ata_port *ap, struct ata_device *adev)
283282 pci_write_config_byte (pdev , 0x44 + ap -> port_no , ultra );
284283}
285284
285+ /**
286+ * artop_6210_qc_defer - implement serialization
287+ * @qc: command
288+ *
289+ * Issue commands per host on this chip.
290+ */
291+
292+ static int artop6210_qc_defer (struct ata_queued_cmd * qc )
293+ {
294+ struct ata_host * host = qc -> ap -> host ;
295+ struct ata_port * alt = host -> ports [1 ^ qc -> ap -> port_no ];
296+ int rc ;
297+
298+ /* First apply the usual rules */
299+ rc = ata_std_qc_defer (qc );
300+ if (rc != 0 )
301+ return rc ;
302+
303+ /* Now apply serialization rules. Only allow a command if the
304+ other channel state machine is idle */
305+ if (alt && alt -> qc_active )
306+ return ATA_DEFER_PORT ;
307+ return 0 ;
308+ }
309+
286310static struct scsi_host_template artop_sht = {
287311 ATA_BMDMA_SHT (DRV_NAME ),
288312};
@@ -293,6 +317,7 @@ static struct ata_port_operations artop6210_ops = {
293317 .set_piomode = artop6210_set_piomode ,
294318 .set_dmamode = artop6210_set_dmamode ,
295319 .prereset = artop6210_pre_reset ,
320+ .qc_defer = artop6210_qc_defer ,
296321};
297322
298323static struct ata_port_operations artop6260_ops = {
@@ -362,12 +387,8 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
362387
363388 if (id -> driver_data == 0 ) { /* 6210 variant */
364389 ppi [0 ] = & info_6210 ;
365- ppi [1 ] = & ata_dummy_port_info ;
366390 /* BIOS may have left us in UDMA, clear it before libata probe */
367391 pci_write_config_byte (pdev , 0x54 , 0 );
368- /* For the moment (also lacks dsc) */
369- printk (KERN_WARNING "ARTOP 6210 requires serialize functionality not yet supported by libata.\n" );
370- printk (KERN_WARNING "Secondary ATA ports will not be activated.\n" );
371392 }
372393 else if (id -> driver_data == 1 ) /* 6260 */
373394 ppi [0 ] = & info_626x ;
0 commit comments