Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp241663lqp; Thu, 4 Apr 2024 11:45:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZfnHCCGy2XfeOdHbYyd0BnkTLvUHnBcLarUIt+nZrOWroHHAuo/eopBFMGZ+U1AgxEyYO+jm7HBARx8fJTk2eEar78zXbmK4/6QLIbA== X-Google-Smtp-Source: AGHT+IEjitLsSj5wj44sURT6UMgNfiOVjvH9/ZvjI29thz9h79XBXM7ggEPA3ssPsahTXcehJP/e X-Received: by 2002:a05:6214:491:b0:699:2726:a94c with SMTP id pt17-20020a056214049100b006992726a94cmr617264qvb.44.1712256312062; Thu, 04 Apr 2024 11:45:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712256312; cv=pass; d=google.com; s=arc-20160816; b=czb34CzT6rBxGscE7AuF0iZKuwsVrt2ouEpCqA/En7Pv4lTWDIaJ1LPnOjtQQuamkI nyOiLpTDl9QQG2rBQj37U3UqJk80n8kRXEbsZy6WqPgcBu4WMLNgL031IznpwaikKbaC 3+h1ohmcS8RISZDGkVMiWCx7Z7yPxIr6iisTtd7Tm5WdTQ4Eixv2CbQvr/65kmxEcYMh wWeQzx4UxjsuYj5UILZx/0DB0QztfxW+fJycMDjENgWIfYZbnZ8BT3nZtK0Wh6txNsok 6xNXA6K/oYBvmUJ7tMgmLqbnuSAQd2/u41mcSZksRVuOS6lZZ+CkzCevNM2kLvgS7+gP VlEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:content-language :references:cc:to:from:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=ShcVu+jYIOMBKbJ46XbLZ7gDGfx4h2P7QLagPhb6Uxg=; fh=bGZd5USUovCdfndMhbToekv9hTQySstro7aFe6cGpw0=; b=OtFb4h61J9dq2Eq8yVa/poGFKEpUDA+AvRmmPRcC+K0UsC1U2DwiALK1Hub9kvP6Ac 7E8ffAJUwzkWLffEfORgOOrhpLXDtf0vgWl/pw254SawI4iHBiyDUWRghZkCjG8GuVkX RcLi4tWCDZwQLF8MXDsidaQ06TFagJNQGJV98yysl/q2I5o6MdvTlqV39PH1/k9fZS0p PZeGAP/Tx2dtr5MZMmWdktHKCpa8XPJLIw0XvlVuvDcYEWL9uAAxcHFFdSDPrtGgZH0L v+XkMK9bhRxBPIUMdN73Jr7i+aIf5b1pQiiPp3klSVWZB4h3agaqFTOLzFl19DLPAsZn mtVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eZKTRAti; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-131975-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131975-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q10-20020a05621419ea00b006992015bd86si6760846qvc.97.2024.04.04.11.45.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 11:45:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131975-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eZKTRAti; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-131975-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131975-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0AA0F1C29162 for ; Thu, 4 Apr 2024 18:43:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFD8B132807; Thu, 4 Apr 2024 18:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eZKTRAti" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 0083F130E29; Thu, 4 Apr 2024 18:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712256175; cv=none; b=nT9v8efRvr6/Me5+FdVXOH9GPACEc+Ma9+PBlswc5yA9JxHdwpiLUCPQqopCxB1Ny6MD9R3gArL3vKrluJYrkJXLIKLPndhMpt0zfAa35/E2JtOI+1wZQSKAcbFBgDmNPTyix/CkDcqVQ66ye+jkH+5aVt//5ltI267VQBlC2Zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712256175; c=relaxed/simple; bh=4NQR6s8aErkFZR1aqYo3S/4BmQ1dbHV3gCI/EvoLQMk=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=ISwW/nUTvOWeKOy7EMTW8HOBTrvchLDEUdU2pFqs0TI2YIp9PR4GSUTodXhWacgG41mFZj3tRsELbJtIBEooPPY/gkbHQiPdEuWt2KWEz7E6ywfU/7u61BuNEufpmMEk8sD8VUzWpKNwNf2Vx7PEULps3TDwJA3JofpYFCp2Dvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eZKTRAti; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712256174; x=1743792174; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=4NQR6s8aErkFZR1aqYo3S/4BmQ1dbHV3gCI/EvoLQMk=; b=eZKTRAtiKEtqOPkraqky2lUoDnx6i3BSHExJ1+NWrN6ASdRtDhgeGhAB WccDlSsCAMWVjrtTK5RL3UfMepY/6FubsbJXIPgEz7FCuxPFyV7Aq5UQr 730eQeon17jGRuQ/OhL68NzGnimXSszqrTuL4rJeW7iAjEQjhnqKHsJzc 4Zn1ylyvkYJz1byzo2aPcKUfGPrH4+ZdmaBLXEcEVN+dxAlwfs/RrEUB5 kF7qYuFKtYlsWVIaJSZFDAVyk8b/TeFn4fOG4qaMXUpWa62ai7otO9eqJ 03IfJqcmakSXZvu6J2Tmm2ILu9t45UgGllQXMLRDlZOWSSkZ/3lp8FCA/ w==; X-CSE-ConnectionGUID: Bn0+/+XtSmyCG/Y6u3tBtA== X-CSE-MsgGUID: iaxRHqvTRGWw4ZOIKkEjRw== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="8144129" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="8144129" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 11:42:53 -0700 X-CSE-ConnectionGUID: L/rnFIAUR4a+alwgAUI4JQ== X-CSE-MsgGUID: Y9bcLz4VRtet7EZ2yn0QDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="18786003" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.251.213.127]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 11:42:49 -0700 Message-ID: <77d76e3b-549e-4d26-834c-a59b91fbb2a0@intel.com> Date: Thu, 4 Apr 2024 21:42:43 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mmc: sdhci-msm: pervent access to suspended controller From: Adrian Hunter To: Ulf Hansson Cc: Mantas Pucka , Bjorn Andersson , Konrad Dybcio , Georgi Djakov , Pramod Gurav , Ritesh Harjani , linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Thierry Reding , Liming Sun , Victor Shih References: <20240321-sdhci-mmc-suspend-v1-1-fbc555a64400@8devices.com> <2e712cf6-7521-4c0b-b6fd-76bacc309496@intel.com> <5bce008a-8354-4ccd-af1f-b7f2b2caf3bc@intel.com> Content-Language: en-US Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <5bce008a-8354-4ccd-af1f-b7f2b2caf3bc@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28/03/24 16:20, Adrian Hunter wrote: > On 27/03/24 17:17, Ulf Hansson wrote: >> On Tue, 26 Mar 2024 at 11:25, Adrian Hunter wrote: >>> >>> On 21/03/24 16:30, Mantas Pucka wrote: >>>> Generic sdhci code registers LED device and uses host->runtime_suspended >>>> flag to protect access to it. The sdhci-msm driver doesn't set this flag, >>>> which causes a crash when LED is accessed while controller is runtime >>>> suspended. Fix this by setting the flag correctly. >>>> >>>> Cc: stable@vger.kernel.org >>>> Fixes: 67e6db113c90 ("mmc: sdhci-msm: Add pm_runtime and system PM support") >>>> Signed-off-by: Mantas Pucka >>> >>> Acked-by: Adrian Hunter >> >> Looks like this problem may exist for other sdhci drivers too. In >> particular for those that enables runtime PM, don't set >> SDHCI_QUIRK_NO_LED and don't use sdhci_runtime|suspend_resume_host(). >> >> Don't know if there is a better way to address this, if not on a case >> by case basis. Do you have any thoughts about this? > > Yes probably case by case, but I will look at it. There seem to be 3 that use runtime pm but not sdhci_runtime_suspend_host(): 1. dwcmshc_runtime_suspend() : only turns off the card clock via SDHCI_CLOCK_CONTROL register, so registers are presumably still accessible 2. gl9763e_runtime_suspend() : ditto 3. sdhci_tegra_runtime_suspend() : disables the functional clock via clk_disable_unprepare(), so registers are presumably still accessible sdhci_msm_runtime_suspend() is different because it also turns off the interface clock. But it looks like there are no similar cases.