From: Zhiqiang Han Date: Mon, 3 Aug 2020 03:30:39 +0000 (+0800) Subject: print: kernel printk optimize [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb8f03143ee17aa0b5e747d45bef4312d4031362;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git print: kernel printk optimize [1/1] PD#SWPL-30651 Problem: kernel printk optimize: too many dvb printk durning boot Solution: disable print by default, use module's debug parameter. Verify: Patchbuild Change-Id: Id753372a0ef75f19074bdfd88a3938b52d73209b Signed-off-by: Zhiqiang Han --- diff --git a/drivers/stream_input/parser/hw_demux/aml_dmx.c b/drivers/stream_input/parser/hw_demux/aml_dmx.c index 6a72122..3684634 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dmx.c +++ b/drivers/stream_input/parser/hw_demux/aml_dmx.c @@ -2557,7 +2557,10 @@ end_alloc: DMX_WRITE_REG(dmx->id, SB_START, addr >> 12); DMX_WRITE_REG(dmx->id, SB_LAST_ADDR, (dmx->sub_buf_len >> 3) - 1); #endif - pr_inf("sub buff: (%d) %lx %x\n", dmx->id, addr, dmx->sub_buf_len); + if (dmx->sub_pages != dvb->sub_pages) { + pr_dbg("sub buff: (%d) %lx %x\n", + dmx->id, addr, dmx->sub_buf_len); + } #endif return 0; } @@ -2579,7 +2582,7 @@ static int dmx_alloc_sub_buffer_shared(struct aml_dvb *dvb) dma_map_single(dvb->dev, (void *)dvb->sub_pages, dvb->sub_buf_len, DMA_FROM_DEVICE); - pr_inf("sub buff shared: %lx %x\n", + pr_dbg("sub buff shared: %lx %x\n", (unsigned long)virt_to_phys((void *)dvb->sub_pages), dvb->sub_buf_len); #endif @@ -2619,7 +2622,10 @@ end_alloc: DMX_WRITE_REG(dmx->id, OB_START, addr >> 12); DMX_WRITE_REG(dmx->id, OB_LAST_ADDR, (dmx->pes_buf_len >> 3) - 1); - pr_inf("pes buff: (%d) %lx %x\n", dmx->id, addr, dmx->pes_buf_len); + if (dmx->pes_pages != dvb->pes_pages) { + pr_dbg("pes buff: (%d) %lx %x\n", + dmx->id, addr, dmx->pes_buf_len); + } return 0; } #ifdef PES_BUF_SHARED @@ -2639,7 +2645,7 @@ static int dmx_alloc_pes_buffer_shared(struct aml_dvb *dvb) dma_map_single(dvb->dev, (void *)dvb->pes_pages, dvb->pes_buf_len, DMA_FROM_DEVICE); - pr_inf("pes buff shared: %lx %x\n", + pr_dbg("pes buff shared: %lx %x\n", (unsigned long)virt_to_phys((void *)dvb->pes_pages), dvb->pes_buf_len); return 0; @@ -2673,7 +2679,7 @@ static int asyncfifo_set_buffer(struct aml_asyncfifo *afifo, afifo->buf_toggle = 0; afifo->buf_read = 0; afifo->buf_len = dmx_get_afifo_size(afifo); - pr_error("++++async fifo %d buf %lu buf size %d, flush size %d, secure_enable %d, blk.addr %u\n", + pr_dbg("async fifo %d buf %lu buf size %d, flush size %d, secure_enable %d, blk.addr %u\n", afifo->id, buf, afifo->buf_len, afifo->flush_size, afifo->secure_enable, afifo->blk.addr); if ((afifo->flush_size <= 0) diff --git a/drivers/stream_input/parser/hw_demux/aml_dvb.c b/drivers/stream_input/parser/hw_demux/aml_dvb.c index e6923b7..fe7932a 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dvb.c +++ b/drivers/stream_input/parser/hw_demux/aml_dvb.c @@ -64,10 +64,10 @@ printk(args);\ } while (0) #define pr_error(fmt, args...) printk("DVB: " fmt, ## args) -#define pr_inf(fmt, args...) printk("DVB: " fmt, ## args) +#define pr_inf(fmt, args...) printk(fmt, ## args) MODULE_PARM_DESC(debug_dvb, "\n\t\t Enable dvb debug information"); -static int debug_dvb = 1; +static int debug_dvb; module_param(debug_dvb, int, 0644); #define CARD_NAME "amlogic-dvb" @@ -155,7 +155,7 @@ long aml_stb_get_base(int id) static void aml_dvb_dmx_release(struct aml_dvb *advb, struct aml_dmx *dmx) { int i; - pr_dbg("[dmx_kpi] %s Enter.\n", __func__); + pr_inf("[dmx_kpi] %s Enter.\n", __func__); dvb_net_release(&dmx->dvb_net); aml_dmx_hw_deinit(dmx); dmx->demux.dmx.close(&dmx->demux.dmx); @@ -166,7 +166,7 @@ static void aml_dvb_dmx_release(struct aml_dvb *advb, struct aml_dmx *dmx) dvb_dmxdev_release(&dmx->dmxdev); dvb_dmx_release(&dmx->demux); - pr_dbg("[dmx_kpi] %s Exit.\n", __func__); + pr_inf("[dmx_kpi] %s Exit.\n", __func__); } static int aml_dvb_dmx_init(struct aml_dvb *advb, struct aml_dmx *dmx, int id) @@ -193,7 +193,7 @@ static int aml_dvb_dmx_init(struct aml_dvb *advb, struct aml_dmx *dmx, int id) if (res) dmx->dmx_irq = res->start; - printk("%s irq num:%d \r\n", buf, dmx->dmx_irq); + pr_dbg("%s irq num:%d \r\n", buf, dmx->dmx_irq); dmx->source = -1; dmx->dump_ts_select = 0; @@ -696,7 +696,7 @@ static int aml_dvb_asyncfifo_init(struct aml_dvb *advb, res = platform_get_resource_byname(advb->pdev, IORESOURCE_IRQ, buf); if (res) asyncfifo->asyncfifo_irq = res->start; - pr_inf("%s irq num:%d \n", buf, asyncfifo->asyncfifo_irq); + pr_dbg("%s irq num:%d \n", buf, asyncfifo->asyncfifo_irq); asyncfifo->dvb = advb; asyncfifo->id = id; asyncfifo->init = 0; @@ -1752,7 +1752,7 @@ static ssize_t demux_do_reset(struct class *class, unsigned long flags; spin_lock_irqsave(&dvb->slock, flags); - pr_dbg("Reset demux, call dmx_reset_hw\n"); + pr_inf("Reset demux, call dmx_reset_hw\n"); dmx_reset_hw_ex(dvb, 0); spin_unlock_irqrestore(&dvb->slock, flags); } @@ -2225,7 +2225,7 @@ static int aml_dvb_probe(struct platform_device *pdev) int i, ret = 0; struct devio_aml_platform_data *pd_dvb; - pr_dbg("probe amlogic dvb driver [%s]\n", DVB_VERSION); + pr_inf("probe amlogic dvb driver [%s]\n", DVB_VERSION); /*switch_mod_gate_by_name("demux", 1); */ #if 0 @@ -2346,7 +2346,7 @@ static int aml_dvb_probe(struct platform_device *pdev) &str); if (!ret) { if (!strcmp(str, "serial")) { - pr_inf("%s: serial\n", buf); + pr_dbg("%s: serial\n", buf); if (s2p_id >= advb->s2p_total_count) pr_error("no free s2p\n"); @@ -2362,7 +2362,7 @@ static int aml_dvb_probe(struct platform_device *pdev) s2p_id++; } } else if (!strcmp(str, "parallel")) { - pr_inf("%s: parallel\n", buf); + pr_dbg("%s: parallel\n", buf); memset(buf, 0, 32); snprintf(buf, sizeof(buf), "p_ts%d", i); advb->ts[i].mode = AM_TS_PARALLEL; @@ -2383,10 +2383,10 @@ static int aml_dvb_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, buf, &value); if (!ret) { - pr_inf("%s: 0x%x\n", buf, value); + pr_dbg("%s: 0x%x\n", buf, value); advb->ts[i].control = value; } else { - pr_inf("read error:%s: 0x%x\n", buf, value); + pr_dbg("read error:%s: 0x%x\n", buf, value); } if (advb->ts[i].s2p_id != -1) { @@ -2396,7 +2396,7 @@ static int aml_dvb_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, buf, &value); if (!ret) { - pr_inf("%s: 0x%x\n", buf, value); + pr_dbg("%s: 0x%x\n", buf, value); advb->s2p[advb->ts[i].s2p_id].invert = value; } @@ -2408,7 +2408,7 @@ static int aml_dvb_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, buf, &value); if (!ret) { - pr_inf("%s: 0x%x\n", buf, value); + pr_dbg("%s: 0x%x\n", buf, value); advb->ts_out_invert = value; } } @@ -2456,7 +2456,7 @@ static int aml_dvb_probe(struct platform_device *pdev) aml_regist_dmx_class(); if (class_register(&aml_stb_class) < 0) { - pr_error("register class error\n"); + pr_error("dvb register class error\n"); goto error; } @@ -2614,7 +2614,6 @@ error_fe: if (advb->tuners) kfree(advb->tuners); - pr_dbg("probe amlogic dvb driver [%s] Exit\n", DVB_VERSION); return 0; } @@ -2643,7 +2642,7 @@ static int aml_dvb_remove(struct platform_device *pdev) struct aml_dvb *advb = (struct aml_dvb *)dev_get_drvdata(&pdev->dev); int i; - pr_dbg("[dmx_kpi] %s Enter.\n", __func__); + pr_inf("[dmx_kpi] %s Enter.\n", __func__); for (i=0; ituners) kfree(advb->tuners); - pr_dbg("[dmx_kpi] %s Exit.\n", __func__); + pr_inf("[dmx_kpi] %s Exit.\n", __func__); return 0; } @@ -2770,13 +2769,12 @@ static struct platform_driver aml_dvb_driver = { static int __init aml_dvb_init(void) { - pr_dbg("aml dvb init\n"); return platform_driver_register(&aml_dvb_driver); } static void __exit aml_dvb_exit(void) { - pr_dbg("aml dvb exit\n"); + pr_inf("aml dvb exit\n"); platform_driver_unregister(&aml_dvb_driver); } @@ -2813,7 +2811,7 @@ static int aml_tsdemux_reset(void) { struct aml_dvb *dvb = &aml_dvb_device; unsigned long flags; - pr_dbg("[dmx_kpi] %s Enter\n", __func__); + pr_inf("[dmx_kpi] %s Enter\n", __func__); spin_lock_irqsave(&dvb->slock, flags); if (dvb->reset_flag) { @@ -2828,7 +2826,7 @@ static int aml_tsdemux_reset(void) } } spin_unlock_irqrestore(&dvb->slock, flags); - pr_dbg("[dmx_kpi] %s Exit\n", __func__); + pr_inf("[dmx_kpi] %s Exit\n", __func__); return 0; }