* [PATCH 01/46] libata: drop BPRINTK()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-04 16:55 ` [PATCH 02/46] libata.h: whitespace and indentation fixes Hannes Reinecke
` (44 subsequent siblings)
45 siblings, 0 replies; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
No users, drop it.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
include/linux/libata.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index a36bdcb8d9e9..bd78646f88a0 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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; \
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* [PATCH 02/46] libata.h: whitespace and indentation fixes
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
2020-02-04 16:55 ` [PATCH 01/46] libata: drop BPRINTK() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 11:51 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 03/46] libata-transport: Whitespace cleanup Hannes Reinecke
` (43 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
include/linux/libata.h | 41 ++++++++++++++++++++++++++---------------
1 file changed, 26 insertions(+), 15 deletions(-)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index bd78646f88a0..19c9c32bd339 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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_remove_one(struct pci_dev *pdev);
#ifdef CONFIG_PM
@@ -1496,7 +1507,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)
/*
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 02/46] libata.h: whitespace and indentation fixes
2020-02-04 16:55 ` [PATCH 02/46] libata.h: whitespace and indentation fixes Hannes Reinecke
@ 2020-02-10 11:51 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 11:51 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> include/linux/libata.h | 41 ++++++++++++++++++++++++++---------------
> 1 file changed, 26 insertions(+), 15 deletions(-)
>
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index bd78646f88a0..19c9c32bd339 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -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_remove_one(struct pci_dev *pdev);
>
> #ifdef CONFIG_PM
> @@ -1496,7 +1507,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)
>
> /*
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 03/46] libata-transport: Whitespace cleanup
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
2020-02-04 16:55 ` [PATCH 01/46] libata: drop BPRINTK() Hannes Reinecke
2020-02-04 16:55 ` [PATCH 02/46] libata.h: whitespace and indentation fixes Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 11:52 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 04/46] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros Hannes Reinecke
` (42 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-transport.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 12a505bb9c5b..4ccfeb85ec66 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -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) \
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 03/46] libata-transport: Whitespace cleanup
2020-02-04 16:55 ` [PATCH 03/46] libata-transport: Whitespace cleanup Hannes Reinecke
@ 2020-02-10 11:52 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 11:52 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-transport.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> index 12a505bb9c5b..4ccfeb85ec66 100644
> --- a/drivers/ata/libata-transport.c
> +++ b/drivers/ata/libata-transport.c
> @@ -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) \
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 04/46] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (2 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 03/46] libata-transport: Whitespace cleanup Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 12:25 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 05/46] libata: remove pointless debugging messages Hannes Reinecke
` (41 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
Use standard dev_{dbg,info,notice,warn,err} macros instead of the
hand-crafted printk helpers.
Also change the name for 'ata_device' structure to ataX:Y to be
inline with the other ata object names.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/ata/ahci.c | 3 +--
drivers/ata/libata-acpi.c | 48 ++++++++++++++++++---------------
drivers/ata/libata-core.c | 61 ------------------------------------------
drivers/ata/libata-transport.c | 4 +--
include/linux/libata.h | 48 +++++++++++----------------------
5 files changed, 45 insertions(+), 119 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 4bfd1b14b390..b2719c64fc04 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -796,8 +796,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);
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 224e3486e9a5..9a7c25252e50 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -649,9 +649,7 @@ static int ata_acpi_run_tf(struct ata_device *dev,
struct ata_taskfile *pptf = NULL;
struct ata_taskfile tf, ptf, rtf;
unsigned int err_mask;
- const char *level;
const char *descr;
- char msg[60];
int rc;
if ((gtf->tf[0] == 0) && (gtf->tf[1] == 0) && (gtf->tf[2] == 0)
@@ -665,6 +663,10 @@ static int ata_acpi_run_tf(struct ata_device *dev,
pptf = &ptf;
}
+ descr = ata_get_cmd_descript(tf.command);
+ if (!descr)
+ descr = "unknown";
+
if (!ata_acpi_filter_tf(dev, &tf, pptf)) {
rtf = tf;
err_mask = ata_exec_internal(dev, &rtf, NULL,
@@ -672,40 +674,42 @@ static int ata_acpi_run_tf(struct ata_device *dev,
switch (err_mask) {
case 0:
- level = KERN_DEBUG;
- snprintf(msg, sizeof(msg), "succeeded");
+ ata_dev_dbg(dev,
+ "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+ "(%s) succeeded\n",
+ tf.command, tf.feature, tf.nsect, tf.lbal,
+ tf.lbam, tf.lbah, tf.device, descr);
rc = 1;
break;
case AC_ERR_DEV:
- level = KERN_INFO;
- snprintf(msg, sizeof(msg),
- "rejected by device (Stat=0x%02x Err=0x%02x)",
- rtf.command, rtf.feature);
+ ata_dev_info(dev,
+ "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+ "(%s) rejected by device (Stat=0x%02x Err=0x%02x)",
+ tf.command, tf.feature, tf.nsect, tf.lbal,
+ tf.lbam, tf.lbah, tf.device, descr,
+ rtf.command, rtf.feature);
rc = 0;
break;
default:
- level = KERN_ERR;
- snprintf(msg, sizeof(msg),
- "failed (Emask=0x%x Stat=0x%02x Err=0x%02x)",
- err_mask, rtf.command, rtf.feature);
+ ata_dev_err(dev,
+ "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+ "(%s) failed (Emask=0x%x Stat=0x%02x Err=0x%02x)",
+ tf.command, tf.feature, tf.nsect, tf.lbal,
+ tf.lbam, tf.lbah, tf.device, descr,
+ err_mask, rtf.command, rtf.feature);
rc = -EIO;
break;
}
} else {
- level = KERN_INFO;
- snprintf(msg, sizeof(msg), "filtered out");
+ ata_dev_info(dev,
+ "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+ "(%s) filtered out\n",
+ tf.command, tf.feature, tf.nsect, tf.lbal,
+ tf.lbam, tf.lbah, tf.device, descr);
rc = 0;
}
- descr = ata_get_cmd_descript(tf.command);
-
- ata_dev_printk(dev, level,
- "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x (%s) %s\n",
- tf.command, tf.feature, tf.nsect, tf.lbal,
- tf.lbam, tf.lbah, tf.device,
- (descr ? descr : "unknown"), msg);
-
return rc;
}
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 6f4ab5c5b52d..cee815ecd7df 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -7236,67 +7236,6 @@ const struct ata_port_info ata_dummy_port_info = {
.port_ops = &ata_dummy_port_ops,
};
-/*
- * Utility print functions
- */
-void ata_port_printk(const struct ata_port *ap, const char *level,
- const char *fmt, ...)
-{
- struct va_format vaf;
- va_list args;
-
- va_start(args, fmt);
-
- vaf.fmt = fmt;
- vaf.va = &args;
-
- printk("%sata%u: %pV", level, ap->print_id, &vaf);
-
- va_end(args);
-}
-EXPORT_SYMBOL(ata_port_printk);
-
-void ata_link_printk(const struct ata_link *link, const char *level,
- const char *fmt, ...)
-{
- struct va_format vaf;
- va_list args;
-
- va_start(args, fmt);
-
- vaf.fmt = fmt;
- vaf.va = &args;
-
- if (sata_pmp_attached(link->ap) || link->ap->slave_link)
- printk("%sata%u.%02u: %pV",
- level, link->ap->print_id, link->pmp, &vaf);
- else
- printk("%sata%u: %pV",
- level, link->ap->print_id, &vaf);
-
- va_end(args);
-}
-EXPORT_SYMBOL(ata_link_printk);
-
-void ata_dev_printk(const struct ata_device *dev, const char *level,
- const char *fmt, ...)
-{
- struct va_format vaf;
- va_list args;
-
- va_start(args, fmt);
-
- vaf.fmt = fmt;
- vaf.va = &args;
-
- printk("%sata%u.%02u: %pV",
- level, dev->link->ap->print_id, dev->link->pmp + dev->devno,
- &vaf);
-
- va_end(args);
-}
-EXPORT_SYMBOL(ata_dev_printk);
-
void ata_print_version(const struct device *dev, const char *version)
{
dev_printk(KERN_DEBUG, dev, "version %s\n", version);
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 4ccfeb85ec66..db42bd05c4cf 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -666,9 +666,9 @@ static int ata_tdev_add(struct ata_device *ata_dev)
dev->parent = &link->tdev;
dev->release = ata_tdev_release;
if (ata_is_host_link(link))
- dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
+ dev_set_name(dev, "ata%d.%d", ap->print_id, ata_dev->devno);
else
- dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp);
+ dev_set_name(dev, "ata%d.%d.0", ap->print_id, link->pmp);
transport_setup_device(dev);
ata_acpi_bind_dev(ata_dev);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 19c9c32bd339..437d2f27bfdd 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1414,51 +1414,38 @@ static inline int sata_srst_pmp(struct ata_link *link)
return link->pmp;
}
-/*
- * printk helpers
- */
-__printf(3, 4)
-void ata_port_printk(const struct ata_port *ap, const char *level,
- const char *fmt, ...);
-__printf(3, 4)
-void ata_link_printk(const struct ata_link *link, const char *level,
- const char *fmt, ...);
-__printf(3, 4)
-void ata_dev_printk(const struct ata_device *dev, const char *level,
- const char *fmt, ...);
-
#define ata_port_err(ap, fmt, ...) \
- ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__)
+ dev_err(&ap->tdev, fmt, ##__VA_ARGS__)
#define ata_port_warn(ap, fmt, ...) \
- ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__)
+ dev_warn(&ap->tdev, fmt, ##__VA_ARGS__)
#define ata_port_notice(ap, fmt, ...) \
- ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__)
+ dev_notice(&ap->tdev, fmt, ##__VA_ARGS__)
#define ata_port_info(ap, fmt, ...) \
- ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__)
+ dev_info(&ap->tdev, fmt, ##__VA_ARGS__)
#define ata_port_dbg(ap, fmt, ...) \
- ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__)
+ dev_dbg(&ap->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)
#define ata_link_err(link, fmt, ...) \
- ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
+ dev_err(&link->tdev, fmt, ##__VA_ARGS__)
#define ata_link_warn(link, fmt, ...) \
- ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__)
+ dev_warn(&link->tdev, fmt, ##__VA_ARGS__)
#define ata_link_notice(link, fmt, ...) \
- ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__)
+ dev_notice(&link->tdev, fmt, ##__VA_ARGS__)
#define ata_link_info(link, fmt, ...) \
- ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
+ dev_info(&link->tdev, fmt, ##__VA_ARGS__)
#define ata_link_dbg(link, fmt, ...) \
- ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
+ dev_dbg(&link->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)
#define ata_dev_err(dev, fmt, ...) \
- ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__)
+ dev_err(&dev->tdev, fmt, ##__VA_ARGS__)
#define ata_dev_warn(dev, fmt, ...) \
- ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
+ dev_warn(&dev->tdev, fmt, ##__VA_ARGS__)
#define ata_dev_notice(dev, fmt, ...) \
- ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__)
+ dev_notice(&dev->tdev, fmt, ##__VA_ARGS__)
#define ata_dev_info(dev, fmt, ...) \
- ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__)
+ dev_info(&dev->tdev, fmt, ##__VA_ARGS__)
#define ata_dev_dbg(dev, fmt, ...) \
- ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__)
+ dev_dbg(&dev->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)
void ata_print_version(const struct device *dev, const char *version);
@@ -1980,11 +1967,8 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
{
u8 status = ata_sff_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
-#ifdef ATA_DEBUG
if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ)))
- ata_port_printk(ap, KERN_DEBUG, "abnormal Status 0x%X\n",
- status);
-#endif
+ ata_port_dbg(ap, "abnormal Status 0x%X\n", status);
return status;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 04/46] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros
2020-02-04 16:55 ` [PATCH 04/46] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros Hannes Reinecke
@ 2020-02-10 12:25 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:25 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Use standard dev_{dbg,info,notice,warn,err} macros instead of the
> hand-crafted printk helpers.
> Also change the name for 'ata_device' structure to ataX:Y to be
> inline with the other ata object names.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/ata/ahci.c | 3 +--
> drivers/ata/libata-acpi.c | 48 ++++++++++++++++++---------------
> drivers/ata/libata-core.c | 61 ------------------------------------------
> drivers/ata/libata-transport.c | 4 +--
> include/linux/libata.h | 48 +++++++++++----------------------
> 5 files changed, 45 insertions(+), 119 deletions(-)
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 4bfd1b14b390..b2719c64fc04 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -796,8 +796,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);
> diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
> index 224e3486e9a5..9a7c25252e50 100644
> --- a/drivers/ata/libata-acpi.c
> +++ b/drivers/ata/libata-acpi.c
> @@ -649,9 +649,7 @@ static int ata_acpi_run_tf(struct ata_device *dev,
> struct ata_taskfile *pptf = NULL;
> struct ata_taskfile tf, ptf, rtf;
> unsigned int err_mask;
> - const char *level;
> const char *descr;
> - char msg[60];
> int rc;
>
> if ((gtf->tf[0] == 0) && (gtf->tf[1] == 0) && (gtf->tf[2] == 0)
> @@ -665,6 +663,10 @@ static int ata_acpi_run_tf(struct ata_device *dev,
> pptf = &ptf;
> }
>
> + descr = ata_get_cmd_descript(tf.command);
> + if (!descr)
> + descr = "unknown";
> +
> if (!ata_acpi_filter_tf(dev, &tf, pptf)) {
> rtf = tf;
> err_mask = ata_exec_internal(dev, &rtf, NULL,
> @@ -672,40 +674,42 @@ static int ata_acpi_run_tf(struct ata_device *dev,
>
> switch (err_mask) {
> case 0:
> - level = KERN_DEBUG;
> - snprintf(msg, sizeof(msg), "succeeded");
> + ata_dev_dbg(dev,
> + "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
> + "(%s) succeeded\n",
> + tf.command, tf.feature, tf.nsect, tf.lbal,
> + tf.lbam, tf.lbah, tf.device, descr);
> rc = 1;
> break;
>
> case AC_ERR_DEV:
> - level = KERN_INFO;
> - snprintf(msg, sizeof(msg),
> - "rejected by device (Stat=0x%02x Err=0x%02x)",
> - rtf.command, rtf.feature);
> + ata_dev_info(dev,
> + "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
> + "(%s) rejected by device (Stat=0x%02x Err=0x%02x)",
> + tf.command, tf.feature, tf.nsect, tf.lbal,
> + tf.lbam, tf.lbah, tf.device, descr,
> + rtf.command, rtf.feature);
> rc = 0;
> break;
>
> default:
> - level = KERN_ERR;
> - snprintf(msg, sizeof(msg),
> - "failed (Emask=0x%x Stat=0x%02x Err=0x%02x)",
> - err_mask, rtf.command, rtf.feature);
> + ata_dev_err(dev,
> + "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
> + "(%s) failed (Emask=0x%x Stat=0x%02x Err=0x%02x)",
> + tf.command, tf.feature, tf.nsect, tf.lbal,
> + tf.lbam, tf.lbah, tf.device, descr,
> + err_mask, rtf.command, rtf.feature);
> rc = -EIO;
> break;
> }
> } else {
> - level = KERN_INFO;
> - snprintf(msg, sizeof(msg), "filtered out");
> + ata_dev_info(dev,
> + "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
> + "(%s) filtered out\n",
> + tf.command, tf.feature, tf.nsect, tf.lbal,
> + tf.lbam, tf.lbah, tf.device, descr);
> rc = 0;
> }
> - descr = ata_get_cmd_descript(tf.command);
> -
> - ata_dev_printk(dev, level,
> - "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x (%s) %s\n",
> - tf.command, tf.feature, tf.nsect, tf.lbal,
> - tf.lbam, tf.lbah, tf.device,
> - (descr ? descr : "unknown"), msg);
> -
> return rc;
> }
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 6f4ab5c5b52d..cee815ecd7df 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -7236,67 +7236,6 @@ const struct ata_port_info ata_dummy_port_info = {
> .port_ops = &ata_dummy_port_ops,
> };
>
> -/*
> - * Utility print functions
> - */
> -void ata_port_printk(const struct ata_port *ap, const char *level,
> - const char *fmt, ...)
> -{
> - struct va_format vaf;
> - va_list args;
> -
> - va_start(args, fmt);
> -
> - vaf.fmt = fmt;
> - vaf.va = &args;
> -
> - printk("%sata%u: %pV", level, ap->print_id, &vaf);
> -
> - va_end(args);
> -}
> -EXPORT_SYMBOL(ata_port_printk);
> -
> -void ata_link_printk(const struct ata_link *link, const char *level,
> - const char *fmt, ...)
> -{
> - struct va_format vaf;
> - va_list args;
> -
> - va_start(args, fmt);
> -
> - vaf.fmt = fmt;
> - vaf.va = &args;
> -
> - if (sata_pmp_attached(link->ap) || link->ap->slave_link)
> - printk("%sata%u.%02u: %pV",
> - level, link->ap->print_id, link->pmp, &vaf);
> - else
> - printk("%sata%u: %pV",
> - level, link->ap->print_id, &vaf);
> -
> - va_end(args);
> -}
> -EXPORT_SYMBOL(ata_link_printk);
> -
> -void ata_dev_printk(const struct ata_device *dev, const char *level,
> - const char *fmt, ...)
> -{
> - struct va_format vaf;
> - va_list args;
> -
> - va_start(args, fmt);
> -
> - vaf.fmt = fmt;
> - vaf.va = &args;
> -
> - printk("%sata%u.%02u: %pV",
> - level, dev->link->ap->print_id, dev->link->pmp + dev->devno,
> - &vaf);
> -
> - va_end(args);
> -}
> -EXPORT_SYMBOL(ata_dev_printk);
> -
> void ata_print_version(const struct device *dev, const char *version)
> {
> dev_printk(KERN_DEBUG, dev, "version %s\n", version);
> diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
> index 4ccfeb85ec66..db42bd05c4cf 100644
> --- a/drivers/ata/libata-transport.c
> +++ b/drivers/ata/libata-transport.c
> @@ -666,9 +666,9 @@ static int ata_tdev_add(struct ata_device *ata_dev)
> dev->parent = &link->tdev;
> dev->release = ata_tdev_release;
> if (ata_is_host_link(link))
> - dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
> + dev_set_name(dev, "ata%d.%d", ap->print_id, ata_dev->devno);
> else
> - dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp);
> + dev_set_name(dev, "ata%d.%d.0", ap->print_id, link->pmp);
This change should be moved to a separate (pre-)patch.
However I worry that it is too late to change the device name as
it is a part of user-space ABI.
Please see Documentation/ABI/testing/sysfs-ata:
[...]
Files under /sys/class/ata_device
---------------------------------
Behind each link, up to two ata devices are created.
The name of the directory is devX[.Y].Z where:
- X is ata_port_id of the port where the device is connected,
- Y the port of the PM if any, and
- Z the device id: for PATA, there is usually 2 devices [0,1], only 1 for SATA.
What: /sys/class/ata_device/devX[.Y].Z/spdn_cnt
What: /sys/class/ata_device/devX[.Y].Z/gscr
What: /sys/class/ata_device/devX[.Y].Z/ering
What: /sys/class/ata_device/devX[.Y].Z/id
What: /sys/class/ata_device/devX[.Y].Z/pio_mode
What: /sys/class/ata_device/devX[.Y].Z/xfer_mode
What: /sys/class/ata_device/devX[.Y].Z/dma_mode
What: /sys/class/ata_device/devX[.Y].Z/class
Date: May, 2010
KernelVersion: v2.6.37
Contact: Gwendal Grignou <gwendal@chromium.org>
[...]
> transport_setup_device(dev);
> ata_acpi_bind_dev(ata_dev);
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 19c9c32bd339..437d2f27bfdd 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1414,51 +1414,38 @@ static inline int sata_srst_pmp(struct ata_link *link)
> return link->pmp;
> }
>
> -/*
> - * printk helpers
> - */
> -__printf(3, 4)
> -void ata_port_printk(const struct ata_port *ap, const char *level,
> - const char *fmt, ...);
> -__printf(3, 4)
> -void ata_link_printk(const struct ata_link *link, const char *level,
> - const char *fmt, ...);
> -__printf(3, 4)
> -void ata_dev_printk(const struct ata_device *dev, const char *level,
> - const char *fmt, ...);
> -
> #define ata_port_err(ap, fmt, ...) \
> - ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__)
> + dev_err(&ap->tdev, fmt, ##__VA_ARGS__)
> #define ata_port_warn(ap, fmt, ...) \
> - ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__)
> + dev_warn(&ap->tdev, fmt, ##__VA_ARGS__)
> #define ata_port_notice(ap, fmt, ...) \
> - ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__)
> + dev_notice(&ap->tdev, fmt, ##__VA_ARGS__)
> #define ata_port_info(ap, fmt, ...) \
> - ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__)
> + dev_info(&ap->tdev, fmt, ##__VA_ARGS__)
> #define ata_port_dbg(ap, fmt, ...) \
> - ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__)
> + dev_dbg(&ap->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)
>
> #define ata_link_err(link, fmt, ...) \
> - ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
> + dev_err(&link->tdev, fmt, ##__VA_ARGS__)
> #define ata_link_warn(link, fmt, ...) \
> - ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__)
> + dev_warn(&link->tdev, fmt, ##__VA_ARGS__)
> #define ata_link_notice(link, fmt, ...) \
> - ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__)
> + dev_notice(&link->tdev, fmt, ##__VA_ARGS__)
> #define ata_link_info(link, fmt, ...) \
> - ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
> + dev_info(&link->tdev, fmt, ##__VA_ARGS__)
> #define ata_link_dbg(link, fmt, ...) \
> - ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
> + dev_dbg(&link->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)
>
> #define ata_dev_err(dev, fmt, ...) \
> - ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__)
> + dev_err(&dev->tdev, fmt, ##__VA_ARGS__)
> #define ata_dev_warn(dev, fmt, ...) \
> - ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
> + dev_warn(&dev->tdev, fmt, ##__VA_ARGS__)
> #define ata_dev_notice(dev, fmt, ...) \
> - ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__)
> + dev_notice(&dev->tdev, fmt, ##__VA_ARGS__)
> #define ata_dev_info(dev, fmt, ...) \
> - ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__)
> + dev_info(&dev->tdev, fmt, ##__VA_ARGS__)
> #define ata_dev_dbg(dev, fmt, ...) \
> - ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__)
> + dev_dbg(&dev->tdev, "%s: " fmt, __func__, ##__VA_ARGS__)
Addition of __func__ to ata_{port,link,dev}_dbg() should be done in
a separate (post-)patch.
It should also be done together with fixing existing ata_*_dbg()
instances that are already using __func__:
drivers/ata/libata-sff.c: ata_port_dbg(ap, "%s: EXIT\n", __func__);
drivers/ata/pata_amd.c: ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
drivers/ata/libata-acpi.c: ata_dev_dbg(dev, "%s: ENTER: port#: %d\n",
drivers/ata/libata-acpi.c- __func__, ap->port_no);
drivers/ata/libata-acpi.c: ata_dev_dbg(dev, "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
drivers/ata/libata-acpi.c- __func__,
drivers/ata/libata-acpi.c: ata_dev_dbg(dev, "%s: returning gtf=%p, gtf_count=%d\n",
drivers/ata/libata-acpi.c- __func__, *gtf, rc);
drivers/ata/libata-acpi.c: ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n",
drivers/ata/libata-acpi.c- __func__, dev->devno, ap->port_no);
drivers/ata/libata-core.c: ata_dev_dbg(dev, "%s: ENTER\n", __func__);
drivers/ata/libata-core.c: ata_dev_dbg(dev, "%s: ENTER\n", __func__);
drivers/ata/libata-core.c: ata_dev_dbg(dev, "%s: EXIT, err\n", __func__);
so we don't end up with duplicated __func__ info.
The rest of the patch looks fine.
> void ata_print_version(const struct device *dev, const char *version);
>
> @@ -1980,11 +1967,8 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
> {
> u8 status = ata_sff_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
>
> -#ifdef ATA_DEBUG
> if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ)))
> - ata_port_printk(ap, KERN_DEBUG, "abnormal Status 0x%X\n",
> - status);
> -#endif
> + ata_port_dbg(ap, "abnormal Status 0x%X\n", status);
>
> return status;
> }
>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 05/46] libata: remove pointless debugging messages
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (3 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 04/46] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 12:34 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 06/46] ata_piix: remove debugging message in piix_init() Hannes Reinecke
` (40 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
Debugging messages in pci init functions or sg setup are pretty
much pointless, as the workflow pretty much decides what happened.
So drop them.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
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(-)
diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c
index 46dc54d18f0b..5270151ac441 100644
--- a/drivers/ata/acard-ahci.c
+++ b/drivers/ata/acard-ahci.c
@@ -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.
*/
@@ -364,8 +362,6 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
struct 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);
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index b2719c64fc04..4f628e33f52e 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1643,8 +1643,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);
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index ea5bf5f4cbed..4055071f213f 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -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,
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index cee815ecd7df..cea065fb6282 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5052,8 +5052,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;
@@ -6016,8 +6014,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;
@@ -6133,8 +6129,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);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 038db94216a9..931ae61d69fb 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -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");
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index eb9dc14e5147..8639f66706a3 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -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)];
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 05/46] libata: remove pointless debugging messages
2020-02-04 16:55 ` [PATCH 05/46] libata: remove pointless debugging messages Hannes Reinecke
@ 2020-02-10 12:34 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:34 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Debugging messages in pci init functions or sg setup are pretty
> much pointless, as the workflow pretty much decides what happened.
> So drop them.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> 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(-)
>
> diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c
> index 46dc54d18f0b..5270151ac441 100644
> --- a/drivers/ata/acard-ahci.c
> +++ b/drivers/ata/acard-ahci.c
> @@ -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.
> */
> @@ -364,8 +362,6 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
> struct 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);
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index b2719c64fc04..4f628e33f52e 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1643,8 +1643,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);
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index ea5bf5f4cbed..4055071f213f 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -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,
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index cee815ecd7df..cea065fb6282 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -5052,8 +5052,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;
> @@ -6016,8 +6014,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;
> @@ -6133,8 +6129,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);
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 038db94216a9..931ae61d69fb 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -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");
> diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
> index eb9dc14e5147..8639f66706a3 100644
> --- a/drivers/ata/sata_nv.c
> +++ b/drivers/ata/sata_nv.c
> @@ -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)];
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 06/46] ata_piix: remove debugging message in piix_init()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (4 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 05/46] libata: remove pointless debugging messages Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 12:36 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 07/46] libata-core: remove pointless debugging messages Hannes Reinecke
` (39 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
Drop pointless debugging message in piix_init()
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/ata/ata_piix.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 3ca7720e7d8f..f940ecf72aaa 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1767,14 +1767,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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 06/46] ata_piix: remove debugging message in piix_init()
2020-02-04 16:55 ` [PATCH 06/46] ata_piix: remove debugging message in piix_init() Hannes Reinecke
@ 2020-02-10 12:36 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:36 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Drop pointless debugging message in piix_init()
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/ata_piix.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
> index 3ca7720e7d8f..f940ecf72aaa 100644
> --- a/drivers/ata/ata_piix.c
> +++ b/drivers/ata/ata_piix.c
> @@ -1767,14 +1767,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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 07/46] libata-core: remove pointless debugging messages
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (5 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 06/46] ata_piix: remove debugging message in piix_init() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-05 8:08 ` Sergei Shtylyov
2020-02-10 12:37 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 08/46] libata: Add ata_port_classify() helper Hannes Reinecke
` (38 subsequent siblings)
45 siblings, 2 replies; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
The bus probe is better tracked with the actual calls, and the
resulting taskfile will be printed with tracepoints anyway.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index cea065fb6282..0f5715cfa1c4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -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,11 +6472,8 @@ int ata_port_probe(struct ata_port *ap)
if (ap->ops->error_handler) {
__ata_port_probe(ap);
ata_port_wait_eh(ap);
- } else {
- DPRINTK("ata%u: bus probe begin\n", ap->print_id);
+ } else
rc = ata_bus_probe(ap);
- DPRINTK("ata%u: bus probe end\n", ap->print_id);
- }
return rc;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 07/46] libata-core: remove pointless debugging messages
2020-02-04 16:55 ` [PATCH 07/46] libata-core: remove pointless debugging messages Hannes Reinecke
@ 2020-02-05 8:08 ` Sergei Shtylyov
2020-02-10 12:37 ` Bartlomiej Zolnierkiewicz
1 sibling, 0 replies; 97+ messages in thread
From: Sergei Shtylyov @ 2020-02-05 8:08 UTC (permalink / raw)
To: Hannes Reinecke, Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide
Hello!
On 04.02.2020 19:55, Hannes Reinecke wrote:
> The bus probe is better tracked with the actual calls, and the
> resulting taskfile will be printed with tracepoints anyway.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/libata-core.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index cea065fb6282..0f5715cfa1c4 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
[...]
> @@ -6475,11 +6472,8 @@ int ata_port_probe(struct ata_port *ap)
> if (ap->ops->error_handler) {
> __ata_port_probe(ap);
> ata_port_wait_eh(ap);
> - } else {
> - DPRINTK("ata%u: bus probe begin\n", ap->print_id);
> + } else
You shousd keep {} here, according to the CodingStyle. {} should be
used in all branches if used in any.
> rc = ata_bus_probe(ap);
> - DPRINTK("ata%u: bus probe end\n", ap->print_id);
> - }
> return rc;
> }
>
MBR, Sergei
^ permalink raw reply [flat|nested] 97+ messages in thread
* Re: [PATCH 07/46] libata-core: remove pointless debugging messages
2020-02-04 16:55 ` [PATCH 07/46] libata-core: remove pointless debugging messages Hannes Reinecke
2020-02-05 8:08 ` Sergei Shtylyov
@ 2020-02-10 12:37 ` Bartlomiej Zolnierkiewicz
1 sibling, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:37 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> The bus probe is better tracked with the actual calls, and the
> resulting taskfile will be printed with tracepoints anyway.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-core.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index cea065fb6282..0f5715cfa1c4 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -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,11 +6472,8 @@ int ata_port_probe(struct ata_port *ap)
> if (ap->ops->error_handler) {
> __ata_port_probe(ap);
> ata_port_wait_eh(ap);
> - } else {
> - DPRINTK("ata%u: bus probe begin\n", ap->print_id);
> + } else
> rc = ata_bus_probe(ap);
> - DPRINTK("ata%u: bus probe end\n", ap->print_id);
> - }
> return rc;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 08/46] libata: Add ata_port_classify() helper
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (6 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 07/46] libata-core: remove pointless debugging messages Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 12:44 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
` (37 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Add 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.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libahci.c | 2 +-
drivers/ata/libata-core.c | 68 ++++++++++++++++++++++++++++++++++-----------
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, 64 insertions(+), 20 deletions(-)
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 4055071f213f..c1bc973ecc16 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -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);
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0f5715cfa1c4..b2b96420a2f2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1025,6 +1025,27 @@ const char *sata_spd_string(unsigned int spd)
return spd_str[spd - 1];
}
+const char *ata_dev_class_string(unsigned int class)
+{
+ static const char * const class_str[] = {
+ "unknown",
+ "ATA",
+ "ATA (unsupported)",
+ "ATAPI",
+ "ATAPI (unsupported",
+ "PMP",
+ "PMP (unsupported)",
+ "SEMB",
+ "SEMB (unsupported)",
+ "ZAC",
+ "ZAC (unsupported)",
+ "none",
+ };
+ if (class == 0 || (class - 1) >= ARRAY_SIZE(class_str))
+ return "unknown";
+ return class_str[class - 1];
+}
+
/**
* ata_dev_classify - determine device type based on ATA-spec signature
* @tf: ATA taskfile register set for device to be identified
@@ -1063,35 +1084,48 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
* SEMB signature. This is worked around in
* ata_dev_read_id().
*/
- if ((tf->lbam == 0) && (tf->lbah == 0)) {
- DPRINTK("found ATA device by sig\n");
+ if ((tf->lbam == 0) && (tf->lbah == 0))
return ATA_DEV_ATA;
- }
- if ((tf->lbam == 0x14) && (tf->lbah == 0xeb)) {
- DPRINTK("found ATAPI device by sig\n");
+ if ((tf->lbam == 0x14) && (tf->lbah == 0xeb))
return ATA_DEV_ATAPI;
- }
- if ((tf->lbam == 0x69) && (tf->lbah == 0x96)) {
- DPRINTK("found PMP device by sig\n");
+ if ((tf->lbam == 0x69) && (tf->lbah == 0x96))
return ATA_DEV_PMP;
- }
- if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3)) {
- DPRINTK("found SEMB device by sig (could be ATA device)\n");
+ if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3))
return ATA_DEV_SEMB;
- }
- if ((tf->lbam == 0xcd) && (tf->lbah == 0xab)) {
- DPRINTK("found ZAC device by sig\n");
+ if ((tf->lbam == 0xcd) && (tf->lbah == 0xab))
return ATA_DEV_ZAC;
- }
- DPRINTK("unknown device\n");
return ATA_DEV_UNKNOWN;
}
+/**
+ * ata_port_classify - determine device type based on ATA-spec signature
+ * @ap: ATA port device on which the classification should be run
+ * @tf: ATA taskfile register set for device to be identified
+ *
+ * A wrapper around ata_dev_classify() to provide additional logging
+ *
+ * RETURNS:
+ * Device type, %ATA_DEV_ATA, %ATA_DEV_ATAPI, %ATA_DEV_PMP,
+ * %ATA_DEV_ZAC, or %ATA_DEV_UNKNOWN the event of failure.
+ */
+unsigned int ata_port_classify(struct ata_port *ap,
+ const struct ata_taskfile *tf)
+{
+ unsigned int class = ata_dev_classify(tf);
+
+ if (class != ATA_DEV_UNKNOWN)
+ ata_port_dbg(ap, "found %s device by sig\n",
+ ata_dev_class_string(class));
+ else
+ ata_port_dbg(ap, "found unknown device\n");
+ return class;
+}
+
/**
* ata_id_string - Convert IDENTIFY DEVICE page into string
* @id: IDENTIFY DEVICE results we will examine
@@ -7267,6 +7301,7 @@ EXPORT_SYMBOL_GPL(ata_xfer_mask2mode);
EXPORT_SYMBOL_GPL(ata_xfer_mode2mask);
EXPORT_SYMBOL_GPL(ata_xfer_mode2shift);
EXPORT_SYMBOL_GPL(ata_mode_string);
+EXPORT_SYMBOL_GPL(ata_dev_class_string);
EXPORT_SYMBOL_GPL(ata_id_xfermask);
EXPORT_SYMBOL_GPL(ata_do_set_mode);
EXPORT_SYMBOL_GPL(ata_std_qc_defer);
@@ -7282,6 +7317,7 @@ EXPORT_SYMBOL_GPL(sata_link_hardreset);
EXPORT_SYMBOL_GPL(sata_std_hardreset);
EXPORT_SYMBOL_GPL(ata_std_postreset);
EXPORT_SYMBOL_GPL(ata_dev_classify);
+EXPORT_SYMBOL_GPL(ata_port_classify);
EXPORT_SYMBOL_GPL(ata_dev_pair);
EXPORT_SYMBOL_GPL(ata_ratelimit);
EXPORT_SYMBOL_GPL(ata_msleep);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 931ae61d69fb..60509997137f 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -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
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index d55ee244d693..0864c4fafa39 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -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,
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index a6b76cc12a66..12f189f2ab1e 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -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;
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 560070d4f1d0..2373cf5d8d14 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -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;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 437d2f27bfdd..c7ffe6fb39f1 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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);
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 08/46] libata: Add ata_port_classify() helper
2020-02-04 16:55 ` [PATCH 08/46] libata: Add ata_port_classify() helper Hannes Reinecke
@ 2020-02-10 12:44 ` Bartlomiej Zolnierkiewicz
2020-02-13 7:15 ` Hannes Reinecke
0 siblings, 1 reply; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:44 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Add 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.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/libahci.c | 2 +-
> drivers/ata/libata-core.c | 68 ++++++++++++++++++++++++++++++++++-----------
> 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, 64 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index 4055071f213f..c1bc973ecc16 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -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);
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 0f5715cfa1c4..b2b96420a2f2 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1025,6 +1025,27 @@ const char *sata_spd_string(unsigned int spd)
> return spd_str[spd - 1];
> }
>
> +const char *ata_dev_class_string(unsigned int class)
> +{
> + static const char * const class_str[] = {
> + "unknown",
> + "ATA",
> + "ATA (unsupported)",
> + "ATAPI",
> + "ATAPI (unsupported",
> + "PMP",
> + "PMP (unsupported)",
> + "SEMB",
> + "SEMB (unsupported)",
> + "ZAC",
> + "ZAC (unsupported)",
> + "none",
> + };
> + if (class == 0 || (class - 1) >= ARRAY_SIZE(class_str))
> + return "unknown";
> + return class_str[class - 1];
> +}
> +
> /**
> * ata_dev_classify - determine device type based on ATA-spec signature
> * @tf: ATA taskfile register set for device to be identified
> @@ -1063,35 +1084,48 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
> * SEMB signature. This is worked around in
> * ata_dev_read_id().
> */
> - if ((tf->lbam == 0) && (tf->lbah == 0)) {
> - DPRINTK("found ATA device by sig\n");
> + if ((tf->lbam == 0) && (tf->lbah == 0))
> return ATA_DEV_ATA;
> - }
>
> - if ((tf->lbam == 0x14) && (tf->lbah == 0xeb)) {
> - DPRINTK("found ATAPI device by sig\n");
> + if ((tf->lbam == 0x14) && (tf->lbah == 0xeb))
> return ATA_DEV_ATAPI;
> - }
>
> - if ((tf->lbam == 0x69) && (tf->lbah == 0x96)) {
> - DPRINTK("found PMP device by sig\n");
> + if ((tf->lbam == 0x69) && (tf->lbah == 0x96))
> return ATA_DEV_PMP;
> - }
>
> - if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3)) {
> - DPRINTK("found SEMB device by sig (could be ATA device)\n");
> + if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3))
> return ATA_DEV_SEMB;
> - }
>
> - if ((tf->lbam == 0xcd) && (tf->lbah == 0xab)) {
> - DPRINTK("found ZAC device by sig\n");
> + if ((tf->lbam == 0xcd) && (tf->lbah == 0xab))
> return ATA_DEV_ZAC;
> - }
>
> - DPRINTK("unknown device\n");
> return ATA_DEV_UNKNOWN;
> }
>
> +/**
> + * ata_port_classify - determine device type based on ATA-spec signature
> + * @ap: ATA port device on which the classification should be run
> + * @tf: ATA taskfile register set for device to be identified
> + *
> + * A wrapper around ata_dev_classify() to provide additional logging
> + *
> + * RETURNS:
> + * Device type, %ATA_DEV_ATA, %ATA_DEV_ATAPI, %ATA_DEV_PMP,
> + * %ATA_DEV_ZAC, or %ATA_DEV_UNKNOWN the event of failure.
> + */
> +unsigned int ata_port_classify(struct ata_port *ap,
> + const struct ata_taskfile *tf)
> +{
> + unsigned int class = ata_dev_classify(tf);
> +
> + if (class != ATA_DEV_UNKNOWN)
> + ata_port_dbg(ap, "found %s device by sig\n",
> + ata_dev_class_string(class));
> + else
> + ata_port_dbg(ap, "found unknown device\n");
> + return class;
> +}
> +
> /**
> * ata_id_string - Convert IDENTIFY DEVICE page into string
> * @id: IDENTIFY DEVICE results we will examine
> @@ -7267,6 +7301,7 @@ EXPORT_SYMBOL_GPL(ata_xfer_mask2mode);
> EXPORT_SYMBOL_GPL(ata_xfer_mode2mask);
> EXPORT_SYMBOL_GPL(ata_xfer_mode2shift);
> EXPORT_SYMBOL_GPL(ata_mode_string);
> +EXPORT_SYMBOL_GPL(ata_dev_class_string);
This is not needed currently, please remove it.
Also EXPORT_SYMBOL_GPL() for ata_dev_classify() should be now
removed too.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> EXPORT_SYMBOL_GPL(ata_id_xfermask);
> EXPORT_SYMBOL_GPL(ata_do_set_mode);
> EXPORT_SYMBOL_GPL(ata_std_qc_defer);
> @@ -7282,6 +7317,7 @@ EXPORT_SYMBOL_GPL(sata_link_hardreset);
> EXPORT_SYMBOL_GPL(sata_std_hardreset);
> EXPORT_SYMBOL_GPL(ata_std_postreset);
> EXPORT_SYMBOL_GPL(ata_dev_classify);
> +EXPORT_SYMBOL_GPL(ata_port_classify);
> EXPORT_SYMBOL_GPL(ata_dev_pair);
> EXPORT_SYMBOL_GPL(ata_ratelimit);
> EXPORT_SYMBOL_GPL(ata_msleep);
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 931ae61d69fb..60509997137f 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -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
> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index d55ee244d693..0864c4fafa39 100644
> --- a/drivers/ata/sata_fsl.c
> +++ b/drivers/ata/sata_fsl.c
> @@ -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,
> diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
> index a6b76cc12a66..12f189f2ab1e 100644
> --- a/drivers/ata/sata_inic162x.c
> +++ b/drivers/ata/sata_inic162x.c
> @@ -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;
> diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
> index 560070d4f1d0..2373cf5d8d14 100644
> --- a/drivers/ata/sata_sil24.c
> +++ b/drivers/ata/sata_sil24.c
> @@ -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;
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 437d2f27bfdd..c7ffe6fb39f1 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -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);
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* Re: [PATCH 08/46] libata: Add ata_port_classify() helper
2020-02-10 12:44 ` Bartlomiej Zolnierkiewicz
@ 2020-02-13 7:15 ` Hannes Reinecke
0 siblings, 0 replies; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-13 7:15 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jens Axboe, linux-ide
On 2/10/20 1:44 PM, Bartlomiej Zolnierkiewicz wrote:
>
> On 2/4/20 5:55 PM, Hannes Reinecke wrote:
>> Add 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.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>> drivers/ata/libahci.c | 2 +-
>> drivers/ata/libata-core.c | 68 ++++++++++++++++++++++++++++++++++-----------
>> 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, 64 insertions(+), 20 deletions(-)
>>
[ .. ]
>> @@ -7267,6 +7301,7 @@ EXPORT_SYMBOL_GPL(ata_xfer_mask2mode);
>> EXPORT_SYMBOL_GPL(ata_xfer_mode2mask);
>> EXPORT_SYMBOL_GPL(ata_xfer_mode2shift);
>> EXPORT_SYMBOL_GPL(ata_mode_string);
>> +EXPORT_SYMBOL_GPL(ata_dev_class_string);
>
> This is not needed currently, please remove it.
>
Okay, will do.
> Also EXPORT_SYMBOL_GPL() for ata_dev_classify() should be now
> removed too.
>
No, we can't, as it's being used in drivers/scsi/libsas/sas_ata.c.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (7 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 08/46] libata: Add ata_port_classify() helper Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-05 1:51 ` kbuild test robot
2020-02-10 12:47 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter Hannes Reinecke
` (36 subsequent siblings)
45 siblings, 2 replies; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Use ata_port_dbg() to print out the information in ata_dump_id()
and remove the ata_msg_probe() conditional.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 37 +++++++++----------------------------
1 file changed, 9 insertions(+), 28 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b2b96420a2f2..8a18047f9bcb 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1449,32 +1449,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_port *ap, const u16 *id)
+{
+ ata_port_dbg(ap,
+ "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]);
}
/**
@@ -2552,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(ap, id);
/* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging
2020-02-04 16:55 ` [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
@ 2020-02-05 1:51 ` kbuild test robot
2020-02-10 12:47 ` Bartlomiej Zolnierkiewicz
1 sibling, 0 replies; 97+ messages in thread
From: kbuild test robot @ 2020-02-05 1:51 UTC (permalink / raw)
To: Hannes Reinecke
Cc: kbuild-all, Jens Axboe, Bartolomiej Zolnierkiewicz, linux-ide,
Hannes Reinecke
[-- Attachment #1: Type: text/plain, Size: 18616 bytes --]
Hi Hannes,
I love your patch! Perhaps something to improve:
[auto build test WARNING on tip/perf/core]
[also build test WARNING on v5.5]
[cannot apply to block/for-next next-20200204]
[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/20200205-040548
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 0cc4bd8f70d1ea2940295f1050508c663fe9eff9
reproduce: make htmldocs
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
Warning: The Sphinx 'sphinx_rtd_theme' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.
WARNING: dot(1) not found, for better output quality install graphviz from http://www.graphviz.org
WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
include/linux/spi/spi.h:207: warning: Function parameter or member 'driver_override' not described in 'spi_device'
include/linux/spi/spi.h:650: warning: Function parameter or member 'irq_flags' not described in 'spi_controller'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'quotactl' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'quota_on' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'getprocattr' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'setprocattr' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'locked_down' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'perf_event_open' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'perf_event_alloc' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'perf_event_free' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'perf_event_read' not described in 'security_list_options'
include/linux/lsm_hooks.h:1830: warning: Function parameter or member 'perf_event_write' not described in 'security_list_options'
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:1: warning: no structured comments found
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1: warning: no structured comments found
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:254: warning: Function parameter or member 'hdcp_workqueue' not described in 'amdgpu_display_manager'
drivers/usb/typec/bus.c:1: warning: 'typec_altmode_register_driver' not found
drivers/usb/typec/bus.c:1: warning: 'typec_altmode_unregister_driver' not found
drivers/usb/typec/class.c:1: warning: 'typec_altmode_register_notifier' not found
drivers/usb/typec/class.c:1: warning: 'typec_altmode_unregister_notifier' not found
include/linux/regulator/machine.h:196: warning: Function parameter or member 'max_uV_step' not described in 'regulation_constraints'
include/linux/regulator/driver.h:223: warning: Function parameter or member 'resume' not described in 'regulator_ops'
sound/soc/soc-core.c:2522: warning: Function parameter or member 'legacy_dai_naming' not described in 'snd_soc_register_dai'
drivers/infiniband/core/umem_odp.c:167: warning: Function parameter or member 'ops' not described in 'ib_umem_odp_alloc_child'
drivers/infiniband/core/umem_odp.c:217: warning: Function parameter or member 'ops' not described in 'ib_umem_odp_get'
drivers/infiniband/ulp/iser/iscsi_iser.h:401: warning: Function parameter or member 'all_list' not described in 'iser_fr_desc'
drivers/infiniband/ulp/iser/iscsi_iser.h:415: warning: Function parameter or member 'all_list' not described in 'iser_fr_pool'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:148: warning: Function parameter or member 'rsvd0' not described in 'opa_vesw_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:148: warning: Function parameter or member 'rsvd1' not described in 'opa_vesw_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:148: warning: Function parameter or member 'rsvd2' not described in 'opa_vesw_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:148: warning: Function parameter or member 'rsvd3' not described in 'opa_vesw_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:148: warning: Function parameter or member 'rsvd4' not described in 'opa_vesw_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:205: warning: Function parameter or member 'rsvd0' not described in 'opa_per_veswport_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:205: warning: Function parameter or member 'rsvd1' not described in 'opa_per_veswport_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:205: warning: Function parameter or member 'rsvd2' not described in 'opa_per_veswport_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:205: warning: Function parameter or member 'rsvd3' not described in 'opa_per_veswport_info'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:263: warning: Function parameter or member 'tbl_entries' not described in 'opa_veswport_mactable'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:342: warning: Function parameter or member 'reserved' not described in 'opa_veswport_summary_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd0' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd1' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd2' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd3' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd4' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd5' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd6' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd7' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd8' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:394: warning: Function parameter or member 'rsvd9' not described in 'opa_veswport_error_counters'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:460: warning: Function parameter or member 'reserved' not described in 'opa_vnic_vema_mad'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:485: warning: Function parameter or member 'reserved' not described in 'opa_vnic_notice_attr'
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h:500: warning: Function parameter or member 'reserved' not described in 'opa_vnic_vema_mad_trap'
include/linux/input/sparse-keymap.h:43: warning: Function parameter or member 'sw' not described in 'key_entry'
>> drivers/ata/libata-core.c:1454: warning: Function parameter or member 'ap' not described in 'ata_dump_id'
include/linux/skbuff.h:888: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'list' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'vlan_present' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
include/net/sock.h:232: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
include/net/sock.h:232: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
include/net/sock.h:514: warning: Function parameter or member 'sk_rx_skb_cache' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'sk_tx_skb_cache' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock'
include/net/sock.h:514: warning: Function parameter or member 'sk_bpf_storage' not described in 'sock'
include/net/sock.h:2459: warning: Function parameter or member 'tcp_rx_skb_cache_key' not described in 'DECLARE_STATIC_KEY_FALSE'
include/net/sock.h:2459: warning: Excess function parameter 'sk' description in 'DECLARE_STATIC_KEY_FALSE'
include/net/sock.h:2459: warning: Excess function parameter 'skb' description in 'DECLARE_STATIC_KEY_FALSE'
net/core/skbuff.c:5489: warning: Function parameter or member 'ethernet' not described in 'skb_mpls_push'
include/linux/netdevice.h:2082: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
include/linux/netdevice.h:2082: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state'
include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state'
include/drm/drm_modeset_helper_vtables.h:1052: warning: Function parameter or member 'prepare_writeback_job' not described in 'drm_connector_helper_funcs'
include/drm/drm_modeset_helper_vtables.h:1052: warning: Function parameter or member 'cleanup_writeback_job' not described in 'drm_connector_helper_funcs'
include/net/cfg80211.h:1189: warning: Function parameter or member 'txpwr' not described in 'station_parameters'
include/net/mac80211.h:4081: warning: Function parameter or member 'sta_set_txpwr' not described in 'ieee80211_ops'
include/net/mac80211.h:2036: warning: Function parameter or member 'txpwr' not described in 'ieee80211_sta'
include/linux/devfreq.h:187: warning: Function parameter or member 'last_status' not described in 'devfreq'
drivers/devfreq/devfreq.c:1818: warning: bad line: - Resource-managed devfreq_register_notifier()
drivers/devfreq/devfreq.c:1854: warning: bad line: - Resource-managed devfreq_unregister_notifier()
drivers/devfreq/devfreq-event.c:355: warning: Function parameter or member 'edev' not described in 'devfreq_event_remove_edev'
drivers/devfreq/devfreq-event.c:355: warning: Excess function parameter 'dev' description in 'devfreq_event_remove_edev'
Documentation/admin-guide/hw-vuln/tsx_async_abort.rst:142: WARNING: duplicate label virt_mechanism, other instance in Documentation/admin-guide/hw-vuln/mds.rst
Documentation/admin-guide/ras.rst:358: WARNING: Definition list ends without a blank line; unexpected unindent.
Documentation/admin-guide/ras.rst:358: WARNING: Definition list ends without a blank line; unexpected unindent.
Documentation/admin-guide/ras.rst:363: WARNING: Definition list ends without a blank line; unexpected unindent.
Documentation/admin-guide/ras.rst:363: WARNING: Definition list ends without a blank line; unexpected unindent.
Documentation/driver-api/driver-model/driver.rst:215: WARNING: Inline emphasis start-string without end-string.
Documentation/driver-api/driver-model/driver.rst:215: WARNING: Inline emphasis start-string without end-string.
include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string.
drivers/firewire/core-transaction.c:606: WARNING: Inline strong start-string without end-string.
Documentation/x86/boot.rst:72: WARNING: Malformed table.
Text in column margin in table line 57.
vim +1454 drivers/ata/libata-core.c
1440
1441 /**
1442 * ata_dump_id - IDENTIFY DEVICE info debugging output
1443 * @id: IDENTIFY DEVICE page to dump
1444 *
1445 * Dump selected 16-bit words from the given IDENTIFY DEVICE
1446 * page.
1447 *
1448 * LOCKING:
1449 * caller.
1450 */
1451
1452 static inline void ata_dump_id(struct ata_port *ap, const u16 *id)
1453 {
> 1454 ata_port_dbg(ap,
1455 "49==0x%04x 53==0x%04x 63==0x%04x 64==0x%04x 75==0x%04x\n"
1456 "80==0x%04x 81==0x%04x 82==0x%04x 83==0x%04x 84==0x%04x\n"
1457 "88==0x%04x 93==0x%04x\n",
1458 id[49], id[53], id[63], id[64], id[75], id[80],
1459 id[81], id[82], id[83], id[84], id[88], id[93]);
1460 }
1461
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7278 bytes --]
^ permalink raw reply [flat|nested] 97+ messages in thread
* Re: [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging
2020-02-04 16:55 ` [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
2020-02-05 1:51 ` kbuild test robot
@ 2020-02-10 12:47 ` Bartlomiej Zolnierkiewicz
1 sibling, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:47 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Use ata_port_dbg() to print out the information in ata_dump_id()
> and remove the ata_msg_probe() conditional.
Can't we use ata_dev_dbg() instead of ata_port_dbg()?
Otherwise it looks fine.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/libata-core.c | 37 +++++++++----------------------------
> 1 file changed, 9 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index b2b96420a2f2..8a18047f9bcb 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1449,32 +1449,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_port *ap, const u16 *id)
> +{
> + ata_port_dbg(ap,
> + "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]);
> }
>
> /**
> @@ -2552,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(ap, id);
>
> /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
> ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (8 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 12:51 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 11/46] sata_nv: move DPRINTK to ata debugging Hannes Reinecke
` (35 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Implement module parameter 'pci_dump' and move the DPRINTK calls
over to dev_printk().
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_mv.c | 71 +++++++++++++++++++++++++++------------------------
1 file changed, 38 insertions(+), 33 deletions(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index d7228f8e9297..9e570d455acc 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -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,47 +1249,49 @@ 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, "%p: %s\n", start + b, linebuf);
}
}
-#endif
-#if defined(ATA_DEBUG) || defined(CONFIG_PCI)
+#if 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, "%02x: %s\n", 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;
int start_port, num_ports, p, start_hc, num_hcs, hc;
+ if (!pci_dump)
+ return;
+ dev_printk(KERN_DEBUG, &pdev->dev, "All regs @ PCI error\n");
if (0 > port) {
start_hc = start_port = 0;
num_ports = 8; /* shld be benign for 4 port devs */
@@ -1295,31 +1301,31 @@ 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,
+ "All registers for port(s) %u-%u:\n", start_port,
+ num_ports > 1 ? num_ports - 1 : start_port);
if (NULL != pdev) {
- DPRINTK("PCI config space regs:\n");
+ dev_printk(KERN_DEBUG, &pdev->dev, "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, "PCI regs:\n");
+ 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, "HC regs (HC %i):\n", 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, "EDMA regs (port %i):\n", p);
+ mv_dump_mem(&pdev->dev, port_base, 0x54);
+ dev_printk(KERN_DEBUG, &pdev->dev, "SATA regs (port %i):\n", p);
+ mv_dump_mem(&pdev->dev, port_base+0x300, 0x60);
}
-#endif
}
static unsigned int mv_scr_offset(unsigned int sc_reg_in)
@@ -2958,7 +2964,6 @@ 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));
writelfl(0, mmio + hpriv->irq_cause_offset);
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter
2020-02-04 16:55 ` [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter Hannes Reinecke
@ 2020-02-10 12:51 ` Bartlomiej Zolnierkiewicz
2020-02-10 12:54 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:51 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Implement module parameter 'pci_dump' and move the DPRINTK calls
> over to dev_printk().
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_mv.c | 71 +++++++++++++++++++++++++++------------------------
> 1 file changed, 38 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index d7228f8e9297..9e570d455acc 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -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,47 +1249,49 @@ 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, "%p: %s\n", start + b, linebuf);
> }
> }
> -#endif
> -#if defined(ATA_DEBUG) || defined(CONFIG_PCI)
> +#if 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, "%02x: %s\n", 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;
> int start_port, num_ports, p, start_hc, num_hcs, hc;
>
> + if (!pci_dump)
> + return;
> + dev_printk(KERN_DEBUG, &pdev->dev, "All regs @ PCI error\n");
> if (0 > port) {
> start_hc = start_port = 0;
> num_ports = 8; /* shld be benign for 4 port devs */
> @@ -1295,31 +1301,31 @@ 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,
> + "All registers for port(s) %u-%u:\n", start_port,
> + num_ports > 1 ? num_ports - 1 : start_port);
>
> if (NULL != pdev) {
> - DPRINTK("PCI config space regs:\n");
> + dev_printk(KERN_DEBUG, &pdev->dev, "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, "PCI regs:\n");
> + 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, "HC regs (HC %i):\n", 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, "EDMA regs (port %i):\n", p);
> + mv_dump_mem(&pdev->dev, port_base, 0x54);
> + dev_printk(KERN_DEBUG, &pdev->dev, "SATA regs (port %i):\n", p);
> + mv_dump_mem(&pdev->dev, port_base+0x300, 0x60);
> }
> -#endif
> }
>
> static unsigned int mv_scr_offset(unsigned int sc_reg_in)
> @@ -2958,7 +2964,6 @@ 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));
>
> writelfl(0, mmio + hpriv->irq_cause_offset);
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* Re: [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter
2020-02-10 12:51 ` Bartlomiej Zolnierkiewicz
@ 2020-02-10 12:54 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 12:54 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/10/20 1:51 PM, Bartlomiej Zolnierkiewicz wrote:
>
> On 2/4/20 5:55 PM, Hannes Reinecke wrote:
>> From: Hannes Reinecke <hare@suse.com>
>>
>> Implement module parameter 'pci_dump' and move the DPRINTK calls
>> over to dev_printk().
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>
> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Revoked. ;)
In reply to v1 I've asked for preserving __func__ during
the conversion and it hasn't been done.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
>
>> ---
>> drivers/ata/sata_mv.c | 71 +++++++++++++++++++++++++++------------------------
>> 1 file changed, 38 insertions(+), 33 deletions(-)
>>
>> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
>> index d7228f8e9297..9e570d455acc 100644
>> --- a/drivers/ata/sata_mv.c
>> +++ b/drivers/ata/sata_mv.c
>> @@ -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,47 +1249,49 @@ 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, "%p: %s\n", start + b, linebuf);
>> }
>> }
>> -#endif
>> -#if defined(ATA_DEBUG) || defined(CONFIG_PCI)
>> +#if 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, "%02x: %s\n", 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;
>> int start_port, num_ports, p, start_hc, num_hcs, hc;
>>
>> + if (!pci_dump)
>> + return;
>> + dev_printk(KERN_DEBUG, &pdev->dev, "All regs @ PCI error\n");
>> if (0 > port) {
>> start_hc = start_port = 0;
>> num_ports = 8; /* shld be benign for 4 port devs */
>> @@ -1295,31 +1301,31 @@ 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,
>> + "All registers for port(s) %u-%u:\n", start_port,
>> + num_ports > 1 ? num_ports - 1 : start_port);
>>
>> if (NULL != pdev) {
>> - DPRINTK("PCI config space regs:\n");
>> + dev_printk(KERN_DEBUG, &pdev->dev, "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, "PCI regs:\n");
>> + 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, "HC regs (HC %i):\n", 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, "EDMA regs (port %i):\n", p);
>> + mv_dump_mem(&pdev->dev, port_base, 0x54);
>> + dev_printk(KERN_DEBUG, &pdev->dev, "SATA regs (port %i):\n", p);
>> + mv_dump_mem(&pdev->dev, port_base+0x300, 0x60);
>> }
>> -#endif
>> }
>>
>> static unsigned int mv_scr_offset(unsigned int sc_reg_in)
>> @@ -2958,7 +2964,6 @@ 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));
>>
>> writelfl(0, mmio + hpriv->irq_cause_offset);
>>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 11/46] sata_nv: move DPRINTK to ata debugging
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (9 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 10/46] sata_mv: replace DPRINTK with 'pci_dump' module parameter Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:25 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 12/46] sata_sx4: move DPRINTK to VPRINTK Hannes Reinecke
` (34 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Replace all DPRINTK calls with the ata_XXX_dbg functions.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_nv.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 8639f66706a3..0cbddad7cd12 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -1394,7 +1394,7 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
void __iomem *mmio = pp->ctl_block;
int curr_ncq = (qc->tf.protocol == ATA_PROT_NCQ);
- VPRINTK("ENTER\n");
+ ata_dev_dbg(qc->dev, "ENTER\n");
/* We can't handle result taskfile with NCQ commands, since
retrieving the taskfile switches us out of ADMA mode and would abort
@@ -1428,7 +1428,7 @@ 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);
+ ata_dev_dbg(qc->dev, "Issued tag %u\n", qc->hw_tag);
return 0;
}
@@ -2007,7 +2007,7 @@ static unsigned int nv_swncq_issue_atacmd(struct ata_port *ap,
if (qc == NULL)
return 0;
- DPRINTK("Enter\n");
+ ata_port_dbg(ap, "Enter\n");
writel((1 << qc->hw_tag), pp->sactive_block);
pp->last_issue_tag = qc->hw_tag;
@@ -2018,7 +2018,7 @@ static unsigned int nv_swncq_issue_atacmd(struct ata_port *ap,
ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */
ap->ops->sff_exec_command(ap, &qc->tf);
- DPRINTK("Issued tag %u\n", qc->hw_tag);
+ ata_port_dbg(ap, "Issued tag %u\n", qc->hw_tag);
return 0;
}
@@ -2031,7 +2031,7 @@ 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");
+ ata_port_dbg(ap, "Enter\n");
if (!pp->qc_active)
nv_swncq_issue_atacmd(ap, qc);
@@ -2099,7 +2099,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;
}
@@ -2114,10 +2114,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);
@@ -2159,7 +2159,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))
@@ -2227,9 +2227,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;
@@ -2255,7 +2255,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);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 11/46] sata_nv: move DPRINTK to ata debugging
2020-02-04 16:55 ` [PATCH 11/46] sata_nv: move DPRINTK to ata debugging Hannes Reinecke
@ 2020-02-10 13:25 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:25 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Replace all DPRINTK calls with the ata_XXX_dbg functions.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/sata_nv.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
> index 8639f66706a3..0cbddad7cd12 100644
> --- a/drivers/ata/sata_nv.c
> +++ b/drivers/ata/sata_nv.c
> @@ -1394,7 +1394,7 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
> void __iomem *mmio = pp->ctl_block;
> int curr_ncq = (qc->tf.protocol == ATA_PROT_NCQ);
>
> - VPRINTK("ENTER\n");
> + ata_dev_dbg(qc->dev, "ENTER\n");
This is VPRINTK() instance so it should be either left
alone or documented in the patch description.
Otherwise the patch looks fine.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> /* We can't handle result taskfile with NCQ commands, since
> retrieving the taskfile switches us out of ADMA mode and would abort
> @@ -1428,7 +1428,7 @@ 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);
> + ata_dev_dbg(qc->dev, "Issued tag %u\n", qc->hw_tag);
>
> return 0;
> }
> @@ -2007,7 +2007,7 @@ static unsigned int nv_swncq_issue_atacmd(struct ata_port *ap,
> if (qc == NULL)
> return 0;
>
> - DPRINTK("Enter\n");
> + ata_port_dbg(ap, "Enter\n");
>
> writel((1 << qc->hw_tag), pp->sactive_block);
> pp->last_issue_tag = qc->hw_tag;
> @@ -2018,7 +2018,7 @@ static unsigned int nv_swncq_issue_atacmd(struct ata_port *ap,
> ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */
> ap->ops->sff_exec_command(ap, &qc->tf);
>
> - DPRINTK("Issued tag %u\n", qc->hw_tag);
> + ata_port_dbg(ap, "Issued tag %u\n", qc->hw_tag);
>
> return 0;
> }
> @@ -2031,7 +2031,7 @@ 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");
> + ata_port_dbg(ap, "Enter\n");
>
> if (!pp->qc_active)
> nv_swncq_issue_atacmd(ap, qc);
> @@ -2099,7 +2099,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;
> }
> @@ -2114,10 +2114,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);
>
> @@ -2159,7 +2159,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))
> @@ -2227,9 +2227,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;
> @@ -2255,7 +2255,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);
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 12/46] sata_sx4: move DPRINTK to VPRINTK
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (10 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 11/46] sata_nv: move DPRINTK to ata debugging Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:29 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 13/46] ata_piix: Drop DPRINTK() statement Hannes Reinecke
` (33 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
All other logging instances in this functions are with VPRINTK,
so follow suit.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_sx4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 2c7b30c5ea3d..e99d9f5139f9 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -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;
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 12/46] sata_sx4: move DPRINTK to VPRINTK
2020-02-04 16:55 ` [PATCH 12/46] sata_sx4: move DPRINTK to VPRINTK Hannes Reinecke
@ 2020-02-10 13:29 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:29 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> All other logging instances in this functions are with VPRINTK,
> so follow suit.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Please fix From: and S-o-B: to match (some other patches also
have this issue).
With that resolved:
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_sx4.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
> index 2c7b30c5ea3d..e99d9f5139f9 100644
> --- a/drivers/ata/sata_sx4.c
> +++ b/drivers/ata/sata_sx4.c
> @@ -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;
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 13/46] ata_piix: Drop DPRINTK() statement
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (11 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 12/46] sata_sx4: move DPRINTK to VPRINTK Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:32 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 14/46] libata: add reset tracepoints Hannes Reinecke
` (32 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Drop a pointless DPRINTK() statement about PCI setup.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/ata_piix.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index f940ecf72aaa..10ebe8daf1a5 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -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);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 13/46] ata_piix: Drop DPRINTK() statement
2020-02-04 16:55 ` [PATCH 13/46] ata_piix: Drop DPRINTK() statement Hannes Reinecke
@ 2020-02-10 13:32 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:32 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Drop a pointless DPRINTK() statement about PCI setup.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Please fix From: and S-o-B: to match (some other patches also
have this issue).
With that resolved:
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/ata_piix.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
> index f940ecf72aaa..10ebe8daf1a5 100644
> --- a/drivers/ata/ata_piix.c
> +++ b/drivers/ata/ata_piix.c
> @@ -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);
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 14/46] libata: add reset tracepoints
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (12 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 13/46] ata_piix: Drop DPRINTK() statement Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:42 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 15/46] ahci: drop DPRINTK() calls in reset Hannes Reinecke
` (31 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
To 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 and soft reset and adds
them in the libata-eh control flow.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-eh.c | 16 +++++++-
include/trace/events/libata.h | 88 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 3bfd9da58473..253dcf903c1b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -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;
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index ab69434e2329..e9fb4d44eeac 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -132,6 +132,22 @@
ata_protocol_name(ATAPI_PROT_PIO), \
ata_protocol_name(ATAPI_PROT_DMA))
+#define ata_class_name(class) { class, #class }
+#define show_class_name(val) \
+ __print_symbolic(val, \
+ ata_class_name(ATA_DEV_UNKNOWN), \
+ ata_class_name(ATA_DEV_ATA), \
+ ata_class_name(ATA_DEV_ATA_UNSUP), \
+ ata_class_name(ATA_DEV_ATAPI), \
+ ata_class_name(ATA_DEV_ATAPI_UNSUP), \
+ ata_class_name(ATA_DEV_PMP), \
+ ata_class_name(ATA_DEV_PMP_UNSUP), \
+ ata_class_name(ATA_DEV_SEMB), \
+ ata_class_name(ATA_DEV_SEMB_UNSUP), \
+ ata_class_name(ATA_DEV_ZAC), \
+ ata_class_name(ATA_DEV_ZAC_UNSUP), \
+ ata_class_name(ATA_DEV_NONE))
+
const char *libata_trace_parse_status(struct trace_seq*, unsigned char);
#define __parse_status(s) libata_trace_parse_status(p, s)
@@ -329,6 +345,78 @@ TRACE_EVENT(ata_eh_link_autopsy_qc,
__parse_eh_err_mask(__entry->eh_err_mask))
);
+DECLARE_EVENT_CLASS(ata_link_reset_begin_template,
+
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
+
+ TP_ARGS(link, class, deadline),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __array( unsigned int, class, 2)
+ __field( unsigned long, deadline)
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = link->ap->print_id;
+ memcpy(__entry->class, class, 2);
+ __entry->deadline = deadline;
+ ),
+
+ TP_printk("ata_port=%u deadline=%lu classes=[%s,%s]",
+ __entry->ata_port, __entry->deadline,
+ show_class_name(__entry->class[0]),
+ show_class_name(__entry->class[1]))
+);
+
+DEFINE_EVENT(ata_link_reset_begin_template, ata_link_hardreset_begin,
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
+ TP_ARGS(link, class, deadline));
+
+DEFINE_EVENT(ata_link_reset_begin_template, ata_slave_hardreset_begin,
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
+ TP_ARGS(link, class, deadline));
+
+DEFINE_EVENT(ata_link_reset_begin_template, ata_link_softreset_begin,
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
+ TP_ARGS(link, class, deadline));
+
+DECLARE_EVENT_CLASS(ata_link_reset_end_template,
+
+ TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
+
+ TP_ARGS(link, class, rc),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __array( unsigned int, class, 2)
+ __field( int, rc)
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = link->ap->print_id;
+ memcpy(__entry->class, class, 2);
+ __entry->rc = rc;
+ ),
+
+ TP_printk("ata_port=%u rc=%d class=[%s,%s]",
+ __entry->ata_port, __entry->rc,
+ show_class_name(__entry->class[0]),
+ show_class_name(__entry->class[1]))
+);
+
+DEFINE_EVENT(ata_link_reset_end_template, ata_link_hardreset_end,
+ TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
+ TP_ARGS(link, class, rc));
+
+DEFINE_EVENT(ata_link_reset_end_template, ata_slave_hardreset_end,
+ TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
+ TP_ARGS(link, class, rc));
+
+DEFINE_EVENT(ata_link_reset_end_template, ata_link_softreset_end,
+ TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
+ TP_ARGS(link, class, rc));
+
#endif /* _TRACE_LIBATA_H */
/* This part must be outside protection */
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 14/46] libata: add reset tracepoints
2020-02-04 16:55 ` [PATCH 14/46] libata: add reset tracepoints Hannes Reinecke
@ 2020-02-10 13:42 ` Bartlomiej Zolnierkiewicz
2020-02-12 10:11 ` Hannes Reinecke
0 siblings, 1 reply; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:42 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> To 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 and soft reset and adds
> them in the libata-eh control flow.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
checkpatch.pl complains about CodingStyle issues:
WARNING: line over 80 characters
#164: FILE: include/trace/events/libata.h:350:
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
ERROR: space prohibited after that open parenthesis '('
#169: FILE: include/trace/events/libata.h:355:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#169: FILE: include/trace/events/libata.h:355:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#170: FILE: include/trace/events/libata.h:356:
+ __array( unsigned int, class, 2)
ERROR: space prohibited after that open parenthesis '('
#171: FILE: include/trace/events/libata.h:357:
+ __field( unsigned long, deadline)
WARNING: line over 80 characters
#187: FILE: include/trace/events/libata.h:373:
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
WARNING: line over 80 characters
#191: FILE: include/trace/events/libata.h:377:
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
WARNING: line over 80 characters
#195: FILE: include/trace/events/libata.h:381:
+ TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
ERROR: space prohibited after that open parenthesis '('
#205: FILE: include/trace/events/libata.h:391:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#205: FILE: include/trace/events/libata.h:391:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#206: FILE: include/trace/events/libata.h:392:
+ __array( unsigned int, class, 2)
ERROR: space prohibited after that open parenthesis '('
#207: FILE: include/trace/events/libata.h:393:
+ __field( int, rc)
Otherwise the patch looks fine.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-eh.c | 16 +++++++-
> include/trace/events/libata.h | 88 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 102 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index 3bfd9da58473..253dcf903c1b 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -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;
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index ab69434e2329..e9fb4d44eeac 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -132,6 +132,22 @@
> ata_protocol_name(ATAPI_PROT_PIO), \
> ata_protocol_name(ATAPI_PROT_DMA))
>
> +#define ata_class_name(class) { class, #class }
> +#define show_class_name(val) \
> + __print_symbolic(val, \
> + ata_class_name(ATA_DEV_UNKNOWN), \
> + ata_class_name(ATA_DEV_ATA), \
> + ata_class_name(ATA_DEV_ATA_UNSUP), \
> + ata_class_name(ATA_DEV_ATAPI), \
> + ata_class_name(ATA_DEV_ATAPI_UNSUP), \
> + ata_class_name(ATA_DEV_PMP), \
> + ata_class_name(ATA_DEV_PMP_UNSUP), \
> + ata_class_name(ATA_DEV_SEMB), \
> + ata_class_name(ATA_DEV_SEMB_UNSUP), \
> + ata_class_name(ATA_DEV_ZAC), \
> + ata_class_name(ATA_DEV_ZAC_UNSUP), \
> + ata_class_name(ATA_DEV_NONE))
> +
> const char *libata_trace_parse_status(struct trace_seq*, unsigned char);
> #define __parse_status(s) libata_trace_parse_status(p, s)
>
> @@ -329,6 +345,78 @@ TRACE_EVENT(ata_eh_link_autopsy_qc,
> __parse_eh_err_mask(__entry->eh_err_mask))
> );
>
> +DECLARE_EVENT_CLASS(ata_link_reset_begin_template,
> +
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
> +
> + TP_ARGS(link, class, deadline),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __array( unsigned int, class, 2)
> + __field( unsigned long, deadline)
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = link->ap->print_id;
> + memcpy(__entry->class, class, 2);
> + __entry->deadline = deadline;
> + ),
> +
> + TP_printk("ata_port=%u deadline=%lu classes=[%s,%s]",
> + __entry->ata_port, __entry->deadline,
> + show_class_name(__entry->class[0]),
> + show_class_name(__entry->class[1]))
> +);
> +
> +DEFINE_EVENT(ata_link_reset_begin_template, ata_link_hardreset_begin,
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
> + TP_ARGS(link, class, deadline));
> +
> +DEFINE_EVENT(ata_link_reset_begin_template, ata_slave_hardreset_begin,
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
> + TP_ARGS(link, class, deadline));
> +
> +DEFINE_EVENT(ata_link_reset_begin_template, ata_link_softreset_begin,
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
> + TP_ARGS(link, class, deadline));
> +
> +DECLARE_EVENT_CLASS(ata_link_reset_end_template,
> +
> + TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> +
> + TP_ARGS(link, class, rc),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __array( unsigned int, class, 2)
> + __field( int, rc)
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = link->ap->print_id;
> + memcpy(__entry->class, class, 2);
> + __entry->rc = rc;
> + ),
> +
> + TP_printk("ata_port=%u rc=%d class=[%s,%s]",
> + __entry->ata_port, __entry->rc,
> + show_class_name(__entry->class[0]),
> + show_class_name(__entry->class[1]))
> +);
> +
> +DEFINE_EVENT(ata_link_reset_end_template, ata_link_hardreset_end,
> + TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> + TP_ARGS(link, class, rc));
> +
> +DEFINE_EVENT(ata_link_reset_end_template, ata_slave_hardreset_end,
> + TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> + TP_ARGS(link, class, rc));
> +
> +DEFINE_EVENT(ata_link_reset_end_template, ata_link_softreset_end,
> + TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> + TP_ARGS(link, class, rc));
> +
> #endif /* _TRACE_LIBATA_H */
>
> /* This part must be outside protection */
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* Re: [PATCH 14/46] libata: add reset tracepoints
2020-02-10 13:42 ` Bartlomiej Zolnierkiewicz
@ 2020-02-12 10:11 ` Hannes Reinecke
0 siblings, 0 replies; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-12 10:11 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jens Axboe, linux-ide
On 2/10/20 2:42 PM, Bartlomiej Zolnierkiewicz wrote:
>
> On 2/4/20 5:55 PM, Hannes Reinecke wrote:
>> To 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 and soft reset and adds
>> them in the libata-eh control flow.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>
> checkpatch.pl complains about CodingStyle issues:
>
> WARNING: line over 80 characters
> #164: FILE: include/trace/events/libata.h:350:
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
>
> ERROR: space prohibited after that open parenthesis '('
> #169: FILE: include/trace/events/libata.h:355:
> + __field( unsigned int, ata_port )
>
> ERROR: space prohibited before that close parenthesis ')'
> #169: FILE: include/trace/events/libata.h:355:
> + __field( unsigned int, ata_port )
>
> ERROR: space prohibited after that open parenthesis '('
> #170: FILE: include/trace/events/libata.h:356:
> + __array( unsigned int, class, 2)
>
> ERROR: space prohibited after that open parenthesis '('
> #171: FILE: include/trace/events/libata.h:357:
> + __field( unsigned long, deadline)
>
> WARNING: line over 80 characters
> #187: FILE: include/trace/events/libata.h:373:
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
>
> WARNING: line over 80 characters
> #191: FILE: include/trace/events/libata.h:377:
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
>
> WARNING: line over 80 characters
> #195: FILE: include/trace/events/libata.h:381:
> + TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
>
> ERROR: space prohibited after that open parenthesis '('
> #205: FILE: include/trace/events/libata.h:391:
> + __field( unsigned int, ata_port )
>
> ERROR: space prohibited before that close parenthesis ')'
> #205: FILE: include/trace/events/libata.h:391:
> + __field( unsigned int, ata_port )
>
> ERROR: space prohibited after that open parenthesis '('
> #206: FILE: include/trace/events/libata.h:392:
> + __array( unsigned int, class, 2)
>
> ERROR: space prohibited after that open parenthesis '('
> #207: FILE: include/trace/events/libata.h:393:
> + __field( int, rc)
>
> Otherwise the patch looks fine.
>
[ .. ]
This is just following the existing coding style used in the trace event
declaration. Seeing that tracepoint generation is quite black magic in
itself I'd rather keep it in-line with the rest of the header file.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 15/46] ahci: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (13 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 14/46] libata: add reset tracepoints Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:43 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 16/46] ahci_qorig: " Hannes Reinecke
` (30 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/ahci.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 4f628e33f52e..56066cb4506f 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -683,8 +683,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),
@@ -692,8 +690,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.
*/
@@ -773,8 +769,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++) {
@@ -812,7 +806,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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 15/46] ahci: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 15/46] ahci: drop DPRINTK() calls in reset Hannes Reinecke
@ 2020-02-10 13:43 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:43 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/ahci.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index 4f628e33f52e..56066cb4506f 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -683,8 +683,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),
> @@ -692,8 +690,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.
> */
> @@ -773,8 +769,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++) {
> @@ -812,7 +806,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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 16/46] ahci_qorig: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (14 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 15/46] ahci: drop DPRINTK() calls in reset Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:45 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 17/46] pata_octeon_cf: " Hannes Reinecke
` (29 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/ahci_qoriq.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index a330307d3201..711cf94c3d08 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 16/46] ahci_qorig: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 16/46] ahci_qorig: " Hannes Reinecke
@ 2020-02-10 13:45 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:45 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/ahci_qoriq.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
> index a330307d3201..711cf94c3d08 100644
> --- a/drivers/ata/ahci_qoriq.c
> +++ b/drivers/ata/ahci_qoriq.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 17/46] pata_octeon_cf: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (15 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 16/46] ahci_qorig: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:46 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 18/46] libahci: " Hannes Reinecke
` (28 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pata_octeon_cf.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index d3d851b014a3..f5cd89173028 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 17/46] pata_octeon_cf: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 17/46] pata_octeon_cf: " Hannes Reinecke
@ 2020-02-10 13:46 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:46 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pata_octeon_cf.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
> index d3d851b014a3..f5cd89173028 100644
> --- a/drivers/ata/pata_octeon_cf.c
> +++ b/drivers/ata/pata_octeon_cf.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 18/46] libahci: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (16 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 17/46] pata_octeon_cf: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:46 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 19/46] sata_rcar: " Hannes Reinecke
` (27 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libahci.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index c1bc973ecc16..1c6d98fab3a3 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -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);
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 18/46] libahci: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 18/46] libahci: " Hannes Reinecke
@ 2020-02-10 13:46 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:46 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libahci.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index c1bc973ecc16..1c6d98fab3a3 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -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);
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 19/46] sata_rcar: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (17 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 18/46] libahci: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:48 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 20/46] sata_sil24: " Hannes Reinecke
` (26 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_rcar.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 980aacdbcf3b..1b42be234761 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 19/46] sata_rcar: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 19/46] sata_rcar: " Hannes Reinecke
@ 2020-02-10 13:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:48 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_rcar.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
> index 980aacdbcf3b..1b42be234761 100644
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 20/46] sata_sil24: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (18 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 19/46] sata_rcar: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:48 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 21/46] sata_fsl: " Hannes Reinecke
` (25 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_sil24.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 2373cf5d8d14..48e2b3ec2afd 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -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:
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 20/46] sata_sil24: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 20/46] sata_sil24: " Hannes Reinecke
@ 2020-02-10 13:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:48 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_sil24.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
> index 2373cf5d8d14..48e2b3ec2afd 100644
> --- a/drivers/ata/sata_sil24.c
> +++ b/drivers/ata/sata_sil24.c
> @@ -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:
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 21/46] sata_fsl: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (19 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 20/46] sata_sil24: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:49 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 22/46] libata-core: " Hannes Reinecke
` (24 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped, and some calls can be dropped as they don't provide
additional value.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_fsl.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 0864c4fafa39..5d48e1d223fa 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -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));
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 21/46] sata_fsl: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 21/46] sata_fsl: " Hannes Reinecke
@ 2020-02-10 13:49 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:49 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped, and some calls can be dropped as they don't provide
> additional value.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_fsl.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index 0864c4fafa39..5d48e1d223fa 100644
> --- a/drivers/ata/sata_fsl.c
> +++ b/drivers/ata/sata_fsl.c
> @@ -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));
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 22/46] libata-core: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (20 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 21/46] sata_fsl: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:50 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 23/46] libata-sff: " Hannes Reinecke
` (23 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 8a18047f9bcb..297aa8172d4e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -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");
}
/**
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 22/46] libata-core: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 22/46] libata-core: " Hannes Reinecke
@ 2020-02-10 13:50 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:50 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-core.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 8a18047f9bcb..297aa8172d4e 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -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");
> }
>
> /**
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 23/46] libata-sff: drop DPRINTK() calls in reset
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (21 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 22/46] libata-core: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 13:54 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 24/46] libata: tracepoints for bus-master DMA Hannes Reinecke
` (22 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Reset is now logged with tracepoints, so the DPRINTK() calls can
be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-sff.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 60509997137f..f1799291b4a6 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -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);
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 23/46] libata-sff: drop DPRINTK() calls in reset
2020-02-04 16:55 ` [PATCH 23/46] libata-sff: " Hannes Reinecke
@ 2020-02-10 13:54 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 13:54 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Reset is now logged with tracepoints, so the DPRINTK() calls can
> be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Also you may consider merging patches #15-23 together.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-sff.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 60509997137f..f1799291b4a6 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -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);
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 24/46] libata: tracepoints for bus-master DMA
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (22 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 23/46] libata-sff: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:21 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 25/46] libata-sff: add tracepoints for HSM state machine Hannes Reinecke
` (21 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Add tracepoints for bus-master DMA and taskfile related functions.
That allows us to drop the relevant DPRINTK() calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-sff.c | 41 +++++++++---------
include/trace/events/libata.h | 97 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+), 22 deletions(-)
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index f1799291b4a6..a5e6be6955ae 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -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;
@@ -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);
}
@@ -509,6 +493,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 +503,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 +741,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 +1350,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 +1362,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 +1392,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;
@@ -2737,8 +2726,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;
@@ -2746,7 +2738,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;
@@ -2794,6 +2788,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;
@@ -2873,6 +2868,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 */
@@ -2906,6 +2902,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);
}
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index e9fb4d44eeac..476acf823928 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -291,6 +291,103 @@ DEFINE_EVENT(ata_qc_complete_template, ata_qc_complete_done,
TP_PROTO(struct ata_queued_cmd *qc),
TP_ARGS(qc));
+TRACE_EVENT(ata_tf_load,
+
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf),
+
+ TP_ARGS(ap, tf),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __field( unsigned char, cmd )
+ __field( unsigned char, dev )
+ __field( unsigned char, lbal )
+ __field( unsigned char, lbam )
+ __field( unsigned char, lbah )
+ __field( unsigned char, nsect )
+ __field( unsigned char, feature )
+ __field( unsigned char, hob_lbal )
+ __field( unsigned char, hob_lbam )
+ __field( unsigned char, hob_lbah )
+ __field( unsigned char, hob_nsect )
+ __field( unsigned char, hob_feature )
+ __field( unsigned char, proto )
+ __field( unsigned long, flags )
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = ap->print_id;
+ __entry->proto = tf->protocol;
+ __entry->cmd = tf->command;
+ __entry->dev = tf->device;
+ __entry->lbal = tf->lbal;
+ __entry->lbam = tf->lbam;
+ __entry->lbah = tf->lbah;
+ __entry->hob_lbal = tf->hob_lbal;
+ __entry->hob_lbam = tf->hob_lbam;
+ __entry->hob_lbah = tf->hob_lbah;
+ __entry->feature = tf->feature;
+ __entry->hob_feature = tf->hob_feature;
+ __entry->nsect = tf->nsect;
+ __entry->hob_nsect = tf->hob_nsect;
+ ),
+
+ TP_printk("ata_port=%u proto=%s cmd=%s%s " \
+ " tf=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)",
+ __entry->ata_port,
+ show_protocol_name(__entry->proto),
+ show_opcode_name(__entry->cmd),
+ __parse_subcmd(__entry->cmd, __entry->feature, __entry->hob_nsect),
+ __entry->cmd, __entry->feature, __entry->nsect,
+ __entry->lbal, __entry->lbam, __entry->lbah,
+ __entry->hob_feature, __entry->hob_nsect,
+ __entry->hob_lbal, __entry->hob_lbam, __entry->hob_lbah,
+ __entry->dev)
+);
+
+DECLARE_EVENT_CLASS(ata_exec_command_template,
+
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
+
+ TP_ARGS(ap, tf, tag),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __field( unsigned int, tag )
+ __field( unsigned char, cmd )
+ __field( unsigned char, proto )
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = ap->print_id;
+ __entry->tag = tag;
+ __entry->proto = tf->protocol;
+ __entry->cmd = tf->command;
+ ),
+
+ TP_printk("ata_port=%u cmd=%s%s tag=%d",
+ __entry->ata_port,
+ show_protocol_name(__entry->proto),
+ show_opcode_name(__entry->cmd),
+ __entry->tag)
+);
+
+DEFINE_EVENT(ata_exec_command_template, ata_exec_command,
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
+ TP_ARGS(ap, tf, tag));
+
+DEFINE_EVENT(ata_exec_command_template, ata_bmdma_setup,
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
+ TP_ARGS(ap, tf, tag));
+
+DEFINE_EVENT(ata_exec_command_template, ata_bmdma_start,
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
+ TP_ARGS(ap, tf, tag));
+
+DEFINE_EVENT(ata_exec_command_template, ata_bmdma_stop,
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
+ TP_ARGS(ap, tf, tag));
+
TRACE_EVENT(ata_eh_link_autopsy,
TP_PROTO(struct ata_device *dev, unsigned int eh_action, unsigned int eh_err_mask),
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 24/46] libata: tracepoints for bus-master DMA
2020-02-04 16:55 ` [PATCH 24/46] libata: tracepoints for bus-master DMA Hannes Reinecke
@ 2020-02-10 15:21 ` Bartlomiej Zolnierkiewicz
2020-02-10 15:23 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:21 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Add tracepoints for bus-master DMA and taskfile related functions.
> That allows us to drop the relevant DPRINTK() calls.
The patch drops VPRINTK() calls, not DPRINTK() ones.
Also please move the removal to a separate (post-)patch
(like it has been done for reset tracepoints).
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/libata-sff.c | 41 +++++++++---------
> include/trace/events/libata.h | 97 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 116 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index f1799291b4a6..a5e6be6955ae 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -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;
> @@ -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);
> }
> @@ -509,6 +493,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 +503,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 +741,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 +1350,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);
Wouldn't it be easier to simply pass 'qc' to ata_tf_to_host()?
> ap->hsm_task_state = HSM_ST_LAST;
>
> if (qc->tf.flags & ATA_TFLAG_POLLING)
> @@ -1373,7 +1362,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 +1392,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;
>
> @@ -2737,8 +2726,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;
> @@ -2746,7 +2738,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;
>
> @@ -2794,6 +2788,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;
>
> @@ -2873,6 +2868,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 */
> @@ -2906,6 +2902,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);
> }
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index e9fb4d44eeac..476acf823928 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -291,6 +291,103 @@ DEFINE_EVENT(ata_qc_complete_template, ata_qc_complete_done,
> TP_PROTO(struct ata_queued_cmd *qc),
> TP_ARGS(qc));
>
> +TRACE_EVENT(ata_tf_load,
> +
> + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf),
> +
> + TP_ARGS(ap, tf),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __field( unsigned char, cmd )
> + __field( unsigned char, dev )
> + __field( unsigned char, lbal )
> + __field( unsigned char, lbam )
> + __field( unsigned char, lbah )
> + __field( unsigned char, nsect )
> + __field( unsigned char, feature )
> + __field( unsigned char, hob_lbal )
> + __field( unsigned char, hob_lbam )
> + __field( unsigned char, hob_lbah )
> + __field( unsigned char, hob_nsect )
> + __field( unsigned char, hob_feature )
> + __field( unsigned char, proto )
> + __field( unsigned long, flags )
'flags' field doesn't seem to be used?
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = ap->print_id;
> + __entry->proto = tf->protocol;
> + __entry->cmd = tf->command;
> + __entry->dev = tf->device;
> + __entry->lbal = tf->lbal;
> + __entry->lbam = tf->lbam;
> + __entry->lbah = tf->lbah;
> + __entry->hob_lbal = tf->hob_lbal;
> + __entry->hob_lbam = tf->hob_lbam;
> + __entry->hob_lbah = tf->hob_lbah;
> + __entry->feature = tf->feature;
> + __entry->hob_feature = tf->hob_feature;
> + __entry->nsect = tf->nsect;
> + __entry->hob_nsect = tf->hob_nsect;
> + ),
> +
> + TP_printk("ata_port=%u proto=%s cmd=%s%s " \
> + " tf=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)",
> + __entry->ata_port,
> + show_protocol_name(__entry->proto),
> + show_opcode_name(__entry->cmd),
> + __parse_subcmd(__entry->cmd, __entry->feature, __entry->hob_nsect),
> + __entry->cmd, __entry->feature, __entry->nsect,
> + __entry->lbal, __entry->lbam, __entry->lbah,
> + __entry->hob_feature, __entry->hob_nsect,
> + __entry->hob_lbal, __entry->hob_lbam, __entry->hob_lbah,
> + __entry->dev)
> +);
> +
> +DECLARE_EVENT_CLASS(ata_exec_command_template,
> +
> + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
> +
> + TP_ARGS(ap, tf, tag),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __field( unsigned int, tag )
> + __field( unsigned char, cmd )
> + __field( unsigned char, proto )
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = ap->print_id;
> + __entry->tag = tag;
> + __entry->proto = tf->protocol;
> + __entry->cmd = tf->command;
> + ),
> +
> + TP_printk("ata_port=%u cmd=%s%s tag=%d",
> + __entry->ata_port,
> + show_protocol_name(__entry->proto),
> + show_opcode_name(__entry->cmd),
Please keep both new events consistent regarding 'proto' and
'cmd' fields printing (add "proto=%s" in this event or rework
printing in ata_tf_load one).
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> + __entry->tag)
> +);
> +
> +DEFINE_EVENT(ata_exec_command_template, ata_exec_command,
> + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
> + TP_ARGS(ap, tf, tag));
> +
> +DEFINE_EVENT(ata_exec_command_template, ata_bmdma_setup,
> + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
> + TP_ARGS(ap, tf, tag));
> +
> +DEFINE_EVENT(ata_exec_command_template, ata_bmdma_start,
> + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
> + TP_ARGS(ap, tf, tag));
> +
> +DEFINE_EVENT(ata_exec_command_template, ata_bmdma_stop,
> + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
> + TP_ARGS(ap, tf, tag));
> +
> TRACE_EVENT(ata_eh_link_autopsy,
>
> TP_PROTO(struct ata_device *dev, unsigned int eh_action, unsigned int eh_err_mask),
^ permalink raw reply [flat|nested] 97+ messages in thread
* Re: [PATCH 24/46] libata: tracepoints for bus-master DMA
2020-02-10 15:21 ` Bartlomiej Zolnierkiewicz
@ 2020-02-10 15:23 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:23 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/10/20 4:21 PM, Bartlomiej Zolnierkiewicz wrote:
>
> On 2/4/20 5:55 PM, Hannes Reinecke wrote:
>> Add tracepoints for bus-master DMA and taskfile related functions.
>> That allows us to drop the relevant DPRINTK() calls.
>
> The patch drops VPRINTK() calls, not DPRINTK() ones.
Also there is a lot of complaints from checkpatch.pl script
regarding CodingStyle:
ERROR: space prohibited after that open parenthesis '('
#251: FILE: include/trace/events/libata.h:301:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#251: FILE: include/trace/events/libata.h:301:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#252: FILE: include/trace/events/libata.h:302:
+ __field( unsigned char, cmd )
ERROR: space prohibited before that close parenthesis ')'
#252: FILE: include/trace/events/libata.h:302:
+ __field( unsigned char, cmd )
ERROR: space prohibited after that open parenthesis '('
#253: FILE: include/trace/events/libata.h:303:
+ __field( unsigned char, dev )
ERROR: space prohibited before that close parenthesis ')'
#253: FILE: include/trace/events/libata.h:303:
+ __field( unsigned char, dev )
ERROR: space prohibited after that open parenthesis '('
#254: FILE: include/trace/events/libata.h:304:
+ __field( unsigned char, lbal )
ERROR: space prohibited before that close parenthesis ')'
#254: FILE: include/trace/events/libata.h:304:
+ __field( unsigned char, lbal )
ERROR: space prohibited after that open parenthesis '('
#255: FILE: include/trace/events/libata.h:305:
+ __field( unsigned char, lbam )
ERROR: space prohibited before that close parenthesis ')'
#255: FILE: include/trace/events/libata.h:305:
+ __field( unsigned char, lbam )
ERROR: space prohibited after that open parenthesis '('
#256: FILE: include/trace/events/libata.h:306:
+ __field( unsigned char, lbah )
ERROR: space prohibited before that close parenthesis ')'
#256: FILE: include/trace/events/libata.h:306:
+ __field( unsigned char, lbah )
ERROR: space prohibited after that open parenthesis '('
#257: FILE: include/trace/events/libata.h:307:
+ __field( unsigned char, nsect )
ERROR: space prohibited before that close parenthesis ')'
#257: FILE: include/trace/events/libata.h:307:
+ __field( unsigned char, nsect )
ERROR: space prohibited after that open parenthesis '('
#258: FILE: include/trace/events/libata.h:308:
+ __field( unsigned char, feature )
ERROR: space prohibited before that close parenthesis ')'
#258: FILE: include/trace/events/libata.h:308:
+ __field( unsigned char, feature )
ERROR: space prohibited after that open parenthesis '('
#259: FILE: include/trace/events/libata.h:309:
+ __field( unsigned char, hob_lbal )
ERROR: space prohibited before that close parenthesis ')'
#259: FILE: include/trace/events/libata.h:309:
+ __field( unsigned char, hob_lbal )
ERROR: space prohibited after that open parenthesis '('
#260: FILE: include/trace/events/libata.h:310:
+ __field( unsigned char, hob_lbam )
ERROR: space prohibited before that close parenthesis ')'
#260: FILE: include/trace/events/libata.h:310:
+ __field( unsigned char, hob_lbam )
ERROR: space prohibited after that open parenthesis '('
#261: FILE: include/trace/events/libata.h:311:
+ __field( unsigned char, hob_lbah )
ERROR: space prohibited before that close parenthesis ')'
#261: FILE: include/trace/events/libata.h:311:
+ __field( unsigned char, hob_lbah )
ERROR: space prohibited after that open parenthesis '('
#262: FILE: include/trace/events/libata.h:312:
+ __field( unsigned char, hob_nsect )
ERROR: space prohibited before that close parenthesis ')'
#262: FILE: include/trace/events/libata.h:312:
+ __field( unsigned char, hob_nsect )
ERROR: space prohibited after that open parenthesis '('
#263: FILE: include/trace/events/libata.h:313:
+ __field( unsigned char, hob_feature )
ERROR: space prohibited before that close parenthesis ')'
#263: FILE: include/trace/events/libata.h:313:
+ __field( unsigned char, hob_feature )
ERROR: space prohibited after that open parenthesis '('
#264: FILE: include/trace/events/libata.h:314:
+ __field( unsigned char, proto )
ERROR: space prohibited before that close parenthesis ')'
#264: FILE: include/trace/events/libata.h:314:
+ __field( unsigned char, proto )
ERROR: space prohibited after that open parenthesis '('
#265: FILE: include/trace/events/libata.h:315:
+ __field( unsigned long, flags )
ERROR: space prohibited before that close parenthesis ')'
#265: FILE: include/trace/events/libata.h:315:
+ __field( unsigned long, flags )
WARNING: Avoid unnecessary line continuations
#285: FILE: include/trace/events/libata.h:335:
+ TP_printk("ata_port=%u proto=%s cmd=%s%s " \
WARNING: line over 80 characters
#290: FILE: include/trace/events/libata.h:340:
+ __parse_subcmd(__entry->cmd, __entry->feature, __entry->hob_nsect),
WARNING: line over 80 characters
#300: FILE: include/trace/events/libata.h:350:
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
ERROR: space prohibited after that open parenthesis '('
#305: FILE: include/trace/events/libata.h:355:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#305: FILE: include/trace/events/libata.h:355:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#306: FILE: include/trace/events/libata.h:356:
+ __field( unsigned int, tag )
ERROR: space prohibited before that close parenthesis ')'
#306: FILE: include/trace/events/libata.h:356:
+ __field( unsigned int, tag )
ERROR: space prohibited after that open parenthesis '('
#307: FILE: include/trace/events/libata.h:357:
+ __field( unsigned char, cmd )
ERROR: space prohibited before that close parenthesis ')'
#307: FILE: include/trace/events/libata.h:357:
+ __field( unsigned char, cmd )
ERROR: space prohibited after that open parenthesis '('
#308: FILE: include/trace/events/libata.h:358:
+ __field( unsigned char, proto )
ERROR: space prohibited before that close parenthesis ')'
#308: FILE: include/trace/events/libata.h:358:
+ __field( unsigned char, proto )
WARNING: line over 80 characters
#326: FILE: include/trace/events/libata.h:376:
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
WARNING: line over 80 characters
#330: FILE: include/trace/events/libata.h:380:
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
WARNING: line over 80 characters
#334: FILE: include/trace/events/libata.h:384:
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
WARNING: line over 80 characters
#338: FILE: include/trace/events/libata.h:388:
+ TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag),
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 25/46] libata-sff: add tracepoints for HSM state machine
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (23 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 24/46] libata: tracepoints for bus-master DMA Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:32 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 26/46] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() Hannes Reinecke
` (20 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
Add tracepoints for the HSM state machine and remove DPRINTK() calls.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/ata/libata-sff.c | 12 +++---
drivers/ata/libata-trace.c | 29 +++++++++++++
include/trace/events/libata.h | 95 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 129 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index a5e6be6955ae..6b961eadc201 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -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));
diff --git a/drivers/ata/libata-trace.c b/drivers/ata/libata-trace.c
index 08e001303a82..5a9fba18411b 100644
--- a/drivers/ata/libata-trace.c
+++ b/drivers/ata/libata-trace.c
@@ -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)
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index 476acf823928..acfc5d739b17 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -148,6 +148,15 @@
ata_class_name(ATA_DEV_ZAC_UNSUP), \
ata_class_name(ATA_DEV_NONE))
+#define ata_sff_hsm_state_name(state) { state, #state }
+#define show_sff_hsm_state_name(val) \
+ __print_symbolic(val, \
+ ata_sff_hsm_state_name(HSM_ST_IDLE), \
+ ata_sff_hsm_state_name(HSM_ST_FIRST), \
+ ata_sff_hsm_state_name(HSM_ST), \
+ ata_sff_hsm_state_name(HSM_ST_LAST), \
+ ata_sff_hsm_state_name(HSM_ST_ERR))
+
const char *libata_trace_parse_status(struct trace_seq*, unsigned char);
#define __parse_status(s) libata_trace_parse_status(p, s)
@@ -160,6 +169,9 @@ const char *libata_trace_parse_eh_err_mask(struct trace_seq *, unsigned int);
const char *libata_trace_parse_qc_flags(struct trace_seq *, unsigned int);
#define __parse_qc_flags(f) libata_trace_parse_qc_flags(p, f)
+const char *libata_trace_parse_tf_flags(struct trace_seq *, unsigned int);
+#define __parse_tf_flags(f) libata_trace_parse_tf_flags(p, f)
+
const char *libata_trace_parse_subcmd(struct trace_seq *, unsigned char,
unsigned char, unsigned char);
#define __parse_subcmd(c,f,h) libata_trace_parse_subcmd(p, c, f, h)
@@ -514,6 +526,89 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_link_softreset_end,
TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
TP_ARGS(link, class, rc));
+DECLARE_EVENT_CLASS(ata_sff_hsm_template,
+
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
+
+ TP_ARGS(qc, status),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __field( unsigned int, ata_dev )
+ __field( unsigned int, tag )
+ __field( unsigned int, qc_flags )
+ __field( unsigned int, protocol )
+ __field( unsigned int, hsm_state )
+ __field( unsigned char, dev_state )
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = qc->ap->print_id;
+ __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
+ __entry->tag = qc->tag;
+ __entry->qc_flags = qc->flags;
+ __entry->protocol = qc->tf.protocol;
+ __entry->hsm_state = qc->ap->hsm_task_state;
+ __entry->dev_state = status;
+ ),
+
+ TP_printk("ata_port=%u ata_dev=%u tag=%d protocol=%d flags=%s task_state=%s dev_stat=0x%X",
+ __entry->ata_port, __entry->ata_dev, __entry->tag,
+ __entry->protocol,__parse_qc_flags(__entry->qc_flags),
+ show_sff_hsm_state_name(__entry->hsm_state),
+ __entry->dev_state)
+);
+
+DEFINE_EVENT(ata_sff_hsm_template, ata_sff_hsm_state,
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned char state),
+ TP_ARGS(qc, state));
+
+DEFINE_EVENT(ata_sff_hsm_template, ata_sff_hsm_command_complete,
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned char state),
+ TP_ARGS(qc, state));
+
+DECLARE_EVENT_CLASS(ata_transfer_data_template,
+
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
+
+ TP_ARGS(qc, offset, count),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __field( unsigned int, ata_dev )
+ __field( unsigned int, tag )
+ __field( unsigned int, flags )
+ __field( unsigned int, offset )
+ __field( unsigned int, bytes )
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = qc->ap->print_id;
+ __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
+ __entry->tag = qc->tag;
+ __entry->flags = qc->tf.flags;
+ __entry->offset = offset;
+ __entry->bytes = count;
+ ),
+
+ TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s offset=%u bytes=%u",
+ __entry->ata_port, __entry->ata_dev, __entry->tag,
+ __parse_tf_flags(__entry->flags),
+ __entry->offset, __entry->bytes)
+);
+
+DEFINE_EVENT(ata_transfer_data_template, ata_sff_pio_transfer_data,
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
+ TP_ARGS(qc, offset, count));
+
+DEFINE_EVENT(ata_transfer_data_template, atapi_pio_transfer_data,
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
+ TP_ARGS(qc, offset, count));
+
+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));
+
#endif /* _TRACE_LIBATA_H */
/* This part must be outside protection */
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 25/46] libata-sff: add tracepoints for HSM state machine
2020-02-04 16:55 ` [PATCH 25/46] libata-sff: add tracepoints for HSM state machine Hannes Reinecke
@ 2020-02-10 15:32 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:32 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Add tracepoints for the HSM state machine and remove DPRINTK() calls.
Please move the removal to a separate (post-)patch
(like it has been done for reset tracepoints).
Also there is a lot of complaints from checkpatch.pl script
regarding CodingStyle:
WARNING: please, no spaces at the start of a line
#180: FILE: include/trace/events/libata.h:153:
+ __print_symbolic(val,^I^I^I^I\$
WARNING: function definition argument 'struct trace_seq *' should also have an identifier name
#194: FILE: include/trace/events/libata.h:172:
+const char *libata_trace_parse_tf_flags(struct trace_seq *, unsigned int);
WARNING: function definition argument 'unsigned int' should also have an identifier name
#194: FILE: include/trace/events/libata.h:172:
+const char *libata_trace_parse_tf_flags(struct trace_seq *, unsigned int);
ERROR: space prohibited after that open parenthesis '('
#211: FILE: include/trace/events/libata.h:536:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#211: FILE: include/trace/events/libata.h:536:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#212: FILE: include/trace/events/libata.h:537:
+ __field( unsigned int, ata_dev )
ERROR: space prohibited before that close parenthesis ')'
#212: FILE: include/trace/events/libata.h:537:
+ __field( unsigned int, ata_dev )
ERROR: space prohibited after that open parenthesis '('
#213: FILE: include/trace/events/libata.h:538:
+ __field( unsigned int, tag )
ERROR: space prohibited before that close parenthesis ')'
#213: FILE: include/trace/events/libata.h:538:
+ __field( unsigned int, tag )
ERROR: space prohibited after that open parenthesis '('
#214: FILE: include/trace/events/libata.h:539:
+ __field( unsigned int, qc_flags )
ERROR: space prohibited before that close parenthesis ')'
#214: FILE: include/trace/events/libata.h:539:
+ __field( unsigned int, qc_flags )
ERROR: space prohibited after that open parenthesis '('
#215: FILE: include/trace/events/libata.h:540:
+ __field( unsigned int, protocol )
ERROR: space prohibited before that close parenthesis ')'
#215: FILE: include/trace/events/libata.h:540:
+ __field( unsigned int, protocol )
ERROR: space prohibited after that open parenthesis '('
#216: FILE: include/trace/events/libata.h:541:
+ __field( unsigned int, hsm_state )
ERROR: space prohibited before that close parenthesis ')'
#216: FILE: include/trace/events/libata.h:541:
+ __field( unsigned int, hsm_state )
ERROR: space prohibited after that open parenthesis '('
#217: FILE: include/trace/events/libata.h:542:
+ __field( unsigned char, dev_state )
ERROR: space prohibited before that close parenthesis ')'
#217: FILE: include/trace/events/libata.h:542:
+ __field( unsigned char, dev_state )
ERROR: space required after that ',' (ctx:VxV)
#232: FILE: include/trace/events/libata.h:557:
+ __entry->protocol,__parse_qc_flags(__entry->qc_flags),
^
WARNING: line over 80 characters
#247: FILE: include/trace/events/libata.h:572:
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
ERROR: space prohibited after that open parenthesis '('
#252: FILE: include/trace/events/libata.h:577:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#252: FILE: include/trace/events/libata.h:577:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#253: FILE: include/trace/events/libata.h:578:
+ __field( unsigned int, ata_dev )
ERROR: space prohibited before that close parenthesis ')'
#253: FILE: include/trace/events/libata.h:578:
+ __field( unsigned int, ata_dev )
ERROR: space prohibited after that open parenthesis '('
#254: FILE: include/trace/events/libata.h:579:
+ __field( unsigned int, tag )
ERROR: space prohibited before that close parenthesis ')'
#254: FILE: include/trace/events/libata.h:579:
+ __field( unsigned int, tag )
ERROR: space prohibited after that open parenthesis '('
#255: FILE: include/trace/events/libata.h:580:
+ __field( unsigned int, flags )
ERROR: space prohibited before that close parenthesis ')'
#255: FILE: include/trace/events/libata.h:580:
+ __field( unsigned int, flags )
ERROR: space prohibited after that open parenthesis '('
#256: FILE: include/trace/events/libata.h:581:
+ __field( unsigned int, offset )
ERROR: space prohibited before that close parenthesis ')'
#256: FILE: include/trace/events/libata.h:581:
+ __field( unsigned int, offset )
ERROR: space prohibited after that open parenthesis '('
#257: FILE: include/trace/events/libata.h:582:
+ __field( unsigned int, bytes )
ERROR: space prohibited before that close parenthesis ')'
#257: FILE: include/trace/events/libata.h:582:
+ __field( unsigned int, bytes )
WARNING: line over 80 characters
#276: FILE: include/trace/events/libata.h:601:
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
WARNING: line over 80 characters
#280: FILE: include/trace/events/libata.h:605:
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
WARNING: line over 80 characters
#284: FILE: include/trace/events/libata.h:609:
+ TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/ata/libata-sff.c | 12 +++---
> drivers/ata/libata-trace.c | 29 +++++++++++++
> include/trace/events/libata.h | 95 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 129 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index a5e6be6955ae..6b961eadc201 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -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));
>
> diff --git a/drivers/ata/libata-trace.c b/drivers/ata/libata-trace.c
> index 08e001303a82..5a9fba18411b 100644
> --- a/drivers/ata/libata-trace.c
> +++ b/drivers/ata/libata-trace.c
> @@ -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)
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index 476acf823928..acfc5d739b17 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -148,6 +148,15 @@
> ata_class_name(ATA_DEV_ZAC_UNSUP), \
> ata_class_name(ATA_DEV_NONE))
>
> +#define ata_sff_hsm_state_name(state) { state, #state }
> +#define show_sff_hsm_state_name(val) \
> + __print_symbolic(val, \
> + ata_sff_hsm_state_name(HSM_ST_IDLE), \
> + ata_sff_hsm_state_name(HSM_ST_FIRST), \
> + ata_sff_hsm_state_name(HSM_ST), \
> + ata_sff_hsm_state_name(HSM_ST_LAST), \
> + ata_sff_hsm_state_name(HSM_ST_ERR))
> +
> const char *libata_trace_parse_status(struct trace_seq*, unsigned char);
> #define __parse_status(s) libata_trace_parse_status(p, s)
>
> @@ -160,6 +169,9 @@ const char *libata_trace_parse_eh_err_mask(struct trace_seq *, unsigned int);
> const char *libata_trace_parse_qc_flags(struct trace_seq *, unsigned int);
> #define __parse_qc_flags(f) libata_trace_parse_qc_flags(p, f)
>
> +const char *libata_trace_parse_tf_flags(struct trace_seq *, unsigned int);
> +#define __parse_tf_flags(f) libata_trace_parse_tf_flags(p, f)
> +
> const char *libata_trace_parse_subcmd(struct trace_seq *, unsigned char,
> unsigned char, unsigned char);
> #define __parse_subcmd(c,f,h) libata_trace_parse_subcmd(p, c, f, h)
> @@ -514,6 +526,89 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_link_softreset_end,
> TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> TP_ARGS(link, class, rc));
>
> +DECLARE_EVENT_CLASS(ata_sff_hsm_template,
> +
> + TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
> +
> + TP_ARGS(qc, status),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __field( unsigned int, ata_dev )
> + __field( unsigned int, tag )
> + __field( unsigned int, qc_flags )
> + __field( unsigned int, protocol )
> + __field( unsigned int, hsm_state )
> + __field( unsigned char, dev_state )
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = qc->ap->print_id;
> + __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
> + __entry->tag = qc->tag;
> + __entry->qc_flags = qc->flags;
> + __entry->protocol = qc->tf.protocol;
> + __entry->hsm_state = qc->ap->hsm_task_state;
> + __entry->dev_state = status;
> + ),
> +
> + TP_printk("ata_port=%u ata_dev=%u tag=%d protocol=%d flags=%s task_state=%s dev_stat=0x%X",
> + __entry->ata_port, __entry->ata_dev, __entry->tag,
> + __entry->protocol,__parse_qc_flags(__entry->qc_flags),
> + show_sff_hsm_state_name(__entry->hsm_state),
> + __entry->dev_state)
> +);
> +
> +DEFINE_EVENT(ata_sff_hsm_template, ata_sff_hsm_state,
> + TP_PROTO(struct ata_queued_cmd *qc, unsigned char state),
> + TP_ARGS(qc, state));
> +
> +DEFINE_EVENT(ata_sff_hsm_template, ata_sff_hsm_command_complete,
> + TP_PROTO(struct ata_queued_cmd *qc, unsigned char state),
> + TP_ARGS(qc, state));
> +
> +DECLARE_EVENT_CLASS(ata_transfer_data_template,
> +
> + TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
> +
> + TP_ARGS(qc, offset, count),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __field( unsigned int, ata_dev )
> + __field( unsigned int, tag )
> + __field( unsigned int, flags )
> + __field( unsigned int, offset )
> + __field( unsigned int, bytes )
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = qc->ap->print_id;
> + __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno;
> + __entry->tag = qc->tag;
> + __entry->flags = qc->tf.flags;
> + __entry->offset = offset;
> + __entry->bytes = count;
> + ),
> +
> + TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s offset=%u bytes=%u",
> + __entry->ata_port, __entry->ata_dev, __entry->tag,
> + __parse_tf_flags(__entry->flags),
> + __entry->offset, __entry->bytes)
> +);
> +
> +DEFINE_EVENT(ata_transfer_data_template, ata_sff_pio_transfer_data,
> + TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
> + TP_ARGS(qc, offset, count));
> +
> +DEFINE_EVENT(ata_transfer_data_template, atapi_pio_transfer_data,
> + TP_PROTO(struct ata_queued_cmd *qc, unsigned int offset, unsigned int count),
> + TP_ARGS(qc, offset, count));
> +
> +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));
> +
> #endif /* _TRACE_LIBATA_H */
>
> /* This part must be outside protection */
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 26/46] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (24 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 25/46] libata-sff: add tracepoints for HSM state machine Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:36 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 27/46] sata_rcar: drop DPRINTK call in sata_rcar_exec_command() Hannes Reinecke
` (19 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Add missing bmdma tracepoints and drop the now pointless
DPRINTK() calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pata_octeon_cf.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index f5cd89173028..9527216e59b9 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -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>
@@ -517,17 +517,14 @@ static void octeon_cf_exec_command16(struct ata_port *ap,
u16 blob;
if (tf->flags & ATA_TFLAG_DEVICE) {
- VPRINTK("device 0x%X\n", tf->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);
}
@@ -541,12 +538,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");
}
/**
@@ -798,8 +793,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, qc->tag);
ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */
+ trace_ata_bmdma_setup(qp, &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;
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 26/46] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK()
2020-02-04 16:55 ` [PATCH 26/46] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() Hannes Reinecke
@ 2020-02-10 15:36 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:36 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Add missing bmdma tracepoints and drop the now pointless
> DPRINTK() calls.
Actually it should be: DPRINTK()/VPRINTK().
Please also consider merging this patch with patch #25.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/pata_octeon_cf.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
> index f5cd89173028..9527216e59b9 100644
> --- a/drivers/ata/pata_octeon_cf.c
> +++ b/drivers/ata/pata_octeon_cf.c
> @@ -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>
>
> @@ -517,17 +517,14 @@ static void octeon_cf_exec_command16(struct ata_port *ap,
> u16 blob;
>
> if (tf->flags & ATA_TFLAG_DEVICE) {
> - VPRINTK("device 0x%X\n", tf->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);
> }
>
> @@ -541,12 +538,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");
> }
>
> /**
> @@ -798,8 +793,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, qc->tag);
> ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */
> + trace_ata_bmdma_setup(qp, &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;
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 27/46] sata_rcar: drop DPRINTK call in sata_rcar_exec_command()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (25 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 26/46] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:37 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 28/46] libata-scsi: drop DPRINTK calls for cdb translation Hannes Reinecke
` (18 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Is now logged with the generic tracepoint, so the DPRINTK call
can be removed.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_rcar.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 1b42be234761..0925a0564cc5 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -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);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 27/46] sata_rcar: drop DPRINTK call in sata_rcar_exec_command()
2020-02-04 16:55 ` [PATCH 27/46] sata_rcar: drop DPRINTK call in sata_rcar_exec_command() Hannes Reinecke
@ 2020-02-10 15:37 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:37 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Is now logged with the generic tracepoint, so the DPRINTK call
> can be removed.
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
However please consider merging this patch with patch #25.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/sata_rcar.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
> index 1b42be234761..0925a0564cc5 100644
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -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);
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 28/46] libata-scsi: drop DPRINTK calls for cdb translation
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (26 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 27/46] sata_rcar: drop DPRINTK call in sata_rcar_exec_command() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:40 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 29/46] libata-sff: add tracepoints for ata_sff_flush_pio_task() Hannes Reinecke
` (17 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Drop 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.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-scsi.c | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index eb2eb599e602..91b69ebef268 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -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");
}
/**
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 28/46] libata-scsi: drop DPRINTK calls for cdb translation
2020-02-04 16:55 ` [PATCH 28/46] libata-scsi: drop DPRINTK calls for cdb translation Hannes Reinecke
@ 2020-02-10 15:40 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:40 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Drop 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.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-scsi.c | 20 +++-----------------
> 1 file changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index eb2eb599e602..91b69ebef268 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -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");
> }
>
> /**
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 29/46] libata-sff: add tracepoints for ata_sff_flush_pio_task()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (27 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 28/46] libata-scsi: drop DPRINTK calls for cdb translation Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:44 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 30/46] libata-core: add postreset tracepoints Hannes Reinecke
` (16 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
Replace DPRINTK calls with tracepoints.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/ata/libata-sff.c | 5 +----
include/trace/events/libata.h | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 6b961eadc201..228f801ef611 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -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, "%s: EXIT\n", __func__);
}
static void ata_sff_pio_task(struct work_struct *work)
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index acfc5d739b17..446f56cb3f01 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -609,6 +609,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 */
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 29/46] libata-sff: add tracepoints for ata_sff_flush_pio_task()
2020-02-04 16:55 ` [PATCH 29/46] libata-sff: add tracepoints for ata_sff_flush_pio_task() Hannes Reinecke
@ 2020-02-10 15:44 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:44 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Replace DPRINTK calls with tracepoints.
Please consider moving the removal to a separate (post-)patch
(for consistency with reset tracepoints conversion etc.).
Also there are some complaints from checkpatch.pl script
regarding CodingStyle:
ERROR: space prohibited after that open parenthesis '('
#119: FILE: include/trace/events/libata.h:619:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#119: FILE: include/trace/events/libata.h:619:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#120: FILE: include/trace/events/libata.h:620:
+ __field( unsigned char, hsm_state )
ERROR: space prohibited before that close parenthesis ')'
#120: FILE: include/trace/events/libata.h:620:
+ __field( unsigned char, hsm_state )
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/ata/libata-sff.c | 5 +----
> include/trace/events/libata.h | 25 +++++++++++++++++++++++++
> 2 files changed, 26 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 6b961eadc201..228f801ef611 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -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, "%s: EXIT\n", __func__);
> }
>
> static void ata_sff_pio_task(struct work_struct *work)
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index acfc5d739b17..446f56cb3f01 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -609,6 +609,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 */
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 30/46] libata-core: add postreset tracepoints
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (28 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 29/46] libata-sff: add tracepoints for ata_sff_flush_pio_task() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:47 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 31/46] pata_octeon_cf: move DPRINTK to VPRINTK Hannes Reinecke
` (15 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Add additional tracepoints for postreset and remove
the DPRINTK() call.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-eh.c | 5 ++++-
drivers/ata/libata-sff.c | 4 +---
include/trace/events/libata.h | 8 ++++++++
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 253dcf903c1b..ef3576eb5874 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2900,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);
+ }
}
/*
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 228f801ef611..ffe633f13f55 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -2052,10 +2052,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) {
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index 446f56cb3f01..40027d8424f8 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -526,6 +526,14 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_link_softreset_end,
TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
TP_ARGS(link, class, rc));
+DEFINE_EVENT(ata_link_reset_end_template, ata_link_postreset,
+ TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
+ TP_ARGS(link, class, rc));
+
+DEFINE_EVENT(ata_link_reset_end_template, ata_slave_postreset,
+ TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
+ TP_ARGS(link, class, rc));
+
DECLARE_EVENT_CLASS(ata_sff_hsm_template,
TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 30/46] libata-core: add postreset tracepoints
2020-02-04 16:55 ` [PATCH 30/46] libata-core: add postreset tracepoints Hannes Reinecke
@ 2020-02-10 15:47 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:47 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Add additional tracepoints for postreset and remove
> the DPRINTK() call.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
How's about merging this with "[PATCH 14/46] libata: add reset
tracepoints"?
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-eh.c | 5 ++++-
> drivers/ata/libata-sff.c | 4 +---
> include/trace/events/libata.h | 8 ++++++++
> 3 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index 253dcf903c1b..ef3576eb5874 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -2900,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);
> + }
> }
>
> /*
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 228f801ef611..ffe633f13f55 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -2052,10 +2052,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) {
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index 446f56cb3f01..40027d8424f8 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -526,6 +526,14 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_link_softreset_end,
> TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> TP_ARGS(link, class, rc));
>
> +DEFINE_EVENT(ata_link_reset_end_template, ata_link_postreset,
> + TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> + TP_ARGS(link, class, rc));
> +
> +DEFINE_EVENT(ata_link_reset_end_template, ata_slave_postreset,
> + TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> + TP_ARGS(link, class, rc));
> +
> DECLARE_EVENT_CLASS(ata_sff_hsm_template,
>
> TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 31/46] pata_octeon_cf: move DPRINTK to VPRINTK
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (29 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 30/46] libata-core: add postreset tracepoints Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:48 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 32/46] pata_pdc202xx_old: Drop DPRINTK in pdc202xx_exec_command() Hannes Reinecke
` (14 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Move the remaining DPRINTK statement in the interrupt handler to
VPRINTK. It'll be converted later with the remaining VPRINTK
calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pata_octeon_cf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 9527216e59b9..f262120f4615 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -671,7 +671,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;
@@ -725,7 +725,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);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 31/46] pata_octeon_cf: move DPRINTK to VPRINTK
2020-02-04 16:55 ` [PATCH 31/46] pata_octeon_cf: move DPRINTK to VPRINTK Hannes Reinecke
@ 2020-02-10 15:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:48 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Move the remaining DPRINTK statement in the interrupt handler to
> VPRINTK. It'll be converted later with the remaining VPRINTK
> calls.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pata_octeon_cf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
> index 9527216e59b9..f262120f4615 100644
> --- a/drivers/ata/pata_octeon_cf.c
> +++ b/drivers/ata/pata_octeon_cf.c
> @@ -671,7 +671,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;
> @@ -725,7 +725,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);
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 32/46] pata_pdc202xx_old: Drop DPRINTK in pdc202xx_exec_command()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (30 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 31/46] pata_octeon_cf: move DPRINTK to VPRINTK Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:49 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 33/46] pata_sil680: Drop DPRINTK in sil_sff_exec_command() Hannes Reinecke
` (13 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Now covered with a generic tracepoint.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pata_pdc202xx_old.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 378ed9ea97e9..3778270e762f 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -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);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 32/46] pata_pdc202xx_old: Drop DPRINTK in pdc202xx_exec_command()
2020-02-04 16:55 ` [PATCH 32/46] pata_pdc202xx_old: Drop DPRINTK in pdc202xx_exec_command() Hannes Reinecke
@ 2020-02-10 15:49 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:49 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Now covered with a generic tracepoint.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pata_pdc202xx_old.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
> index 378ed9ea97e9..3778270e762f 100644
> --- a/drivers/ata/pata_pdc202xx_old.c
> +++ b/drivers/ata/pata_pdc202xx_old.c
> @@ -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);
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 33/46] pata_sil680: Drop DPRINTK in sil_sff_exec_command()
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (31 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 32/46] pata_pdc202xx_old: Drop DPRINTK in pdc202xx_exec_command() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:51 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 34/46] pdc_adma: move DPRINTK to VPRINTK Hannes Reinecke
` (12 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Now covered with a generic tracepoint.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pata_sil680.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 7ab9aea3b630..42ea13dd4ace 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -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);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 33/46] pata_sil680: Drop DPRINTK in sil_sff_exec_command()
2020-02-04 16:55 ` [PATCH 33/46] pata_sil680: Drop DPRINTK in sil_sff_exec_command() Hannes Reinecke
@ 2020-02-10 15:51 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:51 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Now covered with a generic tracepoint.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Also you may consider merging patches #32-33 with patch #24.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pata_sil680.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
> index 7ab9aea3b630..42ea13dd4ace 100644
> --- a/drivers/ata/pata_sil680.c
> +++ b/drivers/ata/pata_sil680.c
> @@ -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);
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 34/46] pdc_adma: move DPRINTK to VPRINTK
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (32 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 33/46] pata_sil680: Drop DPRINTK in sil_sff_exec_command() Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:52 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 35/46] sata_rcar: " Hannes Reinecke
` (11 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Move the remaining DPRINTK statement in the interrupt handler to
VPRINTK. It'll be converted later with the remaining VPRINTK
calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pdc_adma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index 5db55e1e2a61..255738efea89 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -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 */
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 34/46] pdc_adma: move DPRINTK to VPRINTK
2020-02-04 16:55 ` [PATCH 34/46] pdc_adma: move DPRINTK to VPRINTK Hannes Reinecke
@ 2020-02-10 15:52 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:52 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Move the remaining DPRINTK statement in the interrupt handler to
> VPRINTK. It'll be converted later with the remaining VPRINTK
> calls.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pdc_adma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
> index 5db55e1e2a61..255738efea89 100644
> --- a/drivers/ata/pdc_adma.c
> +++ b/drivers/ata/pdc_adma.c
> @@ -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 */
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 35/46] sata_rcar: move DPRINTK to VPRINTK
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (33 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 34/46] pdc_adma: move DPRINTK to VPRINTK Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:52 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 36/46] sata_qstor: " Hannes Reinecke
` (10 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Move the remaining DPRINTK statement in the interrupt handler to
VPRINTK. It'll be converted later with the remaining VPRINTK
calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_rcar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 0925a0564cc5..f65741b5ca20 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -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);
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 35/46] sata_rcar: move DPRINTK to VPRINTK
2020-02-04 16:55 ` [PATCH 35/46] sata_rcar: " Hannes Reinecke
@ 2020-02-10 15:52 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:52 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Move the remaining DPRINTK statement in the interrupt handler to
> VPRINTK. It'll be converted later with the remaining VPRINTK
> calls.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_rcar.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
> index 0925a0564cc5..f65741b5ca20 100644
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -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);
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 36/46] sata_qstor: move DPRINTK to VPRINTK
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (34 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 35/46] sata_rcar: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:53 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 37/46] pata_pdc2027x: Replace PDPRINTK() with standard ata logging Hannes Reinecke
` (9 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Move the remaining DPRINTK statement in the interrupt handler to
VPRINTK. It'll be converted later with the remaining VPRINTK
calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_qstor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index ef00ab644afb..579a8a8f12ba 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -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)
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 36/46] sata_qstor: move DPRINTK to VPRINTK
2020-02-04 16:55 ` [PATCH 36/46] sata_qstor: " Hannes Reinecke
@ 2020-02-10 15:53 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:53 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Move the remaining DPRINTK statement in the interrupt handler to
> VPRINTK. It'll be converted later with the remaining VPRINTK
> calls.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/sata_qstor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
> index ef00ab644afb..579a8a8f12ba 100644
> --- a/drivers/ata/sata_qstor.c
> +++ b/drivers/ata/sata_qstor.c
> @@ -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)
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 37/46] pata_pdc2027x: Replace PDPRINTK() with standard ata logging
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (35 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 36/46] sata_qstor: " Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 15:59 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 38/46] sata_fsl: move DPRINTK to ata debugging Hannes Reinecke
` (8 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Use standard ata logging macros instead of the hand-crafted
PDPRINTK and remove duplicate logging messages.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/pata_pdc2027x.c | 81 ++++++++++++++++++++-------------------------
1 file changed, 36 insertions(+), 45 deletions(-)
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index de834fbb6dfe..2c397c135ccd 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -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 b
R = 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 b
if (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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 37/46] pata_pdc2027x: Replace PDPRINTK() with standard ata logging
2020-02-04 16:55 ` [PATCH 37/46] pata_pdc2027x: Replace PDPRINTK() with standard ata logging Hannes Reinecke
@ 2020-02-10 15:59 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 15:59 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Use standard ata logging macros instead of the hand-crafted
> PDPRINTK and remove duplicate logging messages.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
It looks much better now, thank you for reworking it.
Could you please also fix some minor issues found by
checkpatch.pl script while at it:
WARNING: unnecessary whitespace before a quoted newline
#132: FILE: drivers/ata/pata_pdc2027x.c:300:
+ ata_port_dbg(ap, "Set pio regs... \n");
WARNING: unnecessary whitespace before a quoted newline
#143: FILE: drivers/ata/pata_pdc2027x.c:313:
+ ata_port_dbg(ap, "Set to pio mode[%u] \n", pio);
WARNING: unnecessary whitespace before a quoted newline
#152: FILE: drivers/ata/pata_pdc2027x.c:346:
+ ata_port_dbg(ap, "Set udma regs... \n");
WARNING: unnecessary whitespace before a quoted newline
#163: FILE: drivers/ata/pata_pdc2027x.c:355:
+ ata_port_dbg(ap, "Set to udma mode[%u] \n", udma_mode);
WARNING: unnecessary whitespace before a quoted newline
#171: FILE: drivers/ata/pata_pdc2027x.c:362:
+ ata_port_dbg(ap, "Set mdma regs... \n");
WARNING: unnecessary whitespace before a quoted newline
#182: FILE: drivers/ata/pata_pdc2027x.c:371:
+ ata_port_dbg(ap, "Set to mdma mode[%u] \n", mdma_mode);
?
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pata_pdc2027x.c | 81 ++++++++++++++++++++-------------------------
> 1 file changed, 36 insertions(+), 45 deletions(-)
>
> diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
> index de834fbb6dfe..2c397c135ccd 100644
> --- a/drivers/ata/pata_pdc2027x.c
> +++ b/drivers/ata/pata_pdc2027x.c
> @@ -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 b
> R = 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 b
>
> if (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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 38/46] sata_fsl: move DPRINTK to ata debugging
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (36 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 37/46] pata_pdc2027x: Replace PDPRINTK() with standard ata logging Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:07 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 39/46] libata: add tracepoints for ATA error handling Hannes Reinecke
` (7 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Replace all DPRINTK calls with the standard logging functions.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/sata_fsl.c | 84 ++++++++++++++++++++++++++------------------------
1 file changed, 43 insertions(+), 41 deletions(-)
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 5d48e1d223fa..57c8c4a1558d 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -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,9 +853,10 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
goto try_offline_again;
}
- DPRINTK("hardreset, controller off-lined\n");
- VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
- VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+ ata_port_dbg(ap, "hardreset, controller off-lined\n"
+ "HStatus = 0x%x HControl = 0x%x\n",
+ ioread32(hcr_base + HSTATUS),
+ ioread32(hcr_base + HCONTROL));
/*
* PHY reset should remain asserted for atleast 1ms
@@ -880,9 +884,10 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
goto err;
}
- DPRINTK("hardreset, controller off-lined & on-lined\n");
- VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
- VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+ ata_port_dbg(ap, "controller off-lined & on-lined\n"
+ "HStatus = 0x%x HControl = 0x%x\n",
+ ioread32(hcr_base + HSTATUS),
+ ioread32(hcr_base + HCONTROL));
/*
* First, wait for the PHYRDY change to occur before waiting for
@@ -962,7 +967,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 +975,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 +988,16 @@ 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 +1055,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 +1098,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 +1115,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 +1136,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 +1241,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,15 +1264,13 @@ 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",
+ 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",
+ 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));
}
@@ -1277,7 +1281,7 @@ 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",
+ ata_port_dbg(ap, "completing non-ncq cmd, CC=0x%x\n",
ioread32(hcr_base + CC));
if (qc) {
@@ -1285,7 +1289,7 @@ static void sata_fsl_host_intr(struct ata_port *ap)
}
} else {
/* Spurious Interrupt!! */
- DPRINTK("spurious interrupt!!, CC = 0x%x\n",
+ ata_port_dbg(ap, "spurious interrupt!!, CC = 0x%x\n",
ioread32(hcr_base + CC));
iowrite32(done_mask, hcr_base + CC);
return;
@@ -1305,7 +1309,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,7 +1363,7 @@ 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 */
@@ -1378,8 +1382,8 @@ 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)
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 38/46] sata_fsl: move DPRINTK to ata debugging
2020-02-04 16:55 ` [PATCH 38/46] sata_fsl: move DPRINTK to ata debugging Hannes Reinecke
@ 2020-02-10 16:07 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:07 UTC (permalink / raw)
To: Hannes Reinecke, Jens Axboe; +Cc: linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Replace all DPRINTK calls with the standard logging functions.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/sata_fsl.c | 84 ++++++++++++++++++++++++++------------------------
> 1 file changed, 43 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index 5d48e1d223fa..57c8c4a1558d 100644
> --- a/drivers/ata/sata_fsl.c
> +++ b/drivers/ata/sata_fsl.c
> @@ -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,9 +853,10 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
> goto try_offline_again;
> }
>
> - DPRINTK("hardreset, controller off-lined\n");
> - VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
> - VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
The above two are not DPRINTKs, please update patch description
accordingly.
> + ata_port_dbg(ap, "hardreset, controller off-lined\n"
letfover '\n'?
> + "HStatus = 0x%x HControl = 0x%x\n",
> + ioread32(hcr_base + HSTATUS),
> + ioread32(hcr_base + HCONTROL));
>
> /*
> * PHY reset should remain asserted for atleast 1ms
> @@ -880,9 +884,10 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
> goto err;
> }
>
> - DPRINTK("hardreset, controller off-lined & on-lined\n");
> - VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
> - VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
The above two are not DPRINTKs, please update patch description
accordingly.
> + ata_port_dbg(ap, "controller off-lined & on-lined\n"
letfover '\n'?
> + "HStatus = 0x%x HControl = 0x%x\n",
> + ioread32(hcr_base + HSTATUS),
> + ioread32(hcr_base + HCONTROL));
>
> /*
> * First, wait for the PHYRDY change to occur before waiting for
> @@ -962,7 +967,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 +975,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 +988,16 @@ 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 +1055,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 +1098,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 +1115,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 +1136,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 +1241,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,15 +1264,13 @@ 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",
> + 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",
> + 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));
> }
> @@ -1277,7 +1281,7 @@ 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",
> + ata_port_dbg(ap, "completing non-ncq cmd, CC=0x%x\n",
> ioread32(hcr_base + CC));
>
> if (qc) {
> @@ -1285,7 +1289,7 @@ static void sata_fsl_host_intr(struct ata_port *ap)
> }
> } else {
> /* Spurious Interrupt!! */
> - DPRINTK("spurious interrupt!!, CC = 0x%x\n",
> + ata_port_dbg(ap, "spurious interrupt!!, CC = 0x%x\n",
> ioread32(hcr_base + CC));
> iowrite32(done_mask, hcr_base + CC);
> return;
> @@ -1305,7 +1309,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,7 +1363,7 @@ 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 */
> @@ -1378,8 +1382,8 @@ 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));
checkpatch.pl script complains about this line:
WARNING: line over 80 characters
#329: FILE: drivers/ata/sata_fsl.c:1386:
+ 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);
The above two DPRINTKs are deleted, please update patch description
accordingly.
> + 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)
>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 39/46] libata: add tracepoints for ATA error handling
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (37 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 38/46] sata_fsl: move DPRINTK to ata debugging Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:45 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 40/46] libata-eh: remove DPRINTK() calls for request sense Hannes Reinecke
` (6 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
Add tracepoints for ATA error handling, and remove the related
DPRINTK() calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-eh.c | 22 +++++-----------
drivers/ata/libata-pmp.c | 8 ------
include/trace/events/libata.h | 60 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 23 deletions(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index ef3576eb5874..f37dad5f9c17 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -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");
}
/**
@@ -933,7 +930,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 +1057,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 +1205,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 +1344,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 +1376,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);
}
@@ -2119,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;
@@ -2227,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");
}
/**
@@ -3126,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.
@@ -3241,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;
}
@@ -3755,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;
@@ -3964,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;
}
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 3ff14071617c..438caf3a7d8c 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -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;
}
diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
index 40027d8424f8..c882c8f9b405 100644
--- a/include/trace/events/libata.h
+++ b/include/trace/events/libata.h
@@ -454,6 +454,37 @@ TRACE_EVENT(ata_eh_link_autopsy_qc,
__parse_eh_err_mask(__entry->eh_err_mask))
);
+DECLARE_EVENT_CLASS(ata_eh_action_template,
+
+ TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
+
+ TP_ARGS(link, devno, eh_action),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ __field( unsigned int, ata_dev )
+ __field( unsigned int, eh_action )
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = link->ap->print_id;
+ __entry->ata_dev = link->pmp + devno;
+ __entry->eh_action = eh_action;
+ ),
+
+ TP_printk("ata_port=%u ata_dev=%u eh_action=%s",
+ __entry->ata_port, __entry->ata_dev,
+ __parse_eh_action(__entry->eh_action))
+);
+
+DEFINE_EVENT(ata_eh_action_template, ata_eh_about_to_do,
+ TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
+ TP_ARGS(link, devno, eh_action));
+
+DEFINE_EVENT(ata_eh_action_template, ata_eh_done,
+ TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
+ TP_ARGS(link, devno, eh_action));
+
DECLARE_EVENT_CLASS(ata_link_reset_begin_template,
TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
@@ -534,6 +565,35 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_slave_postreset,
TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
TP_ARGS(link, class, rc));
+DECLARE_EVENT_CLASS(ata_port_eh_begin_template,
+
+ TP_PROTO(struct ata_port *ap),
+
+ TP_ARGS(ap),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, ata_port )
+ ),
+
+ TP_fast_assign(
+ __entry->ata_port = ap->print_id;
+ ),
+
+ TP_printk("ata_port=%u", __entry->ata_port)
+);
+
+DEFINE_EVENT(ata_port_eh_begin_template, ata_std_sched_eh,
+ TP_PROTO(struct ata_port *ap),
+ TP_ARGS(ap));
+
+DEFINE_EVENT(ata_port_eh_begin_template, ata_port_freeze,
+ TP_PROTO(struct ata_port *ap),
+ TP_ARGS(ap));
+
+DEFINE_EVENT(ata_port_eh_begin_template, ata_port_thaw,
+ TP_PROTO(struct ata_port *ap),
+ TP_ARGS(ap));
+
DECLARE_EVENT_CLASS(ata_sff_hsm_template,
TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 39/46] libata: add tracepoints for ATA error handling
2020-02-04 16:55 ` [PATCH 39/46] libata: add tracepoints for ATA error handling Hannes Reinecke
@ 2020-02-10 16:45 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:45 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Add tracepoints for ATA error handling, and remove the related
> DPRINTK() calls.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Please move the removal to a separate (post-)patch
(like it has been done for reset tracepoints).
Also there is a lot of complaints from checkpatch.pl script
regarding CodingStyle:
WARNING: line over 80 characters
#259: FILE: include/trace/events/libata.h:459:
+ TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
ERROR: space prohibited after that open parenthesis '('
#264: FILE: include/trace/events/libata.h:464:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#264: FILE: include/trace/events/libata.h:464:
+ __field( unsigned int, ata_port )
ERROR: space prohibited after that open parenthesis '('
#265: FILE: include/trace/events/libata.h:465:
+ __field( unsigned int, ata_dev )
ERROR: space prohibited before that close parenthesis ')'
#265: FILE: include/trace/events/libata.h:465:
+ __field( unsigned int, ata_dev )
ERROR: space prohibited after that open parenthesis '('
#266: FILE: include/trace/events/libata.h:466:
+ __field( unsigned int, eh_action )
ERROR: space prohibited before that close parenthesis ')'
#266: FILE: include/trace/events/libata.h:466:
+ __field( unsigned int, eh_action )
WARNING: line over 80 characters
#281: FILE: include/trace/events/libata.h:481:
+ TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
WARNING: line over 80 characters
#285: FILE: include/trace/events/libata.h:485:
+ TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
ERROR: space prohibited after that open parenthesis '('
#302: FILE: include/trace/events/libata.h:575:
+ __field( unsigned int, ata_port )
ERROR: space prohibited before that close parenthesis ')'
#302: FILE: include/trace/events/libata.h:575:
+ __field( unsigned int, ata_port )
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-eh.c | 22 +++++-----------
> drivers/ata/libata-pmp.c | 8 ------
> include/trace/events/libata.h | 60 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 67 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index ef3576eb5874..f37dad5f9c17 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -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");
> }
>
> /**
> @@ -933,7 +930,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 +1057,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 +1205,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 +1344,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 +1376,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);
> }
>
> @@ -2119,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;
>
> @@ -2227,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");
> }
>
> /**
> @@ -3126,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.
> @@ -3241,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;
> }
>
> @@ -3755,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;
> @@ -3964,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;
> }
>
> diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
> index 3ff14071617c..438caf3a7d8c 100644
> --- a/drivers/ata/libata-pmp.c
> +++ b/drivers/ata/libata-pmp.c
> @@ -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;
> }
>
> diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
> index 40027d8424f8..c882c8f9b405 100644
> --- a/include/trace/events/libata.h
> +++ b/include/trace/events/libata.h
> @@ -454,6 +454,37 @@ TRACE_EVENT(ata_eh_link_autopsy_qc,
> __parse_eh_err_mask(__entry->eh_err_mask))
> );
>
> +DECLARE_EVENT_CLASS(ata_eh_action_template,
> +
> + TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
> +
> + TP_ARGS(link, devno, eh_action),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + __field( unsigned int, ata_dev )
> + __field( unsigned int, eh_action )
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = link->ap->print_id;
> + __entry->ata_dev = link->pmp + devno;
> + __entry->eh_action = eh_action;
> + ),
> +
> + TP_printk("ata_port=%u ata_dev=%u eh_action=%s",
> + __entry->ata_port, __entry->ata_dev,
> + __parse_eh_action(__entry->eh_action))
> +);
> +
> +DEFINE_EVENT(ata_eh_action_template, ata_eh_about_to_do,
> + TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
> + TP_ARGS(link, devno, eh_action));
> +
> +DEFINE_EVENT(ata_eh_action_template, ata_eh_done,
> + TP_PROTO(struct ata_link *link, unsigned int devno, unsigned int eh_action),
> + TP_ARGS(link, devno, eh_action));
> +
> DECLARE_EVENT_CLASS(ata_link_reset_begin_template,
>
> TP_PROTO(struct ata_link *link, unsigned int *class, unsigned long deadline),
> @@ -534,6 +565,35 @@ DEFINE_EVENT(ata_link_reset_end_template, ata_slave_postreset,
> TP_PROTO(struct ata_link *link, unsigned int *class, int rc),
> TP_ARGS(link, class, rc));
>
> +DECLARE_EVENT_CLASS(ata_port_eh_begin_template,
> +
> + TP_PROTO(struct ata_port *ap),
> +
> + TP_ARGS(ap),
> +
> + TP_STRUCT__entry(
> + __field( unsigned int, ata_port )
> + ),
> +
> + TP_fast_assign(
> + __entry->ata_port = ap->print_id;
> + ),
> +
> + TP_printk("ata_port=%u", __entry->ata_port)
> +);
> +
> +DEFINE_EVENT(ata_port_eh_begin_template, ata_std_sched_eh,
> + TP_PROTO(struct ata_port *ap),
> + TP_ARGS(ap));
> +
> +DEFINE_EVENT(ata_port_eh_begin_template, ata_port_freeze,
> + TP_PROTO(struct ata_port *ap),
> + TP_ARGS(ap));
> +
> +DEFINE_EVENT(ata_port_eh_begin_template, ata_port_thaw,
> + TP_PROTO(struct ata_port *ap),
> + TP_ARGS(ap));
> +
> DECLARE_EVENT_CLASS(ata_sff_hsm_template,
>
> TP_PROTO(struct ata_queued_cmd *qc, unsigned char status),
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 40/46] libata-eh: remove DPRINTK() calls for request sense
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (38 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 39/46] libata: add tracepoints for ATA error handling Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:46 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 41/46] libata-core: move DPRINTK to ata debugging Hannes Reinecke
` (5 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
The information will printed during ata_qc_issue() anyway, so
this messages can be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-eh.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index f37dad5f9c17..388f8ed46eab 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -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,
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 40/46] libata-eh: remove DPRINTK() calls for request sense
2020-02-04 16:55 ` [PATCH 40/46] libata-eh: remove DPRINTK() calls for request sense Hannes Reinecke
@ 2020-02-10 16:46 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:46 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> The information will printed during ata_qc_issue() anyway, so
> this messages can be dropped.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-eh.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index f37dad5f9c17..388f8ed46eab 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -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,
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 41/46] libata-core: move DPRINTK to ata debugging
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (39 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 40/46] libata-eh: remove DPRINTK() calls for request sense Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:48 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 42/46] libata: remove DPRINTK() macro Hannes Reinecke
` (4 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Replace all DPRINTK calls with the ata_XXX_dbg functions.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 297aa8172d4e..73f89026b2a2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2060,7 +2060,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
@@ -2096,7 +2096,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;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 41/46] libata-core: move DPRINTK to ata debugging
2020-02-04 16:55 ` [PATCH 41/46] libata-core: move DPRINTK to ata debugging Hannes Reinecke
@ 2020-02-10 16:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:48 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Replace all DPRINTK calls with the ata_XXX_dbg functions.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-core.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 297aa8172d4e..73f89026b2a2 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -2060,7 +2060,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
> @@ -2096,7 +2096,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;
> }
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 42/46] libata: remove DPRINTK() macro
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (40 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 41/46] libata-core: move DPRINTK to ata debugging Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-04 16:55 ` [PATCH 43/46] libata: kill ATA_MSG_INFO Hannes Reinecke
` (3 subsequent siblings)
45 siblings, 0 replies; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
No users left, remove it.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
include/linux/libata.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c7ffe6fb39f1..e2578d87d931 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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 */
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* [PATCH 43/46] libata: kill ATA_MSG_INFO
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (41 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 42/46] libata: remove DPRINTK() macro Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:49 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 44/46] libata: kill ATA_MSG_CTL Hannes Reinecke
` (2 subsequent siblings)
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
Just a single user, which should be converted to ata_dev_dbg() anyway.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 6 +++---
include/linux/libata.h | 2 --
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 73f89026b2a2..a81e7006e73f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2454,8 +2454,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
diff --git a/include/linux/libata.h b/include/linux/libata.h
index e2578d87d931..cab7aa3f0ed0 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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)
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 43/46] libata: kill ATA_MSG_INFO
2020-02-04 16:55 ` [PATCH 43/46] libata: kill ATA_MSG_INFO Hannes Reinecke
@ 2020-02-10 16:49 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:49 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> Just a single user, which should be converted to ata_dev_dbg() anyway.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-core.c | 6 +++---
> include/linux/libata.h | 2 --
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 73f89026b2a2..a81e7006e73f 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -2454,8 +2454,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
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index e2578d87d931..cab7aa3f0ed0 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -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)
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 44/46] libata: kill ATA_MSG_CTL
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (42 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 43/46] libata: kill ATA_MSG_INFO Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:49 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 45/46] libata: remove references to ATA_DEBUG Hannes Reinecke
2020-02-04 16:55 ` [PATCH 46/46] libata: remove ATA_NDEBUG Hannes Reinecke
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe
Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke, Hannes Reinecke
From: Hannes Reinecke <hare@suse.com>
All instances had been converted to ata_XXX_dbg() anyway, so
the conditional is pointless anyway.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 5 ++---
include/linux/libata.h | 2 --
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a81e7006e73f..0f1682a55b54 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1858,8 +1858,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, "%s: ENTER\n", __func__);
+ 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
diff --git a/include/linux/libata.h b/include/linux/libata.h
index cab7aa3f0ed0..1012aed05187 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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)
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 44/46] libata: kill ATA_MSG_CTL
2020-02-04 16:55 ` [PATCH 44/46] libata: kill ATA_MSG_CTL Hannes Reinecke
@ 2020-02-10 16:49 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:49 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide, Hannes Reinecke
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare@suse.com>
>
> All instances had been converted to ata_XXX_dbg() anyway, so
> the conditional is pointless anyway.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-core.c | 5 ++---
> include/linux/libata.h | 2 --
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index a81e7006e73f..0f1682a55b54 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1858,8 +1858,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, "%s: ENTER\n", __func__);
> + 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
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index cab7aa3f0ed0..1012aed05187 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -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)
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 45/46] libata: remove references to ATA_DEBUG
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (43 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 44/46] libata: kill ATA_MSG_CTL Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:50 ` Bartlomiej Zolnierkiewicz
2020-02-04 16:55 ` [PATCH 46/46] libata: remove ATA_NDEBUG Hannes Reinecke
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
All instances are gone.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-core.c | 2 --
include/linux/libata.h | 5 -----
2 files changed, 7 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0f1682a55b54..9c05177e09c2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -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
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 1012aed05187..06d6a3e18e18 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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) \
({ \
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 45/46] libata: remove references to ATA_DEBUG
2020-02-04 16:55 ` [PATCH 45/46] libata: remove references to ATA_DEBUG Hannes Reinecke
@ 2020-02-10 16:50 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:50 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> All instances are gone.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/libata-core.c | 2 --
> include/linux/libata.h | 5 -----
> 2 files changed, 7 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 0f1682a55b54..9c05177e09c2 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -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
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 1012aed05187..06d6a3e18e18 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -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) \
> ({ \
>
^ permalink raw reply [flat|nested] 97+ messages in thread
* [PATCH 46/46] libata: remove ATA_NDEBUG
2020-02-04 16:55 [PATCH 00/46] ata: kill ATA_DEBUG Hannes Reinecke
` (44 preceding siblings ...)
2020-02-04 16:55 ` [PATCH 45/46] libata: remove references to ATA_DEBUG Hannes Reinecke
@ 2020-02-04 16:55 ` Hannes Reinecke
2020-02-10 16:51 ` Bartlomiej Zolnierkiewicz
45 siblings, 1 reply; 97+ messages in thread
From: Hannes Reinecke @ 2020-02-04 16:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: Bartolomiej Zolnierkiewicz, linux-ide, Hannes Reinecke
No functionality.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
include/linux/libata.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 06d6a3e18e18..021ca967b4df 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -40,7 +40,6 @@
*/
#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 */
--
2.16.4
^ permalink raw reply related [flat|nested] 97+ messages in thread
* Re: [PATCH 46/46] libata: remove ATA_NDEBUG
2020-02-04 16:55 ` [PATCH 46/46] libata: remove ATA_NDEBUG Hannes Reinecke
@ 2020-02-10 16:51 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 97+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-02-10 16:51 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: Jens Axboe, linux-ide
On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> No functionality.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> include/linux/libata.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 06d6a3e18e18..021ca967b4df 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -40,7 +40,6 @@
> */
> #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 */
>
^ permalink raw reply [flat|nested] 97+ messages in thread