From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.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 4F3941A7249 for ; Wed, 18 Dec 2024 12:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734525028; cv=none; b=pSurCyPJr7kGL9AzXuo85mvU4URZlILBfMJa7xtzkHKYElbIWYiyuSS6XYtgKxRyswfhCMZBF8aZndzlhlQE2+gg0fTN8T9+G61Q7fGPbWMzEtqG8rCn+GsF16Ap8Q6HvBP09fj6oHs+ggK+uAhJie/DSTgmOlvQmkY5NNrxKC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734525028; c=relaxed/simple; bh=sIokGkGvk5wEoau7cfzmPpCeUIVZzmYqS6W9pDT1pms=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b3BOwAB5Hzwj534fVd3+YNGJoSVTfgtXTqqc4SeMYO30yFx1n7B+CIJPmh8xV+5/aT/pueWk+1BagPQuGdPFcDcTyedmeRHU+HhBcD0sSlS2440L7dDChsJ4n/zJGbh3/9eNuxFU36GlHTE5zuhzPzJMFQaVZmDshAbGm4zakZ8= 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=zDktpP0G; arc=none smtp.client-ip=209.85.210.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zDktpP0G" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-725ef0397aeso5711005b3a.2 for ; Wed, 18 Dec 2024 04:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734525026; x=1735129826; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6F5mcTldZa7iY872IZQ2vfT0jCbEuXcj2mSPu9gsXzc=; b=zDktpP0Go5OVh4src2sJrpL5ub+hg6myILqxFYWCRCVRXH9QIIvuyHMUKearGGjuke Ynj25rhN8dp0yR9eDkcFX8w7DlohUBsjGFnZJLC3ie4xfAmCkJtr2+JQOBZj04vKNC0+ P7vAPGpHHfBhsAlC0vfx37i4P17dZAbHum6LADDljKbjx2LpsYVC7EwTWPXVgvg43xBZ vMPPCaxy+V/9F6b3ju10SLKWeYFoRmVthOpcm+JJkd2IHp/FOYr7jAWZF9qUgynuxAun gE6i8xWkR6YNrm6arMNWJQQ1SlmvifRaDGsBM5jbKMmp0GAs3OIwHnAvwBP88nfFaXuP t5yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734525026; x=1735129826; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6F5mcTldZa7iY872IZQ2vfT0jCbEuXcj2mSPu9gsXzc=; b=qOkG5zDI91SVMirOWhcKpGZ1LPXBDFovleAq9NHc47WCDgTfKT1ttS01UVWy4sQgJB UEw+bLsc0KtyNS5GV4HKJ82uVuLpEefCHDDCKzm8ou1E5F+eSvzH28z7J73Fc0h+6PRg jqEZU5624OYJftdLolcpFqfVVLJ9yRtNaRa77qjXdSaj+FSwOlF7+pIU11oq+gp7qQ54 JMQcuGkLev6FBat4y658aqGrzc6zImW5igaqsWFFFfRqgXLkOr12PugwQlzhAHgnQEF9 t07lzPJw5IjG+3/jymqxIrxrvYgDu03pVj98WW9akF8n8pSe+lz8//smI8KIV2NxI/i6 UCkw== X-Forwarded-Encrypted: i=1; AJvYcCVtMfAKycV45gu5QWJYXirNKleQ76pr6YUdSxa6/WxAgoxFDKfNG7Gvy6xKnp/35PopH9AiKkNLYJbIfqo=@vger.kernel.org X-Gm-Message-State: AOJu0YwE3Z3RKUWhtaffOfmkoA/YHdheMvZiLZU6UuAgL36Eef5QnUSR +jUAkdT1p+oVb2xk4BD9nEUE0Rf7d8GI22zzGu7G/BRyGDaKHeko8nz6LnZpSw== X-Gm-Gg: ASbGncsemnz4kYqZmo/mhA4C/HX0DKFKpebvmDdH8HEp/cX/01q9e6uASookFK71gXU Ii6NQpC9YvkjbiJCZcUVS9yHkAvEZJNGHJv06s2w3XAm2+d8H7PzY+yQBYg6gc3iazhLDewoODy NMBYGLqWQ1xj92bTMhxkifnfTG/jZxbV7jJPqZuyZWmNQ3cBhaHDM07hW1j1Y7M0Eg9lUaozq+x rhzkqN/V8uZkAxXezUvxcfs/cDi+FYbZgrryTsuAyPaAGugUuBaxg8gA6jGak3txge3 X-Google-Smtp-Source: AGHT+IEVCTF8u4ejkks/VblnJMBrY/RN2wVeVg8W2IFUErI8HUe0PMrVjMwp1C2jnmKDGR2tk1cBMA== X-Received: by 2002:a05:6a00:180b:b0:728:e27c:a9bc with SMTP id d2e1a72fcca58-72a8d237723mr3199997b3a.7.1734525026308; Wed, 18 Dec 2024 04:30:26 -0800 (PST) Received: from thinkpad ([117.213.97.217]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-801d5ae9fe6sm7377693a12.49.2024.12.18.04.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 04:30:25 -0800 (PST) Date: Wed, 18 Dec 2024 18:00:19 +0530 From: Manivannan Sadhasivam To: Johan Hovold Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Loic Poulain Subject: Re: mhi resume failure on reboot with 6.13-rc2 Message-ID: <20241218123019.py57s4r3takm2fs6@thinkpad> References: <20241211145315.vaf7gbapieywcvau@thinkpad> <20241216074021.kwoid2747o7piquv@thinkpad> <20241216141303.2zr5klbgua55agkx@thinkpad> <20241218113830.efflnkxz7qu24xux@thinkpad> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Dec 18, 2024 at 01:02:39PM +0100, Johan Hovold wrote: > On Wed, Dec 18, 2024 at 05:08:30PM +0530, Manivannan Sadhasivam wrote: > > On Wed, Dec 18, 2024 at 09:40:45AM +0100, Johan Hovold wrote: > > > > I've tracked down the hang to a deadlock on the parent device lock. > > > > > > Driver core takes the parent device lock before calling shutdown(), and > > > then mhi_pci_shutdown() waits indefinitely for the recovery thread to > > > finish. > > > Thanks for tracking the deadlock. I think we should use pci_try_reset_function() > > instead of pci_reset_function() in mhi_pci_recovery_work(). > > > > If the pci_dev_lock() is already taken, it will return with -EAGAIN and we do > > not need to worry in that case since the host is going to be powered off anyway > > (and so the device). > > That may work. But note that I've now also seen this deadlock during > suspend (i.e. when the device is not going away). The > pci_try_reset_function() should avoid the deadlock here too, but we'll > end up in funny state. > Hopefully, recovery_work() started by mhi_pci_runtime_resume() would be able to reset the device. > Now I'd also like to know why I'm suddenly seeing these runtime PM > resume errors of this modem. Haven't seen them before 6.13-rc, and I'm > not sure that it's really the firmware that is crashing left and right > all of a sudden. > Yeah, that's worth the effort. I'll go ahead with the patch since the issue is present anyway. - Mani -- மணிவண்ணன் சதாசிவம்