From: Guenter Roeck <linux@roeck-us.net>
To: Hannes Reinecke <hare@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH 35/40] sata_fsl: move DPRINTK to ata debugging
Date: Fri, 13 Mar 2020 07:43:44 -0700 [thread overview]
Message-ID: <20200313144344.GA6330@roeck-us.net> (raw)
In-Reply-To: <20200303093813.18523-36-hare@suse.de>
On Tue, Mar 03, 2020 at 10:38:08AM +0100, Hannes Reinecke wrote:
> Replace all DPRINTK calls with the standard logging functions.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/ata/sata_fsl.c: In function 'sata_fsl_init_controller':
drivers/ata/sata_fsl.c:1365:15: error: 'ap' undeclared (first use in this function); did you mean 'up'?
and several other similar errors.
Guenter
> ---
> drivers/ata/sata_fsl.c | 90 ++++++++++++++++++++++++++------------------------
> 1 file changed, 46 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index 5d48e1d223fa..730f6701052c 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,7 +853,7 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
> goto try_offline_again;
> }
>
> - DPRINTK("hardreset, controller off-lined\n");
> + ata_port_dbg(ap, "hardreset, controller off-lined\n");
> VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
> VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
>
> @@ -880,7 +883,7 @@ static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
> goto err;
> }
>
> - DPRINTK("hardreset, controller off-lined & on-lined\n");
> + ata_port_dbg(ap, "controller off-lined & on-lined\n");
> VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
> VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
>
> @@ -962,7 +965,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
> tf.ctl |= ATA_SRST; /* setup SRST bit in taskfile control reg */
> ata_tf_to_fis(&tf, pmp, 0, cfis);
>
> - DPRINTK("Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n",
> + ata_port_dbg(ap, "Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n",
> cfis[0], cfis[1], cfis[2], cfis[3]);
>
> /*
> @@ -970,7 +973,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
> * other commands are active on the controller/device
> */
>
> - DPRINTK("@Softreset, CQ = 0x%x, CA = 0x%x, CC = 0x%x\n",
> + ata_port_dbg(ap, "CQ = 0x%x, CA = 0x%x, CC = 0x%x\n",
> ioread32(CQ + hcr_base),
> ioread32(CA + hcr_base), ioread32(CC + hcr_base));
>
> @@ -983,15 +986,17 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
> if (temp & 0x1) {
> ata_port_warn(ap, "ATA_SRST issue failed\n");
>
> - DPRINTK("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
> + ata_port_dbg(ap, "Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
> ioread32(CQ + hcr_base),
> ioread32(CA + hcr_base), ioread32(CC + hcr_base));
>
> sata_fsl_scr_read(&ap->link, SCR_ERROR, &Serror);
>
> - DPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
> - DPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
> - DPRINTK("Serror = 0x%x\n", Serror);
> + ata_port_dbg(ap,
> + "HStatus = 0x%x HControl = 0x%x Serror = 0x%x\n",
> + ioread32(hcr_base + HSTATUS),
> + ioread32(hcr_base + HCONTROL),
> + Serror);
> goto err;
> }
>
> @@ -1049,7 +1054,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
> static void sata_fsl_error_handler(struct ata_port *ap)
> {
>
> - DPRINTK("in xx_error_handler\n");
> + ata_port_dbg(ap, "ENTER\n");
> sata_pmp_error_handler(ap);
>
> }
> @@ -1092,7 +1097,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)
> if (unlikely(SError & 0xFFFF0000))
> sata_fsl_scr_write(&ap->link, SCR_ERROR, SError);
>
> - DPRINTK("error_intr,hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n",
> + ata_port_dbg(ap, "hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n",
> hstatus, cereg, ioread32(hcr_base + DE), SError);
>
> /* handle fatal errors */
> @@ -1109,7 +1114,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)
>
> /* Handle PHYRDY change notification */
> if (hstatus & INT_ON_PHYRDY_CHG) {
> - DPRINTK("SATA FSL: PHYRDY change indication\n");
> + ata_port_dbg(ap, "PHYRDY change indication\n");
>
> /* Setup a soft-reset EH action */
> ata_ehi_hotplugged(ehi);
> @@ -1130,7 +1135,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)
> */
> abort = 1;
>
> - DPRINTK("single device error, CE=0x%x, DE=0x%x\n",
> + ata_port_dbg(ap, "single device error, CE=0x%x, DE=0x%x\n",
> ioread32(hcr_base + CE), ioread32(hcr_base + DE));
>
> /* find out the offending link and qc */
> @@ -1235,12 +1240,12 @@ static void sata_fsl_host_intr(struct ata_port *ap)
> }
>
> if (unlikely(SError & 0xFFFF0000)) {
> - DPRINTK("serror @host_intr : 0x%x\n", SError);
> + ata_port_dbg(ap, "serror @host_intr : 0x%x\n", SError);
> sata_fsl_error_intr(ap);
> }
>
> if (unlikely(hstatus & status_mask)) {
> - DPRINTK("error interrupt!!\n");
> + ata_port_dbg(ap, "error interrupt!!\n");
> sata_fsl_error_intr(ap);
> return;
> }
> @@ -1258,17 +1263,15 @@ static void sata_fsl_host_intr(struct ata_port *ap)
> /* clear CC bit, this will also complete the interrupt */
> iowrite32(done_mask, hcr_base + CC);
>
> - DPRINTK("Status of all queues :\n");
> - DPRINTK("done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n",
> - done_mask, ioread32(hcr_base + CA),
> - ioread32(hcr_base + CE));
> + ata_port_dbg(ap, "Status of all queues: done_mask/CC = 0x%x, CA = 0x%x, CE=0x%x\n",
> + done_mask, ioread32(hcr_base + CA),
> + ioread32(hcr_base + CE));
>
> for (i = 0; i < SATA_FSL_QUEUE_DEPTH; i++) {
> if (done_mask & (1 << i))
> - DPRINTK
> - ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n",
> - i, ioread32(hcr_base + CC),
> - ioread32(hcr_base + CA));
> + ata_port_dbg(ap, "completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n",
> + i, ioread32(hcr_base + CC),
> + ioread32(hcr_base + CA));
> }
> ata_qc_complete_multiple(ap, ata_qc_get_active(ap) ^ done_mask);
> return;
> @@ -1277,16 +1280,16 @@ static void sata_fsl_host_intr(struct ata_port *ap)
> iowrite32(1, hcr_base + CC);
> qc = ata_qc_from_tag(ap, ATA_TAG_INTERNAL);
>
> - DPRINTK("completing non-ncq cmd, CC=0x%x\n",
> - ioread32(hcr_base + CC));
> + ata_port_dbg(ap, "completing non-ncq cmd, CC=0x%x\n",
> + ioread32(hcr_base + CC));
>
> if (qc) {
> ata_qc_complete(qc);
> }
> } else {
> /* Spurious Interrupt!! */
> - DPRINTK("spurious interrupt!!, CC = 0x%x\n",
> - ioread32(hcr_base + CC));
> + ata_port_dbg(ap, "spurious interrupt!!, CC = 0x%x\n",
> + ioread32(hcr_base + CC));
> iowrite32(done_mask, hcr_base + CC);
> return;
> }
> @@ -1305,7 +1308,7 @@ static irqreturn_t sata_fsl_interrupt(int irq, void *dev_instance)
> interrupt_enables = ioread32(hcr_base + HSTATUS);
> interrupt_enables &= 0x3F;
>
> - DPRINTK("interrupt status 0x%x\n", interrupt_enables);
> + ata_port_dbg(ap, "interrupt status 0x%x\n", interrupt_enables);
>
> if (!interrupt_enables)
> return IRQ_NONE;
> @@ -1359,14 +1362,14 @@ static int sata_fsl_init_controller(struct ata_host *host)
> iowrite32((temp & ~0x3F), hcr_base + HCONTROL);
>
> /* Disable interrupt coalescing control(icc), for the moment */
> - DPRINTK("icc = 0x%x\n", ioread32(hcr_base + ICC));
> + ata_port_dbg(ap, "icc = 0x%x\n", ioread32(hcr_base + ICC));
> iowrite32(0x01000000, hcr_base + ICC);
>
> /* clear error registers, SError is cleared by libATA */
> iowrite32(0x00000FFFF, hcr_base + CE);
> iowrite32(0x00000FFFF, hcr_base + DE);
>
> - /*
> + /*
> * reset the number of command complete bits which will cause the
> * interrupt to be signaled
> */
> @@ -1378,8 +1381,9 @@ static int sata_fsl_init_controller(struct ata_host *host)
> * callback, that should also initiate the OOB, COMINIT sequence
> */
>
> - DPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
> - DPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
> + ata_port_dbg(ap, "HStatus = 0x%x HControl = 0x%x\n",
> + ioread32(hcr_base + HSTATUS),
> + ioread32(hcr_base + HCONTROL));
>
> return 0;
> }
> @@ -1458,9 +1462,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)
> iowrite32(temp | TRANSCFG_RX_WATER_MARK, csr_base + TRANSCFG);
> }
>
> - DPRINTK("@reset i/o = 0x%x\n", ioread32(csr_base + TRANSCFG));
> - DPRINTK("sizeof(cmd_desc) = %d\n", sizeof(struct command_desc));
> - DPRINTK("sizeof(#define cmd_desc) = %d\n", SATA_FSL_CMD_DESC_SIZE);
> + ata_port_dbg(ap, "@reset i/o = 0x%x\n", ioread32(csr_base + TRANSCFG));
>
> host_priv = kzalloc(sizeof(struct sata_fsl_host_priv), GFP_KERNEL);
> if (!host_priv)
next prev parent reply other threads:[~2020-03-13 14:43 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 9:37 [PATCHv3 00/40] ata: kill ATA_DEBUG Hannes Reinecke
2020-03-03 9:37 ` [PATCH 01/40] libata: drop BPRINTK() Hannes Reinecke
2020-03-03 9:37 ` [PATCH 02/40] libata.h: whitespace and indentation fixes Hannes Reinecke
2020-03-03 9:37 ` [PATCH 03/40] libata-transport: Whitespace cleanup Hannes Reinecke
2020-03-03 9:37 ` [PATCH 04/40] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros Hannes Reinecke
2020-03-24 13:26 ` Geert Uytterhoeven
2020-03-25 14:56 ` Bartlomiej Zolnierkiewicz
2020-03-25 15:34 ` Geert Uytterhoeven
2020-03-25 15:45 ` Bartlomiej Zolnierkiewicz
2020-03-25 16:54 ` Hannes Reinecke
2020-03-03 9:37 ` [PATCH 05/40] libata: move __func__ into ata_{port,link,dev}_dbg() helper Hannes Reinecke
2020-03-03 9:37 ` [PATCH 06/40] libata: remove pointless debugging messages Hannes Reinecke
2020-03-03 9:37 ` [PATCH 07/40] ata_piix: remove " Hannes Reinecke
2020-03-03 9:37 ` [PATCH 08/40] libata-core: remove pointless " Hannes Reinecke
2020-03-03 9:37 ` [PATCH 09/40] libata: Add ata_port_classify() helper Hannes Reinecke
2020-03-03 9:37 ` [PATCH 10/40] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
2020-03-03 9:37 ` [PATCH 11/40] libata: sanitize ATA_HORKAGE_DUMP_ID Hannes Reinecke
2020-03-03 9:37 ` [PATCH 12/40] sata_mv: replace DPRINTK with 'pci_dump' module parameter Hannes Reinecke
2020-03-03 9:37 ` [PATCH 13/40] sata_mv: kill 'port' argument in mv_dump_all_regs() Hannes Reinecke
2020-03-03 9:37 ` [PATCH 14/40] sata_sx4: move DPRINTK to VPRINTK Hannes Reinecke
2020-03-03 9:37 ` [PATCH 15/40] libata: add reset tracepoints Hannes Reinecke
2020-03-03 9:37 ` [PATCH 16/40] libata: drop DPRINTK() calls in reset Hannes Reinecke
2020-03-03 9:37 ` [PATCH 17/40] libata: tracepoints for bus-master DMA Hannes Reinecke
2020-03-03 9:37 ` [PATCH 18/40] libata: drop debugging statements " Hannes Reinecke
2020-03-03 9:37 ` [PATCH 19/40] pata_octeon_cf: add bmdma tracepoints and drop DPRINTK() calls Hannes Reinecke
2020-03-03 9:37 ` [PATCH 20/40] pata_arasan_cf: use generic tracepoints Hannes Reinecke
2020-03-03 9:37 ` [PATCH 21/40] sata_dwc_460ex: " Hannes Reinecke
2020-03-03 9:37 ` [PATCH 22/40] sata_nv: " Hannes Reinecke
2020-03-03 9:37 ` [PATCH 23/40] libata-sff: tracepoints for HSM state machine Hannes Reinecke
2020-03-03 9:37 ` [PATCH 24/40] libata-sff: add tracepoints for ata_sff_flush_pio_task() Hannes Reinecke
2020-03-03 9:37 ` [PATCH 25/40] libata-scsi: drop DPRINTK calls for cdb translation Hannes Reinecke
2020-03-03 9:37 ` [PATCH 26/40] libata: add tracepoints for ATA error handling Hannes Reinecke
2020-03-03 9:38 ` [PATCH 27/40] libata: drop DPRINTK() calls during " Hannes Reinecke
2020-03-03 9:38 ` [PATCH 28/40] libata-eh: remove DPRINTK() calls for request sense Hannes Reinecke
2020-03-03 9:38 ` [PATCH 29/40] pata_octeon_cf: move DPRINTK to VPRINTK Hannes Reinecke
2020-03-03 9:38 ` [PATCH 30/40] pdc_adma: " Hannes Reinecke
2020-03-03 9:38 ` [PATCH 31/40] sata_rcar: " Hannes Reinecke
2020-03-03 9:38 ` [PATCH 32/40] sata_qstor: " Hannes Reinecke
2020-03-03 9:38 ` [PATCH 33/40] pata_pdc2027x: Replace PDPRINTK() with standard ata logging Hannes Reinecke
2020-03-03 9:38 ` [PATCH 34/40] sata_nv: move DPRINTK to ata debugging Hannes Reinecke
2020-03-03 9:38 ` [PATCH 35/40] sata_fsl: " Hannes Reinecke
2020-03-13 14:43 ` Guenter Roeck [this message]
2020-03-03 9:38 ` [PATCH 36/40] libata-core: " Hannes Reinecke
2020-03-03 9:38 ` [PATCH 37/40] libata: remove DPRINTK() macro Hannes Reinecke
2020-03-03 9:38 ` [PATCH 38/40] libata: kill ATA_MSG_INFO Hannes Reinecke
2020-03-03 9:38 ` [PATCH 39/40] libata: kill ATA_MSG_CTL Hannes Reinecke
2020-03-03 9:38 ` [PATCH 40/40] libata: remove references to ATA_DEBUG Hannes Reinecke
2020-03-12 14:04 ` [PATCHv3 00/40] ata: kill ATA_DEBUG Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200313144344.GA6330@roeck-us.net \
--to=linux@roeck-us.net \
--cc=axboe@kernel.dk \
--cc=b.zolnierkie@samsung.com \
--cc=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).