From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 9D60C3DCD97 for ; Mon, 20 Jul 2026 10:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784544046; cv=none; b=ZR/aszD2PcCxjtAwGqSh1nbKv9N6fbJeU1VdDfC2vnYFBVkuZj4jCqcVmcvFSI9ypsZMIKBecBy8RpG6IelXm20X9dCA+5/FKDRSG17QsR9u0LrDoWmo8f7bxfNJPw/4n2Y05PI2hzSAKqF4RGWJVX9HOpo+xn/52BdXccukcmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784544046; c=relaxed/simple; bh=KOg2s0aWMbLiGwvJ+2qMJwffalK7t3oBpcm6XVotiHA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GUI04ClQKLKwcQF5wQQHT3/AMk5bWfs2TenTwd22nMYvUKmuoJo6CDr2RVOREPT2H+Hyouhj2VKFNLB6atB6oFQ4sXUj2ESdNCT4sPyQdMVytmg2IatNzh3SpgJ0aAWWzdnYqmdrRIOBl92AlA7VOJNI5fRfDDNavs35rRxHjI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2cca0c5799eso75288445ad.0 for ; Mon, 20 Jul 2026 03:40:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784544044; x=1785148844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Pc9Q17L9G9Tp/hTZeKzZ+mFFZkDIc4OrDplBBsBLoik=; b=THaIXNxq6xF+h+4fFJ266wtEljabl8UPaYv9UhiIIgFRfLcicyJVQ85K5CGVCA7T8Q nkArA0fsoFUIM4w0RHSRLMgQdzLJowjTvKdH2pErPuwq2b3wD2QPyFPBNRRlWqYiuacs SLR9ycnYS1BwrO5aarvaaEmkLQ8Y3n/WouLvBI+Js96E3S/cagXL9uL42YYSKNwJX0nz Tr4D6Pmz5FNzs9U2hlMlX3OpTc6tGKOLimM3fQeQfNSdY9qSQSThCmcMdtqAcXxeemZn n/E5lVU2F4bDxjFk6/hg0LB1WurwGFZQfx4fjC6lS0LrCCQZFdCyqS9U8SjKmiYMtkEi 1oww== X-Forwarded-Encrypted: i=1; AHgh+Rq6qh3Cs7Zm0CpEDi5kjZcEMRLcDZs+Ho/k0B2mhdImZhxSz9gQ3qIEBmvd/ZB5Z6Q98DHgPdSRupSvC8Y=@vger.kernel.org X-Gm-Message-State: AOJu0YysUpDbBLWtBqxYSO73PP3u2DMQaY2FBP2/MYE09FqhW5Z5+rdv x+KpgojUrgbvYcrs+0XDlHabiKShEN0xXbFmhFqngwxSDF+LPMDICFA= X-Gm-Gg: AfdE7ckvsPBCcql3tKEEKRtRyHnE2GiJAwWX12TIWGjTSSs9hXvxdP62g0VoCCl5ZN7 LunrFzM/oOE7x4QwpArZwEHdkzdbqUPB4X3wnJqmG0Oi1McAC116bUWbxE9Uv/Ek1DmPL6jkSS0 YO2fw4eOlBNJW9y2VEMj5jqZKmnM1LZbIXTx4cAixBeEIJQBks1dNMMJYoSBzlx+CI5OX4d+BBw n5vfshss7L0DKRmCXqFa8ehor3qHGtbN2kll8FAIc0S1bLL76K1L/Z+m+TzA1YtrEUSDaYSHCb+ VnxVZJ0EqJU4SMiORN46Olcg+EAhNX4kvt29WwOwpYBpgI9IO/H9JaBWsLpoSzF7MGdI7feDgIY zeaL5msksFmDiJcE5vNUjLlpUh147Lx0BPB+jNWNbrwc2ttMvSCSEOr5TmQYIk6L9j/5ASgMSIj x0iLGJcIBf1FWkjfpff1KijOfiMt8TG06+GR5KQM6le+DLV2OK6KkdbZhoGIr/dK2+pFbg05pp0 2h15Ck4VPevpYL5c1+Umw9y4JyQ X-Received: by 2002:a17:903:3c46:b0:2c9:97a8:afef with SMTP id d9443c01a7336-2cf349f4a51mr134654595ad.40.1784544043870; Mon, 20 Jul 2026 03:40:43 -0700 (PDT) Received: from penguin.tail0a1999.ts.net (61-228-16-100.dynamic-ip.hinet.net. [61.228.16.100]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf344f61ffsm54900325ad.33.2026.07.20.03.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 03:40:43 -0700 (PDT) From: Shih-Yuan Lee To: Mark Brown Cc: Andy Shevchenko , Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Shih-Yuan Lee Subject: [PATCH v15 4/7] spi: pxa2xx: lock out runtime autosuspend for Intel LPSS SPI in PIO mode Date: Mon, 20 Jul 2026 18:40:26 +0800 Message-Id: <20260720104029.13740-5-fourdollars@debian.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720104029.13740-1-fourdollars@debian.org> References: <20260720104029.13740-1-fourdollars@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When operating in PIO mode on Intel LPSS SPI controllers, runtime PM autosuspend clock-gates the hardware block when idle. On subsequent transfers, MMIO accesses to trigger resume are performed before the runtime PM state machine can wake the controller, causing PCIe Completion Timeouts. This issue does not affect DMA mode, where the DMA engine holds the required resources, nor does it affect non-LPSS controllers. Lock out runtime PM autosuspend for LPSS SPI controllers specifically when operating in PIO mode. Acquire a runtime PM reference via pm_runtime_get_noresume() in pxa2xx_spi_probe() after registration, and release it via pm_runtime_put_sync() in pxa2xx_spi_remove() to ensure the runtime PM state machine transitions to RPM_SUSPENDED upon driver unbind, preventing active child count leaks on the parent LPSS power domain. Signed-off-by: Shih-Yuan Lee --- drivers/spi/spi-pxa2xx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 64b5ec744756..88ed28096b07 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1473,6 +1473,9 @@ int pxa2xx_spi_probe(struct device *dev, struct ssp_device *ssp, goto out_error_irq_alloc; } + if (is_lpss_ssp(drv_data) && !platform_info->enable_dma) + pm_runtime_get_noresume(dev); + return status; out_error_irq_alloc: @@ -1513,6 +1516,8 @@ void pxa2xx_spi_remove(struct device *dev) /* Release DMA */ if (drv_data->controller_info->enable_dma) pxa2xx_spi_dma_release(drv_data); + else if (is_lpss_ssp(drv_data)) + pm_runtime_put_sync(dev); } EXPORT_SYMBOL_NS_GPL(pxa2xx_spi_remove, "SPI_PXA2xx"); -- 2.39.5