Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp151369pxt; Wed, 4 Aug 2021 07:59:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0lWJvXvhizbzdVlX4hVBkIyCwi9BkMfBBZF3LBizZlxgLWv3vGK6d6oZE2GKN1+kwexhP X-Received: by 2002:a92:6909:: with SMTP id e9mr69574ilc.231.1628089190677; Wed, 04 Aug 2021 07:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628089190; cv=none; d=google.com; s=arc-20160816; b=leVt7pradRxba1EJ6ft7joeGHwxm79IT0zcUfdTbCOBv75PweoDBMSYTtcLR9hdCqK KUnl73GnJ9XcmXvLX1s/aZXgBcUS3Gc5CgQl7Fsw3sGrOCDDnznAx4SBRo8T7g5T0IZ6 fMXYs+W3t0t2Aok6jEMOXwa1nRm6RMntQb+xzdEO1YPvKyZYBOorNDIfGrsgxgPMyAVR n4FcmVo3rUq0GcziKVkt1M9SgC+acMPSEnHc0uSOjXHTXdeDxCNxgEC5p4n3DhT0Icz2 FKfrB6XDzxFXezHTBJuk+DOqfiHPBUmWi1+pNaQfT1HinNBcGfkmhRuo+14ZLXS6Bs2H byhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=SqFXGAq4e3ua/Ts6/H9tHLCw4CGuQ4DInivgNoJfgjA=; b=SuecZkCDwgFmiTkaoj1yPrPKz6dy7xSX3U+eN/WYgloxJMfplANtIDQzarsH8+O9Z/ zWepNT7Eeq46699NvhdHwF0+FrQWH++nCG/2ueGM3ffUM5soaN9ZrfZI7E7uD/3k2wYl OJ9Eyl2VeY4Gk61TNTdP5r0OBKNEQMtzacITF9l7tOmTKCY9kQLOavXCcnlLRkwXpumD stiLACDoWNA5WJT5VsS2hzVOZoAyrb5QuVMqnkIdg/Cj5LqfG4XJDDC1cteu4uTfBpkE di640ExshH9ketkqvHttjqbR/VZa0oa65swEDgD/MIayVXmPDju1Fstf072zgWWCPHjv TUtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZCvp2wmp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id z17si2466189iln.36.2021.08.04.07.59.37; Wed, 04 Aug 2021 07:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZCvp2wmp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238842AbhHDOeG (ORCPT + 99 others); Wed, 4 Aug 2021 10:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238106AbhHDOd6 (ORCPT ); Wed, 4 Aug 2021 10:33:58 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3957C061798; Wed, 4 Aug 2021 07:33:05 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id s48so4242670ybi.7; Wed, 04 Aug 2021 07:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=SqFXGAq4e3ua/Ts6/H9tHLCw4CGuQ4DInivgNoJfgjA=; b=ZCvp2wmpsfXcE8l5VO+teKlSfFiqZ5lnsE5oDsq/9W+BtJMZoxAhszV9mYOK7RXq2P yR/nxUAZiKIhFkuxe5KswpcAm+xlHN9gSxDJYaU7XwL37OLi+j4cYcnBwePyEk/TH45H cmLLcQaY1JWK6UspNpOYHLMsvAndroo9VgBXL+NjOdNtR7P3ru5zwl8D1p6gFb0vNd3D iBfVG+QPR3/ZE5LGQAou50tWCQIO/EsglLYK6vwKXIepB2F8KufSK0AtDQ4T0xHHzkJX sKHc3xg/0vJcu16WTbADdN2a8VtiMedeIMiHkuaEQ8US8MRmTw1Us2GlEH8h0cXDC0N7 r5AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=SqFXGAq4e3ua/Ts6/H9tHLCw4CGuQ4DInivgNoJfgjA=; b=jREb/kvQR8DRCf+31WfhQuNnY6PiNs8EQU/RXo8u5lFAlSGoEpHkfyydQKatJXa7aV aXmIUpsiWLy/jYbca9sq1brWH/jUYIl+O9vhVjCLzmsY2iL3WQEDiloOUJKUirUvNym2 q+uFPl80rIWCdwsXZREydxy6dSSsCIWx2ufed/svYb/dsfS44YsT/HWHYA16oMk9BcnV dD90AF1rIIEtoDjHlvw9RZ8Lnd2mvirSwKvq69CD1sHnsniIRWFQND5v/bWDpuZfSxYg wsYXxTOtuH/rfryT+gHS7vaAQ6pg/BGuaXHAsnOUDFoX3zP2dLf4ANrlC+7jWNR98MxK M3bA== X-Gm-Message-State: AOAM530+wPpex9YP1OR+vs9kWwidQPWPGV1m25mn82tS/PNRUvPFcgJn srgzMnQnxP5xTRGVhzDChG280xSbzkOTeMBkn8g= X-Received: by 2002:a25:2cf:: with SMTP id 198mr36391086ybc.259.1628087584033; Wed, 04 Aug 2021 07:33:04 -0700 (PDT) MIME-Version: 1.0 From: Peter Geis Date: Wed, 4 Aug 2021 10:32:52 -0400 Message-ID: Subject: [BUG] mmc_regulator_set_ocr can't cope with regulator-fixed To: Ulf Hansson , Jaehoon Chung , Liam Girdwood , Mark Brown , Rob Herring Cc: linux-mmc@vger.kernel.org, Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Good Morning, I've encountered a fun issue with the dw-mmc driver while working on enabling support for the Quartz-64 Model A. The regulator-fixed driver supports enabling via a gpio, but does not have the ops to set voltage as it is fixed. The dw-mmc calls mmc_regulator_set_ocr for vmmc, which attempts to set the voltage first but fails due to the lack of the voltage ops. It then bails returning -EINVAL. This leads to the following message : dwmmc_rockchip fe2b0000.mmc: could not set regulator OCR (-22) This can be fixed by switching to regulator-gpio for the vmmc supply to the sdmmc controller, however the sdio controller vmmc is provided by a fixed regulator that is always on. Obviously the regulator-gpio isn't an option, as it has no gpio to enable. Removing the vmmc phandle from the sdio node is an option, but then it doesn't fully describe the hardware (it's also a non-standard 4.4v). I had considered changing the check in dw-mmc.c [1] to continue in the case of -EINVAL, but there are other places in the regulator framework that can also return that and it doesn't address the underlying issue. As such I'm reaching out to the experts to see what the best course of action is here. Please weigh in with what you think. Very Respectfully, Peter Geis