ata: kill ATA_DEBUG
Subsystems (6)
v3 cover ata: kill ATA_DEBUG
Hi all,
this is a rewrite of an earlier patchset titled 'ata: move DPRINTK to dynamic debugging'.
The overall idea is that it's really tiresome to having to recompile the kernel every time one wants or needs to debug ata issues, especially as the kernel already provides mechanism for dynamic debugging messages.
At the same time dynamic debugging does increase the load on the logging subsystem, and things like printk() are poorly suited for high-speed logging.
So this patchset does several things:
- cleans up the logging messages by removing duplicate or pointless messages
- Converts I/O and error handling related messages to tracepoints
- Moves all remaining messages over to dynamic debugging
With that ATA_DEBUG can be killed.
Note, I'll be preparing an additional patchset for killing off ATA_VERBOSE_DEBUG, too, but wanted to get this one out first before it becomes too large.
As usual, comments and reviews are welcome.
Changes to v1:
- Included reviews from Bartlomiej
- Merged patches
Changes to v2:
- Included reviews from Barlomiej
Hannes Reinecke (40):
libata: drop BPRINTK()
libata.h: whitespace and indentation fixes
libata-transport: Whitespace cleanup
libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
libata: move __func__ into ata_{port,link,dev}_dbg() helper
libata: remove pointless debugging messages
ata_piix: remove debugging messages
libata-core: remove pointless debugging messages
libata: Add ata_port_classify() helper
libata: move ata_dump_id() to dynamic debugging
libata: sanitize ATA_HORKAGE_DUMP_ID
sata_mv: replace DPRINTK with 'pci_dump' module parameter
sata_mv: kill 'port' argument in mv_dump_all_regs()
sata_sx4: move DPRINTK to VPRINTK
libata: add reset tracepoints
libata: drop DPRINTK() calls in reset
libata: tracepoints for bus-master DMA
libata: drop debugging statements for bus-master DMA
pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() calls
pata_arasan_cf: use generic tracepoints
sata_dwc_460ex: use generic tracepoints
sata_nv: use generic tracepoints
libata-sff: tracepoints for HSM state machine
libata-sff: add tracepoints for ata_sff_flush_pio_task()
libata-scsi: drop DPRINTK calls for cdb translation
libata: add tracepoints for ATA error handling
libata: drop DPRINTK() calls during ATA error handling
libata-eh: remove DPRINTK() calls for request sense
pata_octeon_cf: move DPRINTK to VPRINTK
pdc_adma: move DPRINTK to VPRINTK
sata_rcar: move DPRINTK to VPRINTK
sata_qstor: move DPRINTK to VPRINTK
pata_pdc2027x: Replace PDPRINTK() with standard ata logging
sata_nv: move DPRINTK to ata debugging
sata_fsl: move DPRINTK to ata debugging
libata-core: move DPRINTK to ata debugging
libata: remove DPRINTK() macro
libata: kill ATA_MSG_INFO
libata: kill ATA_MSG_CTL
libata: remove references to ATA_DEBUG
drivers/ata/acard-ahci.c | 4 - drivers/ata/ahci.c | 12 +- drivers/ata/ahci_qoriq.c | 4 - drivers/ata/ata_piix.c | 3 - drivers/ata/libahci.c | 15 +- drivers/ata/libata-acpi.c | 62 +++---- drivers/ata/libata-core.c | 229 +++++++++--------------- drivers/ata/libata-eh.c | 47 ++--- drivers/ata/libata-pmp.c | 8 - drivers/ata/libata-scsi.c | 20 +-- drivers/ata/libata-sff.c | 76 ++++---- drivers/ata/libata-trace.c | 29 ++++ drivers/ata/libata-transport.c | 14 +- drivers/ata/pata_arasan_cf.c | 3 + drivers/ata/pata_octeon_cf.c | 23 +-- drivers/ata/pata_pdc2027x.c | 81 ++++----- drivers/ata/pata_pdc202xx_old.c | 2 - drivers/ata/pata_sil680.c | 1 - drivers/ata/pdc_adma.c | 2 +- drivers/ata/sata_dwc_460ex.c | 57 +----- drivers/ata/sata_fsl.c | 102 +++++------ drivers/ata/sata_inic162x.c | 2 +- drivers/ata/sata_mv.c | 110 ++++++------ drivers/ata/sata_nv.c | 29 ++-- drivers/ata/sata_qstor.c | 2 +- drivers/ata/sata_rcar.c | 8 +- drivers/ata/sata_sil24.c | 5 +- drivers/ata/sata_sx4.c | 2 +- include/linux/libata.h | 105 +++++------ include/trace/events/libata.h | 377 ++++++++++++++++++++++++++++++++++++++++ 30 files changed, 809 insertions(+), 625 deletions(-)
Signature · 1 line
2.16.4
PATCH v3 1/40 libata: drop BPRINTK()
No users, drop it.
--- include/linux/libata.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/libata.h +0 -2
@@ -57,8 +57,6 @@ #define VPRINTK(fmt, args...)#endif /* ATA_DEBUG */ -#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) -#define ata_print_version_once (dev, version) \ ({ \ static bool __print_once; \
Signature · 1 line
2.16.4
PATCH v3 2/40 libata.h: whitespace and indentation fixes
In reply to Hannes Reinecke--- include/linux/libata.h | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-)
include/linux/libata.h +26 -15
@@ -593,7 +593,7 @@ struct ata_ioports {struct ata_host {spinlock_t lock; -struct device *dev; +struct device *dev;void __iomem *const *iomap;unsigned int n_ports;unsigned int n_tags;/* nr of NCQ tags */
@@ -813,7 +813,7 @@ struct ata_port {/* Flags that change dynamically, protected by ap->lock */ unsigned int pflags;/* ATA_PFLAG_xxx */ unsigned int print_id;/* user visible unique port ID */ -unsigned int local_port_no;/* host local port num */ +unsigned int local_port_no;/* host local port num */ unsigned int port_no;/* 0 based port no. inside the host */ #ifdef CONFIG_ATA_SFF
@@ -848,7 +848,7 @@ struct ata_port {struct ata_port_stats stats;struct ata_host *host; -struct device *dev; +struct device *dev;struct device tdev;struct mutex scsi_scan_mutex;
@@ -900,11 +900,14 @@ struct ata_port_operations {* Configuration and exception handling */ int (*cable_detect)(struct ata_port *ap); -unsigned long (*mode_filter)(struct ata_device *dev,unsigned long xfer_mask); +unsigned long (*mode_filter)(struct ata_device *dev, +unsigned long xfer_mask);void (*set_piomode)(struct ata_port *ap,struct ata_device *dev);void (*set_dmamode)(struct ata_port *ap,struct ata_device *dev); -int (*set_mode)(struct ata_link *link,struct ata_device **r_failed_dev); -unsigned int (*read_id)(struct ata_device *dev,struct ata_taskfile *tf,u16 *id); +int (*set_mode)(struct ata_link *link, +struct ata_device **r_failed_dev); +unsigned int (*read_id)(struct ata_device *dev, +struct ata_taskfile *tf,u16 *id);void (*dev_config)(struct ata_device *dev);
@@ -999,7 +1002,7 @@ struct ata_port_info {unsigned long mwdma_mask;unsigned long udma_mask;struct ata_port_operations *port_ops; -void *private_data; +void *private_data; };struct ata_timing {
@@ -1103,7 +1106,8 @@ extern int ata_host_activate(struct ata_host *host, int irq, irq_handler_t irq_handler, unsigned long irq_flags, struct scsi_host_template *sht);extern void ata_host_detach (struct ata_host *host); -extern void ata_host_init (struct ata_host *,struct device *,struct ata_port_operations *); +extern void ata_host_init (struct ata_host *,struct device *, +struct ata_port_operations *);extern int ata_scsi_detect (struct scsi_host_template *sht);extern int ata_scsi_ioctl (struct scsi_device *dev,unsigned int cmd,void __user *arg);
@@ -1117,7 +1121,8 @@ extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, unsigned int cmd, void __user *arg);extern void ata_sas_port_destroy (struct ata_port *);extern struct ata_port *ata_sas_port_alloc (struct ata_host *, -struct ata_port_info *,struct Scsi_Host *); +struct ata_port_info *, +struct Scsi_Host *);extern void ata_sas_async_probe (struct ata_port *ap);extern int ata_sas_sync_probe (struct ata_port *ap);extern int ata_sas_port_init (struct ata_port *);
@@ -1188,12 +1193,17 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev);extern void ata_scsi_slave_destroy (struct scsi_device *sdev);extern int ata_scsi_change_queue_depth (struct scsi_device *sdev,int queue_depth); -extern int __ata_change_queue_depth (struct ata_port *ap,struct scsi_device *sdev, +extern int __ata_change_queue_depth (struct ata_port *ap, +struct scsi_device *sdev,int queue_depth);extern struct ata_device *ata_dev_pair (struct ata_device *adev); -extern int ata_do_set_mode (struct ata_link *link,struct ata_device **r_failed_dev); -extern void ata_scsi_port_error_handler (struct Scsi_Host *host,struct ata_port *ap); -extern void ata_scsi_cmd_error_handler (struct Scsi_Host *host,struct ata_port *ap,struct list_head *eh_q); +extern int ata_do_set_mode (struct ata_link *link, +struct ata_device **r_failed_dev); +extern void ata_scsi_port_error_handler (struct Scsi_Host *host, +struct ata_port *ap); +extern void ata_scsi_cmd_error_handler (struct Scsi_Host *host, +struct ata_port *ap, +struct list_head *eh_q);extern bool sata_lpm_ignore_phy_events (struct ata_link *link);extern int ata_cable_40wire (struct ata_port *ap);
@@ -1223,7 +1233,8 @@ struct pci_bits {unsigned long val; }; -extern int pci_test_config_bits (struct pci_dev *pdev,const struct pci_bits *bits); +extern int pci_test_config_bits (struct pci_dev *pdev, +const struct pci_bits *bits);extern void ata_pci_shutdown_one (struct pci_dev *pdev);extern void ata_pci_remove_one (struct pci_dev *pdev);
@@ -1497,7 +1508,7 @@ static inline bool ata_tag_valid(unsigned int tag)* Internal use only, iterate commands ignoring error handling and * status of 'qc'. */ -#define ata_qc_for_each_raw (ap, qc, tag) \ +#define ata_qc_for_each_raw (ap, qc, tag) \ __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, __ata_qc_from_tag)/*
Signature · 1 line
2.16.4
PATCH v3 3/40 libata-transport: Whitespace cleanup
In reply to Hannes Reinecke--- drivers/ata/libata-transport.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/ata/libata-transport.c +7 -7
@@ -163,7 +163,7 @@ static struct { { AC_ERR_INVALID, "InvalidArg" }, { AC_ERR_OTHER, "Unknown" }, { AC_ERR_NODEV_HINT, "NoDeviceHint" }, - { AC_ERR_NCQ, "NCQError" } + { AC_ERR_NCQ, "NCQError" } };ata_bitfield_name_match (err, ata_err_names)
@@ -327,7 +327,7 @@ int ata_tport_add(struct device *parent,*/ static int noop (int x) {return x; } -#define ata_link_show_linkspeed (field, format) \ +#define ata_link_show_linkspeed (field, format) \ static ssize_t \ show_ata_link_##field(struct device *dev, \ struct device_attribute *attr, char *buf) \
@@ -416,7 +416,7 @@ int ata_tlink_add(struct ata_link *link) dev->release = ata_tlink_release;if (ata_is_host_link (link))dev_set_name (dev,"link%d" , ap->print_id); -else +else dev_set_name (dev,"link%d.%d" , ap->print_id, link->pmp);transport_setup_device (dev);
@@ -484,7 +484,7 @@ show_ata_dev_##field(struct device *dev, \#define ata_dev_simple_attr (field, format_string, type) \ ata_dev_show_simple(field, format_string, (type)) \ -static DEVICE_ATTR(field, S_IRUGO, \ + static DEVICE_ATTR(field, S_IRUGO, \ show_ata_dev_##field, NULL)ata_dev_simple_attr (spdn_cnt,"%d\n" , int);
@@ -502,7 +502,7 @@ static int ata_show_ering(struct ata_ering_entry *ent, void *void_arg) seconds =div_u64_rem (ent->timestamp,HZ , &rem); arg->written +=sprintf (arg->buf + arg->written, -"[%5llu.%09lu]" , seconds, +"[%5llu.%09lu]" , seconds, rem *NSEC_PER_SEC /HZ ); arg->written +=get_ata_err_names (ent->err_mask, arg->buf + arg->written);
@@ -667,7 +667,7 @@ static int ata_tdev_add(struct ata_device *ata_dev) dev->release = ata_tdev_release;if (ata_is_host_link (link))dev_set_name (dev,"dev%d.%d" , ap->print_id,ata_dev->devno); -else +else dev_set_name (dev,"dev%d.%d.0" , ap->print_id, link->pmp);transport_setup_device (dev);
@@ -689,7 +689,7 @@ static int ata_tdev_add(struct ata_device *ata_dev)*/ #define SETUP_TEMPLATE (attrb, field, perm, test) \ - i->private_##attrb[count] = dev_attr_##field; \ + i->private_##attrb[count] = dev_attr_##field; \ i->private_##attrb[count].attr.mode = perm; \ i->attrb[count] = &i->private_##attrb[count]; \ if (test) \
Signature · 1 line
2.16.4
PATCH v3 4/40 libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
In reply to Hannes ReineckeUse standard dev_{dbg,info,notice,warn,err} macros instead of the hand-crafted printk helpers.
--- drivers/ata/ahci.c | 3 +-- drivers/ata/libata-acpi.c | 48 ++++++++++++++++++++----------------- drivers/ata/libata-core.c | 61 ----------------------------------------------- include/linux/libata.h | 48 +++++++++++++------------------------ 4 files changed, 43 insertions(+), 117 deletions(-)
drivers/ata/ahci.c +1 -2
@@ -798,8 +798,7 @@ static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class, (sstatus & 0xf) != 1)break ; -ata_link_printk (link,KERN_INFO ,"avn bounce port%d\n" , - port); +ata_link_info (link,"avn bounce port%d\n" , port);pci_read_config_word (pdev,0x92 , &val); val &= ~(1 << port);
drivers/ata/libata-acpi.c +26 -22
81 lines not on this page · raw message
drivers/ata/libata-core.c +0 -61
67 lines not on this page · raw message
include/linux/libata.h +16 -32
78 lines not on this page · raw message
Signature · 1 line
2.16.4
Re: [PATCH 04/40] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
Hi Hannes,
Quoted 5 lines · Hannes Reinecke
Use standard dev_{dbg,info,notice,warn,err} macros instead of the hand-crafted printk helpers.
Signed-off-by Hannes Reinecke <[email protected]>Reviewed-by Bartlomiej Zolnierkiewicz <[email protected]>
This is now commit ad9f23bd12e1d721 ("libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros") in linux-block/for-next.
This patch causes an intriguing change in boot messages, adding a space at the beginning of each printed line:
scsi host0: sata_rcar
-ata1: SATA max UDMA/133 irq 117
+ ata1: SATA max UDMA/133 irq 117
-ata1: link resume succeeded after 1 retries
+ link1: link resume succeeded after 1 retries
-ata1: SATA link down (SStatus 0 SControl 300)
+ link1: SATA link down (SStatus 0 SControl 300)
It turns out dev_driver_string(&link->tdev) returns an empty string, as its driver field is NULL, so __dev_printk() prints the empty string and the device name, separated by a space.
At first I thought this was a bug in rcar-sata, lacking some setup that was harmless before, but it turns out other drivers (e.g. pata-falcon) show the same issue:
scsi host0: pata_falcon
-ata1: PATA max PIO4 cmd 0xfff00000 ctl 0xfff00039
+ ata1: PATA max PIO4 cmd 0xfff00000 ctl 0xfff00039
-ata1.01: NODEV after polling detection
-ata1.00: ATA-2: Sarge m68k, , max PIO2
-ata1.00: 2118816 sectors, multi 0: LBA
-ata1.00: configured for PIO
+ dev1.0: ATA-2: Sarge m68k, , max PIO2
+ dev1.0: 2118816 sectors, multi 0: LBA
+ dev1.0: configured for PIO
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 04/40] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
Quoted 38 lines · Geert Uytterhoeven
Hi Hannes,
Quoted 5 lines · Hannes Reinecke
Use standard dev_{dbg,info,notice,warn,err} macros instead of the hand-crafted printk helpers.
Signed-off-by Hannes Reinecke <[email protected]>Reviewed-by Bartlomiej Zolnierkiewicz <[email protected]>This is now commit
ad9f23bd12e1d721("libata: move ata_{port,link,dev}_dbg to standarddev_XXX()macros") in linux-block/for-next.This patch causes an intriguing change in boot messages, adding a space at the beginning of each printed line:
scsi host0:
sata_rcar
-ata1: SATA max UDMA/133 irq 117
+ ata1: SATA max UDMA/133 irq 117-ata1: link resume succeeded after 1 retries
+ link1: link resume succeeded after 1 retries-ata1: SATA link down (SStatus 0 SControl 300)
+ link1: SATA link down (SStatus 0 SControl 300)It turns out
dev_driver_string(&link->tdev)returns an empty string, as its driver field is NULL, so__dev_printk()prints the empty string and the device name, separated by a space.At first I thought this was a bug in rcar-sata, lacking some setup that was harmless before, but it turns out other drivers (e.g. pata-falcon) show the same issue:
scsi host0:
pata_falcon
-ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039
+ ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039
Quoted 7 lines
-ata1.01: NODEV after polling detection
-ata1.00: ATA-2: Sarge m68k, , max PIO2
-ata1.00: 2118816 sectors, multi 0: LBA
-ata1.00: configured for PIO
+ dev1.0: ATA-2: Sarge m68k, , max PIO2
+ dev1.0: 2118816 sectors, multi 0: LBA
+ dev1.0: configured for PIO
I'm more worried about change of ATA devices and ATA links names (unfortunately we cannot change the ones used in libata-transport.c as they are a part of ABI exposed through sysfs).
One way to improve the situation is to use transport classes names for dev_printk() when no other means are available, please see/try the patch below (compile tested only). It also includes fixup for extra space issue (change to __dev_printk()).
We should probably consider reverting the commit if the approach with using transport classes names is not feasible (we should not be confusing users with names like "dev1.0" instead of "ata1.00" etc., sorry for not catching this earlier).
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
--- drivers/ata/libata-transport.c | 3 +++ drivers/base/core.c | 14 +++++++++----- include/linux/device.h | 7 ++++++- 3 files changed, 18 insertions(+), 6 deletions(-)
drivers/ata/libata-transport.c +3 -0
@@ -289,6 +289,7 @@ int ata_tport_add(struct device *parent,ata_host_get (ap->host); dev->release = ata_tport_release;dev_set_name (dev,"ata%d" , ap->print_id); + dev->tclass = &ata_port_class;transport_setup_device (dev);ata_acpi_bind_port (ap); error =device_add (dev);
@@ -418,6 +419,7 @@ int ata_tlink_add(struct ata_link *link)dev_set_name (dev,"link%d" , ap->print_id); else dev_set_name(dev, "link%d.%d", ap->print_id, link->pmp); + dev->tclass = &ata_link_class;transport_setup_device (dev);
@@ -669,6 +671,7 @@ static int ata_tdev_add(struct ata_devicdev_set_name (dev,"dev%d.%d" , ap->print_id,ata_dev->devno); else dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp); + dev->tclass = &ata_dev_class;transport_setup_device (dev);ata_acpi_bind_dev (ata_dev);
drivers/base/core.c +9 -5
@@ -1225,7 +1225,8 @@ const char *dev_driver_string(const stru drv =READ_ONCE (dev->driver);return drv ? drv->name : (dev->bus ? dev->bus->name : - (dev->class ? dev->class->name :"" )); + (dev->class ? dev->class->name : + (dev->tclass ? (&dev->tclass->class)->name :"" ))); }EXPORT_SYMBOL (dev_driver_string);
@@ -3784,10 +3785,13 @@ EXPORT_SYMBOL(dev_printk_emit);static void __dev_printk (const char *level,const struct device *dev,struct va_format *vaf) { -if (dev) -dev_printk_emit (level[1 ] -'0' , dev,"%s %s: %pV" , -dev_driver_string (dev),dev_name (dev), vaf); -else +if (dev) { +const char *drv_str =dev_driver_string (dev); + +dev_printk_emit (level[1 ] -'0' , dev,"%s%s%s: %pV" , + drv_str,strcmp (drv_str,"" ) ?" " :"" , +dev_name (dev), vaf); + }else printk ("%s(NULL device *): %pV" , level, vaf); }
include/linux/device.h +6 -1
@@ -29,6 +29,7 @@#include <linux/device/bus.h> #include <linux/device/class.h> #include <linux/device/driver.h> +#include <linux/transport_class.h> #include <asm/device.h> struct device ;
@@ -608,7 +609,11 @@ struct device {spinlock_t devres_lock;struct list_head devres_head; -struct class *class; +union { +struct class *class; +struct transport_class *tclass; + }; +const struct attribute_group **groups;/* optional groups */ void (*release)(struct device *dev);
Re: [PATCH 04/40] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
Hi Bartl,
Quoted 45 lines · Bartlomiej Zolnierkiewicz
Quoted 36 lines · Geert Uytterhoeven
Quoted 5 lines · Hannes Reinecke
Use standard dev_{dbg,info,notice,warn,err} macros instead of the hand-crafted printk helpers.
Signed-off-by Hannes Reinecke <[email protected]>Reviewed-by Bartlomiej Zolnierkiewicz <[email protected]>This is now commit
ad9f23bd12e1d721("libata: move ata_{port,link,dev}_dbg to standarddev_XXX()macros") in linux-block/for-next.This patch causes an intriguing change in boot messages, adding a space at the beginning of each printed line:
scsi host0:
sata_rcar
-ata1: SATA max UDMA/133 irq 117
+ ata1: SATA max UDMA/133 irq 117-ata1: link resume succeeded after 1 retries
+ link1: link resume succeeded after 1 retries-ata1: SATA link down (SStatus 0 SControl 300)
+ link1: SATA link down (SStatus 0 SControl 300)It turns out
dev_driver_string(&link->tdev)returns an empty string, as its driver field is NULL, so__dev_printk()prints the empty string and the device name, separated by a space.At first I thought this was a bug in rcar-sata, lacking some setup that was harmless before, but it turns out other drivers (e.g. pata-falcon) show the same issue:
scsi host0:
pata_falcon
-ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039
+ ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039Quoted 7 lines
-ata1.01: NODEV after polling detection
-ata1.00: ATA-2: Sarge m68k, , max PIO2
-ata1.00: 2118816 sectors, multi 0: LBA
-ata1.00: configured for PIO
+ dev1.0: ATA-2: Sarge m68k, , max PIO2
+ dev1.0: 2118816 sectors, multi 0: LBA
+ dev1.0: configured for PIO
Quoted 3 lines
I'm more worried about change of ATA devices and ATA links names (unfortunately we cannot change the ones used in
libata-transport.cas they are a part of ABI exposed through sysfs).
True.
Quoted 4 lines
One way to improve the situation is to use transport classes names for
dev_printk()when no other means are available, please see/try the patch below (compile tested only). It also includes fixup for extra space issue (change to__dev_printk()).
Thanks for the suggestion!
drivers/base/core.c const char *dev_driver_string(const stru · line 1229
Quoted 9 lines
drivers/base/core.c +2
-1@@ -1225,7 +1225,8 @@ const char *dev_driver_string(const stru drv =READ_ONCE (dev->driver);return drv ? drv->name : (dev->bus ? dev->bus->name : - (dev->class ? dev->class->name :"" )); + (dev->class ? dev->class->name : + (dev->tclass ? (&dev->tclass->class)->name :"" )));
Aren't "dev->class->name" and "(&dev->tclass->class)->name" exactly the same, as the first member of struct transport_class is a struct class object?
(If they're not the same, and I need more coffee, I'm still afraid this is
too fragile. Then there is no guarantee the pointer points to a realtransport_class object, so this might cause a crash.)
drivers/ata/libata-transport.c int ata_tport_add(struct device *parent, · line 292
Quoted 7 lines
drivers/ata/libata-transport.c +1
-0@@ -289,6 +289,7 @@ int ata_tport_add(struct device *parent,ata_host_get (ap->host); dev->release = ata_tport_release;dev_set_name (dev,"ata%d" , ap->print_id); + dev->tclass = &ata_port_class;
Can't you just do dev->class = &ata_port_class.class...
drivers/ata/libata-transport.c int ata_tlink_add(struct ata_link *link) · line 422
Quoted 8 lines
drivers/ata/libata-transport.c +1
-0transport_setup_device (dev);ata_acpi_bind_port (ap); error =device_add (dev);@@ -418,6 +419,7 @@ int ata_tlink_add(struct ata_link *link)dev_set_name (dev,"link%d" , ap->print_id); else dev_set_name(dev, "link%d.%d", ap->print_id, link->pmp); + dev->tclass = &ata_link_class;
... and dev->class = &ata_link_class.class...
drivers/ata/libata-transport.c static int ata_tdev_add(struct ata_devic · line 674
Quoted 8 lines
drivers/ata/libata-transport.c +1
-0transport_setup_device (dev);@@ -669,6 +671,7 @@ static int ata_tdev_add(struct ata_devicdev_set_name (dev,"dev%d.%d" , ap->print_id,ata_dev->devno); else dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp); + dev->tclass = &ata_dev_class;
... and dev->class = &ata_dev_class.class...
Quoted 13 lines
include/linux/device.h +1
-0@@ -29,6 +29,7 @@#include <linux/device/bus.h> #include <linux/device/class.h> #include <linux/device/driver.h> +#include <linux/transport_class.h> #include <asm/device.h> struct device ;@@ -608,7 +609,11 @@ struct device {spinlock_t devres_lock;struct list_head devres_head;
include/linux/device.h struct device { · line 619
Quoted 10 lines
include/linux/device.h +5
-1-struct class *class; +union { +struct class *class; +struct transport_class *tclass; + }; +const struct attribute_group **groups;/* optional groups */ void (*release)(struct device *dev);
... and drop all changes to device.h?
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 04/40] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
Quoted 62 lines · Geert Uytterhoeven
Hi Bartl,
Quoted 45 lines · Bartlomiej Zolnierkiewicz
Quoted 36 lines · Geert Uytterhoeven
Quoted 5 lines · Hannes Reinecke
Use standard dev_{dbg,info,notice,warn,err} macros instead of the hand-crafted printk helpers.
Signed-off-by Hannes Reinecke <[email protected]>Reviewed-by Bartlomiej Zolnierkiewicz <[email protected]>This is now commit
ad9f23bd12e1d721("libata: move ata_{port,link,dev}_dbg to standarddev_XXX()macros") in linux-block/for-next.This patch causes an intriguing change in boot messages, adding a space at the beginning of each printed line:
scsi host0:
sata_rcar
-ata1: SATA max UDMA/133 irq 117
+ ata1: SATA max UDMA/133 irq 117-ata1: link resume succeeded after 1 retries
+ link1: link resume succeeded after 1 retries-ata1: SATA link down (SStatus 0 SControl 300)
+ link1: SATA link down (SStatus 0 SControl 300)It turns out
dev_driver_string(&link->tdev)returns an empty string, as its driver field is NULL, so__dev_printk()prints the empty string and the device name, separated by a space.At first I thought this was a bug in rcar-sata, lacking some setup that was harmless before, but it turns out other drivers (e.g. pata-falcon) show the same issue:
scsi host0:
pata_falcon
-ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039
+ ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039Quoted 7 lines
-ata1.01: NODEV after polling detection
-ata1.00: ATA-2: Sarge m68k, , max PIO2
-ata1.00: 2118816 sectors, multi 0: LBA
-ata1.00: configured for PIO
+ dev1.0: ATA-2: Sarge m68k, , max PIO2
+ dev1.0: 2118816 sectors, multi 0: LBA
+ dev1.0: configured for PIOQuoted 3 lines
I'm more worried about change of ATA devices and ATA links names (unfortunately we cannot change the ones used in
libata-transport.cas they are a part of ABI exposed through sysfs).True.
Quoted 4 lines
One way to improve the situation is to use transport classes names for
dev_printk()when no other means are available, please see/try the patch below (compile tested only). It also includes fixup for extra space issue (change to__dev_printk()).Thanks for the suggestion!
Quoted 13 lines
drivers/base/core.c const char *dev_driver_string(const stru · line 1229
Quoted 9 lines
drivers/base/core.c +2
-1@@ -1225,7 +1225,8 @@ const char *dev_driver_string(const stru drv =READ_ONCE (dev->driver);return drv ? drv->name : (dev->bus ? dev->bus->name : - (dev->class ? dev->class->name :"" )); + (dev->class ? dev->class->name : + (dev->tclass ? (&dev->tclass->class)->name :"" )));Aren't "
dev->class->name" and "(&dev->tclass->class)->name" exactly the same, as the first member of structtransport_classis a struct class object?
struct class is embedded in struct transport_class but it doesn't have to be the same class as pointed by dev->class (for ATA dev->class should be NULL).
Quoted 3 lines
(If they're not the same, and I need more coffee, I'm still afraid this is
too fragile. Then there is no guarantee the pointer points to a realtransport_classobject, so this might cause a crash.)
I see, we can't do unnamed union optimization in <linux/device.h> but otherwise it should be OK, no?
Quoted 54 lines
drivers/ata/libata-transport.c int ata_tport_add(struct device *parent, · line 292
Quoted 7 lines
drivers/ata/libata-transport.c +1
-0@@ -289,6 +289,7 @@ int ata_tport_add(struct device *parent,ata_host_get (ap->host); dev->release = ata_tport_release;dev_set_name (dev,"ata%d" , ap->print_id); + dev->tclass = &ata_port_class;Can't you just do
dev->class= &ata_port_class.class...drivers/ata/libata-transport.c int ata_tlink_add(struct ata_link *link) · line 422
Quoted 8 lines
drivers/ata/libata-transport.c +1
-0transport_setup_device (dev);ata_acpi_bind_port (ap); error =device_add (dev);@@ -418,6 +419,7 @@ int ata_tlink_add(struct ata_link *link)dev_set_name (dev,"link%d" , ap->print_id); else dev_set_name(dev, "link%d.%d", ap->print_id, link->pmp); + dev->tclass = &ata_link_class;... and
dev->class= &ata_link_class.class...drivers/ata/libata-transport.c static int ata_tdev_add(struct ata_devic · line 674
Quoted 8 lines
drivers/ata/libata-transport.c +1
-0transport_setup_device (dev);@@ -669,6 +671,7 @@ static int ata_tdev_add(struct ata_devicdev_set_name (dev,"dev%d.%d" , ap->print_id,ata_dev->devno); else dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp); + dev->tclass = &ata_dev_class;... and
dev->class= &ata_dev_class.class...Quoted 22 lines
include/linux/device.h +6
-1@@ -29,6 +29,7 @@#include <linux/device/bus.h> #include <linux/device/class.h> #include <linux/device/driver.h> +#include <linux/transport_class.h> #include <asm/device.h> struct device ;@@ -608,7 +609,11 @@ struct device {spinlock_t devres_lock;struct list_head devres_head; -struct class *class; +union { +struct class *class; +struct transport_class *tclass; + }; +const struct attribute_group **groups;/* optional groups */
Quoted 3 lines
include/linux/device.h struct device { · line 619
Quoted 1 line
include/linux/device.h +0
-0void (*release)(struct device *dev);... and drop all changes to
device.h?
That would have unintended consequences that we don't want (driver core code checks dev->class existence not only in dev_driver_string())..
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Re: [PATCH 04/40] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
Quoted 57 lines · Bartlomiej Zolnierkiewicz
Quoted 55 lines · Geert Uytterhoeven
Hi Bartl,
Quoted 45 lines · Bartlomiej Zolnierkiewicz
Quoted 36 lines · Geert Uytterhoeven
Quoted 5 lines · Hannes Reinecke
Use standard dev_{dbg,info,notice,warn,err} macros instead of the hand-crafted printk helpers.
Signed-off-by Hannes Reinecke <[email protected]>Reviewed-by Bartlomiej Zolnierkiewicz <[email protected]>This is now commit
ad9f23bd12e1d721("libata: move ata_{port,link,dev}_dbg to standarddev_XXX()macros") in linux-block/for-next.This patch causes an intriguing change in boot messages, adding a space at the beginning of each printed line:
scsi host0:
sata_rcar
-ata1: SATA max UDMA/133 irq 117
+ ata1: SATA max UDMA/133 irq 117-ata1: link resume succeeded after 1 retries
+ link1: link resume succeeded after 1 retries-ata1: SATA link down (SStatus 0 SControl 300)
+ link1: SATA link down (SStatus 0 SControl 300)It turns out
dev_driver_string(&link->tdev)returns an empty string, as its driver field is NULL, so__dev_printk()prints the empty string and the device name, separated by a space.At first I thought this was a bug in rcar-sata, lacking some setup that was harmless before, but it turns out other drivers (e.g. pata-falcon) show the same issue:
scsi host0:
pata_falcon
-ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039
+ ata1: PATA max PIO4 cmd0xfff00000ctl0xfff00039Quoted 7 lines
-ata1.01: NODEV after polling detection
-ata1.00: ATA-2: Sarge m68k, , max PIO2
-ata1.00: 2118816 sectors, multi 0: LBA
-ata1.00: configured for PIO
+ dev1.0: ATA-2: Sarge m68k, , max PIO2
+ dev1.0: 2118816 sectors, multi 0: LBA
+ dev1.0: configured for PIOQuoted 3 lines
I'm more worried about change of ATA devices and ATA links names (unfortunately we cannot change the ones used in
libata-transport.cas they are a part of ABI exposed through sysfs).True.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
One way to improve the situation is to use transport classes names for
dev_printk()when no other means are available, please see/try the patch below (compile tested only). It also includes fixup for extra space issue (change to__dev_printk()).Thanks for the suggestion!
Well, the space can (should?) be fixed with a simple patch to __dev_printk() but just checking if 'dev_driver_string()' returns a value or not:
drivers/base/core.c +9 -4
@@ -3635,10 +3635,15 @@ EXPORT_SYMBOL(dev_printk_emit);static void __dev_printk (const char *level,const struct device *dev,struct va_format *vaf) { -if (dev) -dev_printk_emit (level[1 ] -'0' , dev,"%s %s: %pV" , -dev_driver_string (dev),dev_name (dev), vaf); -else +if (dev) { +if (dev_string_string (dev)) +dev_printk_emit (level[1 ] -'0' , dev,"%s %s: %pV" , +dev_driver_string (dev),dev_name (dev), + vaf); +else +dev_printk_emit (level[1 ] -'0' , dev,"%s: %pV" , +dev_name (dev), vaf); + }else printk ("%s(NULL device *): %pV" , level, vaf); }
which actually makes sense on its own.
As for the name change, yes, I'm not that happy with it, either.
I'll see if we can do some transport class magic such that the names do not change.
(And no-one is to mention 'cake' and 'eat it' ...)
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
PATCH v3 5/40 libata: move __func__ into ata_{port,link,dev}_dbg() helper
In reply to Hannes ReineckeMove the __func__ argument into the ata_{port,link,dev}_dbg() helper and drop the explicit argument from the caller.
--- drivers/ata/libata-acpi.c | 14 ++++++-------- drivers/ata/libata-core.c | 9 ++++----- drivers/ata/libata-sff.c | 2 +- include/linux/libata.h | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-)
drivers/ata/libata-acpi.c +6 -8
@@ -419,8 +419,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) output.pointer =NULL ;/* ACPI-CA sets this; save/free it later */ if (ata_msg_probe (ap)) -ata_dev_dbg (dev,"%s: ENTER: port#: %d\n" , - __func__, ap->port_no); +ata_dev_dbg (dev,"ENTER: port#: %d\n" , ap->port_no);/* _GTF has no input parameters */ status = acpi_evaluate_object(ata_dev_acpi_handle(dev), "_GTF", NULL,
@@ -438,8 +437,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)if (!output.length || !output.pointer) {if (ata_msg_probe (ap)) -ata_dev_dbg (dev,"%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n" , - __func__, +ata_dev_dbg (dev,"Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n" , (unsigned long long )output.length, output.pointer); rc = -EINVAL ;
@@ -465,8 +463,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)if (gtf) { *gtf = (void *)out_obj->buffer.pointer;if (ata_msg_probe (ap)) -ata_dev_dbg (dev,"%s: returning gtf=%p, gtf_count=%d\n" , - __func__, *gtf, rc); +ata_dev_dbg (dev,"returning gtf=%p, gtf_count=%d\n" , + *gtf, rc); }return rc;
@@ -780,8 +778,8 @@ static int ata_acpi_push_id(struct ata_device *dev)union acpi_object in_params[1 ];if (ata_msg_probe (ap)) -ata_dev_dbg (dev,"%s: ix = %d, port#: %d\n" , - __func__, dev->devno, ap->port_no); +ata_dev_dbg (dev,"ix = %d, port#: %d\n" , + dev->devno, ap->port_no);/* Give the drive Identify data to the drive via the _SDD method */ /* _SDD: set up input parameters */
drivers/ata/libata-core.c +4 -5
@@ -1846,7 +1846,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,int rc;if (ata_msg_ctl (ap)) -ata_dev_dbg (dev,"%s: ENTER\n" , __func__); +ata_dev_dbg (dev,"ENTER\n" ); retry:ata_tf_init (dev, &tf);
@@ -2447,7 +2447,7 @@ int ata_dev_configure(struct ata_device *dev) }if (ata_msg_probe (ap)) -ata_dev_dbg (dev,"%s: ENTER\n" , __func__); +ata_dev_dbg (dev,"ENTER\n" );/* set horkage */ dev->horkage |=ata_dev_blacklisted (dev);
@@ -2498,9 +2498,8 @@ int ata_dev_configure(struct ata_device *dev)/* print device capabilities */ if (ata_msg_probe (ap))ata_dev_dbg (dev, -"%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x " +"cfg 49:%04x 82:%04x 83:%04x 84:%04x " "85:%04x 86:%04x 87:%04x 88:%04x\n" , - __func__, id[49 ], id[82 ], id[83 ], id[84 ], id[85 ], id[86 ], id[87 ], id[88 ]);
@@ -2767,7 +2766,7 @@ int ata_dev_configure(struct ata_device *dev) err_out_nosup:if (ata_msg_probe (ap)) -ata_dev_dbg (dev,"%s: EXIT, err\n" , __func__); +ata_dev_dbg (dev,"EXIT, err\n" );return rc; }
drivers/ata/libata-sff.c +1 -1
@@ -1266,7 +1266,7 @@ void ata_sff_flush_pio_task(struct ata_port *ap) ap->sff_pio_task_link =NULL ;if (ata_msg_ctl (ap)) -ata_port_dbg (ap,"%s: EXIT\n" , __func__); +ata_port_dbg (ap,"EXIT\n" ); }static void ata_sff_pio_task (struct work_struct *work)
include/linux/libata.h +3 -3
@@ -1424,7 +1424,7 @@ static inline int sata_srst_pmp(struct ata_link *link)#define ata_port_info (ap, fmt, ...) \ dev_info(&ap->tdev, fmt, ##__VA_ARGS__)#define ata_port_dbg (ap, fmt, ...) \ - dev_dbg(&ap->tdev, fmt, ##__VA_ARGS__) + dev_dbg(&ap->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)#define ata_link_err (link, fmt, ...) \ dev_err(&link->tdev, fmt, ##__VA_ARGS__)
@@ -1435,7 +1435,7 @@ static inline int sata_srst_pmp(struct ata_link *link)#define ata_link_info (link, fmt, ...) \ dev_info(&link->tdev, fmt, ##__VA_ARGS__)#define ata_link_dbg (link, fmt, ...) \ - dev_dbg(&link->tdev, fmt, ##__VA_ARGS__) + dev_dbg(&link->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)#define ata_dev_err (dev, fmt, ...) \ dev_err(&dev->tdev, fmt, ##__VA_ARGS__)
@@ -1446,7 +1446,7 @@ static inline int sata_srst_pmp(struct ata_link *link)#define ata_dev_info (dev, fmt, ...) \ dev_info(&dev->tdev, fmt, ##__VA_ARGS__)#define ata_dev_dbg (dev, fmt, ...) \ - dev_dbg(&dev->tdev, fmt, ##__VA_ARGS__) + dev_dbg(&dev->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)void ata_print_version (const struct device *dev,const char *version);
Signature · 1 line
2.16.4
PATCH v3 6/40 libata: remove pointless debugging messages
In reply to Hannes ReineckeDebugging messages in pci init functions or sg setup are pretty much pointless, as the workflow pretty much decides what happened. So drop them.
--- drivers/ata/acard-ahci.c | 4 ---- drivers/ata/ahci.c | 2 -- drivers/ata/libahci.c | 3 --- drivers/ata/libata-core.c | 6 ------ drivers/ata/libata-sff.c | 2 -- drivers/ata/sata_nv.c | 4 ---- 6 files changed, 21 deletions(-)
drivers/ata/acard-ahci.c +0 -4
@@ -185,8 +185,6 @@ static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl)struct acard_sg *acard_sg = cmd_tbl +AHCI_CMD_TBL_HDR_SZ ;unsigned int si, last_si =0 ; -VPRINTK ("ENTER\n" ); -/* * Next, the S/G list. */
@@ -362,8 +360,6 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_idstruct ata_host *host;int n_ports, i, rc; -VPRINTK ("ENTER\n" ); -WARN_ON ((int )ATA_MAX_QUEUE >AHCI_MAX_CMDS );ata_print_version_once (&pdev->dev,DRV_VERSION );
drivers/ata/ahci.c +0 -2
@@ -1645,8 +1645,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)int n_ports, i, rc;int ahci_pci_bar =AHCI_PCI_BAR_STANDARD ; -VPRINTK ("ENTER\n" ); -WARN_ON ((int )ATA_MAX_QUEUE >AHCI_MAX_CMDS );ata_print_version_once (&pdev->dev,DRV_VERSION );
drivers/ata/libahci.c +0 -3
@@ -1596,8 +1596,6 @@ static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl)struct ahci_sg *ahci_sg = cmd_tbl +AHCI_CMD_TBL_HDR_SZ ;unsigned int si; -VPRINTK ("ENTER\n" ); -/* * Next, the S/G list. */
@@ -1671,7 +1669,6 @@ static void ahci_fbs_dec_intr(struct ata_port *ap)u32 fbs =readl (port_mmio +PORT_FBS );int retries =3 ; -DPRINTK ("ENTER\n" );BUG_ON (!pp->fbs_enabled);/* time to wait for DEC is not specified by AHCI spec,
drivers/ata/libata-core.c +0 -6
@@ -5051,8 +5051,6 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)struct ata_port *ap = qc->ap;unsigned int n_elem; -VPRINTK ("ENTER, ata%u\n" , ap->print_id); - n_elem =dma_map_sg (ap->dev, qc->sg, qc->n_elem, qc->dma_dir);if (n_elem <1 )return -1 ;
@@ -6015,8 +6013,6 @@ struct ata_port *ata_port_alloc(struct ata_host *host) {struct ata_port *ap; -DPRINTK ("ENTER\n" ); - ap =kzalloc (sizeof (*ap),GFP_KERNEL );if (!ap)return NULL ;
@@ -6132,8 +6128,6 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)int i;void *dr; -DPRINTK ("ENTER\n" ); -/* alloc a container for our list of ATA ports (buses) */ sz =sizeof (struct ata_host ) + (max_ports +1 ) *sizeof (void *); host =kzalloc (sz,GFP_KERNEL );
drivers/ata/libata-sff.c +0 -2
@@ -2452,8 +2452,6 @@ static int ata_pci_init_one(struct pci_dev *pdev,struct ata_host *host =NULL ;int rc; -DPRINTK ("ENTER\n" ); - pi =ata_sff_find_valid_pi (ppi);if (!pi) {dev_err (&pdev->dev,"no valid port_info specified\n" );
drivers/ata/sata_nv.c +0 -4
@@ -1271,8 +1271,6 @@ static int nv_adma_host_init(struct ata_host *host)unsigned int i;u32 tmp32; -VPRINTK ("ENTER\n" ); -/* enable ADMA on the ports */ pci_read_config_dword (pdev,NV_MCP_SATA_CFG_20 , &tmp32); tmp32 |= NV_MCP_SATA_CFG_20_PORT0_EN |
@@ -1314,8 +1312,6 @@ static void nv_adma_fill_sg(struct ata_queued_cmd *qc, struct nv_adma_cpb *cpb)struct scatterlist *sg;unsigned int si; -VPRINTK ("ENTER\n" ); -for_each_sg (qc->sg, sg, qc->n_elem, si) { aprd = (si <5 ) ? &cpb->aprd[si] : &pp->aprd[NV_ADMA_SGTBL_LEN * qc->hw_tag + (si-5 )];
Signature · 1 line
2.16.4
PATCH v3 7/40 ata_piix: remove debugging messages
In reply to Hannes ReineckeDrop pointless debugging message for PCI setup.
--- drivers/ata/ata_piix.c | 3 --- 1 file changed, 3 deletions(-)
drivers/ata/ata_piix.c +0 -3
@@ -1343,7 +1343,6 @@ static void piix_init_pcs(struct ata_host *host, new_pcs = pcs | map_db->port_enable;if (new_pcs != pcs) { -DPRINTK ("updating PCS from 0x%x to 0x%x\n" , pcs, new_pcs);pci_write_config_word (pdev,ICH5_PCS , new_pcs);msleep (150 ); }
@@ -1767,14 +1766,12 @@ static int __init piix_init(void) {int rc; -DPRINTK ("pci_register_driver\n" ); rc =pci_register_driver (&piix_pci_driver);if (rc)return rc; in_module_init =0 ; -DPRINTK ("done\n" );return 0 ; }
Signature · 1 line
2.16.4
PATCH v3 8/40 libata-core: remove pointless debugging messages
In reply to Hannes ReineckeThe bus probe is better tracked with the actual calls, and the resulting taskfile will be printed with tracepoints anyway.
--- drivers/ata/libata-core.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/ata/libata-core.c +0 -5
@@ -825,9 +825,6 @@ int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, head = track % dev->heads; sect = (u32 )block % dev->sectors +1 ; -DPRINTK ("block %u track %u cyl %u head %u sect %u\n" , - (u32 )block, track, cyl, head, sect); -/* Check whether the converted CHS can fit. Cylinder: 0-65535 Head: 0-15
@@ -6475,9 +6472,7 @@ int ata_port_probe(struct ata_port *ap)__ata_port_probe (ap);ata_port_wait_eh (ap); }else { -DPRINTK ("ata%u: bus probe begin\n" , ap->print_id); rc =ata_bus_probe (ap); -DPRINTK ("ata%u: bus probe end\n" , ap->print_id); }return rc; }
Signature · 1 line
2.16.4
PATCH v3 9/40 libata: Add ata_port_classify() helper
In reply to Hannes ReineckeAdd an ata_port_classify() helper to print out the results from the device classification and remove the debugging statements from ata_dev_classify(). Also provide a mapping ata_dev_class_string() to provide a string representation for those instances calling ata_dev_classify() directly.
--- drivers/ata/libahci.c | 2 +- drivers/ata/libata-core.c | 67 ++++++++++++++++++++++++++++++++++----------- drivers/ata/libata-sff.c | 5 ++++ drivers/ata/sata_fsl.c | 2 +- drivers/ata/sata_inic162x.c | 2 +- drivers/ata/sata_sil24.c | 2 +- include/linux/libata.h | 3 ++ 7 files changed, 63 insertions(+), 20 deletions(-)
drivers/ata/libahci.c +1 -1
@@ -1276,7 +1276,7 @@ unsigned int ahci_dev_classify(struct ata_port *ap) tf.lbal = (tmp >>8 ) &0xff ; tf.nsect = (tmp) &0xff ; -return ata_dev_classify (&tf); +return ata_port_classify (ap, &tf); }EXPORT_SYMBOL_GPL (ahci_dev_classify);
drivers/ata/libata-core.c +51 -16
98 lines not on this page · raw message
drivers/ata/libata-sff.c +5 -0
@@ -1839,6 +1839,11 @@ unsigned int ata_sff_dev_classify(struct ata_device *dev, int present,/* determine if device is ATA or ATAPI */ class =ata_dev_classify (&tf); +if (class !=ATA_DEV_UNKNOWN ) +ata_dev_dbg (dev,"found %s device by sig\n" , +ata_dev_class_string (class)); +else +ata_dev_dbg (dev,"found unknown device\n" );if (class ==ATA_DEV_UNKNOWN ) {/* If the device failed diagnostic, it's likely to
drivers/ata/sata_fsl.c +1 -1
@@ -812,7 +812,7 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap) tf.lbal = (temp >>8 ) &0xff ; tf.nsect = temp &0xff ; -return ata_dev_classify (&tf); +return ata_port_classify (ap, &tf); } static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
drivers/ata/sata_inic162x.c +1 -1
@@ -657,7 +657,7 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class, }inic_tf_read (ap, &tf); - *class =ata_dev_classify (&tf); + *class =ata_port_classify (ap, &tf); }return 0 ;
drivers/ata/sata_sil24.c +1 -1
@@ -677,7 +677,7 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class, }sil24_read_tf (ap,0 , &tf); - *class =ata_dev_classify (&tf); + *class =ata_port_classify (ap, &tf);DPRINTK ("EXIT, class=%u\n" , *class);return 0 ;
include/linux/libata.h +3 -0
@@ -1173,7 +1173,10 @@ extern int ata_std_qc_defer(struct ata_queued_cmd *qc);extern enum ata_completion_errors ata_noop_qc_prep (struct ata_queued_cmd *qc);extern void ata_sg_init (struct ata_queued_cmd *qc,struct scatterlist *sg,unsigned int n_elem); +extern const char *ata_dev_class_string (unsigned int class);extern unsigned int ata_dev_classify (const struct ata_taskfile *tf); +extern unsigned int ata_port_classify (struct ata_port *ap, +const struct ata_taskfile *tf);extern void ata_dev_disable (struct ata_device *adev);extern void ata_id_string (const u16 *id,unsigned char *s,unsigned int ofs,unsigned int len);
Signature · 1 line
2.16.4
PATCH v3 10/40 libata: move ata_dump_id() to dynamic debugging
In reply to Hannes ReineckeUse ata_dev_dbg() to print out the information in ata_dump_id() and remove the ata_msg_probe() conditional.
--- drivers/ata/libata-core.c | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-)
drivers/ata/libata-core.c +10 -28
@@ -1440,6 +1440,7 @@ static int ata_hpa_resize(struct ata_device *dev)/** * ata_dump_id - IDENTIFY DEVICE info debugging output +* @dev: device from which the information is fetched * @id: IDENTIFY DEVICE page to dump * * Dump selected 16-bit words from the given IDENTIFY DEVICE
@@ -1449,32 +1450,14 @@ static int ata_hpa_resize(struct ata_device *dev)* caller. */ -static inline void ata_dump_id (const u16 *id) -{ -DPRINTK ("49==0x%04x " -"53==0x%04x " -"63==0x%04x " -"64==0x%04x " -"75==0x%04x \n" , - id[49 ], - id[53 ], - id[63 ], - id[64 ], - id[75 ]); -DPRINTK ("80==0x%04x " -"81==0x%04x " -"82==0x%04x " -"83==0x%04x " -"84==0x%04x \n" , - id[80 ], - id[81 ], - id[82 ], - id[83 ], - id[84 ]); -DPRINTK ("88==0x%04x " -"93==0x%04x\n" , - id[88 ], - id[93 ]); +static inline void ata_dump_id (struct ata_device *dev,const u16 *id) +{ +ata_dev_dbg (dev, +"49==0x%04x 53==0x%04x 63==0x%04x 64==0x%04x 75==0x%04x\n" +"80==0x%04x 81==0x%04x 82==0x%04x 83==0x%04x 84==0x%04x\n" +"88==0x%04x 93==0x%04x\n" , + id[49 ], id[53 ], id[63 ], id[64 ], id[75 ], id[80 ], + id[81 ], id[82 ], id[83 ], id[84 ], id[88 ], id[93 ]); }/**
@@ -2551,8 +2534,7 @@ int ata_dev_configure(struct ata_device *dev)/* find max transfer mode; for printk only */ xfer_mask =ata_id_xfermask (id); -if (ata_msg_probe (ap)) -ata_dump_id (id); +ata_dump_id (dev, id);/* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,
Signature · 1 line
2.16.4
PATCH v3 11/40 libata: sanitize ATA_HORKAGE_DUMP_ID
In reply to Hannes ReineckeAs ata_dev_dbg() is now using dynamic debugging ATA_HORKAGE_DUMP_ID will now print out the raw IDENTIFY data without a header unless explicitly enable via dyndebug.
So move the logging level up to INFO and have the header printed always.
--- drivers/ata/libata-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-core.c +2 -2
@@ -1944,10 +1944,10 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, }if (dev->horkage &ATA_HORKAGE_DUMP_ID ) { -ata_dev_dbg (dev,"dumping IDENTIFY data, " +ata_dev_info (dev,"dumping IDENTIFY data, " "class=%d may_fallback=%d tried_spinup=%d\n" , class, may_fallback, tried_spinup); -print_hex_dump (KERN_DEBUG ,"" ,DUMP_PREFIX_OFFSET , +print_hex_dump (KERN_INFO ,"" ,DUMP_PREFIX_OFFSET ,16 ,2 , id,ATA_ID_WORDS *sizeof (*id), true); }
Signature · 1 line
2.16.4
PATCH v3 12/40 sata_mv: replace DPRINTK with 'pci_dump' module parameter
In reply to Hannes ReineckeImplement module parameter 'pci_dump' and move the DPRINTK calls over to dev_printk().
--- drivers/ata/sata_mv.c | 88 ++++++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 39 deletions(-)
drivers/ata/sata_mv.c +49 -39
@@ -83,6 +83,10 @@ module_param(irq_coalescing_usecs, int, S_IRUGO);MODULE_PARM_DESC (irq_coalescing_usecs,"IRQ coalescing time threshold in usecs" ); +static int pci_dump; +module_param (pci_dump, int,S_IRUGO ); +MODULE_PARM_DESC (pci_dump,"Enable dumping of PCI registers on error" ); +enum {/* BAR's are enumerated in terms of pci_resource_start() terms */ MV_PRIMARY_BAR =0 ,/* offset 0x10: memory space */
@@ -1245,42 +1249,43 @@ static int mv_stop_edma(struct ata_port *ap)return err; } -#ifdef ATA_DEBUG -static void mv_dump_mem (void __iomem *start,unsigned bytes) +static void mv_dump_mem (struct device *dev,void __iomem *start,unsigned bytes) { -int b, w; +int b, w, o; +unsigned char linebuf[38 ]; +for (b =0 ; b < bytes; ) { -DPRINTK ("%p: " , start + b); -for (w =0 ; b < bytes && w <4 ; w++) { -printk ("%08x " ,readl (start + b)); +for (w =0 , o =0 ; b < bytes && w <4 ; w++) { + o +=snprintf (linebuf + o,38 - o, +"%08x " ,readl (start + b)); b +=sizeof (u32); } -printk ("\n" ); +dev_printk (KERN_DEBUG , dev,"%s: %p: %s\n" , + __func__, start + b, linebuf); } } -#endif -#if defined(ATA_DEBUG ) || defined(CONFIG_PCI ) +static void mv_dump_pci_cfg (struct pci_dev *pdev,unsigned bytes) { -#ifdef ATA_DEBUG -int b, w; +int b, w, o;u32 dw; +unsigned char linebuf[38 ]; +for (b =0 ; b < bytes; ) { -DPRINTK ("%02x: " , b); -for (w =0 ; b < bytes && w <4 ; w++) { +for (w =0 , o =0 ; b < bytes && w <4 ; w++) { (void )pci_read_config_dword (pdev, b, &dw); -printk ("%08x " , dw); + o +=snprintf (linebuf + o,38 - o, +"%08x " , dw); b +=sizeof (u32); } -printk ("\n" ); +dev_printk (KERN_DEBUG , &pdev->dev,"%s: %02x: %s\n" , + __func__, b, linebuf); } -#endif } -#endif +static void mv_dump_all_regs (void __iomem *mmio_base,int port,struct pci_dev *pdev) { -#ifdef ATA_DEBUG void __iomem *hc_base =mv_hc_base (mmio_base, port >>MV_PORT_HC_SHIFT );void __iomem *port_base;
@@ -1295,31 +1300,34 @@ static void mv_dump_all_regs(void __iomem *mmio_base, int port, start_port = port; num_ports = num_hcs =1 ; } -DPRINTK ("All registers for port(s) %u-%u:\n" , start_port, - num_ports >1 ? num_ports -1 : start_port); +dev_printk (KERN_DEBUG , &pdev->dev, +"%s: All registers for port(s) %u-%u:\n" , __func__, + start_port, num_ports >1 ? num_ports -1 : start_port); -if (NULL != pdev) { -DPRINTK ("PCI config space regs:\n" ); -mv_dump_pci_cfg (pdev,0x68 ); - } -DPRINTK ("PCI regs:\n" ); -mv_dump_mem (mmio_base+0xc00 ,0x3c ); -mv_dump_mem (mmio_base+0xd00 ,0x34 ); -mv_dump_mem (mmio_base+0xf00 ,0x4 ); -mv_dump_mem (mmio_base+0x1d00 ,0x6c ); +dev_printk (KERN_DEBUG , &pdev->dev, +"%s: PCI config space regs:\n" , __func__); +mv_dump_pci_cfg (pdev,0x68 ); + +dev_printk (KERN_DEBUG , &pdev->dev,"%s: PCI regs:\n" , __func__); +mv_dump_mem (&pdev->dev, mmio_base+0xc00 ,0x3c ); +mv_dump_mem (&pdev->dev, mmio_base+0xd00 ,0x34 ); +mv_dump_mem (&pdev->dev, mmio_base+0xf00 ,0x4 ); +mv_dump_mem (&pdev->dev, mmio_base+0x1d00 ,0x6c );for (hc = start_hc; hc < start_hc + num_hcs; hc++) { hc_base =mv_hc_base (mmio_base, hc); -DPRINTK ("HC regs (HC %i):\n" , hc); -mv_dump_mem (hc_base,0x1c ); +dev_printk (KERN_DEBUG , &pdev->dev,"%s: HC regs (HC %i):\n" , + __func__, hc); +mv_dump_mem (&pdev->dev, hc_base,0x1c ); }for (p = start_port; p < start_port + num_ports; p++) { port_base =mv_port_base (mmio_base, p); -DPRINTK ("EDMA regs (port %i):\n" , p); -mv_dump_mem (port_base,0x54 ); -DPRINTK ("SATA regs (port %i):\n" , p); -mv_dump_mem (port_base+0x300 ,0x60 ); +dev_printk (KERN_DEBUG , &pdev->dev,"%s: EDMA regs (port %i):\n" , + __func__, p); +mv_dump_mem (&pdev->dev, port_base,0x54 ); +dev_printk (KERN_DEBUG , &pdev->dev,"%s: SATA regs (port %i):\n" , + __func__, p); +mv_dump_mem (&pdev->dev, port_base+0x300 ,0x60 ); } -#endif }static unsigned int mv_scr_offset (unsigned int sc_reg_in)
@@ -2958,9 +2966,11 @@ static int mv_pci_error(struct ata_host *host, void __iomem *mmio)dev_err (host->dev,"PCI ERROR; PCI IRQ cause=0x%08x\n" , err_cause); -DPRINTK ("All regs @ PCI error\n" ); -mv_dump_all_regs (mmio,-1 ,to_pci_dev (host->dev)); - +if (pci_dump) { +dev_printk (KERN_DEBUG , host->dev,"%s: All regs @ PCI error\n" , + __func__); +mv_dump_all_regs (mmio,-1 ,to_pci_dev (host->dev)); + }writelfl (0 , mmio + hpriv->irq_cause_offset);for (i =0 ; i < host->n_ports; i++) {
Signature · 1 line
2.16.4
PATCH v3 13/40 sata_mv: kill 'port' argument in mv_dump_all_regs()
In reply to Hannes ReineckeAlways '-1', so drop it and simplify the function.
--- drivers/ata/sata_mv.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
drivers/ata/sata_mv.c +7 -17
@@ -1283,23 +1283,13 @@ static void mv_dump_pci_cfg(struct pci_dev *pdev, unsigned bytes) } } -static void mv_dump_all_regs (void __iomem *mmio_base,int port, -struct pci_dev *pdev) +static void mv_dump_all_regs (void __iomem *mmio_base,struct pci_dev *pdev) { -void __iomem *hc_base =mv_hc_base (mmio_base, - port >>MV_PORT_HC_SHIFT ); -void __iomem *port_base;int start_port, num_ports, p, start_hc, num_hcs, hc; -if (0 > port) { - start_hc = start_port =0 ; - num_ports =8 ;/* shld be benign for 4 port devs */ - num_hcs =2 ; - }else { - start_hc = port >>MV_PORT_HC_SHIFT ; - start_port = port; - num_ports = num_hcs =1 ; - } + start_hc = start_port =0 ; + num_ports =8 ;/* shld be benign for 4 port devs */ + num_hcs =2 ;dev_printk (KERN_DEBUG , &pdev->dev,"%s: All registers for port(s) %u-%u:\n" , __func__, start_port, num_ports >1 ? num_ports -1 : start_port);
@@ -1314,13 +1304,13 @@ static void mv_dump_all_regs(void __iomem *mmio_base, int port,mv_dump_mem (&pdev->dev, mmio_base+0xf00 ,0x4 );mv_dump_mem (&pdev->dev, mmio_base+0x1d00 ,0x6c );for (hc = start_hc; hc < start_hc + num_hcs; hc++) { - hc_base =mv_hc_base (mmio_base, hc); +void __iomem *hc_base =mv_hc_base (mmio_base, hc);dev_printk (KERN_DEBUG , &pdev->dev,"%s: HC regs (HC %i):\n" , __func__, hc);mv_dump_mem (&pdev->dev, hc_base,0x1c ); }for (p = start_port; p < start_port + num_ports; p++) { - port_base =mv_port_base (mmio_base, p); +void __iomem *port_base =mv_port_base (mmio_base, p);dev_printk (KERN_DEBUG , &pdev->dev,"%s: EDMA regs (port %i):\n" , __func__, p);mv_dump_mem (&pdev->dev, port_base,0x54 );
@@ -2969,7 +2959,7 @@ static int mv_pci_error(struct ata_host *host, void __iomem *mmio)if (pci_dump) {dev_printk (KERN_DEBUG , host->dev,"%s: All regs @ PCI error\n" , __func__); -mv_dump_all_regs (mmio,-1 ,to_pci_dev (host->dev)); +mv_dump_all_regs (mmio,to_pci_dev (host->dev)); }writelfl (0 , mmio + hpriv->irq_cause_offset);
Signature · 1 line
2.16.4
PATCH v3 14/40 sata_sx4: move DPRINTK to VPRINTK
In reply to Hannes ReineckeAll other logging instances in this functions are with VPRINTK, so follow suit.
--- drivers/ata/sata_sx4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/sata_sx4.c +1 -1
@@ -755,7 +755,7 @@ static inline unsigned int pdc20621_host_intr(struct ata_port *ap, }else if (qc->tf.protocol ==ATA_PROT_NODATA ) { status =ata_sff_busy_wait (ap,ATA_BUSY |ATA_DRQ ,1000 ); -DPRINTK ("BUS_NODATA (drv_stat 0x%X)\n" , status); +VPRINTK ("BUS_NODATA (drv_stat 0x%X)\n" , status); qc->err_mask |=ac_err_mask (status);ata_qc_complete (qc); handled =1 ;
Signature · 1 line
2.16.4
PATCH v3 15/40 libata: add reset tracepoints
In reply to Hannes ReineckeTo follow the flow of control we should be using tracepoints, as they will tie in with the actual I/O flow and deliver a better overview about what it happening.
This patch adds tracepoints for hard reset, soft reset, and postreset and adds them in the libata-eh control flow.
--- drivers/ata/libata-eh.c | 21 ++++++++-- include/trace/events/libata.h | 96 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 3 deletions(-)
drivers/ata/libata-eh.c +18 -3
@@ -2787,12 +2787,19 @@ int ata_eh_reset(struct ata_link *link, int classify,/* mark that this EH session started with reset */ ehc->last_reset = jiffies; -if (reset == hardreset) +if (reset == hardreset) { ehc->i.flags |=ATA_EHI_DID_HARDRESET ; -else +trace_ata_link_hardreset_begin (link, classes, deadline); + }else { ehc->i.flags |=ATA_EHI_DID_SOFTRESET ; +trace_ata_link_softreset_begin (link, classes, deadline); + } rc =ata_do_reset (link, reset, classes, deadline, true); +if (reset == hardreset) +trace_ata_link_hardreset_end (link, classes, rc); +else +trace_ata_link_softreset_end (link, classes, rc);if (rc && rc != -EAGAIN ) { failed_link = link; goto fail;
@@ -2806,8 +2813,11 @@ int ata_eh_reset(struct ata_link *link, int classify,ata_link_info (slave,"hard resetting link\n" );ata_eh_about_to_do (slave,NULL ,ATA_EH_RESET ); +trace_ata_slave_hardreset_begin (slave, classes, + deadline); tmp =ata_do_reset (slave, reset, classes, deadline, false); +trace_ata_slave_hardreset_end (slave, classes, tmp);switch (tmp) {case -EAGAIN : rc = -EAGAIN ;
@@ -2834,7 +2844,9 @@ int ata_eh_reset(struct ata_link *link, int classify, }ata_eh_about_to_do (link,NULL ,ATA_EH_RESET ); +trace_ata_link_softreset_begin (link, classes, deadline); rc =ata_do_reset (link, reset, classes, deadline, true); +trace_ata_link_softreset_end (link, classes, rc);if (rc) { failed_link = link; goto fail;
@@ -2888,8 +2900,11 @@ int ata_eh_reset(struct ata_link *link, int classify,*/ if (postreset) {postreset (link, classes); -if (slave) +trace_ata_link_postreset (link, classes, rc); +if (slave) {postreset (slave, classes); +trace_ata_slave_postreset (slave, classes, rc); + } }/*
include/trace/events/libata.h +96 -0
108 lines not on this page · raw message
Signature · 1 line
2.16.4
PATCH v3 16/40 libata: drop DPRINTK() calls in reset
In reply to Hannes ReineckeReset is now logged with tracepoints, so the DPRINTK() calls can be dropped.
--- drivers/ata/ahci.c | 7 ------- drivers/ata/ahci_qoriq.c | 4 ---- drivers/ata/libahci.c | 10 ---------- drivers/ata/libata-core.c | 7 ------- drivers/ata/libata-sff.c | 11 +---------- drivers/ata/pata_octeon_cf.c | 2 -- drivers/ata/sata_fsl.c | 10 ---------- drivers/ata/sata_rcar.c | 4 ---- drivers/ata/sata_sil24.c | 3 --- 9 files changed, 1 insertion(+), 57 deletions(-)
drivers/ata/ahci.c +0 -7
@@ -685,8 +685,6 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,bool online;int rc; -DPRINTK ("ENTER\n" ); - hpriv->stop_engine (ap); rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context),
@@ -694,8 +692,6 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, hpriv->start_engine (ap); -DPRINTK ("EXIT, rc=%d, class=%u\n" , rc, *class); -/* vt8251 doesn't clear BSY on signature FIS reception, * request follow-up softreset. */
@@ -775,8 +771,6 @@ static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,bool online;int rc, i; -DPRINTK ("ENTER\n" ); - hpriv->stop_engine (ap);for (i =0 ; i <2 ; i++) {
@@ -814,7 +808,6 @@ static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,if (online) *class =ahci_dev_classify (ap); -DPRINTK ("EXIT, rc=%d, class=%u\n" , rc, *class);return rc; }
drivers/ata/ahci_qoriq.c +0 -4
@@ -96,8 +96,6 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,int rc;bool ls1021a_workaround = (qoriq_priv->type ==AHCI_LS1021A ); -DPRINTK ("ENTER\n" ); - hpriv->stop_engine (ap);/*
@@ -139,8 +137,6 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,if (online) *class =ahci_dev_classify (ap); - -DPRINTK ("EXIT, rc=%d, class=%u\n" , rc, *class);return rc; }
drivers/ata/libahci.c +0 -10
@@ -1391,8 +1391,6 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,bool fbs_disabled = false;int rc; -DPRINTK ("ENTER\n" ); -/* prepare for SRST (AHCI-1.1 10.4.1) */ rc =ahci_kick_engine (ap);if (rc && rc != -EOPNOTSUPP )
@@ -1452,7 +1450,6 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,if (fbs_disabled)ahci_enable_fbs (ap); -DPRINTK ("EXIT, class=%u\n" , *class);return 0 ; fail:
@@ -1474,8 +1471,6 @@ static int ahci_softreset(struct ata_link *link, unsigned int *class, {int pmp =sata_srst_pmp (link); -DPRINTK ("ENTER\n" ); -return ahci_do_softreset (link, class, pmp, deadline, ahci_check_ready); }EXPORT_SYMBOL_GPL (ahci_do_softreset);
@@ -1505,8 +1500,6 @@ static int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class,int rc;u32 irq_sts; -DPRINTK ("ENTER\n" ); - rc =ahci_do_softreset (link, class, pmp, deadline, ahci_bad_pmp_check_ready);
@@ -1540,8 +1533,6 @@ int ahci_do_hardreset(struct ata_link *link, unsigned int *class,struct ata_taskfile tf;int rc; -DPRINTK ("ENTER\n" ); - hpriv->stop_engine (ap);/* clear D2H reception area to properly wait for D2H FIS */
@@ -1557,7 +1548,6 @@ int ahci_do_hardreset(struct ata_link *link, unsigned int *class,if (*online) *class =ahci_dev_classify (ap); -DPRINTK ("EXIT, rc=%d, class=%u\n" , rc, *class);return rc; }EXPORT_SYMBOL_GPL (ahci_do_hardreset);
drivers/ata/libata-core.c +0 -7
@@ -4070,8 +4070,6 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,u32 scontrol;int rc; -DPRINTK ("ENTER\n" ); -if (online) *online = false;
@@ -4147,7 +4145,6 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing, *online = false;ata_link_err (link,"COMRESET failed (errno=%d)\n" , rc); } -DPRINTK ("EXIT, rc=%d\n" , rc);return rc; }
@@ -4193,16 +4190,12 @@ void ata_std_postreset(struct ata_link *link, unsigned int *classes) {u32 serror; -DPRINTK ("ENTER\n" ); -/* reset complete, clear SError */ if (!sata_scr_read (link,SCR_ERROR , &serror))sata_scr_write (link,SCR_ERROR , serror);/* print link status */ sata_print_link_status (link); - -DPRINTK ("EXIT\n" ); }/**
drivers/ata/libata-sff.c +1 -10
@@ -1946,8 +1946,6 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask, {struct ata_ioports *ioaddr = &ap->ioaddr; -DPRINTK ("ata%u: bus reset via SRST\n" , ap->print_id); -if (ap->ioaddr.ctl_addr) {/* software reset. causes dev0 to be selected */ iowrite8 (ap->ctl, ioaddr->ctl_addr);
@@ -1985,8 +1983,6 @@ int ata_sff_softreset(struct ata_link *link, unsigned int *classes,int rc;u8 err; -DPRINTK ("ENTER\n" ); -/* determine if device 0/1 are present */ if (ata_devchk (ap,0 )) devmask |= (1 <<0 );
@@ -1997,7 +1993,6 @@ int ata_sff_softreset(struct ata_link *link, unsigned int *classes, ap->ops->sff_dev_select (ap,0 );/* issue bus reset */ -DPRINTK ("about to softreset, devmask=%x\n" , devmask); rc =ata_bus_softreset (ap, devmask, deadline);/* if link is occupied, -ENODEV too is an error */ if (rc && (rc != -ENODEV ||sata_scr_valid (link))) {
@@ -2012,7 +2007,6 @@ int ata_sff_softreset(struct ata_link *link, unsigned int *classes, classes[1 ] =ata_sff_dev_classify (&link->device[1 ], devmask & (1 <<1 ), &err); -DPRINTK ("EXIT, classes[0]=%u [1]=%u\n" , classes[0 ], classes[1 ]);return 0 ; }EXPORT_SYMBOL_GPL (ata_sff_softreset);
@@ -2045,7 +2039,6 @@ int sata_sff_hardreset(struct ata_link *link, unsigned int *class,if (online) *class =ata_sff_dev_classify (link->device,1 ,NULL ); -DPRINTK ("EXIT, class=%u\n" , *class);return rc; }EXPORT_SYMBOL_GPL (sata_sff_hardreset);
@@ -2075,10 +2068,8 @@ void ata_sff_postreset(struct ata_link *link, unsigned int *classes) ap->ops->sff_dev_select (ap,0 );/* bail out if no device is present */ -if (classes[0 ] ==ATA_DEV_NONE && classes[1 ] ==ATA_DEV_NONE ) { -DPRINTK ("EXIT, no device\n" ); +if (classes[0 ] ==ATA_DEV_NONE && classes[1 ] ==ATA_DEV_NONE )return ; - }/* set up device control */ if (ap->ops->sff_set_devctl || ap->ioaddr.ctl_addr) {
drivers/ata/pata_octeon_cf.c +0 -2
@@ -440,7 +440,6 @@ static int octeon_cf_softreset16(struct ata_link *link, unsigned int *classes,int rc;u8 err; -DPRINTK ("about to softreset\n" );__raw_writew (ap->ctl, base +0xe );udelay (20 );__raw_writew (ap->ctl |ATA_SRST , base +0xe );
@@ -455,7 +454,6 @@ static int octeon_cf_softreset16(struct ata_link *link, unsigned int *classes,/* determine by signature whether we have ATA or ATAPI devices */ classes[0 ] =ata_sff_dev_classify (&link->device[0 ],1 , &err); -DPRINTK ("EXIT, classes[0]=%u [1]=%u\n" , classes[0 ], classes[1 ]);return 0 ; }
drivers/ata/sata_fsl.c +0 -10
@@ -825,8 +825,6 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,int i =0 ;unsigned long start_jiffies; -DPRINTK ("in xx_hardreset\n" ); - try_offline_again:/* * Force host controller to go off-line, aborting current operations
@@ -941,10 +939,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,u8 *cfis;u32 Serror; -DPRINTK ("in xx_softreset\n" ); -if (ata_link_offline (link)) { -DPRINTK ("PHY reports no device\n" ); *class =ATA_DEV_NONE ;return 0 ; }
@@ -957,8 +952,6 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,* reached here, we can send a command to the target device */ -DPRINTK ("Sending SRST/device reset\n" ); -ata_tf_init (link->device, &tf); cfis = (u8 *) &pp->cmdentry->cfis;
@@ -1030,8 +1023,6 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,*/ iowrite32 (0x01 ,CC + hcr_base);/* We know it will be cmd#0 always */ -DPRINTK ("SATA FSL : Now checking device signature\n" ); - *class =ATA_DEV_NONE ;/* Verify if SStatus indicates device presence */
@@ -1045,7 +1036,6 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, *class =sata_fsl_dev_classify (ap); -DPRINTK ("class = %d\n" , *class);VPRINTK ("ccreg = 0x%x\n" ,ioread32 (hcr_base +CC ));VPRINTK ("cereg = 0x%x\n" ,ioread32 (hcr_base +CE )); }
drivers/ata/sata_rcar.c +0 -4
@@ -323,8 +323,6 @@ static int sata_rcar_bus_softreset(struct ata_port *ap, unsigned long deadline) {struct ata_ioports *ioaddr = &ap->ioaddr; -DPRINTK ("ata%u: bus reset via SRST\n" , ap->print_id); -/* software reset. causes dev0 to be selected */ iowrite32 (ap->ctl, ioaddr->ctl_addr);udelay (20 );
@@ -350,7 +348,6 @@ static int sata_rcar_softreset(struct ata_link *link, unsigned int *classes, devmask |=1 <<0 ;/* issue bus reset */ -DPRINTK ("about to softreset, devmask=%x\n" , devmask); rc =sata_rcar_bus_softreset (ap, deadline);/* if link is occupied, -ENODEV too is an error */ if (rc && (rc != -ENODEV ||sata_scr_valid (link))) {
@@ -361,7 +358,6 @@ static int sata_rcar_softreset(struct ata_link *link, unsigned int *classes,/* determine by signature whether we have ATA or ATAPI devices */ classes[0 ] =ata_sff_dev_classify (&link->device[0 ], devmask, &err); -DPRINTK ("classes[0]=%u\n" , classes[0 ]);return 0 ; }
drivers/ata/sata_sil24.c +0 -3
@@ -653,8 +653,6 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,const char *reason;int rc; -DPRINTK ("ENTER\n" ); -/* put the port into known state */ if (sil24_init_port (ap)) { reason ="port not ready" ;
@@ -679,7 +677,6 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,sil24_read_tf (ap,0 , &tf); *class =ata_port_classify (ap, &tf); -DPRINTK ("EXIT, class=%u\n" , *class);return 0 ; err:
Signature · 1 line
2.16.4
PATCH v3 17/40 libata: tracepoints for bus-master DMA
In reply to Hannes ReineckeAdd tracepoints for bus-master DMA and taskfile related functions. That allows us to drop the relevant DPRINTK() calls.
--- drivers/ata/libata-core.c | 5 +++ drivers/ata/libata-sff.c | 23 +++++++--- include/trace/events/libata.h | 100 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 5 deletions(-)
drivers/ata/libata-core.c +5 -0
@@ -7383,3 +7383,8 @@ EXPORT_SYMBOL_GPL(ata_cable_ignore);EXPORT_SYMBOL_GPL (ata_cable_sata);EXPORT_SYMBOL_GPL (ata_host_get);EXPORT_SYMBOL_GPL (ata_host_put); + +EXPORT_TRACEPOINT_SYMBOL_GPL (ata_tf_load); +EXPORT_TRACEPOINT_SYMBOL_GPL (ata_exec_command); +EXPORT_TRACEPOINT_SYMBOL_GPL (ata_bmdma_setup); +EXPORT_TRACEPOINT_SYMBOL_GPL (ata_bmdma_start);
drivers/ata/libata-sff.c +18 -5
@@ -22,7 +22,7 @@#include <linux/module.h> #include <linux/libata.h> #include <linux/highmem.h> - +#include <trace/events/libata.h> #include "libata.h" static struct workqueue_struct *ata_sff_wq;
@@ -509,6 +509,7 @@ EXPORT_SYMBOL_GPL(ata_sff_exec_command);* ata_tf_to_host - issue ATA taskfile to host controller * @ap: port to which command is being issued * @tf: ATA taskfile register set +* @tag: tag of the associated command * * Issues ATA taskfile register set to ATA host controller, * with proper synchronization with interrupt handler and
@@ -518,9 +519,12 @@ EXPORT_SYMBOL_GPL(ata_sff_exec_command);* spin_lock_irqsave(host lock) */ static inline void ata_tf_to_host (struct ata_port *ap, -const struct ata_taskfile *tf) +const struct ata_taskfile *tf, +unsigned int tag) { +trace_ata_tf_load (ap, tf); ap->ops->sff_tf_load (ap, tf); +trace_ata_exec_command (ap, tf, tag); ap->ops->sff_exec_command (ap, tf); }
@@ -753,6 +757,7 @@ static void atapi_send_cdb(struct ata_port *ap, struct ata_queued_cmd *qc)case ATAPI_PROT_DMA : ap->hsm_task_state =HSM_ST_LAST ;/* initiate bmdma */ +trace_ata_bmdma_start (ap, &qc->tf, qc->tag); ap->ops->bmdma_start (qc);break ;#endif /* CONFIG_ATA_BMDMA */
@@ -1361,7 +1366,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc)if (qc->tf.flags &ATA_TFLAG_POLLING )ata_qc_set_polling (qc); -ata_tf_to_host (ap, &qc->tf); +ata_tf_to_host (ap, &qc->tf, qc->tag); ap->hsm_task_state =HSM_ST_LAST ;if (qc->tf.flags &ATA_TFLAG_POLLING )
@@ -1373,7 +1378,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc)if (qc->tf.flags &ATA_TFLAG_POLLING )ata_qc_set_polling (qc); -ata_tf_to_host (ap, &qc->tf); +ata_tf_to_host (ap, &qc->tf, qc->tag);if (qc->tf.flags &ATA_TFLAG_WRITE ) {/* PIO data out protocol */
@@ -1403,7 +1408,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc)if (qc->tf.flags &ATA_TFLAG_POLLING )ata_qc_set_polling (qc); -ata_tf_to_host (ap, &qc->tf); +ata_tf_to_host (ap, &qc->tf, qc->tag); ap->hsm_task_state =HSM_ST_FIRST ;
@@ -2735,8 +2740,11 @@ unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc)case ATA_PROT_DMA :WARN_ON_ONCE (qc->tf.flags &ATA_TFLAG_POLLING ); +trace_ata_tf_load (ap, &qc->tf); ap->ops->sff_tf_load (ap, &qc->tf);/* load tf registers */ +trace_ata_bmdma_setup (ap, &qc->tf, qc->tag); ap->ops->bmdma_setup (qc);/* set up bmdma */ +trace_ata_bmdma_start (ap, &qc->tf, qc->tag); ap->ops->bmdma_start (qc);/* initiate bmdma */ ap->hsm_task_state =HSM_ST_LAST ;break ;
@@ -2744,7 +2752,9 @@ unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc)case ATAPI_PROT_DMA :WARN_ON_ONCE (qc->tf.flags &ATA_TFLAG_POLLING ); +trace_ata_tf_load (ap, &qc->tf); ap->ops->sff_tf_load (ap, &qc->tf);/* load tf registers */ +trace_ata_bmdma_setup (ap, &qc->tf, qc->tag); ap->ops->bmdma_setup (qc);/* set up bmdma */ ap->hsm_task_state =HSM_ST_FIRST ;
@@ -2792,6 +2802,7 @@ unsigned int ata_bmdma_port_intr(struct ata_port *ap, struct ata_queued_cmd *qc)return ata_sff_idle_irq (ap);/* before we do anything else, clear DMA-Start bit */ +trace_ata_bmdma_stop (ap, &qc->tf, qc->tag); ap->ops->bmdma_stop (qc); bmdma_stopped = true;
@@ -2871,6 +2882,7 @@ void ata_bmdma_error_handler(struct ata_port *ap) thaw = true; } +trace_ata_bmdma_stop (ap, &qc->tf, qc->tag); ap->ops->bmdma_stop (qc);/* if we're gonna thaw, make sure IRQ is clear */
@@ -2904,6 +2916,7 @@ void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc)if (ata_is_dma (qc->tf.protocol)) {spin_lock_irqsave (ap->lock, flags); +trace_ata_bmdma_stop (ap, &qc->tf, qc->tag); ap->ops->bmdma_stop (qc);spin_unlock_irqrestore (ap->lock, flags); }
include/trace/events/libata.h +100 -0
106 lines not on this page · raw message
Signature · 1 line
2.16.4
PATCH v3 18/40 libata: drop debugging statements for bus-master DMA
In reply to Hannes ReineckeBus-master DMA is now logged with generic tracepoints, so we can drop the DPRINTK()/VPRINTK and dev_dbg() calls here.
--- drivers/ata/libata-sff.c | 18 +----------------- drivers/ata/pata_octeon_cf.c | 10 ++-------- drivers/ata/pata_pdc202xx_old.c | 2 -- drivers/ata/pata_sil680.c | 1 - drivers/ata/sata_dwc_460ex.c | 18 ++++-------------- drivers/ata/sata_rcar.c | 2 -- 6 files changed, 7 insertions(+), 44 deletions(-)
drivers/ata/libata-sff.c +1 -17
@@ -413,12 +413,6 @@ void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)iowrite8 (tf->hob_lbal, ioaddr->lbal_addr);iowrite8 (tf->hob_lbam, ioaddr->lbam_addr);iowrite8 (tf->hob_lbah, ioaddr->lbah_addr); -VPRINTK ("hob: feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n" , - tf->hob_feature, - tf->hob_nsect, - tf->hob_lbal, - tf->hob_lbam, - tf->hob_lbah); }if (is_addr) {
@@ -427,18 +421,10 @@ void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)iowrite8 (tf->lbal, ioaddr->lbal_addr);iowrite8 (tf->lbam, ioaddr->lbam_addr);iowrite8 (tf->lbah, ioaddr->lbah_addr); -VPRINTK ("feat 0x%X nsect 0x%X lba 0x%X 0x%X 0x%X\n" , - tf->feature, - tf->nsect, - tf->lbal, - tf->lbam, - tf->lbah); } -if (tf->flags &ATA_TFLAG_DEVICE ) { +if (tf->flags &ATA_TFLAG_DEVICE )iowrite8 (tf->device, ioaddr->device_addr); -VPRINTK ("device 0x%X\n" , tf->device); - }ata_wait_idle (ap); }
@@ -498,8 +484,6 @@ EXPORT_SYMBOL_GPL(ata_sff_tf_read);*/ void ata_sff_exec_command (struct ata_port *ap,const struct ata_taskfile *tf) { -DPRINTK ("ata%u: cmd 0x%X\n" , ap->print_id, tf->command); -iowrite8 (tf->command, ap->ioaddr.command_addr);ata_sff_pause (ap); }
drivers/ata/pata_octeon_cf.c +2 -8
@@ -514,20 +514,14 @@ static void octeon_cf_exec_command16(struct ata_port *ap, {/* The base of the registers is at ioaddr.data_addr. */ void __iomem *base = ap->ioaddr.data_addr; -u16 blob; +u16 blob =0 ; -if (tf->flags &ATA_TFLAG_DEVICE ) { -VPRINTK ("device 0x%X\n" , tf->device); +if (tf->flags &ATA_TFLAG_DEVICE ) blob = tf->device; - }else { - blob =0 ; - } -DPRINTK ("ata%u: cmd 0x%X\n" , ap->print_id, tf->command); blob |= (tf->command <<8 );__raw_writew (blob, base +6 ); -ata_wait_idle (ap); }
drivers/ata/pata_pdc202xx_old.c +0 -2
@@ -38,8 +38,6 @@ static int pdc2026x_cable_detect(struct ata_port *ap)static void pdc202xx_exec_command (struct ata_port *ap,const struct ata_taskfile *tf) { -DPRINTK ("ata%u: cmd 0x%X\n" , ap->print_id, tf->command); -iowrite8 (tf->command, ap->ioaddr.command_addr);ndelay (400 ); }
drivers/ata/pata_sil680.c +0 -1
@@ -211,7 +211,6 @@ static void sil680_set_dmamode(struct ata_port *ap, struct ata_device *adev)static void sil680_sff_exec_command (struct ata_port *ap,const struct ata_taskfile *tf) { -DPRINTK ("ata%u: cmd 0x%X\n" , ap->print_id, tf->command);iowrite8 (tf->command, ap->ioaddr.command_addr);ioread8 (ap->ioaddr.bmdma_addr +ATA_DMA_CMD ); }
drivers/ata/sata_dwc_460ex.c +4 -14
@@ -970,9 +970,6 @@ static void sata_dwc_exec_command_by_tag(struct ata_port *ap, {struct sata_dwc_device_port *hsdevp =HSDEVP_FROM_AP (ap); -dev_dbg (ap->dev,"%s cmd(0x%02x): %s tag=%d\n" , __func__, tf->command, -ata_get_cmd_descript (tf->command), tag); - hsdevp->cmd_issued[tag] = cmd_issued;/*
@@ -995,12 +992,9 @@ static void sata_dwc_bmdma_setup(struct ata_queued_cmd *qc) {u8 tag = qc->hw_tag; -if (ata_is_ncq (qc->tf.protocol)) { -dev_dbg (qc->ap->dev,"%s: ap->link.sactive=0x%08x tag=%d\n" , - __func__, qc->ap->link.sactive, tag); - }else { +if (!ata_is_ncq (qc->tf.protocol)) tag =0 ; - } +sata_dwc_bmdma_setup_by_tag (qc, tag); }
@@ -1057,13 +1051,9 @@ static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc) {u8 tag = qc->hw_tag; -if (ata_is_ncq (qc->tf.protocol)) { -dev_dbg (qc->ap->dev,"%s: ap->link.sactive=0x%08x tag=%d\n" , - __func__, qc->ap->link.sactive, tag); - }else { +if (!ata_is_ncq (qc->tf.protocol)) tag =0 ; - } -dev_dbg (qc->ap->dev,"%s\n" , __func__); +sata_dwc_bmdma_start_by_tag (qc, tag); }
drivers/ata/sata_rcar.c +0 -2
@@ -436,8 +436,6 @@ static void sata_rcar_tf_read(struct ata_port *ap, struct ata_taskfile *tf)static void sata_rcar_exec_command (struct ata_port *ap,const struct ata_taskfile *tf) { -DPRINTK ("ata%u: cmd 0x%X\n" , ap->print_id, tf->command); -iowrite32 (tf->command, ap->ioaddr.command_addr);ata_sff_pause (ap); }
Signature · 1 line
2.16.4
PATCH v3 19/40 pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() calls
In reply to Hannes ReineckeAdd missing bmdma tracepoints and drop the now pointless DPRINTK() calls.
--- drivers/ata/pata_octeon_cf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/pata_octeon_cf.c +4 -3
@@ -19,7 +19,7 @@#include <linux/of_platform.h> #include <linux/platform_device.h> #include <scsi/scsi_host.h> - +#include <trace/events/libata.h> #include <asm/byteorder.h> #include <asm/octeon/octeon.h>
@@ -535,12 +535,10 @@ static void octeon_cf_dma_setup(struct ata_queued_cmd *qc)struct octeon_cf_port *cf_port; cf_port = ap->private_data; -DPRINTK ("ENTER\n" );/* issue r/w command */ qc->cursg = qc->sg; cf_port->dma_finished =0 ; ap->ops->sff_exec_command (ap, &qc->tf); -DPRINTK ("EXIT\n" ); }/**
@@ -792,8 +790,11 @@ static unsigned int octeon_cf_qc_issue(struct ata_queued_cmd *qc)case ATA_PROT_DMA :WARN_ON (qc->tf.flags &ATA_TFLAG_POLLING ); +trace_ata_tf_load (ap, &qc->tf); ap->ops->sff_tf_load (ap, &qc->tf);/* load tf registers */ +trace_ata_bmdma_setup (ap, &qc->tf, qc->tag);octeon_cf_dma_setup (qc);/* set up dma */ +trace_ata_bmdma_start (ap, &qc->tf, qc->tag);octeon_cf_dma_start (qc);/* initiate dma */ ap->hsm_task_state =HSM_ST_LAST ;break ;
Signature · 1 line
2.16.4
PATCH v3 20/40 pata_arasan_cf: use generic tracepoints
In reply to Hannes ReineckeFor completeness add generic tracepoints for bus-master DMA.
--- drivers/ata/pata_arasan_cf.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/ata/pata_arasan_cf.c +3 -0
@@ -39,6 +39,7 @@#include <linux/spinlock.h> #include <linux/types.h> #include <linux/workqueue.h> +#include <trace/events/libata.h> #define DRIVER_NAME "arasan_cf"#define TIMEOUT msecs_to_jiffies(3000)
@@ -703,9 +704,11 @@ static unsigned int arasan_cf_qc_issue(struct ata_queued_cmd *qc)case ATA_PROT_DMA :WARN_ON_ONCE (qc->tf.flags &ATA_TFLAG_POLLING ); +trace_ata_tf_load (ap, &qc->tf); ap->ops->sff_tf_load (ap, &qc->tf); acdev->dma_status =0 ; acdev->qc = qc; + trace_ata_bmdma_start(ap, &qc->tf, qc->tag)arasan_cf_dma_start (acdev); ap->hsm_task_state =HSM_ST_LAST ;break ;
Signature · 1 line
2.16.4
PATCH v3 21/40 sata_dwc_460ex: use generic tracepoints
In reply to Hannes ReineckeAdd generic tracepoints and drop the now obsolete logging statements.
--- drivers/ata/sata_dwc_460ex.c | 39 ++++----------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-)
drivers/ata/sata_dwc_460ex.c +4 -35
@@ -34,6 +34,7 @@#include <linux/phy/phy.h> #include <linux/libata.h> #include <linux/slab.h> +#include <trace/events/libata.h> #include "libata.h"
@@ -311,21 +312,6 @@ static const char *get_dma_dir_descript(int dma_dir) } } -static void sata_dwc_tf_dump (struct ata_port *ap,struct ata_taskfile *tf) -{ -dev_vdbg (ap->dev, -"taskfile cmd: 0x%02x protocol: %s flags: 0x%lx device: %x\n" , - tf->command,get_prot_descript (tf->protocol), tf->flags, - tf->device); -dev_vdbg (ap->dev, -"feature: 0x%02x nsect: 0x%x lbal: 0x%x lbam: 0x%x lbah: 0x%x\n" , - tf->feature, tf->nsect, tf->lbal, tf->lbam, tf->lbah); -dev_vdbg (ap->dev, -"hob_feature: 0x%02x hob_nsect: 0x%x hob_lbal: 0x%x hob_lbam: 0x%x hob_lbah: 0x%x\n" , - tf->hob_feature, tf->hob_nsect, tf->hob_lbal, tf->hob_lbam, - tf->hob_lbah); -} -static void dma_dwc_xfer_done (void *hsdev_instance) {unsigned long flags;
@@ -548,6 +534,7 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)* active tag. It is the tag that matches the command about to * be completed. */ +trace_ata_bmdma_start (ap, &qc->tf, tag); qc->ap->link.active_tag = tag;sata_dwc_bmdma_start_by_tag (qc, tag);
@@ -1021,12 +1008,6 @@ static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag) start_dma =0 ; } -dev_dbg (ap->dev, -"%s qc=%p tag: %x cmd: 0x%02x dma_dir: %s start_dma? %x\n" , - __func__, qc, tag, qc->tf.command, -get_dma_dir_descript (qc->dma_dir), start_dma); -sata_dwc_tf_dump (ap, &qc->tf); -if (start_dma) {sata_dwc_scr_read (&ap->link,SCR_ERROR , ®);if (reg &SATA_DWC_SERROR_ERR_BITS ) {
@@ -1064,16 +1045,6 @@ static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)struct ata_port *ap = qc->ap;struct sata_dwc_device_port *hsdevp =HSDEVP_FROM_AP (ap); -#ifdef DEBUG_NCQ -if (qc->hw_tag >0 || ap->link.sactive >1 ) -dev_info (ap->dev, -"%s ap id=%d cmd(0x%02x)=%s qc tag=%d prot=%s ap active_tag=0x%08x ap sactive=0x%08x\n" , - __func__, ap->print_id, qc->tf.command, -ata_get_cmd_descript (qc->tf.command), - qc->hw_tag,get_prot_descript (qc->tf.protocol), - ap->link.active_tag, ap->link.sactive); -#endif -if (!ata_is_ncq (qc->tf.protocol)) tag =0 ;
@@ -1090,11 +1061,9 @@ static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc) sactive |= (0x00000001 << tag);sata_dwc_scr_write (&ap->link,SCR_ACTIVE , sactive); -dev_dbg (qc->ap->dev, -"%s: tag=%d ap->link.sactive = 0x%08x sactive=0x%08x\n" , - __func__, tag, qc->ap->link.sactive, sactive); - +trace_ata_tf_load (ap, &qc->tf); ap->ops->sff_tf_load (ap, &qc->tf); +trace_ata_exec_command (qp, &qc->tf, tag);sata_dwc_exec_command_by_tag (ap, &qc->tf, tag,SATA_DWC_CMD_ISSUED_PEND ); }else {
Signature · 1 line
2.16.4
kbuild test robot
build botRe: [PATCH 21/40] sata_dwc_460ex: use generic tracepoints
I love your patch! Yet something to improve:
Hi Hannes,
I love your patch! Yet something to improve:
[auto build test ERROR on block/for-next]
[also build test ERROR on tip/perf/core v5.6-rc4 next-20200305] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Hannes-Reinecke/ata-kill-ATA_DEBUG/20200304-015527 base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next config: i386-randconfig-a001-20200306 (attached as .config) compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010 reproduce: # save the attached .config to linux build tree make ARCH=i386
If you fix the issue, kindly add following tag
All errors (new ones prefixed by >>):
drivers//ata/sata_dwc_460ex.c: In function 'sata_dwc_qc_issue':
>> drivers//ata/sata_dwc_460ex.c:1066:26: error: 'qp' undeclared (first use in this function)
trace_ata_exec_command(qp, &qc->tf, tag);
^ drivers//ata/sata_dwc_460ex.c:1066:26: note: each undeclared identifier is reported only once for each function it appears in drivers//ata/sata_dwc_460ex.c: At top level:
drivers//ata/sata_dwc_460ex.c:301:20: warning: 'get_dma_dir_descript' defined but not used [-Wunused-function]
static const char *get_dma_dir_descript(int dma_dir)
^
vim +/qp +1066 drivers//ata/sata_dwc_460ex.c
1040
1041 static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
1042 {
1043 u32 sactive;
1044 u8 tag = qc->hw_tag;
1045 struct ata_port *ap = qc->ap;
1046 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
1047
1048 if (!ata_is_ncq(qc->tf.protocol))
1049 tag = 0;
1050
1051 if (ata_is_dma(qc->tf.protocol)) {
1052 hsdevp->desc[tag] = dma_dwc_xfer_setup(qc);
1053 if (!hsdevp->desc[tag])
1054 return AC_ERR_SYSTEM;
1055 } else {
1056 hsdevp->desc[tag] = NULL;
1057 }
1058
1059 if (ata_is_ncq(qc->tf.protocol)) {
1060 sata_dwc_scr_read(&ap->link, SCR_ACTIVE, &sactive);
1061 sactive |= (0x00000001 << tag);
1062 sata_dwc_scr_write(&ap->link, SCR_ACTIVE, sactive);
1063
1064 trace_ata_tf_load(ap, &qc->tf);
1065 ap->ops->sff_tf_load(ap, &qc->tf);
> 1066 trace_ata_exec_command(qp, &qc->tf, tag);
1067 sata_dwc_exec_command_by_tag(ap, &qc->tf, tag,
1068 SATA_DWC_CMD_ISSUED_PEND);
1069 } else {
1070 return ata_bmdma_qc_issue(qc);
1071 }
1072 return 0;
1073 }
1074
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH v3 22/40 sata_nv: use generic tracepoints
In reply to Hannes ReineckeRemove logging messages covered by generic tracepoints and add generic tracepoints for internal calls.
--- drivers/ata/sata_nv.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/ata/sata_nv.c +3 -8
@@ -31,6 +31,7 @@#include <scsi/scsi_host.h> #include <scsi/scsi_device.h> #include <linux/libata.h> +#include <trace/events/libata.h> #define DRV_NAME "sata_nv"#define DRV_VERSION "3.5"
@@ -1428,8 +1429,6 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)writew (qc->hw_tag, mmio +NV_ADMA_APPEND ); -DPRINTK ("Issued tag %u\n" , qc->hw_tag); -return 0 ; }
@@ -2007,19 +2006,17 @@ static unsigned int nv_swncq_issue_atacmd(struct ata_port *ap,if (qc ==NULL )return 0 ; -DPRINTK ("Enter\n" ); -writel ((1 << qc->hw_tag), pp->sactive_block); pp->last_issue_tag = qc->hw_tag; pp->dhfis_bits &= ~(1 << qc->hw_tag); pp->dmafis_bits &= ~(1 << qc->hw_tag); pp->qc_active |= (0x1 << qc->hw_tag); +trace_ata_tf_load (ap, &qc->tf); ap->ops->sff_tf_load (ap, &qc->tf);/* load tf registers */ +trace_ata_exec_command (ap, &qc->tf, qc->hw_tag); ap->ops->sff_exec_command (ap, &qc->tf); -DPRINTK ("Issued tag %u\n" , qc->hw_tag); -return 0 ; }
@@ -2031,8 +2028,6 @@ static unsigned int nv_swncq_qc_issue(struct ata_queued_cmd *qc)if (qc->tf.protocol !=ATA_PROT_NCQ )return ata_bmdma_qc_issue (qc); -DPRINTK ("Enter\n" ); -if (!pp->qc_active)nv_swncq_issue_atacmd (ap, qc);else
Signature · 1 line
2.16.4
PATCH v3 23/40 libata-sff: tracepoints for HSM state machine
In reply to Hannes ReineckeAdd tracepoints for the HSM state machine and drop DPRINTK calls
--- drivers/ata/libata-sff.c | 12 +++--- drivers/ata/libata-trace.c | 29 +++++++++++++ include/trace/events/libata.h | 96 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 7 deletions(-)
drivers/ata/libata-sff.c +5 -7
@@ -660,7 +660,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) page =nth_page (page, (offset >>PAGE_SHIFT )); offset %=PAGE_SIZE ; -DPRINTK ("data %s\n" , qc->tf.flags &ATA_TFLAG_WRITE ?"write" :"read" ); +trace_ata_sff_pio_transfer_data (qc, offset, qc->sect_size);/* do the actual data transfer */ buf =kmap_atomic (page);
@@ -723,7 +723,7 @@ static void ata_pio_sectors(struct ata_queued_cmd *qc)static void atapi_send_cdb (struct ata_port *ap,struct ata_queued_cmd *qc) {/* send SCSI cdb */ -DPRINTK ("send cdb\n" ); +trace_atapi_send_cdb (qc,0 , qc->dev->cdb_len);WARN_ON_ONCE (qc->dev->cdb_len <12 ); ap->ops->sff_data_xfer (qc, qc->cdb, qc->dev->cdb_len,1 );
@@ -794,7 +794,7 @@ static int __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)/* don't cross page boundaries */ count =min (count, (unsigned int )PAGE_SIZE - offset); -DPRINTK ("data %s\n" , qc->tf.flags &ATA_TFLAG_WRITE ?"write" :"read" ); +trace_atapi_pio_transfer_data (qc, offset, count);/* do the actual data transfer */ buf =kmap_atomic (page);
@@ -976,8 +976,7 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,WARN_ON_ONCE (in_wq !=ata_hsm_ok_in_wq (ap, qc)); fsm_start: -DPRINTK ("ata%u: protocol %d task_state %d (dev_stat 0x%X)\n" , - ap->print_id, qc->tf.protocol, ap->hsm_task_state, status); +trace_ata_sff_hsm_state (qc, status);switch (ap->hsm_task_state) {case HSM_ST_FIRST :
@@ -1178,8 +1177,7 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, }/* no more data to transfer */ -DPRINTK ("ata%u: dev %u command complete, drv_stat 0x%x\n" , - ap->print_id, qc->dev->devno, status); +trace_ata_sff_hsm_command_complete (qc, status);WARN_ON_ONCE (qc->err_mask & (AC_ERR_DEV |AC_ERR_HSM ));
drivers/ata/libata-trace.c +29 -0
@@ -137,6 +137,35 @@ libata_trace_parse_qc_flags(struct trace_seq *p, unsigned int qc_flags)return ret; } +const char * +libata_trace_parse_tf_flags (struct trace_seq *p,unsigned int tf_flags) +{ +const char *ret =trace_seq_buffer_ptr (p); + +trace_seq_printf (p,"%x" , tf_flags); +if (tf_flags) { +trace_seq_printf (p,"{ " ); +if (tf_flags &ATA_TFLAG_LBA48 ) +trace_seq_printf (p,"LBA48 " ); +if (tf_flags &ATA_TFLAG_ISADDR ) +trace_seq_printf (p,"ISADDR " ); +if (tf_flags &ATA_TFLAG_DEVICE ) +trace_seq_printf (p,"DEV " ); +if (tf_flags &ATA_TFLAG_WRITE ) +trace_seq_printf (p,"WRITE " ); +if (tf_flags &ATA_TFLAG_LBA ) +trace_seq_printf (p,"LBA " ); +if (tf_flags &ATA_TFLAG_FUA ) +trace_seq_printf (p,"FUA " ); +if (tf_flags &ATA_TFLAG_POLLING ) +trace_seq_printf (p,"POLL " ); +trace_seq_putc (p,'}' ); + } +trace_seq_putc (p,0 ); + +return ret; +} +const char *libata_trace_parse_subcmd (struct trace_seq *p,unsigned char cmd,unsigned char feature,unsigned char hob_nsect)
include/trace/events/libata.h +96 -0
114 lines not on this page · raw message
Signature · 1 line
2.16.4
PATCH v3 24/40 libata-sff: add tracepoints for ata_sff_flush_pio_task()
In reply to Hannes ReineckeReplace DPRINTK calls with tracepoints.
--- drivers/ata/libata-sff.c | 5 +---- include/trace/events/libata.h | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-)
drivers/ata/libata-sff.c +1 -4
@@ -1234,7 +1234,7 @@ EXPORT_SYMBOL_GPL(ata_sff_queue_pio_task);void ata_sff_flush_pio_task (struct ata_port *ap) { -DPRINTK ("ENTER\n" ); +trace_ata_sff_flush_pio_task (ap);cancel_delayed_work_sync (&ap->sff_pio_task);
@@ -1251,9 +1251,6 @@ void ata_sff_flush_pio_task(struct ata_port *ap)spin_unlock_irq (ap->lock); ap->sff_pio_task_link =NULL ; - -if (ata_msg_ctl (ap)) -ata_port_dbg (ap,"EXIT\n" ); }static void ata_sff_pio_task (struct work_struct *work)
include/trace/events/libata.h +25 -0
@@ -621,6 +621,31 @@ DEFINE_EVENT(ata_transfer_data_template, atapi_send_cdb, TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count), TP_ARGS(qc, offset, count)); +DECLARE_EVENT_CLASS (ata_sff_template, + + TP_PROTO(struct ata_port *ap), + +TP_ARGS (ap), + +TP_STRUCT__entry ( + __field( unsigned int, ata_port ) + __field( unsigned char, hsm_state ) + ), + +TP_fast_assign ( + __entry->ata_port = ap->print_id; + __entry->hsm_state = ap->hsm_task_state; + ), + +TP_printk ("ata_port=%u task_state=%s" , + __entry->ata_port, +show_sff_hsm_state_name (__entry->hsm_state)) +); + +DEFINE_EVENT (ata_sff_template, ata_sff_flush_pio_task, + TP_PROTO(struct ata_port *ap), +TP_ARGS (ap)); +#endif /* _TRACE_LIBATA_H */ /* This part must be outside protection */
Signature · 1 line
2.16.4
PATCH v3 25/40 libata-scsi: drop DPRINTK calls for cdb translation
In reply to Hannes ReineckeDrop DPRINTK calls for cdb translation as they are already covered by other traces, and convert the DPRINTK calls in ata_scsi_hotplug() to ata_port_dbg() calls.
--- drivers/ata/libata-scsi.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
drivers/ata/libata-scsi.c +3 -17
@@ -1761,9 +1761,6 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc) head = track % dev->heads; sect = (u32 )block % dev->sectors +1 ; -DPRINTK ("block %u track %u cyl %u head %u sect %u\n" , - (u32 )block, track, cyl, head, sect); -/* Check whether the converted CHS can fit. Cylinder: 0-65535 Head: 0-15
@@ -1886,7 +1883,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) goto invalid_fld;break ;default : -DPRINTK ("no-byte command\n" ); fp =0 ; goto invalid_fld; }
@@ -2040,7 +2036,6 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd, early_finish:ata_qc_free (qc); cmd->scsi_done (cmd); -DPRINTK ("EXIT - early finish (good or error)\n" );return 0 ; err_did:
@@ -2048,12 +2043,10 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd, cmd->result = (DID_ERROR <<16 ); cmd->scsi_done (cmd); err_mem: -DPRINTK ("EXIT - internal\n" );return 0 ; defer:ata_qc_free (qc); -DPRINTK ("EXIT - defer\n" );if (rc ==ATA_DEFER_LINK )return SCSI_MLQUEUE_DEVICE_BUSY ;else
@@ -2820,8 +2813,6 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)struct ata_port *ap = qc->ap;struct scsi_cmnd *cmd = qc->scsicmd; -DPRINTK ("ATAPI request sense\n" ); -memset (cmd->sense_buffer,0 ,SCSI_SENSE_BUFFERSIZE );#ifdef CONFIG_ATA_SFF
@@ -2860,8 +2851,6 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) qc->complete_fn = atapi_sense_complete;ata_qc_issue (qc); - -DPRINTK ("EXIT\n" ); }/*
@@ -2971,7 +2960,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) qc->tf.flags |=ATA_TFLAG_ISADDR |ATA_TFLAG_DEVICE ;if (scmd->sc_data_direction ==DMA_TO_DEVICE ) { qc->tf.flags |=ATA_TFLAG_WRITE ; -DPRINTK ("direction: write\n" ); } qc->tf.command =ATA_CMD_PACKET ;
@@ -4355,8 +4343,6 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,return rc; bad_cdb_len: -DPRINTK ("bad CDB len=%u, scsi_op=0x%02x, max=%u\n" , - scmd->cmd_len, scsi_op, dev->cdb_len); scmd->result =DID_ERROR <<16 ; scmd->scsi_done (scmd);return 0 ;
@@ -4796,11 +4782,11 @@ void ata_scsi_hotplug(struct work_struct *work)int i;if (ap->pflags &ATA_PFLAG_UNLOADING ) { -DPRINTK ("ENTER/EXIT - unloading\n" ); +ata_port_dbg (ap,"unloading\n" );return ; } -DPRINTK ("ENTER\n" ); +ata_port_dbg (ap,"ENTER\n" );mutex_lock (&ap->scsi_scan_mutex);/* Unplug detached devices. We cannot use link iterator here
@@ -4816,7 +4802,7 @@ void ata_scsi_hotplug(struct work_struct *work)ata_scsi_scan_host (ap,0 );mutex_unlock (&ap->scsi_scan_mutex); -DPRINTK ("EXIT\n" ); +ata_port_dbg (ap,"EXIT\n" ); }/**
Signature · 1 line
2.16.4
PATCH v3 26/40 libata: add tracepoints for ATA error handling
In reply to Hannes ReineckeAdd tracepoints for ATA error handling.
--- drivers/ata/libata-eh.c | 10 +++++--- include/trace/events/libata.h | 60 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 3 deletions(-)
drivers/ata/libata-eh.c +7 -3
@@ -933,7 +933,7 @@ void ata_std_sched_eh(struct ata_port *ap)ata_eh_set_pending (ap,1 );scsi_schedule_eh (ap->scsi_host); -DPRINTK ("port EH scheduled\n" ); +trace_ata_std_sched_eh (ap); }EXPORT_SYMBOL_GPL (ata_std_sched_eh);
@@ -1060,7 +1060,7 @@ static void __ata_port_freeze(struct ata_port *ap) ap->pflags |=ATA_PFLAG_FROZEN ; -DPRINTK ("ata%u port frozen\n" , ap->print_id); +trace_ata_port_freeze (ap); }/**
@@ -1208,7 +1208,7 @@ void ata_eh_thaw_port(struct ata_port *ap)spin_unlock_irqrestore (ap->lock, flags); -DPRINTK ("ata%u port thawed\n" , ap->print_id); +trace_ata_port_thaw (ap); }static void ata_eh_scsidone (struct scsi_cmnd *scmd)
@@ -1347,6 +1347,8 @@ void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev,struct ata_eh_context *ehc = &link->eh_context;unsigned long flags; +trace_ata_eh_about_to_do (link, dev ? dev->devno :0 , action); +spin_lock_irqsave (ap->lock, flags);ata_eh_clear_action (link, dev, ehi, action);
@@ -1377,6 +1379,8 @@ void ata_eh_done(struct ata_link *link, struct ata_device *dev, {struct ata_eh_context *ehc = &link->eh_context; +trace_ata_eh_done (link, dev ? dev->devno :0 , action); +ata_eh_clear_action (link, dev, &ehc->i, action); }
include/trace/events/libata.h +60 -0
72 lines not on this page · raw message
Signature · 1 line
2.16.4
PATCH v3 27/40 libata: drop DPRINTK() calls during ATA error handling
In reply to Hannes ReineckeThe information is now logged with tracepoints, so the DPRINTK() calls can be dropped.
--- drivers/ata/libata-eh.c | 12 ------------ drivers/ata/libata-pmp.c | 8 -------- 2 files changed, 20 deletions(-)
drivers/ata/libata-eh.c +0 -12
@@ -526,8 +526,6 @@ void ata_scsi_error(struct Scsi_Host *host)unsigned long flags;LIST_HEAD (eh_work_q); -DPRINTK ("ENTER\n" ); -spin_lock_irqsave (host->host_lock, flags);list_splice_init (&host->eh_cmd_q, &eh_work_q);spin_unlock_irqrestore (host->host_lock, flags);
@@ -541,7 +539,6 @@ void ata_scsi_error(struct Scsi_Host *host)/* finish or retry handled scmd's and clean up */ WARN_ON (!list_empty (&eh_work_q)); -DPRINTK ("EXIT\n" ); }/**
@@ -2123,8 +2120,6 @@ static void ata_eh_link_autopsy(struct ata_link *link)u32 serror;int rc; -DPRINTK ("ENTER\n" ); -if (ehc->i.flags &ATA_EHI_NO_AUTOPSY )return ;
@@ -2231,7 +2226,6 @@ static void ata_eh_link_autopsy(struct ata_link *link) ehc->i.action |=ata_eh_speed_down (dev, eflags, all_err_mask);trace_ata_eh_link_autopsy (dev, ehc->i.action, all_err_mask); } -DPRINTK ("EXIT\n" ); }/**
@@ -3130,8 +3124,6 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,unsigned long flags;int rc =0 ; -DPRINTK ("ENTER\n" ); -/* For PATA drive side cable detection to work, IDENTIFY must * be done backwards such that PDIAG- is released by the slave * device before the master device is identified.
@@ -3245,7 +3237,6 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, err: *r_failed_dev = dev; -DPRINTK ("EXIT rc=%d\n" , rc);return rc; }
@@ -3759,8 +3750,6 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,int rc, nr_fails;unsigned long flags, deadline; -DPRINTK ("ENTER\n" ); -/* prep for recovery */ ata_for_each_link (link, ap,EDGE ) {struct ata_eh_context *ehc = &link->eh_context;
@@ -3968,7 +3957,6 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,if (rc && r_failed_link) *r_failed_link = link; -DPRINTK ("EXIT, rc=%d\n" , rc);return rc; }
drivers/ata/libata-pmp.c +0 -8
@@ -652,8 +652,6 @@ static int sata_pmp_revalidate(struct ata_device *dev, unsigned int new_class)u32 *gscr = (void *)ap->sector_buf;int rc; -DPRINTK ("ENTER\n" ); -ata_eh_about_to_do (link,NULL ,ATA_EH_REVALIDATE );if (!ata_dev_enabled (dev)) {
@@ -686,12 +684,10 @@ static int sata_pmp_revalidate(struct ata_device *dev, unsigned int new_class)ata_eh_done (link,NULL ,ATA_EH_REVALIDATE ); -DPRINTK ("EXIT, rc=0\n" );return 0 ; fail:ata_dev_err (dev,"PMP revalidation failed (errno=%d)\n" , rc); -DPRINTK ("EXIT, rc=%d\n" , rc);return rc; }
@@ -759,8 +755,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,int detach =0 , rc =0 ;int reval_failed =0 ; -DPRINTK ("ENTER\n" ); -if (dev->flags &ATA_DFLAG_DETACH ) { detach =1 ; goto fail;
@@ -827,7 +821,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,/* okay, PMP resurrected */ ehc->i.flags =0 ; -DPRINTK ("EXIT, rc=0\n" );return 0 ; fail:
@@ -837,7 +830,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,else ata_dev_disable (dev); -DPRINTK ("EXIT, rc=%d\n" , rc);return rc; }
Signature · 1 line
2.16.4
PATCH v3 28/40 libata-eh: remove DPRINTK() calls for request sense
In reply to Hannes ReineckeThe information will printed during ata_qc_issue() anyway, so this messages can be dropped.
--- drivers/ata/libata-eh.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/ata/libata-eh.c +0 -4
@@ -1538,8 +1538,6 @@ static void ata_eh_request_sense(struct ata_queued_cmd *qc,return ; } -DPRINTK ("ATA request sense\n" ); -ata_tf_init (dev, &tf); tf.flags |=ATA_TFLAG_ISADDR |ATA_TFLAG_DEVICE ; tf.flags |=ATA_TFLAG_LBA |ATA_TFLAG_LBA48 ;
@@ -1580,8 +1578,6 @@ unsigned int atapi_eh_request_sense(struct ata_device *dev,struct ata_port *ap = dev->link->ap;struct ata_taskfile tf; -DPRINTK ("ATAPI request sense\n" ); -memset (sense_buf,0 ,SCSI_SENSE_BUFFERSIZE );/* initialize sense_buf with the error register,
Signature · 1 line
2.16.4
PATCH v3 29/40 pata_octeon_cf: move DPRINTK to VPRINTK
In reply to Hannes ReineckeMove the remaining DPRINTK statement in the interrupt handler to VPRINTK. It'll be converted later with the remaining VPRINTK calls.
--- drivers/ata/pata_octeon_cf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/pata_octeon_cf.c +2 -2
@@ -668,7 +668,7 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)spin_lock_irqsave (&host->lock, flags); -DPRINTK ("ENTER\n" ); +VPRINTK ("ENTER\n" );for (i =0 ; i < host->n_ports; i++) {u8 status;struct ata_port *ap;
@@ -722,7 +722,7 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance) } }spin_unlock_irqrestore (&host->lock, flags); -DPRINTK ("EXIT\n" ); +VPRINTK ("EXIT\n" );return IRQ_RETVAL (handled); }
Signature · 1 line
2.16.4
PATCH v3 30/40 pdc_adma: move DPRINTK to VPRINTK
In reply to Hannes ReineckeMove the remaining DPRINTK statement in the interrupt handler to VPRINTK. It'll be converted later with the remaining VPRINTK calls.
--- drivers/ata/pdc_adma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pdc_adma.c +1 -1
@@ -475,7 +475,7 @@ static inline unsigned int adma_intr_mmio(struct ata_host *host)u8 status =ata_sff_check_status (ap);if ((status &ATA_BUSY ))continue ; -DPRINTK ("ata%u: protocol %d (dev_stat 0x%X)\n" , +VPRINTK ("ata%u: protocol %d (dev_stat 0x%X)\n" , ap->print_id, qc->tf.protocol, status);/* complete taskfile transaction */
Signature · 1 line
2.16.4
PATCH v3 31/40 sata_rcar: move DPRINTK to VPRINTK
In reply to Hannes ReineckeMove the remaining DPRINTK statement in the interrupt handler to VPRINTK. It'll be converted later with the remaining VPRINTK calls.
--- drivers/ata/sata_rcar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/sata_rcar.c +1 -1
@@ -679,7 +679,7 @@ static void sata_rcar_serr_interrupt(struct ata_port *ap)if (!serror)return ; -DPRINTK ("SError @host_intr: 0x%x\n" , serror); +VPRINTK ("SError @host_intr: 0x%x\n" , serror);/* first, analyze and record host port events */ ata_ehi_clear_desc (ehi);
Signature · 1 line
2.16.4
PATCH v3 32/40 sata_qstor: move DPRINTK to VPRINTK
In reply to Hannes ReineckeMove the remaining DPRINTK statement in the interrupt handler to VPRINTK. It'll be converted later with the remaining VPRINTK calls.
--- drivers/ata/sata_qstor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/sata_qstor.c +1 -1
@@ -374,7 +374,7 @@ static inline unsigned int qs_intr_pkt(struct ata_host *host)struct qs_port_priv *pp = ap->private_data;struct ata_queued_cmd *qc; -DPRINTK ("SFF=%08x%08x: sCHAN=%u sHST=%d sDST=%02x\n" , +VPRINTK ("SFF=%08x%08x: sCHAN=%u sHST=%d sDST=%02x\n" , sff1, sff0, port_no, sHST, sDST); handled =1 ;if (!pp || pp->state != qs_state_pkt)
Signature · 1 line
2.16.4
PATCH v3 33/40 pata_pdc2027x: Replace PDPRINTK() with standard ata logging
In reply to Hannes ReineckeUse standard ata logging macros instead of the hand-crafted PDPRINTK and remove duplicate logging messages.
--- drivers/ata/pata_pdc2027x.c | 81 ++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 45 deletions(-)
drivers/ata/pata_pdc2027x.c +36 -45
@@ -30,13 +30,6 @@#define DRV_NAME "pata_pdc2027x"#define DRV_VERSION "1.0" -#undef PDC_DEBUG - -#ifdef PDC_DEBUG -#define PDPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args) -#else -#define PDPRINTK(fmt, args...) -#endif enum {PDC_MMIO_BAR =5 ,
@@ -214,11 +207,13 @@ static int pdc2027x_cable_detect(struct ata_port *ap)if (cgcr & (1 <<26 )) goto cbl40; -PDPRINTK ("No cable or 80-conductor cable on port %d\n" , ap->port_no); +ata_port_dbg (ap,"No cable or 80-conductor cable on port %d\n" , + ap->port_no);return ATA_CBL_PATA80 ; cbl40: - printk(KERN_INFO DRV_NAME ": 40-conductor cable detected on port %d\n", ap->port_no); +ata_port_info (ap,"40-conductor cable detected on port %d\n" , + ap->port_no);return ATA_CBL_PATA40 ; }
@@ -292,17 +287,17 @@ static void pdc2027x_set_piomode(struct ata_port *ap, struct ata_device *adev)unsigned int pio = adev->pio_mode -XFER_PIO_0 ;u32 ctcr0, ctcr1; -PDPRINTK ("adev->pio_mode[%X]\n" , adev->pio_mode); +ata_port_dbg (ap,"adev->pio_mode[%X]\n" , adev->pio_mode);/* Sanity check */ if (pio >4 ) { - printk(KERN_ERR DRV_NAME ": Unknown pio mode [%d] ignored\n", pio); +ata_port_err (ap,"Unknown pio mode [%d] ignored\n" , pio);return ; }/* Set the PIO timing registers using value table for 133MHz */ -PDPRINTK ("Set pio regs... \n" ); +ata_port_dbg (ap,"Set pio regs...\n" ); ctcr0 =ioread32 (dev_mmio (ap, adev,PDC_CTCR0 )); ctcr0 &=0xffff0000 ;
@@ -315,9 +310,7 @@ static void pdc2027x_set_piomode(struct ata_port *ap, struct ata_device *adev) ctcr1 |= (pdc2027x_pio_timing_tbl[pio].value2 <<24 );iowrite32 (ctcr1,dev_mmio (ap, adev,PDC_CTCR1 )); -PDPRINTK ("Set pio regs done\n" ); - -PDPRINTK ("Set to pio mode[%u] \n" , pio); +ata_port_dbg (ap,"Set to pio mode[%u]\n" , pio); }/**
@@ -350,7 +343,7 @@ static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev)iowrite32 (ctcr1 & ~(1 <<7 ),dev_mmio (ap, adev,PDC_CTCR1 )); } -PDPRINTK ("Set udma regs... \n" ); +ata_port_dbg (ap,"Set udma regs...\n" ); ctcr1 =ioread32 (dev_mmio (ap, adev,PDC_CTCR1 )); ctcr1 &=0xff000000 ;
@@ -359,16 +352,14 @@ static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev) (pdc2027x_udma_timing_tbl[udma_mode].value2 <<16 );iowrite32 (ctcr1,dev_mmio (ap, adev,PDC_CTCR1 )); -PDPRINTK ("Set udma regs done\n" ); - -PDPRINTK ("Set to udma mode[%u] \n" , udma_mode); +ata_port_dbg (ap,"Set to udma mode[%u]\n" , udma_mode); }else if ((dma_mode >=XFER_MW_DMA_0 ) && (dma_mode <=XFER_MW_DMA_2 )) {/* Set the MDMA timing registers with value table for 133MHz */ unsigned int mdma_mode = dma_mode &0x07 ; -PDPRINTK ("Set mdma regs... \n" ); +ata_port_dbg (ap,"Set mdma regs...\n" ); ctcr0 =ioread32 (dev_mmio (ap, adev,PDC_CTCR0 )); ctcr0 &=0x0000ffff ;
@@ -376,11 +367,10 @@ static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev) (pdc2027x_mdma_timing_tbl[mdma_mode].value1 <<24 );iowrite32 (ctcr0,dev_mmio (ap, adev,PDC_CTCR0 )); -PDPRINTK ("Set mdma regs done\n" ); -PDPRINTK ("Set to mdma mode[%u] \n" , mdma_mode); +ata_port_dbg (ap,"Set to mdma mode[%u]\n" , mdma_mode); }else { - printk(KERN_ERR DRV_NAME ": Unknown dma mode [%u] ignored\n", dma_mode); +ata_port_err (ap,"Unknown dma mode [%u] ignored\n" , dma_mode); } }
@@ -414,7 +404,7 @@ static int pdc2027x_set_mode(struct ata_link *link, struct ata_device **r_failed ctcr1 |= (1 <<25 );iowrite32 (ctcr1,dev_mmio (ap, dev,PDC_CTCR1 )); -PDPRINTK ("Turn on prefetch\n" ); +ata_dev_dbg (dev,"Turn on prefetch\n" ); }else {pdc2027x_set_dmamode (ap, dev); }
@@ -485,8 +475,10 @@ static long pdc_read_counter(struct ata_host *host) counter = (bccrh <<15 ) | bccrl; -PDPRINTK ("bccrh [%X] bccrl [%X]\n" , bccrh, bccrl); -PDPRINTK ("bccrhv[%X] bccrlv[%X]\n" , bccrhv, bccrlv); +dev_dbg (host->dev,"%s: bccrh [%X] bccrl [%X]\n" , + __func__, bccrh, bccrl); +dev_dbg (host->dev,"%s: bccrhv[%X] bccrlv[%X]\n" , + __func__, bccrhv, bccrlv);/* * The 30-bit decreasing counter are read by 2 pieces.
@@ -495,7 +487,7 @@ static long pdc_read_counter(struct ata_host *host)*/ if (retry && !(bccrh == bccrhv && bccrl >= bccrlv)) { retry--; -PDPRINTK ("rereading counter\n" ); +dev_dbg (host->dev,"%s: rereading counter\n" , __func__); goto retry; }
@@ -520,20 +512,21 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int b/* Sanity check */ if (unlikely (pll_clock_khz <5000L || pll_clock_khz >70000L )) { - printk(KERN_ERR DRV_NAME ": Invalid PLL input clock %ldkHz, give up!\n", pll_clock_khz); +dev_err (host->dev, +"Invalid PLL input clock %ldkHz, give up!\n" , + pll_clock_khz);return ; } -#ifdef PDC_DEBUG -PDPRINTK ("pout_required is %ld\n" , pout_required); +dev_dbg (host->dev,"%s: pout_required is %ld\n" , + __func__, pout_required);/* Show the current clock value of PLL control register * (maybe already configured by the firmware) */ pll_ctl =ioread16 (mmio_base +PDC_PLL_CTL ); -PDPRINTK ("pll_ctl[%X]\n" , pll_ctl); -#endif +dev_dbg (host->dev,"%s: pll_ctl[%X]\n" , __func__, pll_ctl);/* * Calculate the ratio of F, R and OD
@@ -552,7 +545,7 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int bR =0x00 ; }else {/* Invalid ratio */ - printk(KERN_ERR DRV_NAME ": Invalid ratio %ld, give up!\n", ratio); +dev_err (host->dev,"Invalid ratio %ld, give up!\n" , ratio);return ; }
@@ -560,15 +553,16 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int bif (unlikely (F <0 ||F >127 )) {/* Invalid F */ - printk(KERN_ERR DRV_NAME ": F[%d] invalid!\n", F); +dev_err (host->dev,"F[%d] invalid!\n" ,F );return ; } -PDPRINTK ("F[%d] R[%d] ratio*1000[%ld]\n" ,F ,R , ratio); +dev_dbg (host->dev,"%s: F[%d] R[%d] ratio*1000[%ld]\n" , + __func__,F ,R , ratio); pll_ctl = (R <<8 ) |F ; -PDPRINTK ("Writing pll_ctl[%X]\n" , pll_ctl); +dev_dbg (host->dev,"%s: Writing pll_ctl[%X]\n" , __func__, pll_ctl);iowrite16 (pll_ctl, mmio_base +PDC_PLL_CTL );ioread16 (mmio_base +PDC_PLL_CTL );/* flush */
@@ -576,15 +570,12 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int b/* Wait the PLL circuit to be stable */ msleep (30 ); -#ifdef PDC_DEBUG /* * Show the current clock value of PLL control register * (maybe configured by the firmware) */ - pll_ctl =ioread16 (mmio_base +PDC_PLL_CTL ); - -PDPRINTK ("pll_ctl[%X]\n" , pll_ctl); -#endif +dev_dbg (host->dev,"%s: pll_ctl[%X]\n" , __func__, +ioread16 (mmio_base +PDC_PLL_CTL ));return ; }
@@ -605,7 +596,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)/* Start the test mode */ scr =ioread32 (mmio_base +PDC_SYS_CTL ); -PDPRINTK ("scr[%X]\n" , scr); +dev_dbg (host->dev,"%s: scr[%X]\n" , __func__, scr);iowrite32 (scr | (0x01 <<14 ), mmio_base +PDC_SYS_CTL );ioread32 (mmio_base +PDC_SYS_CTL );/* flush */
@@ -622,7 +613,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)/* Stop the test mode */ scr =ioread32 (mmio_base +PDC_SYS_CTL ); -PDPRINTK ("scr[%X]\n" , scr); +dev_dbg (host->dev,"%s: scr[%X]\n" , __func__, scr);iowrite32 (scr & ~(0x01 <<14 ), mmio_base +PDC_SYS_CTL );ioread32 (mmio_base +PDC_SYS_CTL );/* flush */
@@ -632,8 +623,8 @@ static long pdc_detect_pll_input_clock(struct ata_host *host) pll_clock = ((start_count - end_count) &0x3fffffff ) /100 * (100000000 / usec_elapsed); -PDPRINTK ("start[%ld] end[%ld] \n" , start_count, end_count); -PDPRINTK ("PLL input clock[%ld]Hz\n" , pll_clock); +dev_dbg (host->dev,"%s: start[%ld] end[%ld] PLL input clock[%ld]HZ\n" , + __func__, start_count, end_count, pll_clock);return pll_clock; }
Signature · 1 line
2.16.4
PATCH v3 34/40 sata_nv: move DPRINTK to ata debugging
In reply to Hannes ReineckeReplace all DPRINTK calls with the ata_XXX_dbg functions.
--- drivers/ata/sata_nv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/ata/sata_nv.c +7 -7
@@ -2094,7 +2094,7 @@ static int nv_swncq_sdbfis(struct ata_port *ap)ata_qc_complete_multiple (ap, ap->qc_active ^ done_mask);if (!ap->qc_active) { -DPRINTK ("over\n" ); +ata_port_dbg (ap,"over\n" );nv_swncq_pp_reinit (ap);return 0 ; }
@@ -2109,10 +2109,10 @@ static int nv_swncq_sdbfis(struct ata_port *ap)*/ lack_dhfis =1 ; -DPRINTK ("id 0x%x QC: qc_active 0x%x," +ata_port_dbg (ap,"QC: qc_active 0x%llx," "SWNCQ:qc_active 0x%X defer_bits %X " "dhfis 0x%X dmafis 0x%X last_issue_tag %x\n" , - ap->print_id, ap->qc_active, pp->qc_active, + ap->qc_active, pp->qc_active, pp->defer_queue.defer_bits, pp->dhfis_bits, pp->dmafis_bits, pp->last_issue_tag);
@@ -2154,7 +2154,7 @@ static void nv_swncq_dmafis(struct ata_port *ap)__ata_bmdma_stop (ap); tag =nv_swncq_tag (ap); -DPRINTK ("dma setup tag 0x%x\n" , tag); +ata_port_dbg (ap,"dma setup tag 0x%x\n" , tag); qc =ata_qc_from_tag (ap, tag);if (unlikely (!qc))
@@ -2222,9 +2222,9 @@ static void nv_swncq_host_interrupt(struct ata_port *ap, u16 fis)if (fis &NV_SWNCQ_IRQ_SDBFIS ) { pp->ncq_flags |= ncq_saw_sdb; -DPRINTK ("id 0x%x SWNCQ: qc_active 0x%X " +ata_port_dbg (ap,"SWNCQ: qc_active 0x%X " "dhfis 0x%X dmafis 0x%X sactive 0x%X\n" , - ap->print_id, pp->qc_active, pp->dhfis_bits, + pp->qc_active, pp->dhfis_bits, pp->dmafis_bits,readl (pp->sactive_block));if (nv_swncq_sdbfis (ap) <0 ) goto irq_error;
@@ -2250,7 +2250,7 @@ static void nv_swncq_host_interrupt(struct ata_port *ap, u16 fis) goto irq_exit;if (pp->defer_queue.defer_bits) { -DPRINTK ("send next command\n" ); +ata_port_dbg (ap,"send next command\n" ); qc =nv_swncq_qc_from_dq (ap);nv_swncq_issue_atacmd (ap, qc); }
Signature · 1 line
2.16.4
PATCH v3 35/40 sata_fsl: move DPRINTK to ata debugging
In reply to Hannes ReineckeReplace all DPRINTK calls with the standard logging functions.
--- drivers/ata/sata_fsl.c | 90 ++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 44 deletions(-)
drivers/ata/sata_fsl.c +46 -44
@@ -311,10 +311,12 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host, intr_coalescing_ticks = ticks;spin_unlock_irqrestore (&host->lock, flags); -DPRINTK ("interrupt coalescing, count = 0x%x, ticks = %x\n" , - intr_coalescing_count, intr_coalescing_ticks); -DPRINTK ("ICC register status: (hcr base: 0x%x) = 0x%x\n" , - hcr_base,ioread32 (hcr_base +ICC )); +dev_dbg (host->dev, +"%s: interrupt coalescing, count = 0x%x, ticks = %x\n" , + __func__, intr_coalescing_count, intr_coalescing_ticks); +dev_dbg (host->dev, +"%s: ICC register status: (hcr base: 0x%x) = 0x%x\n" , + __func__, hcr_base,ioread32 (hcr_base +ICC )); } static ssize_t fsl_sata_intr_coalescing_show(struct device *dev,
@@ -385,18 +387,19 @@ static ssize_t fsl_sata_rx_watermark_store(struct device *dev,return strlen (buf); } -static inline unsigned int sata_fsl_tag (unsigned int tag, +static inline unsigned int sata_fsl_tag (struct ata_port *ap, +unsigned int tag,void __iomem *hcr_base) {/* We let libATA core do actual (queue) tag allocation */ if (unlikely (tag >=SATA_FSL_QUEUE_DEPTH )) { -DPRINTK ("tag %d invalid : out of range\n" , tag); +ata_port_dbg (ap,"tag %d invalid : out of range\n" , tag);return 0 ; }if (unlikely ((ioread32 (hcr_base +CQ )) & (1 << tag))) { -DPRINTK ("tag %d invalid : in use!!\n" , tag); +ata_port_dbg (ap,"tag %d invalid : in use!!\n" , tag);return 0 ; }
@@ -508,7 +511,7 @@ static enum ata_completion_errors sata_fsl_qc_prep(struct ata_queued_cmd *qc)struct sata_fsl_port_priv *pp = ap->private_data;struct sata_fsl_host_priv *host_priv = ap->host->private_data;void __iomem *hcr_base = host_priv->hcr_base; -unsigned int tag =sata_fsl_tag (qc->hw_tag, hcr_base); +unsigned int tag =sata_fsl_tag (ap, qc->hw_tag, hcr_base);struct command_desc *cd;u32 desc_info =CMD_DESC_RES |CMD_DESC_SNOOP_ENABLE ;u32 num_prde =0 ;
@@ -557,7 +560,7 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)struct ata_port *ap = qc->ap;struct sata_fsl_host_priv *host_priv = ap->host->private_data;void __iomem *hcr_base = host_priv->hcr_base; -unsigned int tag =sata_fsl_tag (qc->hw_tag, hcr_base); +unsigned int tag =sata_fsl_tag (ap, qc->hw_tag, hcr_base); VPRINTK("xx_qc_issue called,CQ=0x%x,CA=0x%x,CE=0x%x,CC=0x%x\n", ioread32(CQ + hcr_base),
@@ -586,7 +589,7 @@ static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc)struct sata_fsl_port_priv *pp = qc->ap->private_data;struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data;void __iomem *hcr_base = host_priv->hcr_base; -unsigned int tag =sata_fsl_tag (qc->hw_tag, hcr_base); +unsigned int tag =sata_fsl_tag (qc->ap, qc->hw_tag, hcr_base);struct command_desc *cd; cd = pp->cmdentry + tag;
@@ -850,7 +853,7 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, goto try_offline_again; } -DPRINTK ("hardreset, controller off-lined\n" ); +ata_port_dbg (ap,"hardreset, controller off-lined\n" );VPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS ));VPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL ));
@@ -880,7 +883,7 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, goto err; } -DPRINTK ("hardreset, controller off-lined & on-lined\n" ); +ata_port_dbg (ap,"controller off-lined & on-lined\n" );VPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS ));VPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL ));
@@ -962,7 +965,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, tf.ctl |=ATA_SRST ;/* setup SRST bit in taskfile control reg */ ata_tf_to_fis (&tf, pmp,0 , cfis); -DPRINTK ("Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n" , +ata_port_dbg (ap,"Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n" , cfis[0 ], cfis[1 ], cfis[2 ], cfis[3 ]);/*
@@ -970,7 +973,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,* other commands are active on the controller/device */ -DPRINTK ("@Softreset, CQ = 0x%x, CA = 0x%x, CC = 0x%x\n" , +ata_port_dbg (ap,"CQ = 0x%x, CA = 0x%x, CC = 0x%x\n" ,ioread32 (CQ + hcr_base),ioread32 (CA + hcr_base),ioread32 (CC + hcr_base));
@@ -983,15 +986,17 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,if (temp &0x1 ) {ata_port_warn (ap,"ATA_SRST issue failed\n" ); -DPRINTK ("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n" , +ata_port_dbg (ap,"Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n" ,ioread32 (CQ + hcr_base),ioread32 (CA + hcr_base),ioread32 (CC + hcr_base));sata_fsl_scr_read (&ap->link,SCR_ERROR , &Serror); -DPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS )); -DPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL )); -DPRINTK ("Serror = 0x%x\n" , Serror); +ata_port_dbg (ap, +"HStatus = 0x%x HControl = 0x%x Serror = 0x%x\n" , +ioread32 (hcr_base +HSTATUS ), +ioread32 (hcr_base +HCONTROL ), + Serror); goto err; }
@@ -1049,7 +1054,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,static void sata_fsl_error_handler (struct ata_port *ap) { -DPRINTK ("in xx_error_handler\n" ); +ata_port_dbg (ap,"ENTER\n" );sata_pmp_error_handler (ap); }
@@ -1092,7 +1097,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)if (unlikely (SError &0xFFFF0000 ))sata_fsl_scr_write (&ap->link,SCR_ERROR , SError); -DPRINTK ("error_intr,hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n" , +ata_port_dbg (ap,"hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n" , hstatus, cereg,ioread32 (hcr_base +DE ), SError);/* handle fatal errors */
@@ -1109,7 +1114,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)/* Handle PHYRDY change notification */ if (hstatus &INT_ON_PHYRDY_CHG ) { -DPRINTK ("SATA FSL: PHYRDY change indication\n" ); +ata_port_dbg (ap,"PHYRDY change indication\n" );/* Setup a soft-reset EH action */ ata_ehi_hotplugged (ehi);
@@ -1130,7 +1135,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)*/ abort =1 ; -DPRINTK ("single device error, CE=0x%x, DE=0x%x\n" , +ata_port_dbg (ap,"single device error, CE=0x%x, DE=0x%x\n" ,ioread32 (hcr_base +CE ),ioread32 (hcr_base +DE ));/* find out the offending link and qc */
@@ -1235,12 +1240,12 @@ static void sata_fsl_host_intr(struct ata_port *ap) }if (unlikely (SError &0xFFFF0000 )) { -DPRINTK ("serror @host_intr : 0x%x\n" , SError); +ata_port_dbg (ap,"serror @host_intr : 0x%x\n" , SError);sata_fsl_error_intr (ap); }if (unlikely (hstatus & status_mask)) { -DPRINTK ("error interrupt!!\n" ); +ata_port_dbg (ap,"error interrupt!!\n" );sata_fsl_error_intr (ap);return ; }
@@ -1258,17 +1263,15 @@ static void sata_fsl_host_intr(struct ata_port *ap)/* clear CC bit, this will also complete the interrupt */ iowrite32 (done_mask, hcr_base +CC ); -DPRINTK ("Status of all queues :\n" ); -DPRINTK ("done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n" , - done_mask,ioread32 (hcr_base +CA ), -ioread32 (hcr_base +CE )); +ata_port_dbg (ap,"Status of all queues: done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n" , + done_mask,ioread32 (hcr_base +CA ), +ioread32 (hcr_base +CE ));for (i =0 ; i <SATA_FSL_QUEUE_DEPTH ; i++) {if (done_mask & (1 << i)) -DPRINTK - ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n" , - i,ioread32 (hcr_base +CC ), -ioread32 (hcr_base +CA )); +ata_port_dbg (ap,"completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n" , + i,ioread32 (hcr_base +CC ), +ioread32 (hcr_base +CA )); }ata_qc_complete_multiple (ap,ata_qc_get_active (ap) ^ done_mask);return ;
@@ -1277,16 +1280,16 @@ static void sata_fsl_host_intr(struct ata_port *ap)iowrite32 (1 , hcr_base +CC ); qc =ata_qc_from_tag (ap,ATA_TAG_INTERNAL ); -DPRINTK ("completing non-ncq cmd, CC=0x%x\n" , -ioread32 (hcr_base +CC )); +ata_port_dbg (ap,"completing non-ncq cmd, CC=0x%x\n" , +ioread32 (hcr_base +CC ));if (qc) {ata_qc_complete (qc); } }else {/* Spurious Interrupt!! */ -DPRINTK ("spurious interrupt!!, CC = 0x%x\n" , -ioread32 (hcr_base +CC )); +ata_port_dbg (ap,"spurious interrupt!!, CC = 0x%x\n" , +ioread32 (hcr_base +CC ));iowrite32 (done_mask, hcr_base +CC );return ; }
@@ -1305,7 +1308,7 @@ static irqreturn_t sata_fsl_interrupt(int irq, void *dev_instance) interrupt_enables =ioread32 (hcr_base +HSTATUS ); interrupt_enables &=0x3F ; -DPRINTK ("interrupt status 0x%x\n" , interrupt_enables); +ata_port_dbg (ap,"interrupt status 0x%x\n" , interrupt_enables);if (!interrupt_enables)return IRQ_NONE ;
@@ -1359,14 +1362,14 @@ static int sata_fsl_init_controller(struct ata_host *host)iowrite32 ((temp & ~0x3F ), hcr_base +HCONTROL );/* Disable interrupt coalescing control(icc), for the moment */ -DPRINTK ("icc = 0x%x\n" ,ioread32 (hcr_base +ICC )); +ata_port_dbg (ap,"icc = 0x%x\n" ,ioread32 (hcr_base +ICC ));iowrite32 (0x01000000 , hcr_base +ICC );/* clear error registers, SError is cleared by libATA */ iowrite32 (0x00000FFFF , hcr_base +CE );iowrite32 (0x00000FFFF , hcr_base +DE ); -/* +/* * reset the number of command complete bits which will cause the * interrupt to be signaled */
@@ -1378,8 +1381,9 @@ static int sata_fsl_init_controller(struct ata_host *host)* callback, that should also initiate the OOB, COMINIT sequence */ -DPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS )); -DPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL )); +ata_port_dbg (ap,"HStatus = 0x%x HControl = 0x%x\n" , +ioread32 (hcr_base +HSTATUS ), +ioread32 (hcr_base +HCONTROL ));return 0 ; }
@@ -1458,9 +1462,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)iowrite32 (temp |TRANSCFG_RX_WATER_MARK , csr_base +TRANSCFG ); } -DPRINTK ("@reset i/o = 0x%x\n" ,ioread32 (csr_base +TRANSCFG )); -DPRINTK ("sizeof(cmd_desc) = %d\n" ,sizeof (struct command_desc )); -DPRINTK ("sizeof(#define cmd_desc) = %d\n" ,SATA_FSL_CMD_DESC_SIZE ); +ata_port_dbg (ap,"@reset i/o = 0x%x\n" ,ioread32 (csr_base +TRANSCFG )); host_priv =kzalloc (sizeof (struct sata_fsl_host_priv ),GFP_KERNEL );if (!host_priv)
Signature · 1 line
2.16.4
Re: [PATCH 35/40] sata_fsl: move DPRINTK to ata debugging
Quoted 4 lines · Hannes Reinecke
Replace all DPRINTK calls with the standard logging functions.
Signed-off-by Hannes Reinecke <[email protected]>Reviewed-by Bartlomiej Zolnierkiewicz <[email protected]>
drivers/ata/sata_fsl.c: In function 'sata_fsl_init_controller':drivers/ata/sata_fsl.c:1365:15: error: 'ap' undeclared (first use in this function); did you mean 'up'?
and several other similar errors.
Guenter
Quoted 278 lines
--- drivers/ata/sata_fsl.c | 90 ++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 44 deletions(-)drivers/ata/sata_fsl.c +46
-44@@ -311,10 +311,12 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host, intr_coalescing_ticks = ticks;spin_unlock_irqrestore (&host->lock, flags); -DPRINTK ("interrupt coalescing, count = 0x%x, ticks = %x\n" , - intr_coalescing_count, intr_coalescing_ticks); -DPRINTK ("ICC register status: (hcr base: 0x%x) = 0x%x\n" , - hcr_base,ioread32 (hcr_base +ICC )); +dev_dbg (host->dev, +"%s: interrupt coalescing, count = 0x%x, ticks = %x\n" , + __func__, intr_coalescing_count, intr_coalescing_ticks); +dev_dbg (host->dev, +"%s: ICC register status: (hcr base: 0x%x) = 0x%x\n" , + __func__, hcr_base,ioread32 (hcr_base +ICC )); } static ssize_t fsl_sata_intr_coalescing_show(struct device *dev,@@ -385,18 +387,19 @@ static ssize_t fsl_sata_rx_watermark_store(struct device *dev,return strlen (buf); } -static inline unsigned int sata_fsl_tag (unsigned int tag, +static inline unsigned int sata_fsl_tag (struct ata_port *ap, +unsigned int tag,void __iomem *hcr_base) {/* We let libATA core do actual (queue) tag allocation */ if (unlikely (tag >=SATA_FSL_QUEUE_DEPTH )) { -DPRINTK ("tag %d invalid : out of range\n" , tag); +ata_port_dbg (ap,"tag %d invalid : out of range\n" , tag);return 0 ; }if (unlikely ((ioread32 (hcr_base +CQ )) & (1 << tag))) { -DPRINTK ("tag %d invalid : in use!!\n" , tag); +ata_port_dbg (ap,"tag %d invalid : in use!!\n" , tag);return 0 ; }@@ -508,7 +511,7 @@ static enum ata_completion_errors sata_fsl_qc_prep(struct ata_queued_cmd *qc)struct sata_fsl_port_priv *pp = ap->private_data;struct sata_fsl_host_priv *host_priv = ap->host->private_data;void __iomem *hcr_base = host_priv->hcr_base; -unsigned int tag =sata_fsl_tag (qc->hw_tag, hcr_base); +unsigned int tag =sata_fsl_tag (ap, qc->hw_tag, hcr_base);struct command_desc *cd;u32 desc_info =CMD_DESC_RES |CMD_DESC_SNOOP_ENABLE ;u32 num_prde =0 ;@@ -557,7 +560,7 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)struct ata_port *ap = qc->ap;struct sata_fsl_host_priv *host_priv = ap->host->private_data;void __iomem *hcr_base = host_priv->hcr_base; -unsigned int tag =sata_fsl_tag (qc->hw_tag, hcr_base); +unsigned int tag =sata_fsl_tag (ap, qc->hw_tag, hcr_base); VPRINTK("xx_qc_issue called,CQ=0x%x,CA=0x%x,CE=0x%x,CC=0x%x\n", ioread32(CQ + hcr_base),@@ -586,7 +589,7 @@ static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc)struct sata_fsl_port_priv *pp = qc->ap->private_data;struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data;void __iomem *hcr_base = host_priv->hcr_base; -unsigned int tag =sata_fsl_tag (qc->hw_tag, hcr_base); +unsigned int tag =sata_fsl_tag (qc->ap, qc->hw_tag, hcr_base);struct command_desc *cd; cd = pp->cmdentry + tag;@@ -850,7 +853,7 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, goto try_offline_again; } -DPRINTK ("hardreset, controller off-lined\n" ); +ata_port_dbg (ap,"hardreset, controller off-lined\n" );VPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS ));VPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL ));@@ -880,7 +883,7 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, goto err; } -DPRINTK ("hardreset, controller off-lined & on-lined\n" ); +ata_port_dbg (ap,"controller off-lined & on-lined\n" );VPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS ));VPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL ));@@ -962,7 +965,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, tf.ctl |=ATA_SRST ;/* setup SRST bit in taskfile control reg */ ata_tf_to_fis (&tf, pmp,0 , cfis); -DPRINTK ("Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n" , +ata_port_dbg (ap,"Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n" , cfis[0 ], cfis[1 ], cfis[2 ], cfis[3 ]);/* @@ -970,7 +973,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,* other commands are active on the controller/device */ -DPRINTK ("@Softreset, CQ = 0x%x, CA = 0x%x, CC = 0x%x\n" , +ata_port_dbg (ap,"CQ = 0x%x, CA = 0x%x, CC = 0x%x\n" ,ioread32 (CQ + hcr_base),ioread32 (CA + hcr_base),ioread32 (CC + hcr_base));@@ -983,15 +986,17 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,if (temp &0x1 ) {ata_port_warn (ap,"ATA_SRST issue failed\n" ); -DPRINTK ("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n" , +ata_port_dbg (ap,"Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n" ,ioread32 (CQ + hcr_base),ioread32 (CA + hcr_base),ioread32 (CC + hcr_base));sata_fsl_scr_read (&ap->link,SCR_ERROR , &Serror); -DPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS )); -DPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL )); -DPRINTK ("Serror = 0x%x\n" , Serror); +ata_port_dbg (ap, +"HStatus = 0x%x HControl = 0x%x Serror = 0x%x\n" , +ioread32 (hcr_base +HSTATUS ), +ioread32 (hcr_base +HCONTROL ), + Serror); goto err; }@@ -1049,7 +1054,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,static void sata_fsl_error_handler (struct ata_port *ap) { -DPRINTK ("in xx_error_handler\n" ); +ata_port_dbg (ap,"ENTER\n" );sata_pmp_error_handler (ap); }@@ -1092,7 +1097,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)if (unlikely (SError &0xFFFF0000 ))sata_fsl_scr_write (&ap->link,SCR_ERROR , SError); -DPRINTK ("error_intr,hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n" , +ata_port_dbg (ap,"hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n" , hstatus, cereg,ioread32 (hcr_base +DE ), SError);/* handle fatal errors */ @@ -1109,7 +1114,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)/* Handle PHYRDY change notification */ if (hstatus &INT_ON_PHYRDY_CHG ) { -DPRINTK ("SATA FSL: PHYRDY change indication\n" ); +ata_port_dbg (ap,"PHYRDY change indication\n" );/* Setup a soft-reset EH action */ ata_ehi_hotplugged (ehi);@@ -1130,7 +1135,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)*/ abort =1 ; -DPRINTK ("single device error, CE=0x%x, DE=0x%x\n" , +ata_port_dbg (ap,"single device error, CE=0x%x, DE=0x%x\n" ,ioread32 (hcr_base +CE ),ioread32 (hcr_base +DE ));/* find out the offending link and qc */ @@ -1235,12 +1240,12 @@ static void sata_fsl_host_intr(struct ata_port *ap) }if (unlikely (SError &0xFFFF0000 )) { -DPRINTK ("serror @host_intr : 0x%x\n" , SError); +ata_port_dbg (ap,"serror @host_intr : 0x%x\n" , SError);sata_fsl_error_intr (ap); }if (unlikely (hstatus & status_mask)) { -DPRINTK ("error interrupt!!\n" ); +ata_port_dbg (ap,"error interrupt!!\n" );sata_fsl_error_intr (ap);return ; }@@ -1258,17 +1263,15 @@ static void sata_fsl_host_intr(struct ata_port *ap)/* clear CC bit, this will also complete the interrupt */ iowrite32 (done_mask, hcr_base +CC ); -DPRINTK ("Status of all queues :\n" ); -DPRINTK ("done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n" , - done_mask,ioread32 (hcr_base +CA ), -ioread32 (hcr_base +CE )); +ata_port_dbg (ap,"Status of all queues: done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n" , + done_mask,ioread32 (hcr_base +CA ), +ioread32 (hcr_base +CE ));for (i =0 ; i <SATA_FSL_QUEUE_DEPTH ; i++) {if (done_mask & (1 << i)) -DPRINTK - ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n" , - i,ioread32 (hcr_base +CC ), -ioread32 (hcr_base +CA )); +ata_port_dbg (ap,"completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n" , + i,ioread32 (hcr_base +CC ), +ioread32 (hcr_base +CA )); }ata_qc_complete_multiple (ap,ata_qc_get_active (ap) ^ done_mask);return ;@@ -1277,16 +1280,16 @@ static void sata_fsl_host_intr(struct ata_port *ap)iowrite32 (1 , hcr_base +CC ); qc =ata_qc_from_tag (ap,ATA_TAG_INTERNAL ); -DPRINTK ("completing non-ncq cmd, CC=0x%x\n" , -ioread32 (hcr_base +CC )); +ata_port_dbg (ap,"completing non-ncq cmd, CC=0x%x\n" , +ioread32 (hcr_base +CC ));if (qc) {ata_qc_complete (qc); } }else {/* Spurious Interrupt!! */ -DPRINTK ("spurious interrupt!!, CC = 0x%x\n" , -ioread32 (hcr_base +CC )); +ata_port_dbg (ap,"spurious interrupt!!, CC = 0x%x\n" , +ioread32 (hcr_base +CC ));iowrite32 (done_mask, hcr_base +CC );return ; }@@ -1305,7 +1308,7 @@ static irqreturn_t sata_fsl_interrupt(int irq, void *dev_instance) interrupt_enables =ioread32 (hcr_base +HSTATUS ); interrupt_enables &=0x3F ; -DPRINTK ("interrupt status 0x%x\n" , interrupt_enables); +ata_port_dbg (ap,"interrupt status 0x%x\n" , interrupt_enables);if (!interrupt_enables)return IRQ_NONE ;@@ -1359,14 +1362,14 @@ static int sata_fsl_init_controller(struct ata_host *host)iowrite32 ((temp & ~0x3F ), hcr_base +HCONTROL );/* Disable interrupt coalescing control(icc), for the moment */ -DPRINTK ("icc = 0x%x\n" ,ioread32 (hcr_base +ICC )); +ata_port_dbg (ap,"icc = 0x%x\n" ,ioread32 (hcr_base +ICC ));iowrite32 (0x01000000 , hcr_base +ICC );/* clear error registers, SError is cleared by libATA */ iowrite32 (0x00000FFFF , hcr_base +CE );iowrite32 (0x00000FFFF , hcr_base +DE ); -/* +/* * reset the number of command complete bits which will cause the * interrupt to be signaled */ @@ -1378,8 +1381,9 @@ static int sata_fsl_init_controller(struct ata_host *host)* callback, that should also initiate the OOB, COMINIT sequence */ -DPRINTK ("HStatus = 0x%x\n" ,ioread32 (hcr_base +HSTATUS )); -DPRINTK ("HControl = 0x%x\n" ,ioread32 (hcr_base +HCONTROL )); +ata_port_dbg (ap,"HStatus = 0x%x HControl = 0x%x\n" , +ioread32 (hcr_base +HSTATUS ), +ioread32 (hcr_base +HCONTROL ));return 0 ; }@@ -1458,9 +1462,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)iowrite32 (temp |TRANSCFG_RX_WATER_MARK , csr_base +TRANSCFG ); } -DPRINTK ("@reset i/o = 0x%x\n" ,ioread32 (csr_base +TRANSCFG )); -DPRINTK ("sizeof(cmd_desc) = %d\n" ,sizeof (struct command_desc )); -DPRINTK ("sizeof(#define cmd_desc) = %d\n" ,SATA_FSL_CMD_DESC_SIZE ); +ata_port_dbg (ap,"@reset i/o = 0x%x\n" ,ioread32 (csr_base +TRANSCFG )); host_priv =kzalloc (sizeof (struct sata_fsl_host_priv ),GFP_KERNEL );if (!host_priv)
PATCH v3 36/40 libata-core: move DPRINTK to ata debugging
In reply to Hannes ReineckeReplace all DPRINTK calls with the ata_XXX_dbg functions.
--- drivers/ata/libata-core.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/ata/libata-core.c +11 -9
@@ -2061,7 +2061,7 @@ unsigned int ata_read_log_page(struct ata_device *dev, u8 log,unsigned int err_mask;bool dma = false; -DPRINTK ("read log page - log 0x%x, page 0x%x\n" , log, page); +ata_dev_dbg (dev,"read log page - log 0x%x, page 0x%x\n" , log, page);/* * Return error without actually issuing the command on controllers
@@ -2097,7 +2097,7 @@ unsigned int ata_read_log_page(struct ata_device *dev, u8 log, goto retry; } -DPRINTK ("EXIT, err_mask=%x\n" , err_mask); +ata_dev_dbg (dev,"EXIT, err_mask=%x\n" , err_mask);return err_mask; }
@@ -3560,7 +3560,7 @@ static int ata_dev_set_mode(struct ata_device *dev) dev_err_whine =" (device error ignored)" ; } -DPRINTK ("xfer_shift=%u, xfer_mode=0x%x\n" , +ata_dev_dbg (dev,"xfer_shift=%u, xfer_mode=0x%x\n" , dev->xfer_shift, (int )dev->xfer_mode); if (!(ehc->i.flags & ATA_EHI_QUIET) ||
@@ -4814,7 +4814,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)unsigned int err_mask;/* set up set-features taskfile */ -DPRINTK ("set features - xfer mode\n" ); +ata_dev_dbg (dev,"set features - xfer mode\n" );/* Some controllers and ATAPI devices show flaky interrupt * behavior after setting xfer mode. Use polling instead.
@@ -4836,7 +4836,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)/* On some disks, this command causes spin-up, so we need longer timeout */ err_mask =ata_exec_internal (dev, &tf,NULL ,DMA_NONE ,NULL ,0 ,15000 ); -DPRINTK ("EXIT, err_mask=%x\n" , err_mask); +ata_dev_dbg (dev,"EXIT, err_mask=%x\n" , err_mask);return err_mask; }
@@ -4862,7 +4862,8 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature)unsigned long timeout =0 ;/* set up set-features taskfile */ -DPRINTK ("set features - SATA features\n" ); +ata_dev_dbg (dev,"set features - SATA features enable %u feature %u\n" , + enable, feature);ata_tf_init (dev, &tf); tf.command =ATA_CMD_SET_FEATURES ;
@@ -4876,7 +4877,7 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature) ata_probe_timeout * 1000 : SETFEATURES_SPINUP_TIMEOUT; err_mask =ata_exec_internal (dev, &tf,NULL ,DMA_NONE ,NULL ,0 , timeout); -DPRINTK ("EXIT, err_mask=%x\n" , err_mask); +ata_dev_dbg (dev,"EXIT, err_mask=%x\n" , err_mask);return err_mask; }EXPORT_SYMBOL_GPL (ata_dev_set_feature);
@@ -4904,7 +4905,8 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,return AC_ERR_INVALID ;/* set up init dev params taskfile */ -DPRINTK ("init dev params \n" ); +ata_dev_dbg (dev,"init dev params heads %u sectors %u\n" , + heads, sectors);ata_tf_init (dev, &tf); tf.command =ATA_CMD_INIT_DEV_PARAMS ;
@@ -4920,7 +4922,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,if (err_mask ==AC_ERR_DEV && (tf.feature &ATA_ABORTED )) err_mask =0 ; -DPRINTK ("EXIT, err_mask=%x\n" , err_mask); +ata_dev_dbg (dev,"EXIT, err_mask=%x\n" , err_mask);return err_mask; }
Signature · 1 line
2.16.4
PATCH v3 37/40 libata: remove DPRINTK() macro
In reply to Hannes ReineckeNo users left, remove it.
--- include/linux/libata.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/libata.h +0 -2
@@ -46,14 +46,12 @@/* note: prints function name for you */ #ifdef ATA_DEBUG -#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)#ifdef ATA_VERBOSE_DEBUG #define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)#else #define VPRINTK(fmt, args...)#endif /* ATA_VERBOSE_DEBUG */ #else -#define DPRINTK(fmt, args...) #define VPRINTK(fmt, args...)#endif /* ATA_DEBUG */
Signature · 1 line
2.16.4
PATCH v3 38/40 libata: kill ATA_MSG_INFO
In reply to Hannes ReineckeJust a single user, which should be converted to ata_dev_dbg() anyway.
--- drivers/ata/libata-core.c | 6 +++--- include/linux/libata.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/ata/libata-core.c +3 -3
@@ -2455,8 +2455,8 @@ int ata_dev_configure(struct ata_device *dev)char modelbuf[ATA_ID_PROD_LEN +1 ];int rc; -if (!ata_dev_enabled (dev) &&ata_msg_info (ap)) { -ata_dev_info (dev,"%s: ENTER/EXIT -- nodev\n" , __func__); +if (!ata_dev_enabled (dev)) { +ata_dev_dbg (dev,"ENTER/EXIT -- nodev\n" );return 0 ; }
@@ -6036,7 +6036,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host)/* turn on all debugging levels */ ap->msg_enable =0x00FF ;#elif defined(ATA_DEBUG ) - ap->msg_enable =ATA_MSG_DRV |ATA_MSG_INFO |ATA_MSG_CTL |ATA_MSG_WARN |ATA_MSG_ERR ; + ap->msg_enable =ATA_MSG_DRV |ATA_MSG_CTL |ATA_MSG_WARN |ATA_MSG_ERR ;#else ap->msg_enable =ATA_MSG_DRV |ATA_MSG_ERR |ATA_MSG_WARN ;#endif
include/linux/libata.h +0 -2
@@ -70,7 +70,6 @@enum {ATA_MSG_DRV =0x0001 , -ATA_MSG_INFO =0x0002 ,ATA_MSG_PROBE =0x0004 ,ATA_MSG_WARN =0x0008 ,ATA_MSG_MALLOC =0x0010 ,
@@ -80,7 +79,6 @@ enum { };#define ata_msg_drv (p) ((p)->msg_enable & ATA_MSG_DRV) -#define ata_msg_info (p) ((p)->msg_enable & ATA_MSG_INFO)#define ata_msg_probe (p) ((p)->msg_enable & ATA_MSG_PROBE)#define ata_msg_warn (p) ((p)->msg_enable & ATA_MSG_WARN)#define ata_msg_malloc (p) ((p)->msg_enable & ATA_MSG_MALLOC)
Signature · 1 line
2.16.4
PATCH v3 39/40 libata: kill ATA_MSG_CTL
In reply to Hannes ReineckeAll instances had been converted to ata_XXX_dbg() anyway, so the conditional is pointless anyway.
--- drivers/ata/libata-core.c | 5 ++--- include/linux/libata.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/ata/libata-core.c +2 -3
@@ -1859,8 +1859,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,int may_fallback =1 , tried_spinup =0 ;int rc; -if (ata_msg_ctl (ap)) -ata_dev_dbg (dev,"ENTER\n" ); +ata_dev_dbg (dev,"ENTER\n" ); retry:ata_tf_init (dev, &tf);
@@ -6036,7 +6035,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host)/* turn on all debugging levels */ ap->msg_enable =0x00FF ;#elif defined(ATA_DEBUG ) - ap->msg_enable =ATA_MSG_DRV |ATA_MSG_CTL |ATA_MSG_WARN |ATA_MSG_ERR ; + ap->msg_enable =ATA_MSG_DRV |ATA_MSG_WARN |ATA_MSG_ERR ;#else ap->msg_enable =ATA_MSG_DRV |ATA_MSG_ERR |ATA_MSG_WARN ;#endif
include/linux/libata.h +0 -2
@@ -73,7 +73,6 @@ enum {ATA_MSG_PROBE =0x0004 ,ATA_MSG_WARN =0x0008 ,ATA_MSG_MALLOC =0x0010 , -ATA_MSG_CTL =0x0020 ,ATA_MSG_INTR =0x0040 , ATA_MSG_ERR = 0x0080, };
@@ -82,7 +81,6 @@ enum {#define ata_msg_probe (p) ((p)->msg_enable & ATA_MSG_PROBE)#define ata_msg_warn (p) ((p)->msg_enable & ATA_MSG_WARN)#define ata_msg_malloc (p) ((p)->msg_enable & ATA_MSG_MALLOC) -#define ata_msg_ctl (p) ((p)->msg_enable & ATA_MSG_CTL)#define ata_msg_intr (p) ((p)->msg_enable & ATA_MSG_INTR)#define ata_msg_err (p) ((p)->msg_enable & ATA_MSG_ERR)
Signature · 1 line
2.16.4
PATCH v3 40/40 libata: remove references to ATA_DEBUG
In reply to Hannes ReineckeAll instances are gone.
--- drivers/ata/libata-core.c | 2 -- include/linux/libata.h | 5 ----- 2 files changed, 7 deletions(-)
drivers/ata/libata-core.c +0 -2
@@ -6034,8 +6034,6 @@ struct ata_port *ata_port_alloc(struct ata_host *host)#if defined(ATA_VERBOSE_DEBUG )/* turn on all debugging levels */ ap->msg_enable =0x00FF ; -#elif defined(ATA_DEBUG ) - ap->msg_enable =ATA_MSG_DRV |ATA_MSG_WARN |ATA_MSG_ERR ;#else ap->msg_enable =ATA_MSG_DRV |ATA_MSG_ERR |ATA_MSG_WARN ;#endif
include/linux/libata.h +0 -5
@@ -38,22 +38,17 @@* compile-time options: to be removed as soon as all the drivers are * converted to the new debugging mechanism */ -#undef ATA_DEBUG/* debugging output */ #undef ATA_VERBOSE_DEBUG/* yet more debugging output */ #undef ATA_IRQ_TRAP/* define to ack screaming irqs */ #undef ATA_NDEBUG/* define to disable quick runtime checks */ /* note: prints function name for you */ -#ifdef ATA_DEBUG #ifdef ATA_VERBOSE_DEBUG #define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)#else #define VPRINTK(fmt, args...)#endif /* ATA_VERBOSE_DEBUG */ -#else -#define VPRINTK(fmt, args...) -#endif /* ATA_DEBUG */ #define ata_print_version_once (dev, version) \ ({ \
Signature · 1 line
2.16.4
Quoted 20 lines · Hannes Reinecke
Hi all,
this is a rewrite of an earlier patchset titled 'ata: move DPRINTK to dynamic debugging'.
The overall idea is that it's really tiresome to having to recompile the kernel every time one wants or needs to debug ata issues, especially as the kernel already provides mechanism for dynamic debugging messages.At the same time dynamic debugging does increase the load on the logging subsystem, and things like
printk()are poorly suited for high-speed logging.So this patchset does several things:
- cleans up the logging messages by removing duplicate or pointless messages
- Converts I/O and error handling related messages to tracepoints
- Moves all remaining messages over to dynamic debugging
Quoted 5 lines
With that
ATA_DEBUGcan be killed.Note, I'll be preparing an additional patchset for killing off
ATA_VERBOSE_DEBUG, too, but wanted to get this one out first before it becomes too large.
Applied for 5.7.
Signature · 1 line
Jens Axboe