From: Hannes Reinecke <hare@suse.de>
To: Damien LeMoal <damien.lemoal@wdc.com>
Cc: linux-ide@vger.kernel.org, Hannes Reinecke <hare@suse.com>,
Hannes Reinecke <hare@suse.de>
Subject: [PATCH 22/68] pata_pdc2027x: Replace PDPRINTK() with standard ata logging
Date: Fri, 10 Dec 2021 08:28:19 +0100 [thread overview]
Message-ID: <20211210072905.15666-23-hare@suse.de> (raw)
In-Reply-To: <20211210072905.15666-1-hare@suse.de>
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 | 71 +++++++++++++++----------------------
1 file changed, 28 insertions(+), 43 deletions(-)
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index effc1a09444d..4fbb3eed8b0b 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,11 @@ 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\n");
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, DRV_NAME ":40-conductor cable detected\n");
return ATA_CBL_PATA40;
}
@@ -292,17 +285,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 +308,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 +341,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 +350,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 +365,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 +402,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 +473,8 @@ 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, "bccrh [%X] bccrl [%X]\n", bccrh, bccrl);
+ dev_dbg(host->dev, "bccrhv[%X] bccrlv[%X]\n", bccrhv, bccrlv);
/*
* The 30-bit decreasing counter are read by 2 pieces.
@@ -495,7 +483,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, "rereading counter\n");
goto retry;
}
@@ -520,20 +508,19 @@ 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, "pout_required is %ld\n", 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, "pll_ctl[%X]\n", pll_ctl);
/*
* Calculate the ratio of F, R and OD
@@ -552,7 +539,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 +547,15 @@ 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, "F[%d] R[%d] ratio*1000[%ld]\n", F, R, ratio);
pll_ctl = (R << 8) | F;
- PDPRINTK("Writing pll_ctl[%X]\n", pll_ctl);
+ dev_dbg(host->dev, "Writing pll_ctl[%X]\n", pll_ctl);
iowrite16(pll_ctl, mmio_base + PDC_PLL_CTL);
ioread16(mmio_base + PDC_PLL_CTL); /* flush */
@@ -576,15 +563,13 @@ 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, "pll_ctl[%X]\n", pll_ctl);
return;
}
@@ -605,7 +590,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, "scr[%X]\n", scr);
iowrite32(scr | (0x01 << 14), mmio_base + PDC_SYS_CTL);
ioread32(mmio_base + PDC_SYS_CTL); /* flush */
@@ -622,7 +607,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, "scr[%X]\n", scr);
iowrite32(scr & ~(0x01 << 14), mmio_base + PDC_SYS_CTL);
ioread32(mmio_base + PDC_SYS_CTL); /* flush */
@@ -632,8 +617,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, "start[%ld] end[%ld] PLL input clock[%ld]HZ\n",
+ start_count, end_count, pll_clock);
return pll_clock;
}
--
2.29.2
next prev parent reply other threads:[~2021-12-10 7:29 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 7:27 [PATCHv2 00/68] libata: rework logging, take II Hannes Reinecke
2021-12-10 7:27 ` [PATCH 01/68] libata: remove pointless debugging messages Hannes Reinecke
2021-12-10 7:27 ` [PATCH 02/68] libata: whitespace cleanup Hannes Reinecke
2021-12-10 7:28 ` [PATCH 03/68] libata: Add ata_port_classify() helper Hannes Reinecke
2021-12-10 7:28 ` [PATCH 04/68] libata: move ata_dump_id() to dynamic debugging Hannes Reinecke
2021-12-10 7:28 ` [PATCH 05/68] libata: sanitize ATA_HORKAGE_DUMP_ID Hannes Reinecke
2021-12-10 7:28 ` [PATCH 06/68] libata: add reset tracepoints Hannes Reinecke
2021-12-10 7:28 ` [PATCH 07/68] libata: add qc_prep tracepoint Hannes Reinecke
2021-12-10 7:28 ` [PATCH 08/68] libata: tracepoints for bus-master DMA Hannes Reinecke
2021-12-10 7:28 ` [PATCH 09/68] libata-sff: tracepoints for HSM state machine Hannes Reinecke
2021-12-10 7:28 ` [PATCH 10/68] libata-scsi: drop DPRINTK calls for cdb translation Hannes Reinecke
2021-12-10 7:28 ` [PATCH 11/68] libata: add tracepoints for ATA error handling Hannes Reinecke
2021-12-10 7:28 ` [PATCH 12/68] libata: move ata_{port,link,dev}_dbg to standard dev_XXX() macros Hannes Reinecke
2021-12-10 7:28 ` [PATCH 13/68] libata: revamp ata_get_cmd_descript() Hannes Reinecke
2021-12-12 9:33 ` Sergey Shtylyov
2021-12-10 7:28 ` [PATCH 14/68] libata: move DPRINTK to ata debugging Hannes Reinecke
2021-12-12 9:36 ` Sergey Shtylyov
2021-12-10 7:28 ` [PATCH 15/68] sata_mv: kill 'port' argument in mv_dump_all_regs() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 16/68] sata_mv: replace DPRINTK with dynamic debugging Hannes Reinecke
2021-12-10 7:28 ` [PATCH 17/68] pata_octeon_cf: remove DPRINTK() macro in interrupt context Hannes Reinecke
2021-12-10 7:28 ` [PATCH 18/68] pdc_adma: Remove DPRINTK call Hannes Reinecke
2021-12-10 7:28 ` [PATCH 19/68] sata_fsl: move DPRINTK to ata debugging Hannes Reinecke
2021-12-10 7:28 ` [PATCH 20/68] sata_rcar: replace DPRINTK() with ata_port_dbg() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 21/68] sata_qstor: " Hannes Reinecke
2021-12-10 7:28 ` Hannes Reinecke [this message]
2021-12-10 7:28 ` [PATCH 23/68] libata: remove pointless VPRINTK() calls Hannes Reinecke
2021-12-10 7:28 ` [PATCH 24/68] ahci: Drop pointless VPRINTK() calls and convert the remaining ones Hannes Reinecke
2021-12-10 7:28 ` [PATCH 25/68] pdc_adma: Drop pointless VPRINTK() calls and remove disabled NCQ debugging Hannes Reinecke
2021-12-10 7:28 ` [PATCH 26/68] pata_octeon_cf: Drop pointless VPRINTK() calls and convert the remaining one Hannes Reinecke
2021-12-12 9:23 ` Sergey Shtylyov
2021-12-10 7:28 ` [PATCH 27/68] pata_via: Drop pointless VPRINTK() calls Hannes Reinecke
2021-12-10 7:28 ` [PATCH 28/68] sata_promise: Drop pointless VPRINTK() calls and convert the remaining ones Hannes Reinecke
2021-12-10 16:19 ` Mikael Pettersson
2021-12-12 9:52 ` Sergey Shtylyov
2021-12-10 7:28 ` [PATCH 29/68] sata_qstor: Drop pointless VPRINTK() calls Hannes Reinecke
2021-12-10 7:28 ` [PATCH 30/68] sata_rcar: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 31/68] sata_inic162x: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 32/68] sata_mv: Drop pointless VPRINTK() call and convert the remaining one Hannes Reinecke
2021-12-10 7:28 ` [PATCH 33/68] sata_nv: drop pointless VPRINTK() calls and convert remaining ones Hannes Reinecke
2021-12-10 7:28 ` [PATCH 34/68] sata_fsl: convert VPRINTK() calls to ata_port_dbg() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 35/68] sata_sil: Drop pointless VPRINTK() calls Hannes Reinecke
2021-12-10 7:28 ` [PATCH 36/68] sata_sx4: Drop pointless VPRINTK() calls and convert the remaining ones Hannes Reinecke
2021-12-10 7:28 ` [PATCH 37/68] sata_sx4: add module parameter 'dimm_test' Hannes Reinecke
2021-12-10 7:28 ` [PATCH 38/68] libata: drop ata_msg_error() and ata_msg_intr() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 39/68] libata: drop ata_msg_ctl() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 40/68] libata: drop ata_msg_malloc() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 41/68] libata: drop ata_msg_warn() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 42/68] libata: drop ata_msg_probe() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 43/68] libata: drop ata_msg_info() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 44/68] libata: drop ata_msg_drv() Hannes Reinecke
2021-12-10 7:28 ` [PATCH 45/68] libata: remove 'new' ata message handling Hannes Reinecke
2021-12-10 7:28 ` [PATCH 46/68] libata: remove debug compilation switches Hannes Reinecke
2021-12-12 9:21 ` Sergey Shtylyov
2021-12-10 7:28 ` [PATCH 47/68] pata_atp867x: convert printk() calls Hannes Reinecke
2021-12-10 7:28 ` [PATCH 48/68] pata_cmd640: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 49/68] pata_cmd64x: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 50/68] pata_cs5520: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 51/68] pata_cs5536: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 52/68] pata_cypress: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 53/68] pata_it821x: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 54/68] pata_marvell: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 55/68] pata_rz1000: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 56/68] pata_serverworks: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 57/68] pata_sil680: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 58/68] sata_sx4: " Hannes Reinecke
2021-12-10 7:28 ` [PATCH 59/68] sata_mv: convert remaining printk() to structured logging Hannes Reinecke
2021-12-10 7:28 ` [PATCH 60/68] pata_hpt37x: convert pr_XXX() calls Hannes Reinecke
2021-12-10 7:28 ` [PATCH 61/68] pata_octeon_cf: Replace pr_XXX() calls with structured logging Hannes Reinecke
2021-12-10 7:28 ` [PATCH 62/68] pata_hpt3x2n: convert pr_XXX() calls Hannes Reinecke
2021-12-10 7:29 ` [PATCH 63/68] sata_gemini: convert pr_err() calls Hannes Reinecke
2021-12-10 7:29 ` [PATCH 64/68] pata_hpt366: convert pr_warn() calls Hannes Reinecke
2021-12-10 7:29 ` [PATCH 65/68] libata-scsi: rework ata_dump_status to avoid using pr_cont() Hannes Reinecke
2021-12-10 7:29 ` [PATCH 66/68] sata_dwc_460ex: drop DEBUG_NCQ Hannes Reinecke
2021-12-10 7:29 ` [PATCH 67/68] sata_dwc_460ex: remove 'checkstatus' argument Hannes Reinecke
2021-12-12 9:18 ` Sergey Shtylyov
2021-12-10 7:29 ` [PATCH 68/68] sata_dwc_460ex: Remove debug compile options Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2021-12-21 7:20 [PATCHv3 00/68] libata: rework logging, take II Hannes Reinecke
2021-12-21 7:20 ` [PATCH 22/68] pata_pdc2027x: Replace PDPRINTK() with standard ata logging Hannes Reinecke
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=20211210072905.15666-23-hare@suse.de \
--to=hare@suse.de \
--cc=damien.lemoal@wdc.com \
--cc=hare@suse.com \
--cc=linux-ide@vger.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).