From patchwork Fri May 18 06:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 136242 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp840372lji; Thu, 17 May 2018 23:26:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpwSdmY65qwHLMB/+ePCWCaZ+/CH4WNaDdn7ceOKNOemUm9R9i8qb4hUAU4CR5Cx3YzpSyC X-Received: by 2002:a17:902:7c18:: with SMTP id x24-v6mr8402289pll.173.1526624806672; Thu, 17 May 2018 23:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526624806; cv=none; d=google.com; s=arc-20160816; b=NTmb8Uy3PoYTRxYqMQiq0EU3729qMoJwxqL1hW3Rf0wB1yWGFJmSK8CMYb0bTaal5/ kk3iN05GiaFqmU0CXQSc6PbeanbLO7m0uIroWYq/HjOF+oRrj1dnneXBTj1bJwk07JMI 9kGyptqRaKG530s40Tiifwup2yLIbWeRwHMc/tobnW3953HgLYteKcyH1ehAt7IbEP64 e1WoM7hdAnDcwTPQ6deoQuzhC8ZNe4tnz49ZbvHbKXPUhXp8Yymse49QPlwr4vfj3bd5 sNblnZhf+Fz14cvK4DIkcmcCkhiWweI9hJMCGYMYVcfqeiqlxW/CELiXXMYoF+tthP2B vlJQ== 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=KnAbWvpxTqkVrNFAmh7ymf8ZxwsClxYhhNasEkrbkQI=; b=m2oR1WnFujd2obrFRmaneoUNLL9/UgbhQSVpuAp1QjwIz18TJT/QxI5nU2R+B1K3jv EW7TiLy4DWGxM1DOeLcwBPebOAA38J7lGG/IL9Le+hLCIrIWjcDjviPyXA5f/i++4Aj9 iiApASXaYvaT3/3CALZZNPxiv2sYUUQisffLi29ZR1V7y8qJLCRNIj5oX8ko1vOm46oM ZLNzhKG+PPjo0y/wf6LbsakfwvpwrxVV79YwyIgsvT6UiKGcOFpTyY6Bk7dS66KoMDwX Ef1alu9cHyXoPWYi4CtK9l5f3qeWFPGy98EHh4wNTAU/NpTwkzV89QNlndWxJk1MzjZM Klrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ifVodamq; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 v23-v6si7174402pfl.233.2018.05.17.23.26.46; Thu, 17 May 2018 23:26:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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=ifVodamq; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 S1752129AbeERG0o (ORCPT + 1 other); Fri, 18 May 2018 02:26:44 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:39036 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588AbeERG0m (ORCPT ); Fri, 18 May 2018 02:26:42 -0400 Received: by mail-pl0-f68.google.com with SMTP id c19-v6so3983783pls.6 for ; Thu, 17 May 2018 23:26:42 -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=KnAbWvpxTqkVrNFAmh7ymf8ZxwsClxYhhNasEkrbkQI=; b=ifVodamqgLFjVfxB0KZYKEfd7wkFm1r7lAFbHv6jrDshuEOCSplUHaIN0G6ygcp2Oh IAeEsvdVFz4tviFaUk2LTCmPY3Bjn7yzMmCWOL2ZCnfojPjFJKOTlFUUD7e3VJGWfbZq 78YV4kgpqF9haw0SptKfhyl0TZFf/cCLw0Hyg= 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=KnAbWvpxTqkVrNFAmh7ymf8ZxwsClxYhhNasEkrbkQI=; b=WKbBP5oEseIbroMIsAfFyHJUe34ICoxzGJdOUAPjbAyTArjfS6IE/c8GZHu134eYsv 1QHu0KbRMDKV5sbAA9lRl2lHcOPz2PsuJfLh06aHaX8MTnDdJlma5lRbL1pr+ngkMunX xLzFpeR2EW1oezYuXFpszvcTZ/N1nU2bX4firOHPyureS5YuPb/zYZZG90sQJHR4qC9H VXjzADxkyToxjsVAYzIpxjFCpvaRKgAZpKwWYPhf/5FxVR8ShCXCu8dpqFzSY4OwN5JP c7QjLyanA9gu9vCd7zKWM0HggDiuw39HMaZukuctoPf4XGmwvrnrIS+uLKDb/0j/ncAS KRFA== X-Gm-Message-State: ALKqPwe3FmlEnhwFEjiv/j9oeNMxqoSL2qT8hVd9xfMdtqU06T5QNNi8 X3wybrEEDz+lVmDGn5rdgcjdxg== X-Received: by 2002:a17:902:9004:: with SMTP id a4-v6mr8119307plp.143.1526624801765; Thu, 17 May 2018 23:26:41 -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 b72-v6sm14157432pfm.69.2018.05.17.23.26.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 23:26:41 -0700 (PDT) From: Bjorn Andersson To: Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" , Andy Gross Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vivek Gautam Subject: [PATCH v3 0/3] Fix UFS and devfreq interaction Date: Thu, 17 May 2018 23:26:35 -0700 Message-Id: <20180518062638.31777-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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). Added in v3 is the dts patch for Andy to introduce UFS in msm8996 and db820c, now that it finally works again. Bjorn Andersson (3): scsi: ufs: Extract devfreq registration scsi: ufs: Use freq table with devfreq arm64: dts: qcom: msm8996: Add ufs related nodes arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 8 ++ arch/arm64/boot/dts/qcom/msm8996.dtsi | 85 ++++++++++++++++++++ drivers/scsi/ufs/ufshcd.c | 76 +++++++++++++---- 3 files changed, 154 insertions(+), 15 deletions(-) -- 2.17.0