diff --git a/arch/arm64/boot/dts/vendor/qcom/display/yupik-sde.dtsi b/arch/arm64/boot/dts/vendor/qcom/display/yupik-sde.dtsi index c5e834a1893891692f91cae7a11e3995c717db91..f3b7349917d143ef2ce292fefb1b47100ddd5eb1 100644 --- a/arch/arm64/boot/dts/vendor/qcom/display/yupik-sde.dtsi +++ b/arch/arm64/boot/dts/vendor/qcom/display/yupik-sde.dtsi @@ -351,5 +351,6 @@ qcom,dsi-pll-ssc-en; qcom,dsi-pll-ssc-mode = "down-spread"; memory-region = <&dfps_data_memory>; + qcom,panel-allow-phy-poweroff; }; diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 5d56836dfae597ed2dd4bc58c2f95888ecf92ad4..07c5e2d01bffcc00e78be4e405e6db914a470b90 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -440,8 +440,13 @@ static void scsi_report_sense(struct scsi_device *sdev, if (sshdr->asc == 0x29) { evt_type = SDEV_EVT_POWER_ON_RESET_OCCURRED; - sdev_printk(KERN_WARNING, sdev, - "Power-on or device reset occurred\n"); + /* + * Do not print message if it is an expected side-effect + * of runtime PM. + */ + if (!sdev->silence_suspend) + sdev_printk(KERN_WARNING, sdev, + "Power-on or device reset occurred\n"); } if (sshdr->asc == 0x2a && sshdr->ascq == 0x01) { diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e90a22e7fc4ea64fbf8e9c01f5454ec4252d32c0..55d040fec17e4cafc208b9e5a481f6dbcccedbec 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3572,7 +3572,8 @@ static int sd_suspend_common(struct device *dev, bool ignore_stop_errors) return 0; if (sdkp->WCE && sdkp->media_present) { - sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); + if (!sdkp->device->silence_suspend) + sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); ret = sd_sync_cache(sdkp, &sshdr); if (ret) { @@ -3594,7 +3595,8 @@ static int sd_suspend_common(struct device *dev, bool ignore_stop_errors) } if (sdkp->device->manage_start_stop) { - sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); + if (!sdkp->device->silence_suspend) + sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); /* an error is not worth aborting a system sleep */ ret = sd_start_stop_device(sdkp, 0); if (ignore_stop_errors) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e2df10b0c3414847ad38962c2037610244489e3e..83338ab622173042fc11e835aecc46b06b020148 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -614,7 +614,12 @@ static void ufshcd_print_pwr_info(struct ufs_hba *hba) "INVALID MODE", }; - dev_err(hba->dev, "%s:[RX, TX]: gear=[%d, %d], lane[%d, %d], pwr[%s, %s], rate = %d\n", + /* + * Using dev_dbg to avoid messages during runtime PM to avoid + * never-ending cycles of messages written back to storage by user space + * causing runtime resume, causing more messages and so on. + */ + dev_dbg(hba->dev, "%s:[RX, TX]: gear=[%d, %d], lane[%d, %d], pwr[%s, %s], rate = %d\n", __func__, hba->pwr_info.gear_rx, hba->pwr_info.gear_tx, hba->pwr_info.lane_rx, hba->pwr_info.lane_tx, @@ -4968,6 +4973,12 @@ static int ufshcd_slave_configure(struct scsi_device *sdev) if (ufshcd_is_rpm_autosuspend_allowed(hba)) sdev->rpm_autosuspend = 1; + /* + * Do not print messages during runtime PM to avoid never-ending cycles + * of messages written back to storage by user space causing runtime + * resume, causing more messages and so on. + */ + sdev->silence_suspend = 1; return 0; } @@ -7122,7 +7133,13 @@ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba, if (!hba->vreg_info.vcc || (!hba->vreg_info.vccq && hba->dev_info.wspecversion >= 0x300) || (!hba->vreg_info.vccq2 && hba->dev_info.wspecversion < 0x300)) { - dev_err(hba->dev, + /* + * Using dev_dbg to avoid messages during runtime PM to avoid + * never-ending cycles of messages written back to storage by + * user space causing runtime resume, causing more messages and + * so on. + */ + dev_dbg(hba->dev, "%s: Regulator capability was not set, actvIccLevel=%d", __func__, icc_level); goto out; diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 752497e773b05b6f8d8826303699c88e434c9dc0..58a7ad61e79f47e881728a172638d9189cef417a 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1459,15 +1459,23 @@ static int ep_create_wakeup_source(struct epitem *epi) { struct name_snapshot n; struct wakeup_source *ws; + char task_comm_buf[TASK_COMM_LEN]; + char buf[64]; + + get_task_comm(task_comm_buf, current); if (!epi->ep->ws) { - epi->ep->ws = wakeup_source_register(NULL, "eventpoll"); + snprintf(buf, sizeof(buf), "epoll_%.*s_epollfd", + (int)sizeof(task_comm_buf), task_comm_buf); + epi->ep->ws = wakeup_source_register(NULL, buf); if (!epi->ep->ws) return -ENOMEM; } take_dentry_name_snapshot(&n, epi->ffd.file->f_path.dentry); - ws = wakeup_source_register(NULL, n.name.name); + snprintf(buf, sizeof(buf), "epoll_%.*s_file:%s", + (int)sizeof(task_comm_buf), task_comm_buf, n.name.name); + ws = wakeup_source_register(NULL, buf); release_dentry_name_snapshot(&n); if (!ws) diff --git a/fs/timerfd.c b/fs/timerfd.c index 48305ba41e3c75d1a1b2cce8d9baa92a9d3cc259..57d0f2354866a880663a9c18ba361da377a0d24f 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -45,6 +45,8 @@ struct timerfd_ctx { bool might_cancel; }; +static atomic_t instance_count = ATOMIC_INIT(0); + static LIST_HEAD(cancel_list); static DEFINE_SPINLOCK(cancel_lock); @@ -238,6 +240,12 @@ static __poll_t timerfd_poll(struct file *file, poll_table *wait) spin_lock_irqsave(&ctx->wqh.lock, flags); if (ctx->ticks) events |= EPOLLIN; + + if (ctx->expired && isalarm(ctx)) + pr_info("%s: comm:%s pid:%d exp:%llu\n", __func__, + current->comm, current->pid, + ktime_to_ms(ctx->t.alarm.node.expires)); + spin_unlock_irqrestore(&ctx->wqh.lock, flags); return events; @@ -388,6 +396,9 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) { int ufd; struct timerfd_ctx *ctx; + char task_comm_buf[TASK_COMM_LEN]; + char file_name_buf[32]; + int instance; /* Check the TFD_* constants for consistency. */ BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC); @@ -424,7 +435,12 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) ctx->moffs = ktime_mono_to_real(0); - ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, + instance = atomic_inc_return(&instance_count); + get_task_comm(task_comm_buf, current); + snprintf(file_name_buf, sizeof(file_name_buf), "[timerfd%d_%.*s]", + instance, (int)sizeof(task_comm_buf), task_comm_buf); + + ufd = anon_inode_getfd(file_name_buf, &timerfd_fops, ctx, O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS)); if (ufd < 0) kfree(ctx); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 576840c6e323aa7466dd512d2b6a3d11d1d5449b..ad6a72094f09b036e7f1f567da2e362d8213ebf3 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -203,6 +203,7 @@ struct scsi_device { unsigned unmap_limit_for_ws:1; /* Use the UNMAP limit for WRITE SAME */ unsigned rpm_autosuspend:1; /* Enable runtime autosuspend at device * creation time */ + unsigned silence_suspend:1; /* Do not print runtime PM related messages */ atomic_t disk_events_disable_depth; /* disable depth for disk events */ DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 9bd4e492823b46b468acc5083ee018c3ed3afb16..1e716c953fcdca81d2525c0ce0aab62ff254cfb7 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -60,6 +60,7 @@ static struct wakeup_source *ws; /* rtc timer and device for setting alarm wakeups at suspend */ static struct rtc_timer rtctimer; static struct rtc_device *rtcdev; +static int alarm_debug = 0; static DEFINE_SPINLOCK(rtcdev_lock); /** @@ -215,6 +216,12 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) alarmtimer_dequeue(base, alarm); spin_unlock_irqrestore(&base->lock, flags); + if(alarm_debug & 0x1){ + pr_info("%s: type=%d, func=%pf, exp:%llu\n", __func__, + alarm->type, alarm->function, ktime_to_ms(alarm->node.expires)); + alarm_debug &= 0xFE; + } + if (alarm->function) restart = alarm->function(alarm, base->gettime()); @@ -255,6 +262,7 @@ static int alarmtimer_suspend(struct device *dev) struct rtc_device *rtc; unsigned long flags; struct rtc_time tm; + struct alarm* min_timer = NULL; spin_lock_irqsave(&freezer_delta_lock, flags); min = freezer_delta; @@ -281,6 +289,7 @@ static int alarmtimer_suspend(struct device *dev) continue; delta = ktime_sub(next->expires, base->gettime()); if (!min || (delta < min)) { + min_timer = container_of(next, struct alarm, node); expires = next->expires; min = delta; type = i; @@ -289,6 +298,14 @@ static int alarmtimer_suspend(struct device *dev) if (min == 0) return 0; + if (min_timer){ + pr_info("%s: [%p]type=%d, func=%pf, exp:%llu\n", __func__, + min_timer, min_timer->type, min_timer->function, + ktime_to_ms(min_timer->node.expires)); + min_timer = NULL; + } + alarm_debug = 0x1; + if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) { __pm_wakeup_event(ws, 2 * MSEC_PER_SEC); return -EBUSY;