Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp305515lqp; Mon, 10 Jun 2024 05:02:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFS2+w13YhnVKKialEPz0nDAD0ONKGQWE1GJb3FfLx3IlE7WQZT2GKNhBO7T5NCgzQw5vLVTCTkIcnp0BUHiq6ebpz5QvFU/gElBmk5g== X-Google-Smtp-Source: AGHT+IFosFUzZAlGt9RWaDg7aCEhkYyXKNkbt4s4pwJwWxi5/JiqhyiGwGqttKs3727VLdWLgZ2v X-Received: by 2002:a05:6808:bd1:b0:3d2:1bb6:88df with SMTP id 5614622812f47-3d21bb68addmr9003896b6e.14.1718020963311; Mon, 10 Jun 2024 05:02:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718020963; cv=pass; d=google.com; s=arc-20160816; b=bLsv5uwuona+38zk7mOsV7CzISfW3L6tYUUiaii4HH/Fq1HZSbqy9/Fjr2IM3GHh0f mgEUSDE5jukj/Z6qq06pzwygrioAl1ASixm6nzlt2xDf3p2zAZSLrSjWOTZ579JR7SzM TVt+S0nHeMk+wuHD1gE0dYTeqrf1jDNbYgxihHELbMH8cvBGnCyFLbxn/TdKE6/NwXbY JRvQba3Kzcil4sVmqlhhE5EcwNX1GviRb/aPmiymYDGSZeFxe8xB2REV4hH2fIV01DGE H9MSux2x/EUxoDtRR28vAsVG4Vqz9SKgpp33LwFxhc7fv/lkk1NFm1CCm3TRJEPfIanw BcNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=hdDozi5lsGbUD6cyN4ZLmx54z1ydzCykUd3pd8uPLHM=; fh=mVC8WWMwFFGz5Wd2dGXdNKR60gOyLqq6g7c4X2gYHQw=; b=jNYR2CMIVfGnifgbyRrIdjnQhT3m+WaJUPmga61Yf6959STds+kGGzDcA/NL69gFY2 4vPTSOmNqLCGfCfgvY6EUZI4LoOVMDDAVzYRfiNfVy6xE7EodB6jn3W//NztG7NW2qBz p5XoQijBlQLZG3KIW+V3CTnpQF+QylHBfE+dk97MqGOxaBfLG688SP3E6nRXZ9kRDu5S c2SmN4O+Qu6PDhq41rIDiS9MkZD0jDYUS4mdy3KNkZE2kfzkg85hhJRSEqkyO8QwQRJZ Nx16Vs3bv5osVoZV1SL0o+WhCcmsLAfSLH8osXphrTppziVERd9kBuxVyBEHArXUSK2n icKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=nD1aEVXk; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-208124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 5614622812f47-3d2275f0820si1050600b6e.252.2024.06.10.05.02.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 05:02:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=nD1aEVXk; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-208124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6888C28693B for ; Mon, 10 Jun 2024 12:01:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DF867F48A; Mon, 10 Jun 2024 12:01:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="nD1aEVXk" Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86F5C77113 for ; Mon, 10 Jun 2024 12:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.89.224.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718020860; cv=none; b=OJ42J07kFYTChe9gp0zdJZA+FwRV9VeE+0cANu9wwKG/zHBBexq+lHJy9HX8n+MuVzRyqQq036CSoL9RJkSru6fwQDxjuGcpcrCGvuggmqpd98cixt0CmQVtlG/ptppEHUfCQyOt37nkobLFjrh482njjvz9xJFHi/LuwxpgPlI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718020860; c=relaxed/simple; bh=S87b0AoCg4zTupdBjkHp463O4Vqz7rMJKPouOx5ONS0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JPZwpLShdxhaH3hgqXxMcyq85D3ZU/0gL+lQQP7EtAWAhJddt0K41+5JrbT10pLJFKAqswcV4DSqkqaPhYTA0OupgWz9cJjYpg+5v+q0rm31QsDDwv+XeaQ3nCFFn9jGlSFoidNWlzQ52yGRN396MRC+i6JrofmHVnNwJFdXIIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=salutedevices.com; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=nD1aEVXk; arc=none smtp.client-ip=45.89.224.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=salutedevices.com Received: from p-infra-ksmg-sc-msk02.sberdevices.ru (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 06D6E120011; Mon, 10 Jun 2024 15:00:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 06D6E120011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1718020856; bh=hdDozi5lsGbUD6cyN4ZLmx54z1ydzCykUd3pd8uPLHM=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=nD1aEVXkwLz16U2BYjwWe1b5PbwbDmmcOEiMFH1kpAEtTrpSB/azqpCEv1vM06Xbh TxgKK+BgE0nac8Wvo6yKmnZJGN2sHDi9SHFld5HV+o2TsrHzs0whCIGEn6XDDs54Fp Qvu5wUuFLDJ+fJ4slxOdCgNoV5GdCesh2HbW/ysHyKhaPdn1ZZOLEMycScJDIwBAYL q5SBQJaPNb9OGpGlzj1UTEPzmVIiKZKnExgKd5oUXDvZuHfElGMjAz0ZuUJ5lsPCN2 IhD10D2NYUyQ/vKLFedIrVRLaYAus53BAIohwDDCtYo4NASVnx23Z4OLkiXQJ/IgB2 EYGFJMZ1TbtLA== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Mon, 10 Jun 2024 15:00:55 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 10 Jun 2024 15:00:55 +0300 From: George Stark To: , CC: , , , George Stark Subject: [PATCH 0/1] pwm-regulator with voltage table problem Date: Mon, 10 Jun 2024 15:00:24 +0300 Message-ID: <20240610120025.405062-1-gnstark@salutedevices.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 185831 [Jun 10 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: gnstark@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 20 0.3.20 743589a8af6ec90b529f2124c2bbfc3ce1d2f20f, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;127.0.0.199:7.1.2;smtp.sberdevices.ru:5.0.1,7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/06/10 11:09:00 #25535815 X-KSMG-AntiVirus-Status: Clean, skipped Here is the situation we've met on an ARM SoC: We have an ARM SoC with dedicated power input for CPU core and supports different CPU clocks. CPU core power is supplied by external regulator, it's controlled by PWM channel from the SoC. DTS has node for pwm-regulator with voltage table (voltage table is used instead of range apparently to use only fine-tuned duty-cycle values) and with boot-on and always-on properties. This regulator is bound to cpu node. The pwm-regulator is inited at very early stage before bootloader in vendor closed-source code. When a pwm-regulator is probed in the kernel it gets pwm current state and search voltage table by dutycycle to figure out the current voltage. If that search failed then the regulator goes to notrecoverbale state and the core sets the minimal power for the regulator. The situation: bootloader sets mean cpu power and mean cpu clock. but that cpu power is not found in the voltage table (value is between table items) due to different versions of bootloader and kernel and the regulator core sets the minimal power but cpu clock stays the same. CPU hangs somewhere during boot. The core problem as I see it is if regulator is bound to CPU (or some other complex consumer) it can't be changed except by the consumer at any stage. So the regulator driver (core part) should wait for the own consumer to init it properly but regulator can't be in unknown state after probing. What you think? The least should be done is to report about the situation. George Stark (1): regulator: core: add warning for not-recoverable state drivers/regulator/core.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.25.1