Received: by 10.223.164.221 with SMTP id h29csp3961770wrb; Wed, 4 Oct 2017 10:55:23 -0700 (PDT) X-Received: by 10.159.254.20 with SMTP id r20mr8693044pls.16.1507139723295; Wed, 04 Oct 2017 10:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507139723; cv=none; d=google.com; s=arc-20160816; b=lT6soeBO941pUZOPCdgVsSbV0h7JaOxuum+CXW1rAgoc3//c4mYerz93P3TysakDeu mv5W+IcXq038F3X5e6rYFDW1M5nIL+kQercBr4ovQ8srPWR57iBmOPkBAye8rIdjtuxb FTm+k1iVahux4GDyTOB+liljDQxtubPGysOB8+B3hXUD3YOYYOj91BjMusphcfgrVNLZ 8vPEiNHc31vUNebUxxxRWL5xx8W86mDomKOjQULz1Hhl6tFevvQILn5AuKcFGUURajnb 5XkVcw2Yqj6RU3FNSPXhvbHt0s1+Fpn0NKyc4RI+lkfGQ4pXWDxUJf/dHCMWlrCPIy6U bjlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=wE9w5w8Xi3byJPOoUXQs3AOPPeByD3LDJNX2IV/MgAQ=; b=y6HyyKYTe5nll/vXkgqAXhyEXwrx98L1TQ3qrfAvLRitH78tq1d1o+eJ9vqIYY4+eo yLAL9RxpeAlTG7DnBRA0MgR3LT/JXdwbOuhvA2TZhl3i16axgIDTZbIbsp1E5t0LjCfz SyE0ABUFDgwRTZk6xttUjI4LvHMway3BtqsEcBL5xM5fVQppfmasZsBVtXjfCBDxHqgG dmlEByJwk0Ud9DsJudSUrhkqpNiOqCePKBzG4k/1siKaj8Sza86UU6cnuLsZEjGNJdbV +df0lA1cnI/OmaNF3NDMU0Ln0xHfINFqNSmgKWFVL3B8PmOw6NteBv6DzJIECnN+jgbF lxqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=X4v1Io4U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91si12449671pld.3.2017.10.04.10.55.06; Wed, 04 Oct 2017 10:55:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=X4v1Io4U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbdJDRyN (ORCPT + 99 others); Wed, 4 Oct 2017 13:54:13 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:52987 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbdJDRxy (ORCPT ); Wed, 4 Oct 2017 13:53:54 -0400 Received: by mail-lf0-f65.google.com with SMTP id b127so14280329lfe.9 for ; Wed, 04 Oct 2017 10:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=wE9w5w8Xi3byJPOoUXQs3AOPPeByD3LDJNX2IV/MgAQ=; b=X4v1Io4UpVAsTW0zTSrLChRU5nxItoFBvvhKmcrWULuUIyqLfevjJcocbY8+ath4wg mlDTme+V7Pj9wpBDcvBWuanhiqLHn45R3iEjeVA8/6dzdFNwwz7U/1KbKp/qf9m3Q217 bfTsVhBmw3LAa+RAg6OrzLuIMI0c/tKt7y7/Hbln+6AsbHQl4fU1usAgwdNoWe6jgyTk gSxC+A00uh4uCqG4Znbq4E1J2GKDwBdwigW97YTV+kCCJQpJdG2Wh2fDfJlmcms12Ap/ 1/HgYwE93QqHselIM97NvG1w5N5F+ivO1NuUf+8PXzmVmtzCI8Ia8wxluL05E7lBf9HF sR+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=wE9w5w8Xi3byJPOoUXQs3AOPPeByD3LDJNX2IV/MgAQ=; b=VV2dJjnjxWGL8PpdAcW3V6b0x6p4oO6yi9Bvq89gRuGvnIadkFIVcHZpaDoAY2O+Kv X/RyWM/Xlxk3u5Wkb6Rv/wA1HdvwfXYkb11/2f4bCElrEWsnZzBoDGKuuYh4WbOxTmwr mkLExQGl88z0+gHMNhmJHdDKFh+aYm2f1ufcYwDllc6w08+zF6iY/3hpPejyEOhqe+DR tRYrMmnW79eLsDk3R3PjZ4EbzshS9f6lcFooeeuIiJrugHr6uvwWZCJj3jnIb3WaVWyI KUMfqp+9dVHO2W6ZWxT13Du6JBYLSHPPOeg70nPpbkaC8yg3DiVNsEKSVVpAbStXB7eR WxXg== X-Gm-Message-State: AMCzsaUXOLlLEme4P4L6qaoDGGmuDxyo2gbr79pvLMfxrnI9c+Rg2hak nKBRNf3LPSBSN2sc5nDBburk/gNO X-Google-Smtp-Source: AOwi7QDPMNK2H7RmwYy1h8y446+GyGo6tRjlBxIH9NsekXtn+X+VihRd7RnLKObMzPB2kl+J7Ikuyw== X-Received: by 10.25.242.65 with SMTP id d1mr3431626lfk.82.1507139632451; Wed, 04 Oct 2017 10:53:52 -0700 (PDT) Received: from localhost.localdomain (0173002341.0.fullrate.ninja. [90.184.117.6]) by smtp.gmail.com with ESMTPSA id r2sm3551089lja.32.2017.10.04.10.53.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 10:53:51 -0700 (PDT) From: Emil Renner Berthing To: Mark Yao Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Emil Renner Berthing Subject: [PATCH] drm/rockchip: analogix_dp: Use mutex rather than spinlock Date: Wed, 4 Oct 2017 19:53:46 +0200 Message-Id: <20171004175346.11956-1-kernel@esmil.dk> X-Mailer: git-send-email 2.14.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the Samsung Chromebook Plus I get this error with 4.14-rc3: BUG: scheduling while atomic: kworker/3:1/50/0x00000002 Modules linked in: CPU: 3 PID: 50 Comm: kworker/3:1 Not tainted 4.14.0-0.rc3-kevin #2 Hardware name: Google Kevin (DT) Workqueue: events analogix_dp_psr_work Call trace: [] dump_backtrace+0x0/0x320 [] show_stack+0x14/0x20 [] dump_stack+0x9c/0xbc [] __schedule_bug+0x4c/0x70 [] __schedule+0x3f0/0x458 [] schedule+0x38/0xa0 [] schedule_hrtimeout_range_clock+0x84/0xe8 [] schedule_hrtimeout_range+0x10/0x18 [] usleep_range+0x64/0x78 [] analogix_dp_transfer+0x16c/0x340 [] analogix_dpaux_transfer+0x10/0x18 [] drm_dp_dpcd_access+0x4c/0xf0 [] drm_dp_dpcd_write+0x1c/0x28 [] analogix_dp_disable_psr+0x60/0xa8 [] analogix_dp_psr_work+0x4c/0x90 [] process_one_work+0x1d4/0x348 [] worker_thread+0x48/0x478 [] kthread+0x12c/0x130 [] ret_from_fork+0x10/0x18 Changing rockchip_dp_device::psr_lock to a mutex rather than spinlock seems to fix the issue. Signed-off-by: Emil Renner Berthing --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index 9606121fa185..d8f72d87ef08 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -72,7 +72,7 @@ struct rockchip_dp_device { struct reset_control *rst; struct work_struct psr_work; - spinlock_t psr_lock; + struct mutex psr_lock; unsigned int psr_state; const struct rockchip_dp_chip_data *data; @@ -83,21 +83,20 @@ struct rockchip_dp_device { static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled) { struct rockchip_dp_device *dp = to_dp(encoder); - unsigned long flags; if (!analogix_dp_psr_supported(dp->dev)) return; dev_dbg(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit"); - spin_lock_irqsave(&dp->psr_lock, flags); + mutex_lock(&dp->psr_lock); if (enabled) dp->psr_state = EDP_VSC_PSR_STATE_ACTIVE; else dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE; schedule_work(&dp->psr_work); - spin_unlock_irqrestore(&dp->psr_lock, flags); + mutex_unlock(&dp->psr_lock); } static void analogix_dp_psr_work(struct work_struct *work) @@ -105,7 +104,6 @@ static void analogix_dp_psr_work(struct work_struct *work) struct rockchip_dp_device *dp = container_of(work, typeof(*dp), psr_work); int ret; - unsigned long flags; ret = rockchip_drm_wait_vact_end(dp->encoder.crtc, PSR_WAIT_LINE_FLAG_TIMEOUT_MS); @@ -114,12 +112,12 @@ static void analogix_dp_psr_work(struct work_struct *work) return; } - spin_lock_irqsave(&dp->psr_lock, flags); + mutex_lock(&dp->psr_lock); if (dp->psr_state == EDP_VSC_PSR_STATE_ACTIVE) analogix_dp_enable_psr(dp->dev); else analogix_dp_disable_psr(dp->dev); - spin_unlock_irqrestore(&dp->psr_lock, flags); + mutex_unlock(&dp->psr_lock); } static int rockchip_dp_pre_init(struct rockchip_dp_device *dp) @@ -381,7 +379,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master, dp->plat_data.power_off = rockchip_dp_powerdown; dp->plat_data.get_modes = rockchip_dp_get_modes; - spin_lock_init(&dp->psr_lock); + mutex_init(&dp->psr_lock); dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE; INIT_WORK(&dp->psr_work, analogix_dp_psr_work); -- 2.14.2 From 1583468657142251882@xxx Wed Nov 08 03:56:29 +0000 2017 X-GM-THRID: 1583468657142251882 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread