Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4261396imm; Wed, 30 May 2018 02:08:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLLEPGkrYJGR9gR87VKbSCm3KVZ7TjG2PC9abijIVsVomWRaT3pdtcx3qKq+ht7OiXALnJ0 X-Received: by 2002:a17:902:600a:: with SMTP id r10-v6mr2024340plj.70.1527671284649; Wed, 30 May 2018 02:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527671284; cv=none; d=google.com; s=arc-20160816; b=i/EdfVTZmr9pGBN6bkexIxjYa7VeCwuWVa5u/opZD05G3k6sRZRL0JBwfZoDgzDBVN 7O0UiAg9R0WDsp4Oi93jy8ZTzLQs/PMP6H0650RpxcLnkUmuaMKOoJC42l1/1K24x/gA C5txz8ksUDZbG4qCMqLjQyxHucPxU3KE1OoP4pI9z6WTw1MayW94/G+Utck9/KN3sGYv Jzo2HtjJXVNXEblDqLdXqIm/eElcFMZGosXz+k6MQ8uq8xn22fDQNp4sI2vcV6L6y1RF 4rXoPM9TNDlY1640M46WP9FhtVpOTW/ayjj91L8Z8MiGTZPPiKAy4Oe+D7xcRZCFFrdH rZ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature :arc-authentication-results; bh=fbIay7gAyBOUYeq/UkWH6o2Sq7iObZdDypebYbSvyEw=; b=p6PoqIk45L8lk54rEhg0tKrL18yRImFmPZbvbdxV83k9UlUAQR5WDOnIn5axbjAkbT 3x53CPB5XOwLbxWovZuGJ4M8iQ3etyP2rRC/LpwDcHF+3x0G+zeYYOdR1Ajcdd0fzr0w 0g4CRoR5+SZ3dQcAf4kJZB4vIX6HPHtt7TxRo+Dy5kbn2njjd2S18ZRjI6iB+OXsiSHk jmTgBZcYfsNnZJvCZpDffYl3HMl6qnILf9feW8/RHljcX79cKFKlvrQSfLTe8On9cAuI 85cyREVv/75vOFKmQ1sqAdsSPyoVM4uuqrNPs7+EIXIy0yPGInl1GcgfaPT+zy8V+i+U vokA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lX8V0KR/; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17-v6si26953860pgv.17.2018.05.30.02.07.50; Wed, 30 May 2018 02:08:04 -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=@gmail.com header.s=20161025 header.b=lX8V0KR/; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968775AbeE3JFj (ORCPT + 99 others); Wed, 30 May 2018 05:05:39 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:44944 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964791AbeE3JFR (ORCPT ); Wed, 30 May 2018 05:05:17 -0400 Received: by mail-lf0-f67.google.com with SMTP id 36-v6so1157578lfr.11; Wed, 30 May 2018 02:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=fbIay7gAyBOUYeq/UkWH6o2Sq7iObZdDypebYbSvyEw=; b=lX8V0KR/WaFpOIUA+Oeo61ny0jyImjJy/wUEjjXHzKZwbe2l4pxF//Q2wdVR0BHDSz 3U6h0nE3wsCRukHM3Ildr34YWb2IwGiXKehfEaaVJ9cGb5lfUV9ZgubnXTEB3vWApn9l cZWrbaLHl3ycGKZ/PqCR4Pne2jGfcIxHtYn1OxNpUpYyYJQ5iHDVVchkCtxdjyitSgk0 gjUgo5bRWah+4Zt6/pZZhUV4y3JRq4GDIqu0P4cm8Kn4HWhbfllUocK4mYQu7k/7qM65 lmfZ5YKCmWrhXyuzfnbbcwX2bkcWA493MuM+mqp/Bp61r2eGsc9i7q0Tz0tgpiyRLuYb vB6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=fbIay7gAyBOUYeq/UkWH6o2Sq7iObZdDypebYbSvyEw=; b=q1L9BolF+7E24W60yjxEWlrAw6liV08EkycJe/4L65I+vyQ+yL1ayfLo4Q/w7N67xn S9JXgCkWeoFkrVlFlVOd4CEOKlx9FaNmoj9WvH2vZOQ3ktqW3gNM+DFTF/e6qG9/MsoJ XpGt/sz5Hx+T0jnEG1+UOn/4iFa+rMEoRL7Cc9GY+LfcPXfOpQQShSdWZVpzKMZpGMv2 oa6brf1/m6mrhD1JOOIi28tOQkLIwg80W8cqMHunB7pr1wJHQPmQ9FHFsHCr2Cc7If7/ i/EfKVgBRyqwEkjmkwBdky9C7gQFZ5mVm9zUh2+pB6lUbp2nla0NHlC2sUNMKUKpflMd t1lg== X-Gm-Message-State: ALKqPwcU9XLEzRjfauvBCkwRvzJO0E32gOqeUowTiy3YbqA7WP8eulhJ CUJw8FCS9Jt4nO8yIQ+tFYw= X-Received: by 2002:a2e:1d53:: with SMTP id d80-v6mr1501451ljd.104.1527671115191; Wed, 30 May 2018 02:05:15 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.34]) by smtp.gmail.com with ESMTPSA id f22-v6sm6895945ljc.50.2018.05.30.02.05.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 May 2018 02:05:14 -0700 (PDT) From: Matti Vaittinen X-Google-Original-From: Matti Vaittinen Date: Wed, 30 May 2018 12:05:12 +0300 To: Matti Vaittinen Cc: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, lee.jones@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, mazziesaccount@gmail.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mikko.mutanen@fi.rohmeurope.com, heikki.haikola@fi.rohmeurope.com Subject: Re: [PATCH v4 0/6] mfd/regulator/clk: bd71837: ROHM BD71837 PMIC driver Message-ID: <20180530090512.GC13528@localhost.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello All, I would like to ask for an educated opinion from more experienced regulator driver developers. On Wed, May 30, 2018 at 11:41:13AM +0300, Matti Vaittinen wrote: > Patch series adding support for ROHM BD71837 PMIC. > > BD71837 is a programmable Power Management IC for powering single-core, > dual-core, and quad-core SoC’s such as NXP-i.MX 8M. It is optimized for > low BOM cost and compact solution footprint. It integrates 8 buck > regulators and 7 LDO’s to provide all the power rails required by the > SoC and the commonly used peripherals. > > The driver aims to not limit the usage of PMIC. Thus the buck and LDO > naming is generic and not tied to any specific purposes. However there > is following limitations which make it mostly suitable for use cases > where the processor where PMIC driver is running is powered by the PMIC: > > - The PMIC is not re-initialized if it resets. PMIC may reset as a > result of voltage monitoring (over/under voltage) or due to reset > request. Driver is only initializing PMIC at probe. This is not > problem as long as processor controlling PMIC is powered by PMIC. > > - The PMIC internal state machine is ignored by driver. Driver assumes > the PMIC is wired so that it is always in "run" state when controlled > by the driver. > > Changelog v4 > - remove mutex from regulator state check as core prevents simultaneous > accesses > - allow voltage change for bucks 1 to 4 when regulator is enabled This chip has 8 bucks. 4 of then support DVS (dynamic voltage scaling). Other 4 can be used on PWM or PFM switching mode. When PWM is used voltages can be changed without disabling regulator. On PFM this should not be done. These latter 4 regulators can be forced to PWM mode via control bit in register. This driver does not support controlling this mode though. So this driver version just checks if regulator is enabled before changing the voltage and if it is the voltage change fails with -EBUSY My question is whether it would be good idea to also read the 'force PWM' bit when voltage is changed and allow the change if PWM mode is forced to be used? Problem is that the check and voltage change can't be atomic so there is a chance someone changes the mode (bypassing the driver and regulator core) after this check but before we get to modify the voltage. Furthermore, I doubt the 'force PWM' is widely used (but I can't say for sure as I can't imagine all use cases) as it is not so power efficient. But as I am really inexperienced on this area I would like to get opinions from people who know this field of industry better... Br, Matti Vaittinen