Received: by 10.192.165.148 with SMTP id m20csp4020761imm; Mon, 23 Apr 2018 17:22:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/NGNNn1C+/trjVn7RRofvGCY4Z6zkLGBh3DfK0Q3xkiOhKdECJIZ3i4+Ml7/HVjmFgw6yB X-Received: by 10.99.5.69 with SMTP id 66mr8984786pgf.446.1524529353494; Mon, 23 Apr 2018 17:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524529353; cv=none; d=google.com; s=arc-20160816; b=ZpNZ4EM+acIf3shRFW3FB3funKrGsxpa/kHBWHn1qB4URTQfMS9R1Z+yYob40vhJ+A pjYUxNbG8mFJ1lLglgAv+6wsuGtFn3j46pyeBjgWYfALmsYjlh9qwiWgJR9kx1Q7lTIJ CdJCOpS5+716to/JXBAWq4ZV9Aq2Ug8ko3HQ2No1RCLktG3qejvijgAtJnDtnhTT9w+a P6V6HIDKltbOaDEW1laP2ABb2c910kRViTy5nqhT9ZMdlvAMZ9Z6zlcbuAcdONMBsJIz teyptbXu+zjJxQj7umKAISG2+P2gc0fvV7O4YEz3PCqW+S1nYhXqeqFWsz1veni6GYYR L6gg== 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=XkE+kRj0rmU/0s7CA11PhFDfPJ37eTGitHII0MecwWE=; b=doqHaS/53lizOJwuM+2IZSPu0jnTuVePQ5yr+LvULENMKiN1Sql/jvuPQDvDzsRudG DzmRs4BJUw+BjS54DtQEqiobi1hyI7y7Xuzr4Yp5xTYEkAQmfA/IMJokIGqw+9jqRHya jNJZoDRP4fZuzn/2IpCjPpONCWCdI31c6rS6073g3MbfKg4MR6pki1V6vWTmdlxachiw CeVZSwKzaA7wG6m0KHgHLFAsOcVyFbwsCMP4UabZoxjmnUc21Aa92jF+PXUlEAd36HJp YJif75AwdXJ6YyAvvvzp02Tt1Nfgpc8KXCgxxonAl3LSfTI66rvjEmLnSxLrGteGON06 1Kcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eAeOVD0j; 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 k25si10595075pgf.581.2018.04.23.17.22.19; Mon, 23 Apr 2018 17:22:33 -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=eAeOVD0j; 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 S932689AbeDXAUX (ORCPT + 99 others); Mon, 23 Apr 2018 20:20:23 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36480 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932647AbeDXAUU (ORCPT ); Mon, 23 Apr 2018 20:20:20 -0400 Received: by mail-pg0-f68.google.com with SMTP id i6so9518350pgv.3 for ; Mon, 23 Apr 2018 17:20:20 -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=XkE+kRj0rmU/0s7CA11PhFDfPJ37eTGitHII0MecwWE=; b=eAeOVD0jtOKFK5Tmq+4lrZRndSNgbBxEeqh7cMidaZK8SZXJaotq3oD7JcnS0YPtPR KjCBA4vf9bIsetJhNbtUxJL3/cUqMaQ2wDR0MRSobjOH6NRX8JtdDak8psq4ty80EmmX 1WzJUoYTBblSAvq693HZ4yZN2w5W1mc4MaK5Q= 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=XkE+kRj0rmU/0s7CA11PhFDfPJ37eTGitHII0MecwWE=; b=FOLlWRXGPEdWV66LrJGT1pf9CfEB6UIeRXeneO7rOCo/lEI1WlXA/Gqx1pBTpWg1vH e9gIulYoGc0MDc4bxu/rKLq8/PbrnvoRHfeN6HJAhghAvCIuEMs57VtLny/Mt+Btz/Bw lFw5lxIg/8vI5uFSBFOq41VVYGMTHbOhiMg3mwfTZpY/6AlU7se5ge3N61vuCKvFBTsA twRv6R/+drmu4I+21mGOQn51+o4G9dxORc3ly14iOR3W7mbJM2wjFiU7d6QTXX4CA9Dg 9JQeJx2L6ipZXby9yitk4r9brf2BFBUq44Gdwa47NsA9rEsc7J/UpvFS6ZQ2QiySlJiX puZg== X-Gm-Message-State: ALQs6tDatQ4liCFGsPNtVsKVQaj+uUbre2nZDphQC5Q7475cfPQ5xZTo cM3f8P1IaTIpxE5gev+gPxhyQQ== X-Received: by 10.98.144.205 with SMTP id q74mr21447562pfk.55.1524529219790; Mon, 23 Apr 2018 17:20:19 -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 p6sm26669845pfk.104.2018.04.23.17.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 17:20:19 -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 0/3] Fix UFS and devfreq interaction Date: Mon, 23 Apr 2018 17:20:13 -0700 Message-Id: <20180424002016.9205-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.16.2 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, so the first patch makes this actually work. The second patch extracts the devfreq registration in the UFSHCD driver, both to facilitate the third patch and to remove a dereference of an ERR_PTR() in the case that devfreq registration fails. Finally, the third patch picks the two frequencies from the freq-table provided in UFSHCD and pass these to devfreq, as well as map these frequencies back to the step up/down actions. With this UFS is once again functional on the db820c, and is needed to get UFS working on SDM845 (both tested). Bjorn Andersson (3): PM / devfreq: Actually support providing freq_table scsi: ufs: Extract devfreq registration scsi: ufs: Use freq table with devfreq drivers/devfreq/devfreq.c | 22 +++------------ drivers/scsi/ufs/ufshcd.c | 68 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 57 insertions(+), 33 deletions(-) -- 2.16.2