Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2653445img; Sun, 24 Mar 2019 15:03:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwA4+J5o9cH0/08hOQXxwvIplprxJ2Dl3tt8njXRli9qkrYbyaEbpewB5vVlnA1qmZ0SDYE X-Received: by 2002:a63:4287:: with SMTP id p129mr19448288pga.84.1553465008731; Sun, 24 Mar 2019 15:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553465008; cv=none; d=google.com; s=arc-20160816; b=sqzCY2nVUqCmwKPnlFTa2Lor3hjCP6lPFzzyh8xPAqdJXVscgJfFuNZLkhRl9UKhmM b8c13EA3MHYERzLN6MPq4vqhu/9sLPe+OAYP3TLX4ekjusj3SHK7emy9nSSet4+Ej/tV mRSgRjheN05jK8e77UtqjrJiMTanOVkWBxBu5UvyMfg1LAzb/8EIOJtrG65KZel9jiJg n3s0eMYMBVL7bCJDVqi4WV/R2V8z4mUpai5pMnyeuMJ6jeSc/8H6QmD0iDinv/XK6CKF 1nYuCAcxMbQWv4rTJ3nIFfSbb66x8wHMqr3NxiFrlJtPzjfiuigwu0GC6ifrIUPUtsAw gd6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=v+fyB4tI3gKbJMEPPqCvbrfsNxpucCIHFMC9GxrzHgg=; b=n8grG1gdDh2O0wY+hehXI1LluVPEYOgBXgGDur1oJcVr9IGjqdF/q0Jddgp9mcOxi9 yaD/j+3SBoH2gO8K5kW276e15Gp0t0lMUKDxe4OEFWjGiafzTMfx6SNY3hFTMdPojxW/ NOoZqWi5KyxXghmm1A+2AGMGg/+5EC6PN/cNkq/8kpAEveNL5dniUPDmVj5CGHUmZoGW D4stEEyShzxaTKU2OhAB72dDaCeSBbP48CqgoiqiTWLy3RHb8OotskMS7ww83SAsFN3y IhuPPfNV9WjnCiao5jgtAoifZc6ocsXJziQZ8R2rlO+YfKnOUopWYZ7G/SBq4vVLS6zu Pxgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=l223+tlm; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si5360016pgt.496.2019.03.24.15.03.14; Sun, 24 Mar 2019 15:03:28 -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=pass header.i=@googlemail.com header.s=20161025 header.b=l223+tlm; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728991AbfCXWCh (ORCPT + 99 others); Sun, 24 Mar 2019 18:02:37 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35004 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728893AbfCXWCh (ORCPT ); Sun, 24 Mar 2019 18:02:37 -0400 Received: by mail-wm1-f68.google.com with SMTP id y197so7053116wmd.0; Sun, 24 Mar 2019 15:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v+fyB4tI3gKbJMEPPqCvbrfsNxpucCIHFMC9GxrzHgg=; b=l223+tlmj3z0NLeJvTxzZWimnTsh1nV0CycvWZG1TaxDt/+H7uAb/H2jY+oar8yEHg DQwnqTePU+RWCD3KRQgpqeyl+GOU409bk8NP77wt9rInmAeg1PWNyBxmjWEtdA5a4pBi 9vvrjHkJeERhiN5txXHgVd08HH8fTIbbYcIi+0zaAnyZk2x3YwwdAJi8KjPOxaug1pwv ELc1JCIFCGRWYxaBdvDIHl7EMoTBIxz7x7aNtE7jmrhg7+JjFMQCUEtNVy320ZRPW9V9 W1HWokG+Keb7510GRtYArjGdSGjRPtQaHJASMq+EF++D0YbBvVWQNCBjBbUautCKpDp9 nfYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v+fyB4tI3gKbJMEPPqCvbrfsNxpucCIHFMC9GxrzHgg=; b=DAWk/dqgDT+NFwJsIkujYNbq/pN8vR66ZcL8RDIOk2qSVK3uEV8J8Wq+9Mldtnk7Su D2VpgRxowLttygA+6i6lTeptyy2TwrWsctktBheJFC9tiYkj0uptQg8IrDr8Ddqio6aR VKOm4QHHsTrkS1V3EKphB3oWgPTYu0aqKyi5kTU9AB0EfSetJlmT79+FVlXEa8qhmXZn TBk26wDp/U2NucTBsdOfvD5q2eO/GwhIzzJCW3Se8p5v05E/CRLijvxskpWUTDxLbpVa Y1vIT9cwP1J7K2Z9mh5/KVg/xR2NUqrVq7AHomH6p1m1cRMekjTdqKLZMvf8lSc2RB1D 8rIg== X-Gm-Message-State: APjAAAXWjZ2PyNjghDPMCJ2BR1murt0GBSz7+9q3ZDO/ogeU9xRh2o3O 74JmI1im2CUQIAaCfMfGris= X-Received: by 2002:a7b:cb58:: with SMTP id v24mr560348wmj.121.1553464954737; Sun, 24 Mar 2019 15:02:34 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7399900428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:dc:d739:9900:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id o13sm12743485wmc.20.2019.03.24.15.02.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 15:02:33 -0700 (PDT) From: Martin Blumenstingl To: thierry.reding@gmail.com, narmstrong@baylibre.com, jbrunet@baylibre.com, linux-pwm@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH 0/1] pwm: meson: fix scheduling while atomic issue Date: Sun, 24 Mar 2019 23:02:16 +0100 Message-Id: <20190324220217.15813-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Back in January a "BUG: scheduling while atomic" error showed up during boot on my Meson8b Odroid-C1 (which uses a PWM regulator as CPU supply). The call trace comes down to: __mutex_lock clk_prepare_lock clk_core_get_rate meson_pwm_apply .. dev_pm_opp_set_rate .. Jerome has also seen the same problem but from pwm-leds (instead of a pwm-regulator). He posted a patch which replaces the spinlock with a mutex. That works. I believe we can optimize this by reducing the time where the lock is held - that also allows to keep the spin-lock. Analyzing this issue helped me understand the pwm-meson driver better. My plan is to send some cleanups (with the goal of re-using more of the goodies from the PWM core in the pwm-meson driver) after this single fix is merged (they can be found here: [1]). Dependencies: none Target version: please queue this for -fixes so it makes it's way into v5.1-rc (so we can get it backported from there, because this issue has existed since the pwm-meson driver was introduced). [0] http://lists.infradead.org/pipermail/linux-amlogic/2019-January/009690.html [1] https://github.com/xdarklight/linux/commits/meson-pwm-for-5.2-v0 Martin Blumenstingl (1): pwm: meson: use the spin-lock only to protect register modifications drivers/pwm/pwm-meson.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) -- 2.21.0