Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: make use of ata_port_is_frozen() helper

Clean up the code by making use of the newly introduced
ata_port_is_frozen() helper function.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

authored by

Niklas Cassel and committed by
Damien Le Moal
4cb7c6f1 fddb1a64

+22 -23
+3 -3
drivers/ata/libahci.c
··· 2120 2120 { 2121 2121 struct ahci_host_priv *hpriv = ap->host->private_data; 2122 2122 2123 - if (!(ap->pflags & ATA_PFLAG_FROZEN)) { 2123 + if (!ata_port_is_frozen(ap)) { 2124 2124 /* restart engine */ 2125 2125 hpriv->stop_engine(ap); 2126 2126 hpriv->start_engine(ap); ··· 2311 2311 * Note that during initialization, the port is marked as 2312 2312 * frozen since the irq handler is not yet registered. 2313 2313 */ 2314 - if (!(ap->pflags & ATA_PFLAG_FROZEN)) 2314 + if (!ata_port_is_frozen(ap)) 2315 2315 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK); 2316 2316 } 2317 2317 ··· 2330 2330 pp->intr_mask &= ~PORT_IRQ_BAD_PMP; 2331 2331 2332 2332 /* see comment above in ahci_pmp_attach() */ 2333 - if (!(ap->pflags & ATA_PFLAG_FROZEN)) 2333 + if (!ata_port_is_frozen(ap)) 2334 2334 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK); 2335 2335 } 2336 2336
+2 -2
drivers/ata/libata-acpi.c
··· 992 992 993 993 acpi_err: 994 994 /* ignore evaluation failure if we can continue safely */ 995 - if (rc == -EINVAL && !nr_executed && !(ap->pflags & ATA_PFLAG_FROZEN)) 995 + if (rc == -EINVAL && !nr_executed && !ata_port_is_frozen(ap)) 996 996 return 0; 997 997 998 998 /* fail and let EH retry once more for unknown IO errors */ ··· 1007 1007 /* We can safely continue if no _GTF command has been executed 1008 1008 * and port is not frozen. 1009 1009 */ 1010 - if (!nr_executed && !(ap->pflags & ATA_PFLAG_FROZEN)) 1010 + if (!nr_executed && !ata_port_is_frozen(ap)) 1011 1011 return 0; 1012 1012 1013 1013 return rc;
+2 -2
drivers/ata/libata-core.c
··· 1489 1489 spin_lock_irqsave(ap->lock, flags); 1490 1490 1491 1491 /* no internal command while frozen */ 1492 - if (ap->pflags & ATA_PFLAG_FROZEN) { 1492 + if (ata_port_is_frozen(ap)) { 1493 1493 spin_unlock_irqrestore(ap->lock, flags); 1494 1494 return AC_ERR_SYSTEM; 1495 1495 } ··· 4721 4721 return; 4722 4722 } 4723 4723 4724 - WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); 4724 + WARN_ON_ONCE(ata_port_is_frozen(ap)); 4725 4725 4726 4726 /* read result TF if requested */ 4727 4727 if (qc->flags & ATA_QCFLAG_RESULT_TF)
+10 -11
drivers/ata/libata-eh.c
··· 1406 1406 struct ata_taskfile tf; 1407 1407 unsigned int err_mask; 1408 1408 1409 - if (qc->ap->pflags & ATA_PFLAG_FROZEN) { 1409 + if (ata_port_is_frozen(qc->ap)) { 1410 1410 ata_dev_warn(dev, "sense data available but port frozen\n"); 1411 1411 return; 1412 1412 } ··· 1596 1596 break; 1597 1597 1598 1598 case ATA_DEV_ATAPI: 1599 - if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { 1599 + if (!ata_port_is_frozen(qc->ap)) { 1600 1600 tmp = atapi_eh_request_sense(qc->dev, 1601 1601 qc->scsicmd->sense_buffer, 1602 1602 qc->result_tf.error >> 4); ··· 2003 2003 ehc->i.flags |= ATA_EHI_QUIET; 2004 2004 2005 2005 /* enforce default EH actions */ 2006 - if (ap->pflags & ATA_PFLAG_FROZEN || 2006 + if (ata_port_is_frozen(ap) || 2007 2007 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT)) 2008 2008 ehc->i.action |= ATA_EH_RESET; 2009 2009 else if (((eflags & ATA_EFLAG_IS_IO) && all_err_mask) || ··· 2246 2246 return; 2247 2247 2248 2248 frozen = ""; 2249 - if (ap->pflags & ATA_PFLAG_FROZEN) 2249 + if (ata_port_is_frozen(ap)) 2250 2250 frozen = " frozen"; 2251 2251 2252 2252 if (ap->eh_tries < ATA_EH_MAX_TRIES) ··· 2567 2567 if (reset && !(ehc->i.action & ATA_EH_RESET)) { 2568 2568 ata_for_each_dev(dev, link, ALL) 2569 2569 classes[dev->devno] = ATA_DEV_NONE; 2570 - if ((ap->pflags & ATA_PFLAG_FROZEN) && 2571 - ata_is_host_link(link)) 2570 + if (ata_port_is_frozen(ap) && ata_is_host_link(link)) 2572 2571 ata_eh_thaw_port(ap); 2573 2572 rc = 0; 2574 2573 goto out; ··· 2725 2726 ap->pflags &= ~ATA_PFLAG_EH_PENDING; 2726 2727 spin_unlock_irqrestore(link->ap->lock, flags); 2727 2728 2728 - if (ap->pflags & ATA_PFLAG_FROZEN) 2729 + if (ata_port_is_frozen(ap)) 2729 2730 ata_eh_thaw_port(ap); 2730 2731 2731 2732 /* ··· 3232 3233 if (err_mask & AC_ERR_DEV) { 3233 3234 qc->err_mask |= AC_ERR_DEV; 3234 3235 qc->result_tf = tf; 3235 - if (!(ap->pflags & ATA_PFLAG_FROZEN)) 3236 + if (!ata_port_is_frozen(ap)) 3236 3237 rc = 0; 3237 3238 } 3238 3239 } ··· 3409 3410 return 1; 3410 3411 3411 3412 /* thaw frozen port and recover failed devices */ 3412 - if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link)) 3413 + if (ata_port_is_frozen(ap) || ata_link_nr_enabled(link)) 3413 3414 return 0; 3414 3415 3415 3416 /* reset at least once if reset is requested */ ··· 3764 3765 if (dev) 3765 3766 ata_eh_handle_dev_fail(dev, rc); 3766 3767 3767 - if (ap->pflags & ATA_PFLAG_FROZEN) { 3768 + if (ata_port_is_frozen(ap)) { 3768 3769 /* PMP reset requires working host port. 3769 3770 * Can't retry if it's frozen. 3770 3771 */ ··· 3938 3939 ap->pflags &= ~ATA_PFLAG_PM_PENDING; 3939 3940 if (rc == 0) 3940 3941 ap->pflags |= ATA_PFLAG_SUSPENDED; 3941 - else if (ap->pflags & ATA_PFLAG_FROZEN) 3942 + else if (ata_port_is_frozen(ap)) 3942 3943 ata_port_schedule_eh(ap); 3943 3944 3944 3945 spin_unlock_irqrestore(ap->lock, flags);
+1 -1
drivers/ata/libata-sata.c
··· 1420 1420 int tag, rc; 1421 1421 1422 1422 /* if frozen, we can't do much */ 1423 - if (ap->pflags & ATA_PFLAG_FROZEN) 1423 + if (ata_port_is_frozen(ap)) 1424 1424 return; 1425 1425 1426 1426 /* is it NCQ device error? */
+1 -1
drivers/ata/libata-scsi.c
··· 658 658 struct ata_queued_cmd *qc; 659 659 int tag; 660 660 661 - if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) 661 + if (unlikely(ata_port_is_frozen(ap))) 662 662 goto fail; 663 663 664 664 if (ap->flags & ATA_FLAG_SAS_HOST) {
+1 -1
drivers/ata/sata_nv.c
··· 2185 2185 if (!fis) 2186 2186 return; 2187 2187 2188 - if (ap->pflags & ATA_PFLAG_FROZEN) 2188 + if (ata_port_is_frozen(ap)) 2189 2189 return; 2190 2190 2191 2191 if (fis & NV_SWNCQ_IRQ_HOTPLUG) {
+1 -1
drivers/ata/sata_promise.c
··· 817 817 818 818 static void pdc_error_handler(struct ata_port *ap) 819 819 { 820 - if (!(ap->pflags & ATA_PFLAG_FROZEN)) 820 + if (!ata_port_is_frozen(ap)) 821 821 pdc_reset_port(ap); 822 822 823 823 ata_sff_error_handler(ap);
+1 -1
drivers/ata/sata_sx4.c
··· 855 855 856 856 static void pdc_error_handler(struct ata_port *ap) 857 857 { 858 - if (!(ap->pflags & ATA_PFLAG_FROZEN)) 858 + if (!ata_port_is_frozen(ap)) 859 859 pdc_reset_port(ap); 860 860 861 861 ata_sff_error_handler(ap);