Received: by 10.192.165.148 with SMTP id m20csp584118imm; Fri, 4 May 2018 15:45:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpizyzI6QrHIV2dvUvgcUCNXnJzx27gIL8ZmyJALf4gkNfJHNfkrIAVh1g48SKialWkYom2 X-Received: by 2002:a17:902:b788:: with SMTP id e8-v6mr29753926pls.263.1525473923597; Fri, 04 May 2018 15:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525473923; cv=none; d=google.com; s=arc-20160816; b=lJgpn/m0Uc4+xN/avXLoO60fojUcAxm0Wb0OXuJ7SF/V1rsdy2ceSGhCf3JWMwtQEw Mwct/YiqB0ElD34+S9AVEKI3Tu5SKle665C3yv8vU/ApqKcJ8XGHdu0nJEyCwywYfw5m MYWr6bpnU6dFGjNUhu7J9/Do4T/jPsGaAMZTi06tBMUsiuM6lhIpADCKw/LHKFiYTps6 6btV4bIJn86+67ymPCbvbLn0jqFIHh+d+ukljNNGNqKLkg5eCA8uqbSu0sEsS1IkTXQq tA4D3A+//7k006mr9A/LSSh2pjHiJvcvGFcSdAaUjw8ijQkiSdt/qp7Q/pwH0gDj0jwO uq+A== 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=iu83D4HAGJgbG2PLWaJuXa/OrVfZpCPlgedhHLPTwMA=; b=Et121TMfwh94OQtQGrSO5HdJaCfgXt87egU5gmfftHt+pgF0qxTb19D4WM3mgrEMTk 5hKhLgMQHS+9pqk5MT2OrTPc8YuHYXBWt6gly7LO/okNbAKG727tq9DOVjlcbc5IBH5D SGPHg1C+zjbkiwRJY4E5DrYifBrBqHd4OC2zrzwIQsJYZDHk4c9x4pJFtjXCEcRQrxN8 pEwEtuC7X28qmptfrpaZM7aB3j1Zo7FKMTmL5WfFT1b0pKEhFqFxSGsQxMOkUPz3O7gw ToYh85jxBuT8VAHnf9KUzQx+gqBmWjGeXG9HE2/u6ElQhmhzoKWvTxOr1hbfX2aUxb2r SkEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hoYeSklK; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19-v6si14926956plo.174.2018.05.04.15.45.09; Fri, 04 May 2018 15:45: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=pass header.i=@linaro.org header.s=google header.b=hoYeSklK; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751792AbeEDWoe (ORCPT + 99 others); Fri, 4 May 2018 18:44:34 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33867 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbeEDWoc (ORCPT ); Fri, 4 May 2018 18:44:32 -0400 Received: by mail-pf0-f196.google.com with SMTP id a14so18513795pfi.1 for ; Fri, 04 May 2018 15:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=iu83D4HAGJgbG2PLWaJuXa/OrVfZpCPlgedhHLPTwMA=; b=hoYeSklK/HMBMDzoKIv0Bt97wTVMwFkJqIi8HvW4LtOTf6iuVWfZReWpk16WRCQ8oa Q1QlY1xvTfJ5WjX+kDITL3kxokMp0XUGuusHgAluMsM61cafOBG/PlBINzGrBWk7Rr2G ZV9pVAfCV/C8nTQ0xaCW1isoQqiLi1glOVRA4= 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; bh=iu83D4HAGJgbG2PLWaJuXa/OrVfZpCPlgedhHLPTwMA=; b=aXw//5mUwnfqMropFE3bvh1n6Andd7ihOx5yE/y9Wf9g7H3pTOa6lVqKwY76cHu6Ur zbKliGiguEoqKT+2RBp6MAUJF4ehq+fpK4c3hiStIGc5/MCyANUEeN8WoXYpIr4CY7cM 0Goy9jlas/HytIRepGl2KTPDa3LEMzc74AgOzDoj4r3cowYC1l15sTwJk8Ce5nwuE/7h LxO8VRDncPyT8aIRnhrb0xpJHuIPLd3v15Tz1EqFOmmTCdR154u/MPaFBtgiLsi/5d5l KIt0GTiP1RFOrdU2JDeRKk33OJSAOG80FMcUnvn22qpa2WW2a0LjWBglQrkxn48m9aAG fpsw== X-Gm-Message-State: ALQs6tApBituUmXRhJnQXXfNfrUVVEnMkAIghOPRlrlEGEQrXu7bhOjt iNNTYUohcdKMRnIel5NDp8iEzA== X-Received: by 2002:a65:5c88:: with SMTP id a8-v6mr23184111pgt.373.1525473871466; Fri, 04 May 2018 15:44:31 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b29sm34793210pfh.155.2018.05.04.15.44.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 15:44:30 -0700 (PDT) From: Bjorn Andersson To: Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vivek Gautam Subject: [PATCH v2 0/2] Fix UFS and devfreq interaction Date: Fri, 4 May 2018 15:44:25 -0700 Message-Id: <20180504224427.32606-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the introduction of f1d981eaecf8 ("PM / devfreq: Use the available min/max frequency") the UFS host controller driver (UFSHCD) stopped probing for platforms that supports frequency scaling, e.g. all modern Qualcomm platforms. The cause of this was UFSHCD's reliance of not registering any frequencies and then being called by devfreq to switch between the frequencies 0 and UINT_MAX. The devfreq code implies that the client is able to pass the frequency table, instead of relying on opp tables, but as concluded after v1 this is not compliant with devfreq cooling, which will enable and disable opp entries in order to limit the valid frequencies. So instead the UFSHCD driver is modified to read the freq-table and register the first clock's two rates as the two available opp levels. This follows the first patch which facilitates the implementation of this in a clean fashion, and removes the kernel panic which previously happened when devfreq initialization failed. With this UFS is once again functional on the db820c, and is needed to get UFS working on SDM845 (both tested). Bjorn Andersson (2): scsi: ufs: Extract devfreq registration scsi: ufs: Use freq table with devfreq drivers/scsi/ufs/ufshcd.c | 76 +++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 15 deletions(-) -- 2.17.0