diff mbox

[v6,1/2] mmc: dw_mmc: silent verbose log when calling from PM context

Message ID 1484616176-1005-1-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Lin Jan. 17, 2017, 1:22 a.m. UTC
When deploying runtime PM, it's quite verbose to print the
log of ios setting. Also it's useless to print it from system
PM as it should be the same with booting time. We also have
sysfs to get all these information from ios attribute, so let's
skip this print from PM context.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

---

Changes in v6:
- reuse force_clkinit to skip the log

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/mmc/host/dw_mmc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Jaehoon Chung Jan. 20, 2017, 8:20 a.m. UTC | #1
Hi Shawn,

On 01/17/2017 10:22 AM, Shawn Lin wrote:
> When deploying runtime PM, it's quite verbose to print the
> log of ios setting. Also it's useless to print it from system
> PM as it should be the same with booting time. We also have
> sysfs to get all these information from ios attribute, so let's
> skip this print from PM context.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Applied on my dwmmc repository. Thanks!

Best Regards,
Jaehoon Chung

> 
> ---
> 
> Changes in v6:
> - reuse force_clkinit to skip the log
> 
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/mmc/host/dw_mmc.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 3d213e7..972c779 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1182,11 +1182,13 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
>  		if ((clock != slot->__clk_old &&
>  			!test_bit(DW_MMC_CARD_NEEDS_POLL, &slot->flags)) ||
>  			force_clkinit) {
> -			dev_info(&slot->mmc->class_dev,
> -				 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n",
> -				 slot->id, host->bus_hz, clock,
> -				 div ? ((host->bus_hz / div) >> 1) :
> -				 host->bus_hz, div);
> +			/* Silent the verbose log if calling from PM context */
> +			if (!force_clkinit)
> +				dev_info(&slot->mmc->class_dev,
> +					 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n",
> +					 slot->id, host->bus_hz, clock,
> +					 div ? ((host->bus_hz / div) >> 1) :
> +					 host->bus_hz, div);
>  
>  			/*
>  			 * If card is polling, display the message only
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 3d213e7..972c779 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1182,11 +1182,13 @@  static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
 		if ((clock != slot->__clk_old &&
 			!test_bit(DW_MMC_CARD_NEEDS_POLL, &slot->flags)) ||
 			force_clkinit) {
-			dev_info(&slot->mmc->class_dev,
-				 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n",
-				 slot->id, host->bus_hz, clock,
-				 div ? ((host->bus_hz / div) >> 1) :
-				 host->bus_hz, div);
+			/* Silent the verbose log if calling from PM context */
+			if (!force_clkinit)
+				dev_info(&slot->mmc->class_dev,
+					 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n",
+					 slot->id, host->bus_hz, clock,
+					 div ? ((host->bus_hz / div) >> 1) :
+					 host->bus_hz, div);
 
 			/*
 			 * If card is polling, display the message only