Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp316122lqp; Thu, 4 Apr 2024 14:13:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXG5t5+1oMdZg4JqZ7N5cfvYNk4ObQUjNAZFytuRY8fDrHzsfKiP+u+Ln40cwgmWy+ujh6Y15py6PatK4sBKOFeiU8mgThXMbswvy9MvQ== X-Google-Smtp-Source: AGHT+IGXs1/1pN703dRDM6xCGMMg8RU7xlGsIp4c2x83NpOSy4CWi9gnpAuqFfjUrLrkTAM6OS6e X-Received: by 2002:a05:6a21:8ccc:b0:1a7:3b4a:432b with SMTP id ta12-20020a056a218ccc00b001a73b4a432bmr1712154pzb.17.1712265234883; Thu, 04 Apr 2024 14:13:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712265234; cv=pass; d=google.com; s=arc-20160816; b=vsQNEgo9EBDZSpqI7CWuwJu4DrY5efa+bg228/vCPhReDZLCb8tSzecfu6OIdvr4fM i7ujcctVtQPqP9sWaO2Rd2g62u1GP6i6YkbH+Z1413E3/8z4d3O9kvNHEljndou1DfuC buUJCARAcv6b3o7RYqSBmpRyfEiXY7v/VFui555gT+oiF8g3OnsNumaQ5OCztcTHHReu Ppvox9VNU9wGMc4F4DTc8pABldactS7XAvYPMt1WS0MKRWphDrzLzVtD7s+I0RqZr63Z skKeCYOOEW5+TFAK0aSrXvhz1z89zHhvLTEmNwHEvmjcz5qaKghm/20Qv6wkHcvr3e5B kQeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=s9wwL23thTprrqQZ5wXrDwmYHVyBkc8YlW0ql+daai0=; fh=csS0pRjhO0ufpvlTU/VNtWS04Dtwr7RV/paPxNmnYSU=; b=yFinLH0lmexH3ETeiZm0OuGoH8ANpYt2ToudG6tlKJ5L+5/AER8m12kUBQ9qflmOHX /kgkR9m8/hnJ653M2+mU8OxABMP4n7QZfjSJgUaYLQH9W4Q5XXQuw5SGIVrOoCukBsYS jsRYPAsgUgGW59PRZOiLolXdo7VuDSoahfHaJjLGXK+1bvR8ErKzR7C2dfJ5Fhw7URAW 6NsZQdfgb7+55tCFBBeu3QuSitHDUaNy7ofGpF4tw9Yo+CIXv+wtmrd80USFBBrfvkv8 Ze1TEuMrGyDtmpd4tlF/Q9IrxJE6UMyKcdVp2dt7IAXmYqvJdImVEKNuSOpVMixk/tII Cjbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VkOxH4PZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-132124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lb14-20020a056a004f0e00b006eaf871dd92si114429pfb.363.2024.04.04.14.13.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 14:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VkOxH4PZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-132124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 82EE62812D3 for ; Thu, 4 Apr 2024 21:13:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFB5D13B79F; Thu, 4 Apr 2024 21:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VkOxH4PZ" Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6871213AD2F for ; Thu, 4 Apr 2024 21:13:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712265222; cv=none; b=XOt/kgXrPiSb+nH5BuUib4DA6O/OJTQ5dzuBkA8YLORG3jHJONL4CY7ZuCjAxmbc8D7N9aWKRkhENDc3eHAcaMLa34MCIskMyyRq+n0BWWWMWu71tehWyFG+L2onBIm6NfC1AKv5befpOhVQilJW8lBUyL46UdnWbPdMlL4El1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712265222; c=relaxed/simple; bh=s9wwL23thTprrqQZ5wXrDwmYHVyBkc8YlW0ql+daai0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Nxyhu9Jz5tzijSL/TNScTAv94GmDyj/vhX+lXTiYug8UvY4YfE+YzHESMSn1+PeoINSLwCzyz3KjeId+YyaxKIYvkKQ8WcklAv1ZVZQ3FZGMNOHUKoYpuQIL5/nksleDHPnE6edsGQprW0amzt8rja4mIx4pRFebyjGebl3uGXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VkOxH4PZ; arc=none smtp.client-ip=209.85.128.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-6157c30fbc9so15275617b3.0 for ; Thu, 04 Apr 2024 14:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712265219; x=1712870019; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=s9wwL23thTprrqQZ5wXrDwmYHVyBkc8YlW0ql+daai0=; b=VkOxH4PZ7ve7D7LfwdEUJPzVPbSfTaFeTpr+gNHWXiAfodLp3YWewCKjOMMULmPTLx zvYo1QgjKhbkzj54exC17ZXzSZEQZcTLtvxrgjHkTTH1HTSPRS9YZAzNAKiAOzLt2SrS 9308pt2J9xVqcYmxw65EOr013jDXm+pjg28YcpobcMDZVRSpRe5wgHK3AilmDn4oPZre BIVfS75gS+4Ue2/8us1eg7Wf+F4yze0lS5DdD/Q2S+Qs1xxRwTl8g9gRjbzETvf3tRs8 ZCbmzbzGWEYitfDQlVkRNkihB2bxVN4dY08AQAiUciM4SIjDqBu6n7SzsxqgHz6y6qES YttQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712265219; x=1712870019; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s9wwL23thTprrqQZ5wXrDwmYHVyBkc8YlW0ql+daai0=; b=P3R3zyMPQSKZskCg8wk2xK3Ox4mEXJ+9A2EDYlajEhFQY/2M57owkftgbw28oAxdpW o7oUSdIR01acZniK22LJ73mHNNWiMw1E0v8oNiUQOM8QpkMsSG1Q5e69Klt2kWOtW6f5 61C6f/Ch1ywehDBCsj3NuszPtVS0nXVgij7Tb+f9FZQalURamE/sXCK8VuKSeTzI5tmC +/9ITkjHDzhRBYXz5dyVdP3QE6RHlut/17CZ0s85fkItYwRGLv68LLh4F1ciaVXxBdVp v4GmCQR9+zbMjx4DvaOZ45MPzWF9P5ojTZImcLtpG2n7E6ez2I229PZW1w/k0VDHrb6M nvPA== X-Forwarded-Encrypted: i=1; AJvYcCU1arnpQCOUk0ve7RzZUJWsQuQJG7Ip5j8aaHH0PV+9nlJE7MDkDkvTnQpTXjGZ9MjQSLI0SxPxdow2ZVJYb/djsKeQDxDDxLebM5x0 X-Gm-Message-State: AOJu0YzA50xnra1w9n48V2NeK/ltoY/ule2k8BT0mj1F5He0yOSMIhgX sOg1x0G+q73rp03iqsdimEf3aGZ0j/qcs+w2RZkd1w1sBWpQiHUPHNlkgGvbPHTUSwq3DVgw4Qa il5xMKHcLAYFhMB3O0bb1JM0MCh2I/ofQlVHllg== X-Received: by 2002:a25:c744:0:b0:dc2:398b:fa08 with SMTP id w65-20020a25c744000000b00dc2398bfa08mr3804202ybe.31.1712265219410; Thu, 04 Apr 2024 14:13:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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> In-Reply-To: <77d76e3b-549e-4d26-834c-a59b91fbb2a0@intel.com> From: Ulf Hansson Date: Thu, 4 Apr 2024 23:13:02 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci-msm: pervent access to suspended controller To: Adrian Hunter 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 Content-Type: text/plain; charset="UTF-8" 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. Kind regards Uffe