Received: by 2002:a05:7208:3228:b0:82:47:81bb with SMTP id cb40csp2638173rbb; Tue, 16 Apr 2024 07:29:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMROPaDm8wIKcMAe7ij2mOIyqpyuhBsC86tM5V6b8sCIU7Pas3JNuq8Kv8MTPvq3jCtDOSu0snyxZt3Cg6Q55ee/NwbTGuh83sfyG2Vg== X-Google-Smtp-Source: AGHT+IF6tuWpwpzRl9XeuVMPt5BVaf06wNmdlzACiEuNzbdHuyLdeV8UdN9KVKJ1nLUUrNWnpkXO X-Received: by 2002:a05:6808:428c:b0:3c5:ffa5:3dd5 with SMTP id dq12-20020a056808428c00b003c5ffa53dd5mr14288475oib.28.1713277795921; Tue, 16 Apr 2024 07:29:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713277795; cv=pass; d=google.com; s=arc-20160816; b=kBBvWMDVdRg92v1mjJsV94wUbqwmqtYPIewXZsv9y5Q0N0sItHjdCKEhuoRF7EqxRA 1U0enWd30M9pyV3g27NTRi54myCaYDeXZ7RKmwByNWTag3IuBM5xNMm4PWwKI3ia5eE0 ods02qS23dafsqVTy52JDzvELugkjOY+SvBP3JWebDc9DsMWUohw7M0WIxuaob8nsCIx gOyZDja1QuZVz6L0/0dLrVKueRN1BLdhCQWmjLJ1AVXqaurV6e0s2vzj9V+rMkiIZCrd TiEwWdX+NurNw521ekv15A7VS6NQFSnGhSIGN9MYy2Vz8gk4J5IlLgqnO44uOEUqL5sf +mkg== 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:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=p46NLymR63vASMlbdL/ylvK8iMB+sTEHHkplvZa9X+I=; fh=bGZd5USUovCdfndMhbToekv9hTQySstro7aFe6cGpw0=; b=GBF1xBJUDO0oVYF4Rx29xER2OLn2VtJrWSfsurkIjS2JGv5B6XWT2i+Bgzu7yTUd62 nydYjWQmTiOLsGC+Rih0sD5jlUKFS44vS0ccXNCysr0YTJX0y/xia5oofwWjM2Bkua0V 5+tc41FqVi/TQgn80nVGm8kpntqwu0aQuAmEPmo4VyyHs+DDbqj60HKRNKAgzwMPx0fl t3DpR667GJTS3vCC4fHbxTEUoqSGfVO/8PWUpHohsznDMV2LjccPzWKVo6oreDQmtsJw n0ZB532Dz9ar8Vu4kVs2i3IHCoYB/Zjks7RT7JejHw3vGpisulwKfA4byyX+bLFdbv8N 0tOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FwtwHAbf; 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-147015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147015-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 g4-20020ac85804000000b00436f84d0ac9si5569843qtg.34.2024.04.16.07.29.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:29:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147015-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=FwtwHAbf; 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-147015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147015-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 961FE1C204F6 for ; Tue, 16 Apr 2024 14:29:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 927B6130495; Tue, 16 Apr 2024 14:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FwtwHAbf" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 5150312C491; Tue, 16 Apr 2024 14:28:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277691; cv=none; b=LV9/3PLpoHwMNB0tngx79i1p0bgdvu/v5ZedTjztiY1dW796HJPS4F7DYBiyoeyQO4cPL89tCrWNgDN0zecR3F+q/i85v/OuGaF9lmnUlZxD/Vp7aIUTbhjLFdky1nih98+fW+Fu+Q1SS0fhtvTpmTBNlOlyWPcp+kJFPLOiuBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277691; c=relaxed/simple; bh=phn+BucdZGMtnw8g08k3T7d/QfnKj5WDeUf8Ocjk1JY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j5UFwMkM38yam7yN3uy8k9efHYPn6yOKzxFY2X+Iu+uORyvqXonwq20mGxOTeK5BpnBYOUuiWBlmV80Hd2ih9ZAjYfoUWl3mp7x2IUJbN6DqVzZ4Z/xtEPhdR5Z5If6mcUJzG8E8abp2sNPD8f62J26dT2mLkZIk8aYH4WXXBnY= 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=FwtwHAbf; arc=none smtp.client-ip=192.198.163.8 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=1713277689; x=1744813689; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=phn+BucdZGMtnw8g08k3T7d/QfnKj5WDeUf8Ocjk1JY=; b=FwtwHAbfywuNEXWR7o2hpXzjIM/KvtPxguG9MIOMCswO2L2hbrYNRR9I voP+cCPOKUqn646a9EcB2Xnt7Z8afZtrdK5UnLZIcc5TbpIJ63V+6SthZ m+CPMIxZV73TcJaTUKFur7399ertCagVuury+tvTteezEEkyMkDI3hXyQ wluu4UXYopz7MDyic7LohZZkDmcvSKkvlVNZVTnARvfrtwcytSUfycutw CJOP7xwSYK92Uqq5mfvA6H0JEvLTOKVfnCFYmDh1nSveEStI2CQVZpeqH 5RqEJ0CDo+7LmIP+bA6qrqplYI3DhbK0LCZ5/WbadZxxPAUmkU7/zHZyA A==; X-CSE-ConnectionGUID: ZoLKFnWuQ7aG3B/KIjrrUw== X-CSE-MsgGUID: gyrDM8lORMmVfoYR/b49ZQ== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="26230017" X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="26230017" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 07:28:08 -0700 X-CSE-ConnectionGUID: R7U1Jg+RT8SzMByYQVm9WA== X-CSE-MsgGUID: r203CmhBQwC3cSYiuuMJEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="53257458" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.61.239]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 07:28:04 -0700 Message-ID: <0bba3454-ba8a-4c4e-8c17-725b6334b0d6@intel.com> Date: Tue, 16 Apr 2024 17:27:59 +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 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> <77d76e3b-549e-4d26-834c-a59b91fbb2a0@intel.com> Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/04/24 00:13, Ulf Hansson wrote: > On Thu, 4 Apr 2024 at 20:42, Adrian Hunter wrote: >> >> 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. > > Not sure we should care, but it still looks a bit fragile to me. We > may also have a power-domain hooked up to the device, that could get > power gated too, in which case it's likely affecting the access to > registers. Thought some more about this, but there isn't an easy way to know if drivers are catering for SDIO card interrupt or SD card detect interrupt.