From patchwork Sun Jun 30 15:36:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808992 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 AC7211422A8; Sun, 30 Jun 2024 15:37:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761873; cv=none; b=m/bbXBZ/x1cykIbglrP2eTwoXkSSZ9yoUwRnoSBPcN2cffaTkuhk1rgP+ip3HvN2WnoWoeVKe3wmM3vvBit2Zv884FQSzONUiuIpaizaxUs5Uu2cMobN6hUDbdehoHleXTO70nwjg/AjMy2Ztp7YDxKHe2mbYPdSAJ+VAuj2JCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761873; c=relaxed/simple; bh=qQwi+KPDIZxW5GZlpRAbTobx32sUz3lKs/edcSv1W+w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cuXIHuF2cIFey1tC8ATcVZxcpMi9q8ve41Y4AfWad/RtRGSx2sevlGeySvK1ft03oTIYJW1A0nFed8235R1VJoRe+bVZ36omXcq4xsbLjUN4/OjeQiv/Z4GKJt12Au2PrGEYZ4XeVfg0MBFI1VlFot9bkkPspb9yAVjwwPQSfbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=ep8yM1Uq; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="ep8yM1Uq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761838; x=1720366638; i=wahrenst@gmx.net; bh=+rxQ791ubcSxhOIK3kEqE6IzwyoFm1gQrUg4Eh9bhfg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ep8yM1UqjNI4tYbUGxYXd3MWHdd7qpwG3ZkN+8Bb00WnDJx0khVHLkZA9LcxzS3R ociMgBcDCGrxxvuHZfBWVtVaMGPj50QAer6BMcyerrpNVl0O/EhKDqt7gtstfLPtw XIM/GvEGcubFQNYLTwAwZmiP9BwWtD/QoqY/cwjuFh72HdFpRcDisMlqKxTbM5+p0 M5pWJvFc8YD3FzEalcfoaX2NkMWlUGsvIjmi7GoWBw4dsJCIk0WFN87axKNCGdHzE 4KroQkD/cMQLzTbjpNJiUrc7woXa1KQjtRsY5F+hN0szsaSeOS7ihjbiqlatWeDT3 k2sEiCiyniboX57PbA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1wq3-1sH5tc3gcb-013lvq; Sun, 30 Jun 2024 17:37:18 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 01/11] firmware: raspberrypi: Improve timeout warning Date: Sun, 30 Jun 2024 17:36:42 +0200 Message-Id: <20240630153652.318882-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:+fDSsr7/+1m0xx5jNNZO5K4aelCIX1oa9z/e7EF4bCJ/BqcX+/l GZB4P+Dbvny3hJik8esZBgJdKLMNoMLwRyuDU9g9cw7nCo6Niu37bmQS83d06fYvF821c51 xt0tuKV93IfqN1Xco4x4g/807GrrMeshXjpmWMufSWbTQcuQ9m/i5yabx49vm/MS9bZWtD4 QWgSi7beLjp8V/oAvMMKg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:qL3riX2MGg4=;D2/m4WXwE9Wy2ZsgCNs/qwYDp9R lSBIPwXiITay4NnuZ1BzTnJ6onPzOWqZ00kx5YARH9TP8jR0tjxOPf6a7VlPjbySxELwm0AlS R+CBtdyPakaNEQHdUaRdNkaeIyKqFnIud+Bpi6PqoOhyOKRMBv/0mu8GnY4C3JiEzuIdz+1EU LEhUirQ45fWoXvlx9u7jHbT4QHXQSSpgBA6bs7VN1KOwF2AP+9lbfAmEyDUBFM2nyJlQgSS+n e7cv+pFv/iQdaqD41ksPD3t6UaEHL6YLHPEzoICMpMIiYN7Y1jXoZRFn/3u4b7ctp1hNJRyJ+ WboLv6atSIyjgrPCPDNXEADzkm5nrESe/2/MOGpp5nmHkhzYug+eHqPK73lzdmchS4LLm8Fr0 +A0VkFy+VSOBl9qOaRKxog4ScP8Yf2IrvOj6oCuXsv5hxpiiOD2bt9L2yOcPr9T0enCW4o+gJ 6sD+zcMzSEI4MBCKLVqJj7ueoX9kDfPOMuQ5kCCCnYmmGyZBsNTM0gePhzsTBMeiE8KUUPlB5 awyGxW3T9NrvLGfpyyMVPC/vVq236X2tS4o6fwriTbIWYsbGmsxWfF/Q1crAFFKsp8Zv9Cz71 9ZbOF0AzPlBDBrJuYPT7tAks0r3L3N/smARjTwD/Ua6FlYo0zek54GgroF7CFHMIuRWYMMstP nru+phMPCC8uYUcCOjixlBvp5lhTOgkQ8OyAsGuJDZouSG3Ln6ThWXcB04dWFidDhg/EcOylf F2Rsa8SulqGm/wOoyCclP1zhZnevUJBfPPrmiE48zbFnr/O16IaPuKJRM/gS0HWKECg7Ywzzv /pOMkfXgsHxNvJE5JzZpDu5oENBKoPLMf3phzmlUdypr8= Recent work on raspberry-power driver showed that even the stacktrace on firmware property timeout doesn't provide enough information. So add the first tag name to the warning to be in line with a status error. Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- drivers/firmware/raspberrypi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index ac34876a97f8..18cc34987108 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c @@ -62,7 +62,6 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) ret = 0; } else { ret = -ETIMEDOUT; - WARN_ONCE(1, "Firmware transaction timeout"); } } else { dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret); @@ -125,6 +124,8 @@ int rpi_firmware_property_list(struct rpi_firmware *fw, dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n", buf[2], buf[1]); ret = -EINVAL; + } else if (ret == -ETIMEDOUT) { + WARN_ONCE(1, "Firmware transaction 0x%08x timeout", buf[2]); } dma_free_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size), buf, bus_addr); From patchwork Sun Jun 30 15:36:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808991 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 F2B331534FB; Sun, 30 Jun 2024 15:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761873; cv=none; b=boeyDKCb3azHIxauREMbjwmMeL2veejz5yYhrDyNSodyAX4IJWrZr2iHmP4Ae10/rDUFKnkdQI+8bVLRWeJsQYNRM26Lhv6UTpCq/j7emtjXlnGLckw7L2NR8ZUKmsonDUixrYtfaruHgx92JOZCiIKZTkc4o+QLF9do/Irrdw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761873; c=relaxed/simple; bh=Snna4vWkVe7VrHMEWqWpceKl+iHu1h0a2wRLIPoC/ms=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ld1TbJTE/Wk/vdxQhnFjdw8yfKP/edYRK7YY5TuBBQZrFnEx0gDSv2jvyI9iFRramQWDdFfCCerGVk0J1uOqVYN0PJddhdBpbomhFZaDBD9KufTFnZmu0xQyo/oFweaKsZEqEL8sYHo+HFtCbpP9hUQchZfPmTCH7Pb9HaZkY74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=HqwyRkuo; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="HqwyRkuo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761839; x=1720366639; i=wahrenst@gmx.net; bh=ih3wUQeDzJJqL1OWTddn6+L5ffHfGjRbiVctGOrH+AM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=HqwyRkuoE+qRsI0+bsGC/P5S+k1ntwg9R2iHcaSt4zBPCsVFbokHB3+hnVE6g+4K IZ2akmhbed3E639JN7lTkCI8LvV6gP5hN4McqVggJj69w+A6h2Z8ZItSK/070OMkn RnoD50XogkbvhLocYP7iobTjkghA84DEPBP1rY8PCRmXUJtwz6KJkZmFJEfXGtfwY jTYH0JiE2zcfI3j1LR6rm6vWJ4gICa5tkgTY77NyIORF9n2T91GjYrnFqTz2CEWwa ErloGGNjt2nxnwCGsA9Oc09dswosSEfyT9A1VvEzsMHv3LhiR1vAlGXZx0RsF7xvy k6067PpRJRfl2m7XHw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Msq2E-1s8baQ3Q64-00ufFH; Sun, 30 Jun 2024 17:37:18 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 02/11] mailbox: bcm2835: Fix timeout during suspend mode Date: Sun, 30 Jun 2024 17:36:43 +0200 Message-Id: <20240630153652.318882-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:+eS7VjvylTmd2ce6rQQXNQVZzMe2xTWuYOen4qDXgVNExxnGsfd DRRDc00e/b7oFfw1PtqTPjPGxawx4evTppOhjkFTdloe2+teyYa0P9+O3rja0FohGjpcLGf QZAa1N0wPmLsjx9sMQ69FB6QKU1teVj1vxft+Q/rpDQoxKFmkJz+s+7F54inVXqEdNkGiIO 85++VrQYxeuQAPABACv2Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:8EW4z9MobNc=;JJUIZttLMZqr1SkeydBcjP1xOPu Unjiw4xtRYZWx+8jWNS7/NFujaE44rLoAreuM9ovzixRSOHuwaiX5IvDXc/ZBWuIS4Dx+FT26 WmSSk9Xr0y7JZyOGarctrjVEZqeHcm69gMSEGwcXeQfIF9c/GkufHP17W/AeO5QqJKa7hxkpC qSTfqxiSahJcX9E4ihmngP9fID9fZMEagemuUc1EPX/exRL2YMAqqwK/D31hzCoznCsydQmrX G/ti47qlJ+GHDSD+WFTnuFtJ0EqHhfj60z3EHojwBJJ7xO34z8+9dusRBtT8h+NXARmlx6Jd/ d61c1fWDeZZ3AeiYVinXdj06R/RL56GpV+fNPpXhnKpBn95fw4/kB/MMGpjnLezLnD4QAEEiv KtTN7E4dOlumDkeQFdgBp4/9GdAqfQbQF3sD/h/7n9DV4EzjrUoZfrMV5fKZz/cj4uLeLHAMs bu7vHdtNBtQiSz2twOkSJunW3EJkENGSBcrgZuO56v/amzdzJVihzreqRTJ70L5/zNx3G3ogR aG8NJWb+/WNa/HyEySRyOzEJ5OOmG0vGEqCj6yMYi/oHCzDQG8vN4afVwj7WtQ85iea/gspxv QsOHYQLTTorNxa4lLkIVBrWi+ux5KgiEgubR87zoCcB3sFilayjUJftidRGic8eY9/jYcW2et 3qMbMpA9jqp5AhK8g0Y2uwqASCSYgCRIhsvcfhiB33cT3w1zLgkYreCSOdwlqAhKSUZ1hrYzy xtMd9N578XdAkaW1MnqYyWn7IF9Mh2/cYZy9WgweNk2Te24+8SlVCftIgk4GYxjGuKSxWqksu aLO+1f5vwa7QqijA/YXsn08LcgY7Zct48NRYwB70/OJv0= During noirq suspend phase the Raspberry Pi power driver suffer of firmware property timeouts. The reason is that the IRQ of the underlying BCM2835 mailbox is disabled and rpi_firmware_property_list() will always run into a timeout [1]. Since the VideoCore side isn't consider as a wakeup source, set the IRQF_NO_SUSPEND flag for the mailbox IRQ in order to keep it enabled during suspend-resume cycle. [1] PM: late suspend of devices complete after 1.754 msecs WARNING: CPU: 0 PID: 438 at drivers/firmware/raspberrypi.c:128 rpi_firmware_property_list+0x204/0x22c Firmware transaction 0x00028001 timeout Modules linked in: CPU: 0 PID: 438 Comm: bash Tainted: G C 6.9.3-dirty #17 Hardware name: BCM2835 Call trace: unwind_backtrace from show_stack+0x18/0x1c show_stack from dump_stack_lvl+0x34/0x44 dump_stack_lvl from __warn+0x88/0xec __warn from warn_slowpath_fmt+0x7c/0xb0 warn_slowpath_fmt from rpi_firmware_property_list+0x204/0x22c rpi_firmware_property_list from rpi_firmware_property+0x68/0x8c rpi_firmware_property from rpi_firmware_set_power+0x54/0xc0 rpi_firmware_set_power from _genpd_power_off+0xe4/0x148 _genpd_power_off from genpd_sync_power_off+0x7c/0x11c genpd_sync_power_off from genpd_finish_suspend+0xcc/0xe0 genpd_finish_suspend from dpm_run_callback+0x78/0xd0 dpm_run_callback from device_suspend_noirq+0xc0/0x238 device_suspend_noirq from dpm_suspend_noirq+0xb0/0x168 dpm_suspend_noirq from suspend_devices_and_enter+0x1b8/0x5ac suspend_devices_and_enter from pm_suspend+0x254/0x2e4 pm_suspend from state_store+0xa8/0xd4 state_store from kernfs_fop_write_iter+0x154/0x1a0 kernfs_fop_write_iter from vfs_write+0x12c/0x184 vfs_write from ksys_write+0x78/0xc0 ksys_write from ret_fast_syscall+0x0/0x54 Exception stack(0xcc93dfa8 to 0xcc93dff0) [...] PM: noirq suspend of devices complete after 3095.584 msecs Link: https://github.com/raspberrypi/firmware/issues/1894 Fixes: 0bae6af6d704 ("mailbox: Enable BCM2835 mailbox support") Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- drivers/mailbox/bcm2835-mailbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c index fbfd0202047c..ea12fb8d2401 100644 --- a/drivers/mailbox/bcm2835-mailbox.c +++ b/drivers/mailbox/bcm2835-mailbox.c @@ -145,7 +145,8 @@ static int bcm2835_mbox_probe(struct platform_device *pdev) spin_lock_init(&mbox->lock); ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0), - bcm2835_mbox_irq, 0, dev_name(dev), mbox); + bcm2835_mbox_irq, IRQF_NO_SUSPEND, dev_name(dev), + mbox); if (ret) { dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n", ret); From patchwork Sun Jun 30 15:36:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808805 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 85256282F1; Sun, 30 Jun 2024 15:37:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761872; cv=none; b=cPLbruhGvrVQoF2KhFcDoX+Wa5kK/EHj1YT5fGcIubYGps4RMwdAN4n4BP7dQpG+9EWDcz7wwigDC1ds8DlyVuhBXy8JVN8CgMDaHi7bDjVd14X06lSOj6jagTZ8OeF3JlBA6MrrUuzsxglgyydiUUYTnhfXkYLU55rNPt9HTWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761872; c=relaxed/simple; bh=BSj48tqmwm05Ljg1q373LCH2MRpwkN2xpcXLoYF9JBk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iGv5urRlkNl1iYh/pCpv1y4uHXh3xe+37yDWRzpBXcQBSLsAMT6SKmyYBiY15A1uNJmeOJMIKB6RNNfX/9pPSwsUftsnxwxdX3OpO+KNlAB77pqPvxfouoFEzMQ0BoYCaJUeXqQf7Ljrrs/4VIHihfB0CUl2Lt3gVF6jEXCcNQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=QvvW/ybf; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="QvvW/ybf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761840; x=1720366640; i=wahrenst@gmx.net; bh=y0qOLaYt6Eo8pJE0miDoGlJ+NVS4slEP6icBdDJRzuc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=QvvW/ybf2mOaJVc47VoFjn+kLT6bKRPFOjLl0FDbezZaLxxyN6lLxLjXyQ07vuCi DCfeBS1pvGZLmG0PpLkxBjT9CpN+nxV0h0FdKJya1xZ/EMjYi9fGZUmowOW7NAkvJ JlYImhGuYqgtad8Zro9iUE2ZkUrdglkWXry3b5D43cbUDnmlrQW02s24sRulFc6NC IeRs47HrkkjFhVuAeae4bh0cpndAzSjpM6wLcRDXnFuguJDvI+MkF/mKPPFQmABqN mI9ve3qe/83QzeNqggYw7sdX+mNht9ysFqdkbdvpivRv+xwAvX4Kf30xzjynSLN/S 38Q+ymP3RWGOTWT1UQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbirE-1rsj7x3VPS-00bUUz; Sun, 30 Jun 2024 17:37:19 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 03/11] pmdomain: raspberrypi-power: Adjust packet definition Date: Sun, 30 Jun 2024 17:36:44 +0200 Message-Id: <20240630153652.318882-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:QqYv8SsOHT/MdLbf9Bg/MkzNBJG3Ti02c5AdTTzhzh8KgfY/TO6 3GFk7ubmP9O8Y4OUQ9hmMPTYH1NRskbpJDnJPWbArtxybb4hoSw1mpWG+0YoPbMXehp9GeM FWTieW1h9rm3rwusEyK+2Xp4MZ9ZriuTi1lrNJ9r3ybTnlFX/yDh1vNGShEmg5ofsX/3WLN ARP1dJaV7XPPYz/YxVdBA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:NDh8fTVKp4k=;hNyq0VO06cMK9NCcVctv1X4zGj1 Lsa76eLuUXzK+u19YqKuQtSsZ9kqIVkE8/Npmfc/Cdl9bkk3QYcpzkivL5eYKfSUPcSeP2p24 73kDPH82x8Dbj1Vvev/dzZgGZAgE3A1DAC7Nf0+liOt3Hubi9kVQY9J89swAXtoc35WhbEG5e tSw7SI386FITof9+BS1m1D0HA0Q4tMRrIhLsWCcWgBOHQ9EZhodD87sSXzD84+TPbROMh9wv9 xoFkqGdj4s4rjaEhMp1lZFJZ+JysTPugwKRUzLD0lJQW4ru8Z6VZfzZ+PejfrwzmEXZRkrD0m Jimeo8Qr7/SWJS2lRRW8lHcKhYAVe0gxnYC+tqerlwyF+I9TXVPuNeSqAVKKj02gZ6lXcbAT1 w6iLzP9fdp7VAsLEROx041KZeIeFKnvA1ZeFc1PLpvTf3ts1gj59fDp0pEW5Iy0e8yISqEFSY mQsi3m3HPqgZZkzQeX8tkILdQaTznSz9KHL/3eupcNFHA2zXZL/5p8IZGvBvZFn61IBvp+3V1 QEMbECsb688qUCD5tqoM2ouE7sHKc4g8QjSSBwDmnxjQ2/41yeabJR3cVd5eeqHV1g7duEfMe q/N7QBkoUFpnIbRzMUatQ1DQvd7oB8DjSpVzPuXQ83C6bkZcvwXRJ6kJGH45f3fP3ih7Ur0L4 XNwTSK/DzBhqL1fm6BBvmNjfQ/7AYoFfKBqZYB/mly47QGbA9gw5sPxTYojuGMxIrn/Bi/v/i IyE3eCsF5M1wieNgX3WDPueQ8ReTfa0NS96c8YbHD0wjUAktGze0O2eGVMiU0i/eVBmrIqIdX bUCT9+V4eIVDB7MCPndCD9+T82xuMpVvtwNnoODyJupVQ= According to the official Mailbox property interface the second part of RPI_FIRMWARE_SET_POWER_STATE ( and so on ...) is named state because it represent u32 flags and just the lowest bit is for on/off. So rename it to align with documentation and prepare the driver for further changes. Link: https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- drivers/pmdomain/bcm/raspberrypi-power.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.34.1 diff --git a/drivers/pmdomain/bcm/raspberrypi-power.c b/drivers/pmdomain/bcm/raspberrypi-power.c index 06196ebfe03b..39d9a52200c3 100644 --- a/drivers/pmdomain/bcm/raspberrypi-power.c +++ b/drivers/pmdomain/bcm/raspberrypi-power.c @@ -41,7 +41,7 @@ struct rpi_power_domains { */ struct rpi_power_domain_packet { u32 domain; - u32 on; + u32 state; }; /* @@ -53,7 +53,7 @@ static int rpi_firmware_set_power(struct rpi_power_domain *rpi_domain, bool on) struct rpi_power_domain_packet packet; packet.domain = rpi_domain->domain; - packet.on = on; + packet.state = on; return rpi_firmware_property(rpi_domain->fw, rpi_domain->old_interface ? RPI_FIRMWARE_SET_POWER_STATE : @@ -142,13 +142,13 @@ rpi_has_new_domain_support(struct rpi_power_domains *rpi_domains) int ret; packet.domain = RPI_POWER_DOMAIN_ARM; - packet.on = ~0; + packet.state = ~0; ret = rpi_firmware_property(rpi_domains->fw, RPI_FIRMWARE_GET_DOMAIN_STATE, &packet, sizeof(packet)); - return ret == 0 && packet.on != ~0; + return ret == 0 && packet.state != ~0; } static int rpi_power_probe(struct platform_device *pdev) From patchwork Sun Jun 30 15:36:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808990 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 E047515383E; Sun, 30 Jun 2024 15:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761874; cv=none; b=g9ch/67kYs3eSB1s3cn7jro1tfrnBScqc8lTDf7gH12s55SRdJxNIjtKce1nI6b89VP2S3bdGfl/i+QfBnt6LM+uNVTrDNTymjyM3tBozNr2XXjff3cV89H27mN6/0cnG2flhcqjWFFplAag4Z9YNnwKv0IRGeAJ77Nkvg+muns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761874; c=relaxed/simple; bh=OepjnN1m7XIniciruK8E2vJ6wGJGpCI6r606OxLFd24=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l4Bp0Paw9E9uGsWJvulRJQB/jAeqWoq0WSw5kP4Ut9L0uwYu82iAoivLFJatR16eBo25/QuX2zjibpNTaIUINyYy+VgwmSQM2ocs6Jw991IWIX8x908SdAer4RcjiS23b6iTeBK7cA4RnHnciAqhOdddRjUdrunjMm+alWR8Zhg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=o7ZIFkdy; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="o7ZIFkdy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761840; x=1720366640; i=wahrenst@gmx.net; bh=uvy/JYKDHmXcPICPfORiHDhkAZe5s5Om1p3LDeO8diw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=o7ZIFkdyeolSFgsqSlg9F/907y+3/o7oltU/Jq7EwFbSxRgN9WmwgYBH7zyUedaA iX5zayU7f5hw1XFRSfb9dJzB2C4L0atfWCnUIEfmZHGbb7YnrQFDYKThhhlyaWmDX Zfe4+6HdzhCMfMgdM6bqCm/DumILbrYhN3daXBiqKp2A2fWg0lNSV/qWv8daZ+Wxf 1XS3snIsP2fA4YDE7wBWZMQfnUC9/vmP3TFSBoZEw2KrK5q2dJasPZNgW1j8gSm8v GEq5qLwVKmGWYqBPnG02Nwc42bd07SX5Zt7eZERafXerVIstRn862hdo4gu4rjLQt 9A/c57oZjPZ1k0BmJg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MdvmO-1rqXH42uNa-00ZIdt; Sun, 30 Jun 2024 17:37:20 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 04/11] pmdomain: raspberrypi-power: Avoid powering down USB Date: Sun, 30 Jun 2024 17:36:45 +0200 Message-Id: <20240630153652.318882-5-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:22tg+yWWqKf6rCi94aIzD/RkT7pXmbRAAhSxwf6W8WcCzyNMjbd j47KQebfJCVLSl1XFpvwPcIB8kmB6vxytQOXHOoKX8vpukqcVyRvtoMxZctNIgUXZrZsbyP M1Ez1s8XIAFhhBqA7HoCa2qTcc9wcGRMyyFUoiMebKnLHrL9JQpT3spS1oOrMAtG46pk3fq T3JonfyI1KZaJXlZvgoog== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:o0N5jBQm4iM=;q+71ifQ2Zv2GDZeVPGzKI9bBQMg ITd5Q5iGfSSBWp1p+vKU/AGRKQRK0/1CRitQt627JVfEC+5K6pRuadGo6eJOMsKAtbFZqNVeQ lhOHahQLH8rAycR2oLJcj0QWrzH5OOQU7p5oHeG7WHkQUjEV7W2HoPpZtw32Wv8AsteukZPvG a6wu0r60xiYh3Lam5CeGSMxW7GhxYmMT2zDlu7YJUDRmUcEHSBDoUgHZ+y7dTSQexufltzMTL emG8cSNkyd+S8kvewoKGpWsxttU/+FVoim/lSrB4Mm/mPkQD8FB8IcE0Ya+AJFZ9WW06WkfY1 9Cm+rrfNlrIs3Q6DR5Q3G91yw2KJBgfJlu6bznnvx/y8FmfMXIN5Ygq4lr6UdN4ikQrc5H1xi PMGylNcIWhchhU0R+n7gFWY0CqlJ4uYg64gukNxTkjQBTj0yCYl3ZKNsFejBbArpGOl80JJh6 5L5kNRFt2yD8M/OTHGO+AuxATLHgDbkr564L9MOXV1jEXJQF9F/mdQnumfsiG1HjsltqT9qDE 4o/QkeaB4AINfhLyW3lHskid4rPKLH+PosKU4BEUgu6XKT2Y9tPCPifMB/EKQ/Rdy+qDeLl+t 9yrd8eQqAUTSCoxynVkqNmNB4+q7CqSg4EFEvJlYPoVy6BSGJREeU0NBCl9HrvMCCwxfV6sgK /m8zFFKSppQdn1yn07r0fSXPNCxYYRMfXHEPNr0WzFarq3I+ceGxHfAn81QWO72P87aBTA314 o0pgOZ6eaWF/eBiPrBqPlKePK0OPlurpagJ9qr/Wbgr6sxEX75mWLGZr2biwlnyHRmz4fUAz5 tV4WK6UkzNRqhEgrwXuILugRk3uih7RHVUhbDt44Wg690= During supend to idle any request to power off the USB domain leads to a timeout. As a temporary workaround don't register the relevant power off handler. Link: https://github.com/raspberrypi/firmware/issues/1894 Signed-off-by: Stefan Wahren --- drivers/pmdomain/bcm/raspberrypi-power.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/pmdomain/bcm/raspberrypi-power.c b/drivers/pmdomain/bcm/raspberrypi-power.c index 39d9a52200c3..3e7b84006acc 100644 --- a/drivers/pmdomain/bcm/raspberrypi-power.c +++ b/drivers/pmdomain/bcm/raspberrypi-power.c @@ -86,7 +86,14 @@ static void rpi_common_init_power_domain(struct rpi_power_domains *rpi_domains, dom->base.name = name; dom->base.power_on = rpi_domain_on; - dom->base.power_off = rpi_domain_off; + + /* + * During supend to idle any request to power off the USB domain + * leads to a timeout. As a temporary workaround don't register + * the relevant power off handler. + */ + if (strcmp("USB", name)) + dom->base.power_off = rpi_domain_off; /* * Treat all power domains as off at boot. From patchwork Sun Jun 30 15:36:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808989 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 A75EA282F1; Sun, 30 Jun 2024 15:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761875; cv=none; b=V+jN1CWhpDh3WYV3xPr/L5bLAmFKugDyq3dp4yDZiiN1Uuq7iLtBmmZhAvSIWEl5fOhOrjSsUQLY5/4fb5QnJfrC61HXx1/rdHkZow6yyqN/Dged8qzSxrccmXLasU76kKANq2QEzMkB4pdrc1lr7ObBbFVlxZ5y+u9gdp7RWNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761875; c=relaxed/simple; bh=m6tWh5VFeUVuRWlJSVFGRTLpHvqDFP6glRqtCEMizSg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mlNb7rzYRRkl1A4esF2J7MibzLytDQTcPe4luC+rEN7IhpqgaIPcNA9w16XqAQOCuXZLr+FI6Ycm587YQj2SsFdyZrbdToDx2Fgz6a1oQydghuaxZi8DZkaIV8oEhXvDhJKH2dMXut/wsMR+gegvjInYaKYcUIN+ei4PJzkn+6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=X7aik6t4; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="X7aik6t4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761841; x=1720366641; i=wahrenst@gmx.net; bh=4r6Hb3gvtnU8vTL9qCacD/NYc/kZfSz2IGu4cIiUycI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=X7aik6t4uOtmi1FCRIFUupfyyTLgagoIq7hhRty+/4yPBBwYYNy6kibUV/P4dDvz 3DVT2dWV3Fhl14S5VlVhZQUif/I4o6x6S57hYdb0qt02WXNTjesd/uu/bHbMVLnoz jjZ84GvzEi7gry6K4jLAVo5DRtrhMBtbI1JwGLYhsEGV5EqmK3Fumsoek082N/5QT POtPk+3tLrYIRnSZpjRekiAF8bXqcNtljOYH4OEScH0zg1Ct2y6yA9msU7RVuN4dJ YVrjYD4uboyoTthXotFaHDOrWOtwkjuTmcaHuUU/OvzyFXnruZ0cdj+mr8SZQRXYW 7dPtbj18gvi3vRpoCA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtOGa-1sAG1H2vzq-00t1Ll; Sun, 30 Jun 2024 17:37:21 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 05/11] irqchip/bcm2835: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND Date: Sun, 30 Jun 2024 17:36:46 +0200 Message-Id: <20240630153652.318882-6-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:gG2zMh+5jv70iXOh5vFMJHOoLe5umeeOapkAwXLaixUOKZ+w9QA jPqoLpaAOuyJxVXORl0vegF1SRPmg4dQxiGU8L7EH9QB/4Iz219fGjQXz8DwSGSKM66yRXr vnStIUjEtjuzJgL5OnFe2GRajHR2k6x/xHH4MarDtqWy6tVBMieMywmH14JIEdqGeNs3PgU XqknQyYVH7TRn7AyZjuHw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:kq6aJGVKb94=;BpeGVYzb1ZqeBqbopRubsnmH5ax bfoCiueu4CjcjLXZqr3WtEX2tERwkAFYxJP/aQQQ1ojQA3+bsxkQoAH/ojzLQIOHuLKP4XPAc PVgiBTqos9NLSBi+/Xv0YpPxTvJGupp//SFJjyqj4Q7FG2tkr1mG2Zlr0vJlUZSXQgZEK9vWW aEKsjAfBXct9DD+JcXevmysY/sO5N12Perafl3iY1mVumAySBHh0xOv1wrN4d5eavdYi8D0nq VdsG4kfE6nx3o3pkcOFo4REsD+nIXEW3kiMPyzof0uk6e+rA0xJVxe2AgPkmcCfzGIwXmmzow KgWcg+s29ZVRXJjDxEvxK3LPWrvWVfrRA98sq876H7KB2rkqEmfMsnWVQnCQFvN1uS+qooUzJ L8iiBIWRQ3KKNvIyX6yW+DcOrh+qz2oh1JuixG68LlNouCGAPPl5FlTdW6zbxqXicYhZvsJ7C q/n6LSVxb6bxweJlN2HLWEIEhBI57OEvPgQUBjIFslAP/2xVbBOqYsYTo7bXWS8mEeKyceJbh rmEWYJ8Yl7tEZZL4JlPyO22is1EbNRtKO1pcwLJ0X3Igb22rk9e4GbwUk3STI9Wj/6DLIQAmq WsqlUXHWR+1/rj0KTlQeLszN2nzIkuLQBdiUxkjqJiRw2DPsw9jl2HUn/es64EDRjVI+oL7Dh XzBhIbs7rYrrcC0zKHr1C67qXW71zhy6ZGGgYWq2kpIAhQa/lGQ0xAqeVD0dti8yme6Nxr4NF sEm1K1J3fThW8EXVaHpon1QQO+XAThqSD1IiUIslRPDG5I4OUmnWJqKR80tKncoNLLLqazLfW +F/fKvsXndGa6dgyAok+CecJ2A2ytKP4v/QEeRwH6wEaA= The BCM2835 ARMCTRL interrupt controller doesn't provide any facility to configure the wakeup sources. That's the reason why this implementation lacks the irq_set_wake implementation. But this prevent us from properly entering power management states like "suspend to idle". So enable the flags IRQCHIP_SKIP_SET_WAKE and IRQCHIP_MASK_ON_SUSPEND to let the irqchip core allows and handles the power management. Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- drivers/irqchip/irq-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c index e94e2882286c..6c20604c2242 100644 --- a/drivers/irqchip/irq-bcm2835.c +++ b/drivers/irqchip/irq-bcm2835.c @@ -102,7 +102,9 @@ static void armctrl_unmask_irq(struct irq_data *d) static struct irq_chip armctrl_chip = { .name = "ARMCTRL-level", .irq_mask = armctrl_mask_irq, - .irq_unmask = armctrl_unmask_irq + .irq_unmask = armctrl_unmask_irq, + .flags = IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SKIP_SET_WAKE, }; static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr, From patchwork Sun Jun 30 15:36:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808804 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 99813152E06; Sun, 30 Jun 2024 15:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761873; cv=none; b=kvC4tiGRxnbJw+r9drpe1xsRp2fH1mG/xhsRantfrvWmb24Ww1QrEjNNPWCpb6YDIELCxrSaXll51jmzK3Sm41+eP55fzlIU3sUmKeVyVBoiPXP2/fHKvigZIM6bwgDhRMuJxzWXQJgtdvWfjVbqd4UgSjyh/pcL3RPJfRAq0MY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761873; c=relaxed/simple; bh=3Z/M5cg/J/IA9+p9ob+z7Y78E58DUBaEpY5pEblPWjk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UkdQelP9OmMA6RDQkLGu4oRleB6GdXXhvQrslqjrT4g3+R9XDcvWXpHS3dZQM5zU0OfksMMHBks8eoiI+t4O+XkaEYMyrvWiUoypNlCct3pJ73Up1tKteHAvP4IqvMklQ5HI4/jvrJ1vIJY/K2Y4o+LijzkNFNfvW4vDCeRnsFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=qGzzQJuB; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="qGzzQJuB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761843; x=1720366643; i=wahrenst@gmx.net; bh=g8bLwDV9vv1b9MjKzssmd/pW+2/RUfnLBRsyg8CTzsY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=qGzzQJuBaoggAKtGrq8PdHltRSA+ZJEhsqNuVhNzZ7MQcWP8si8dNNOFewgGaY2V gWpQ00aFkvrLUmT0LBVQ+F4yCN13o4Tz1Y3UKNJRDjdCjSSsDZC1BH735Kai3h3w+ rk3PMPpUEgDIQiSkPhkC/hfNCOTtFzDvlUR3Z4cA7L/D5JGH2uW7bOrJY0vb4+XLA V7qg7FixqNeYnMJG2D8YBiRu+HVuQctHjVzNFxK/eVuJn7GwAAMMiwKjrDHJ4DKbC GYlvj5QwZoXr53rdnD7ZeRDj2Kjv5xYcittddBB3CkdGU6ajJ3ppiiMAKI3tONvW1 92nnXAbToM6oKfs0sg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MoO2E-1s4DqU34eG-00qLoN; Sun, 30 Jun 2024 17:37:22 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 06/11] drm/vc4: hdmi: Handle error case of pm_runtime_resume_and_get Date: Sun, 30 Jun 2024 17:36:47 +0200 Message-Id: <20240630153652.318882-7-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:o69+hBbDReia1Doo4Ua3Ap4tjIE5FyVFPvweuwOPKrNdWE2Eyje By+/XWKIkUjXGa4HdY4rDd0THstR9kLGO9WtHySi849Aq8O8XA0QTYI1kuLhjGrc2pDXAxV Rnq+qCbeXhbq0oaML/vuatyAXa3F2q54Y4s7gx1Ss/AqUnBGUfUaCMExkbfCYl2qMowQT6N WX1CXhGE/fU4mw+tKg2WQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:NDt+LCOQYCA=;vGODWVysfJmV2IQbHHklMS9vJx+ SH7O3KrTaP3EhoIqV9fGlnhmH1+b2Vsd5E8JUkyUXWNuYj49dgZEmD3sVKNIfy0rGA+BnSlWw bohaFfTzLm2qMSEk7ZVuTxI2/4Lj9Turh4sXwHzZXbDKwGryOu9G4Wn1K6nM9DLGWI8fYKni+ JB1iC8/9Z9V7TRVxIflCDnThLTRzTaTdD5fo2j5y7gt+B45duZ31yTl/TNDteYbb60A93rUFH zOCUwgZDoeXomGbFRSmQMWoGsvSW+BFrctwUI2hb5w09h1HmDv6/y3e489MdKlzdIInBbgjXM t1mQaOl9TK5roixBzDXdkfI6mTKUyVKe94lF8ZFhhvhMSvyduUyQ4rD597w4HxpL1b4/EuhK7 QuuYuAaaOwjes5WRORS7XYJ2mz3ESub7m2b0usrX60HKbN5rwnB2LRg5OKYEcSsiEw9BLyC+6 Er/CwjWf+DKk46xsVdblADf8B69FeIzmorRUxV7Er69s3IFCsqVXdd0BqdmR7dYIdVSlUsdb7 iHmz7H2iOPnXWNjGivMU1ywfwOhhXj60wPm+KyPeb18Zsu6TFstx8ygeAFs/LT2AY0JYsQnoT W9rJTjSXavcMUUJv1YKPHKrEimrOvJaTexrnQe0FjRthC/A+CS18vSrvYaDllq2ORmwb5S8iW Vuc5ROWWSMRUMA6svk6Sr/jXiTvbHgGt3snp/5FxNbj6wQggN2s8MMOmirkmiASRY4qwkbZXh KnidWOdaabSuyzvjoHdtonCXhTOf0CLtU/4ma2QsW25f1YffG/OGbbQUdgfgHhGOXF54/yu92 pXmAaYiNa1gDdD9DzH8TFRt8ve4lC2EZI2XvW8a9g4ZVQ= The commit 0f5251339eda ("drm/vc4: hdmi: Make sure the controller is powered in detect") introduced the necessary power management handling to avoid register access while controller is powered down. Unfortunately it just print a warning if pm_runtime_resume_and_get() fails and proceed anyway. This could happen during suspend to idle. So we must assume it is unsafe to access the HDMI register. So bail out properly. Fixes: 0f5251339eda ("drm/vc4: hdmi: Make sure the controller is powered in detect") Signed-off-by: Stefan Wahren Reviewed-by: MaĆ­ra Canal --- drivers/gpu/drm/vc4/vc4_hdmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index d57c4a5948c8..b3a42b709718 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -429,6 +429,7 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, { struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); enum drm_connector_status status = connector_status_disconnected; + int ret; /* * NOTE: This function should really take vc4_hdmi->mutex, but @@ -441,7 +442,11 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, * the lock for now. */ - WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); + if (ret) { + DRM_ERROR("Failed to retain HDMI power domain: %d\n", ret); + return status; + } if (vc4_hdmi->hpd_gpio) { if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) From patchwork Sun Jun 30 15:36:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808803 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 6EEF0153509; Sun, 30 Jun 2024 15:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761874; cv=none; b=c0xfvw8hBJrsU1K2aBQj55tpNCq1QrIcHopZl8wdnmkeYF2UXHjXP8WJEuWt4+NlPFuFvoW7i4x4NGsY6eYyRmSXegux17Jyx+o3S222t/c13AzIWM+EyBdRH6IGdCWCXRGBaTlGWIF0Xh5ct4iD5evA/li/gaa4Zl3CI0hzmxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761874; c=relaxed/simple; bh=2zWnTrB0QP7kA65GnHCUHymZBdeqdF6gXuwowGyI+og=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=akxCzZEYaGQ1DdJ78yqg4nYulX77PfULi9PLSzg0fV889MnhrDsM1q2vwT+fxCjGGXKfrhGaA9x8JlUU3Pp08WOQX/EiWvMHBRtV9hUC7JLPj/Pnt1IhBNe9pWkGap1q6PlbjLcAVPsuTQycOM6iUQNuta7saYKa7SCwyxMzrcs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=fVdknZ5m; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="fVdknZ5m" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761843; x=1720366643; i=wahrenst@gmx.net; bh=jR2qUoYJWjo62ss14f32ABLuwKjco/WEcCrvFX1iwUQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=fVdknZ5mjA66HYdyBZ1DkGQaXT1SWXB65A7CaQGtGJCzBR3QToSHQr5r5B09qGYt G8/Po3Lt0aO6l54ZSXR+GYw8CNwgdWQ15sOcBRGnkvUULa5JXF0fUUFn+ztWmP32Q I96YP5NZoVEc5zi8sEcxwRidcCTyA63bethzXNmlmI++nnzxYAGvyLzYSOt5O66M8 rgVH6dap01enPILApRp5myHV42WB1+uWMkpiewrDSHAVMh9Q+zLenIA3zkOS9wi6K pll2eFx9a+L3JWpZVtp/4xSMG8eLecAaCm2FrBulde/nDfXTPi7thiRAaf96r22BK J62yRkV/D6ZFmn6R+w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M6Ue3-1sUF4c2wHZ-008jJu; Sun, 30 Jun 2024 17:37:23 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 07/11] drm/vc4: hdmi: Disable connector status polling during suspend Date: Sun, 30 Jun 2024 17:36:48 +0200 Message-Id: <20240630153652.318882-8-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:16Ngb9tSxp2iZwHbx5dqk16AQEKX8kLcRlkqIw9cY3Qs9QzfZno XUBl7sn846cccKtsEHGyLm7q5kzaqH90IJ8JhAqcwRSCXHyTQ/DrwFhPNE5q3XMfEO9LpX4 UqsN5Ie+oAMtdG/IpeKtp5/GiHPbugvdU8ZZkjpvdkZcCfLb8CqLsZD2odXAP2AzNekfdOR W55XynRw/dHEi6zCgg2FA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:75eQMN8yRdA=;haDMuV5WnSJ3HWguPxybuI47jn1 e4lnr87wp77Gm16QAmleCGaZxLNO8UADI6b+3GHMbw8T70H8BaaETJzGOYaSEumgQ1zAyPBHp whCKx3IaXlR99Jto1W+YBWWMoM3+gB/0CnPOGYWUvQVbCKpCPcLGkXHzoiCBnTJ8VfYyj1vOR nEFO2xKx/UB1QjUcOpBYYDPs5uQ46ufs/WEWzoVr+sJer6FHSisICR4k0aXz0YXM9ltGhm3i4 VUaupQ7XCkMHi77rpWLTFw4ZDtMt0sdQuCVH+FcWqzLSFGzidhUBg0Z9PCZw1qgsVHXo3eJsa ehOxUR4RsD7LK2DhS/HWQLfU/EYAlZRN2rqMoc/79LEGhlD38XK7QYhDLrDxZEhC4236NFFHU vQm3dqi9zkQVh6u7OWqD1lacC2Pn1n+mKANxv1oid7QjuP9QKceGByCyOHbzvHMa2bfTeToNM Ya1YjdXYiZb5supX0l4tWBuzEI5nKm419FkiGDVzYYLSsHvNI4hJQ+M6u0mwzmf/FUlzszXML 0q3ETBjs93rhiom3cv5s8OoWtHuT0IwJ2pnNMZfii+2uRvNeYZvKbsf4oVmG41A6yqU0U/vcn vy0JDfubHvUehe9EKHSXPPPBlhJbBFQjWz6YFk8fujUbLOnl+fnYR4GtPf0wIDEKDGyxfyvb/ NIhztcr86voQaj6e4oxNaTwfZvL7XizyCUsr7pnxGgcJ6ZlhorN2/YvuiYocNpWMpHGtUiCLb OQFqSCezyx/m2r67/6HWhfzcgML/FhOXYig2GJmsnjdyIK4+h9yjWKA95tnRAaUXQvmNuNRL+ Tg1HaAqYr3KYh3d5ChmNnibKOufTBfrq1wbwJKba4o7qQ= Suspend of VC4 HDMI will likely triggers a warning from vc4_hdmi_connector_detect_ctx() during poll of connector status. The power management will prevent the resume and keep the relevant power domain disabled. Since there is no reason to poll the connector status during suspend, the polling should be disabled during this. It not possible to use drm_mode_config_helper_suspend() here, because the callbacks might be called during bind phase and not all components are fully initialized. Link: https://lore.kernel.org/dri-devel/7003512d-7303-4f41-b0d6-a8af5bf8e497@gmx.net/ Signed-off-by: Stefan Wahren --- drivers/gpu/drm/vc4/vc4_hdmi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.34.1 diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index b3a42b709718..e80495cea6ac 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3106,6 +3106,13 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, static int vc4_hdmi_runtime_suspend(struct device *dev) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + struct drm_device *drm = vc4_hdmi->connector.dev; + + /* + * Don't disable polling if it was never initialized + */ + if (drm && drm->mode_config.poll_enabled) + drm_kms_helper_poll_disable(drm); clk_disable_unprepare(vc4_hdmi->hsm_clock); @@ -3115,6 +3122,7 @@ static int vc4_hdmi_runtime_suspend(struct device *dev) static int vc4_hdmi_runtime_resume(struct device *dev) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + struct drm_device *drm = vc4_hdmi->connector.dev; unsigned long __maybe_unused flags; u32 __maybe_unused value; unsigned long rate; @@ -3159,6 +3167,9 @@ static int vc4_hdmi_runtime_resume(struct device *dev) } #endif + if (drm && drm->mode_config.poll_enabled) + drm_kms_helper_poll_enable(drm); + return 0; err_disable_clk: From patchwork Sun Jun 30 15:36:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808988 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 061A0156967; Sun, 30 Jun 2024 15:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761877; cv=none; b=jpFKpnfGDrIab0QmUl411fAybccERJUpxBqBq+ysQxN/6k9GOtHG5VpJ4TDXHWwbqjPufL+BE3pTRRy62uOqMuKB0iUnBrVmqQnQgo12dKGcP0crCwNBy7hka+84P3miUwQuUC26XPdT+GcCRBY9F+Z+534pTzADVooBO/8Xrdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761877; c=relaxed/simple; bh=Z/y0IFADfKfJvFiNwnyAj1kXb+3X4rxM/FOzZQk6XVw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X7dEhntk67cEfwC9n2ElcPFdgUU2EmG3o76169GviC6EgCjrdytLpAu0lSURN/D7iQQbHXIIWYLq7N13abx9GUf5uryRZrUQIwfaFn1BIF9NMYJC4oK7wjK42qKKoHYS3ImnG8afEBooniCB4xDUlKnN89o6iRL5/uTeAHpE9ZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=Gpf1//3s; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="Gpf1//3s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761844; x=1720366644; i=wahrenst@gmx.net; bh=lCFQBeBlbmpUg9EyXUyqn5DC7Bbo3JN2mDc4pQ7TCIw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=Gpf1//3sptoh0BqAY9+K8DWuGeBmw+14AW5vGaMnqtdrUtrC60rP9HwuSjH1nEq2 tZjNmkjPkCQCVY/FwfeTawoESM8K2FlwLo2aszffrrayuQu7Rp6L8z3WrPMVEfscV aI/SuHreY7rXStZY+T+VNyIgNIJvbJrVV5fo86kgPZfwHq5KVCN8xhTF4YQyAgruF MNTtarpzEYfcKuThXAZ4QelWbD6n+1lbxJYkG51dKwPeK+ro7nEH+C9yM3P2fJXh8 FIcpAptoxrmAcTSDvQs+3GGUE4UrNB0vppZxNjumCGCLmkiYoQsY+vvAmiFLNRla1 9QYMcbfMC8rclpxwIg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MFsZ3-1seevT2qMh-00Fv84; Sun, 30 Jun 2024 17:37:24 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 08/11] usb: dwc2: debugfs: Print parameter no_clock_gating Date: Sun, 30 Jun 2024 17:36:49 +0200 Message-Id: <20240630153652.318882-9-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:Y2/ydqCyqYHWHavK5/XG4b46LsgTWvQ3AzoHTM5k/IIqoHGxAdu YmHJwmsQJKG3BiEcn/lVB63s5ODVPmRQCXvi1v/puqwcPbB9y/BglDKYBDHBcNlySv4Pux8 Aiv2WHULsE2ioRoX6rVAL9MGN7wv0b+hY9DQIVE8t7jRYaaD3R4y47BjYJtZHz3kf9g40YU kCRuybOwyGdQwQf6CYwQw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:1mr6sDBPqAY=;ZVkIx5NNUR0ZJQM95skTQK9wG9G YQ//jV7KGMQwMhiLuozF7iwuXXsavmAxKDlwYcvpTnqcCoQ4cRO7JXS8WvjpeO0CGzkH8/CeZ KVwxEH49j4t+hhkiUBoSh0Udkzx8SNT1KQg2pu/qFHDnfYsRY1t5HRznGr3/GZ1ad6gI32WII mfDwlCe1hjdKj56Peofvihz41IHFncxcDsOt9SP1pBGjqR9EnDVUJe777Xrx5bEk9Nf+jNEB8 NtQ5DAFBDZGx+31cDrhg06e59qTg7leiT67FUse0/SQWvvHBRGDSd/fniQSS3YwBs2KJxgUhT bH/YZp+tZZjUuMC5XdAXNBANuhFGAFE4YVA/eR81UBc10kVDFfH/cmBREY98OMGdbi58569/X lgsygz2Vq0ponplUSfg7M+o3YZG9zxjRhG7aUkJ3dCWPWpxREe00h2Qbd6oXLGmP0y0c3NVQO cK8eoYBXpmBm6qUhrpKYvvfQmmM5YEFCPgxNVOQydubkcppzK1MYa+bBSfvZrnODoMEvQ+GMB ArEDD2Za/Bsi5Xom854maKOkcXgySDsNHH2pPopgQJQH6jEZU/xwynvwjqFZCHdpk/uO1YM91 hrdlK8rrbRVH5vs/tVA3e3lz5jlByvi/IQ7zat3EBsVHwzeQBFr1bc+biyxd+e0RPr/aPKcil Sy9u6YyxO/gY/or8MPDKihrxH/0N7bad414NbWboObpHEd2Yvb8VP2JbXBTs1xb5rOVxGP3tD xvItjcHC7chExI5cbgLJs98U5I4t3QtKlDfUVEt4s3uXrYoGfP6/p1UVQ5307NO1sbYcrCgmc /55cQvNWI6q+ZRrzkWJCoJojDh6UMUCt3bm0ZICYtxtpk= The commit c4a0f7a6ab54 ("usb: dwc2: Skip clock gating on Samsung SoCs") introduced a parameter to skip enabling clock gating mode even the hardware platform should supports it. In order to make this more visible also print this in show parameters of debugfs. Signed-off-by: Stefan Wahren Acked-by: Minas Harutyunyan Reviewed-by: Florian Fainelli --- drivers/usb/dwc2/debugfs.c | 1 + 1 file changed, 1 insertion(+) -- 2.34.1 diff --git a/drivers/usb/dwc2/debugfs.c b/drivers/usb/dwc2/debugfs.c index 7c82ab590401..3116ac72747f 100644 --- a/drivers/usb/dwc2/debugfs.c +++ b/drivers/usb/dwc2/debugfs.c @@ -702,6 +702,7 @@ static int params_show(struct seq_file *seq, void *v) print_param(seq, p, uframe_sched); print_param(seq, p, external_id_pin_ctl); print_param(seq, p, power_down); + print_param(seq, p, no_clock_gating); print_param(seq, p, lpm); print_param(seq, p, lpm_clock_gating); print_param(seq, p, besl); From patchwork Sun Jun 30 15:36:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808801 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 858E6155739; Sun, 30 Jun 2024 15:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761876; cv=none; b=Fe5n1lojfrT4WIyamxAe4Jj8jCdhdpgbdMumv7L9i5j5Vnvtab3vd2TAvXU3Do9QjCiaeY7xIv/SxkBsMb/rRxpxaNf5BYbJfMqsPH1GGiFEqIWLaSOxv/ZqfqJc56PpgdIUPJR9pkfL99KFAuglVLYzZBTuNchX78UWa1aKN4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719761876; c=relaxed/simple; bh=htFaQCpdyD71n4pNPL8ZQEsGXm5kTTzIwWkMkp+T2HM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J+zzIXfmQ0U6K0A+ZwgBhhGUBeC/efKkLUZtVFWLqQKjSjz+c8OOpfMxwl9m9M5QK88+f8zfpFsTmjmVJY3kWkt+r5YKmiY1C7+8E3cBR4IEy7ADB8B2COlalTiE1TPFXAUGOeLYAzhgGCZWev038tm9RLMAydy1yX7BHAiTV+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=OAM7af0S; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="OAM7af0S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719761845; x=1720366645; i=wahrenst@gmx.net; bh=P9b6UEReDpU77Jd10Cj2qEnGBLfdX01BBvJz6wX6RDo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=OAM7af0SnCS1ZARK4RA4CkYk6exCAufqxsQsCgLR3fzwetYAHxX8NmH/xwsSHH52 fn1X+6k5daXF2o1dCVvJQcbRKkBqB9dCRlPuxjhk4WWwPfkESO8kqXJQGd5/e+Yea daEuJ0eMROYKxns6+GMiGnSo8oeUg63Xb80p1qAWsD+UaUL0OQ5vgEcr/v6NvqRND ir43c+JlVVjWo4dAVHoaJ9y77syEzO06rQGJ3d0mrWPETWcKuseoLBKc+qZPFETen q7UsPqvgIG1dtXKZ3gzaFHF2ghr6cyavqKQWFVWFrYsSvc2NhQZ8RTZPj78V/oL87 qifxeKiHGa1paw5yYg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MGz1V-1sbMbW2khX-00EpCe; Sun, 30 Jun 2024 17:37:25 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 09/11] usb: dwc2: Skip clock gating on Broadcom SoCs Date: Sun, 30 Jun 2024 17:36:50 +0200 Message-Id: <20240630153652.318882-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:pI9X3saIj1rv3u8rkYVt5Z2mn5Afvx+C+DmVZ9+PgFr6tyA0tFT f2di+bJIcWOzMogkgezYjB2heHLGJEe8mitLQMHh9hvvizU9Hub7dsnOj4PIXEncKhn0sOG qFyhE2FzXXiMAY4c3kL70pxuCzZlNgA5sOSR1b7MqrlnsWwpJm+DpDqU60tldbwLzD8KCtz q+ZBsE8ao6B1eNETfpP5Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:r+xf4Y+CXp8=;dAxB9no4yNcRmM23mLNbkn4eZo0 gJCfajaBuonOEWkB8tcs8u29OtY9HzcchKLFC269zRzIh6A2oqV3NtDMHpkfbEANkUhMm1Qcb 179qo1P8aCyoO/ZyOP3ZYJajVnrKo8+HKOMH6JbZxKE/sd7oqzPwf9icHwS8tpiEGs/qhnWYx cOtF3xjeahz5zE56PFH9Vp2Pmq7m1oohwh6A8exJYoNuVmcucmwcRc8rgo6cTcET2UH+s+JC9 Rlqs9/AsBxgLNy4sRWcZFVpQ5EKrrlLu7VP+JuCdBhPHpkr4kdbFfpRyOjqUD8FuJkacwdble v8N11NQXp2AaMNUB+f1IDYAzDywiNcJGZedSkfMTWJJYdUEZL4eB4RevvWZ8/nJ/o0uAFrp2M MtHBholgzoF2F5MMKzaFF7HLSmUZcC/iRa3ZQkXEyXk+8G1u5EjBHuqJ4cVOC+NtYHusYEjVt mVMr0/pC7dBf/dhJCvJ8KcN+T7XgVKG03fpRzG3il+g66/V/NBjECOhZQ1gythLP+ara/KBNA svb7saNx+lZ/Mj3ieDkFFbEaJ0MGVa7vQXozZpJ6Ta03U7nsrJVPaqIfEr/ykkq7h/DlFKPYt n43yd5fgYkm4l1a1JOM3WoM9kgTecGab53+kFTRW7z8yrhAEceUbBjvivjLK4kyM1Pkb2RgyK P/VcJyHNUyDtZ31jvnVzDzUaksEjHH26JoYQ6SYmoKnL/4ceTi/s/wDDtGDyF3/gGPiVWDj3Z n41gLwUZ869NfKYPmkpKfJjYec8zWnthXdSKxtJPCUU+sbNSxWlnBffvZl2zGz6pFOqwebFbp MqDNR8LlYtDj15hOgxvhLT5CCquAP/IoO4r60kKWmcFpE= On resume of the Raspberry Pi the dwc2 driver fails to enable HCD_FLAG_HW_ACCESSIBLE before re-enabling the interrupts. This causes a situation where both handler ignore a incoming port interrupt and force the upper layers to disable the dwc2 interrupt line. This leaves the USB interface in a unusable state: irq 66: nobody cared (try booting with the "irqpoll" option) CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 6.10.0-rc3 Hardware name: BCM2835 Call trace: unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x50/0x64 dump_stack_lvl from __report_bad_irq+0x38/0xc0 __report_bad_irq from note_interrupt+0x2ac/0x2f4 note_interrupt from handle_irq_event+0x88/0x8c handle_irq_event from handle_level_irq+0xb4/0x1ac handle_level_irq from generic_handle_domain_irq+0x24/0x34 generic_handle_domain_irq from bcm2836_chained_handle_irq+0x24/0x28 bcm2836_chained_handle_irq from generic_handle_domain_irq+0x24/0x34 generic_handle_domain_irq from generic_handle_arch_irq+0x34/0x44 generic_handle_arch_irq from __irq_svc+0x88/0xb0 Exception stack(0xc1b01f20 to 0xc1b01f68) 1f20: 0005c0d4 00000001 00000000 00000000 c1b09780 c1d6b32c c1b04e54 c1a5eae8 1f40: c1b04e90 00000000 00000000 00000000 c1d6a8a0 c1b01f70 c11d2da8 c11d4160 1f60: 60000013 ffffffff __irq_svc from default_idle_call+0x1c/0xb0 default_idle_call from do_idle+0x21c/0x284 do_idle from cpu_startup_entry+0x28/0x2c cpu_startup_entry from kernel_init+0x0/0x12c handlers: [] dwc2_handle_common_intr [<75cd278b>] usb_hcd_irq Disabling IRQ #66 Disabling clock gatling workaround this issue. Fixes: 0112b7ce68ea ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.") Link: https://lore.kernel.org/linux-usb/3fd0c2fb-4752-45b3-94eb-42352703e1fd@gmx.net/T/ Signed-off-by: Stefan Wahren Acked-by: Minas Harutyunyan --- drivers/usb/dwc2/params.c | 1 + 1 file changed, 1 insertion(+) -- 2.34.1 diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 5a1500d0bdd9..66580de52882 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -23,6 +23,7 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg) p->max_transfer_size = 65535; p->max_packet_count = 511; p->ahbcfg = 0x10; + p->no_clock_gating = true; } static void dwc2_set_his_params(struct dwc2_hsotg *hsotg) From patchwork Sun Jun 30 16:53:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808987 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 5842413CFB8; Sun, 30 Jun 2024 16:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719766442; cv=none; b=KbzySNF46Z8iiIitffMi+0+klZSaTUff/zO2A/xOM9COaZJf1EyTTiUUThCN+msIrkV/Hb0mGA4SROPX6KqTE2q6qKfCiO/ptTdYMmp9FojTuYQClEudD1VcCzSgeI2aiDRRymztPba9Fbe4fl9zG7kv9VUiTafqAgkVCFVCk6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719766442; c=relaxed/simple; bh=IDz8sfG2rJ2XDtyV9KlADYXg9I6EzDZ4IZkpSVQew7o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IDDWRlrdtwEG1tQ9hMm36bTL6nHkjVQ9cbHFPUoA4ZCTAa7pD1i7XnyOHw3M1p8kqoVP6zVpw9Gc5JdqScNCmt9znHQugd1sj6eSinQ6eU34QBczAV9TIZtJoJTegpEUJHYebCQjWtxmtcuPJ1LqtBFO8QAHGYkyZcnwC1zjTbI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=co+khgJL; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="co+khgJL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719766404; x=1720371204; i=wahrenst@gmx.net; bh=x6X/JBGaDbXhfz2zCdgdBC9Xbw9KpBWry+heZSf/vYw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=co+khgJLL3I35VMjh/AKMVnmw3JPmoSsHTQRnoawNenZfKo4FyiEzMwGWe1Sy5ww hR6AIrhO3oh4hFkXrLHHIVlDKTHomfo+fUc9AghNyCeJ9vhJOlIY+y4cEWcsYXoKN jJbugRnYLl3ly/aZKQDKzTEYtRCDlHfOntQcuuyl6f5rbhfgOLi8pvDqJomIT+rIN rFJ0n/l1jY4QzzL+QQQYkR7VMcTigBfxsxmffxDjXVcLlK1pXB6B2Ap5yPDs1pt6O gxTquMIZsvzELOGK3xlLE2qJiFGQqMyLJs8dMXlWkq+zpeE2nf/ZQnNSWhPr3O/q8 73J0RYsy35yFwRUTzw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M3lcJ-1sOEv12IFf-002P3U; Sun, 30 Jun 2024 18:53:24 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH RFT 10/11] serial: 8250_bcm2835aux: add PM suspend/resume support Date: Sun, 30 Jun 2024 18:53:04 +0200 Message-Id: <20240630165304.323095-1-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:4gFUJsAqzBEe0Ecm192F+EOC5bzkfojzIoxo17BhwwQMZSUayGA aoHR3ququVF0cAZgp0qNUz+67nJI3An977H1iEQn0dvfqUUSZAkNJd0Cge4khmOjgHPODAW 3fxZ+TBPZSHDWvrKdOb4YOn8Fkz6nb9woQGsYOtRjr1UmI7SgLZLatvKan1jOGJjZvJFbI6 7huOwk+6E0lfTHXsikFhg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:RC+tt6aEpOI=;1EW8hiWdl4BGJhJ4wQfv5AMukc5 ZEeVMD/okghGbmPzVHi0APqS3iWRMF1wKmhloRCbelkkAJn1Sm/Vvn98lJFrOzCO8urP9Ygwf gTGkYWjIAoUo8NoZxBxrnGWJ0joi+LCicWuTtMarXVr9yCRFBjr+kbHObjc/yjO+7UKcTz3WZ 0py2ifYsEsJaE/bLO/eRuYgiAQOP6nNhG0gb0vuEwzd5k7VA+lZ0FmqdBtIj5CAI4KqwGpxSb Jyfyb6rmrTvDA9fC59hAa8gIXjwklPT087BiLt5G4Fgv5w1vimzAwe/IoKJbOCSSzGKUhnvVJ XHyjbnG5Pd8CEJzi7YHIxwgNJj57kAYuki3Xkdij4zXwkXmWFKaCPpL/SJJ7gkJAsnGQgKmkF poizMB35wx89493MKT/E+8eV4pOz2sVuvfjBHdNtc1SeeMnVCYrzw+2TIm1ZpTTRixdX4pbuE VUZQl2RvlJXPD1tjKhRxKik0gCjl/T5Hk1YBLRr1c9fwlU0pXl3VhEGLxbcVNEJruDnfezGtQ iqOhszlDM/1ldUPLzejAS8R5LT5rqeIu9FYPuU1okh2BR9ub3faug8JzYAG6IsomotgU2Zmpd ATf0m6AoTiMqz1pzNBy4tvJAdviKXJxbJT56dx1kr+uMEGFpvVI4j2+wce8zFCDtlv/csnJ4h eKP62EVipAK/KdjNrNwXfDPhTxngwEcTpbIrC+pvGnEjeXWTPjYQcTniJfZZ+dDMVzN9cupV4 54a+7MHBLu69HLRnHUiGt6VepISknaHu2CTqbxPxaV8jqRQgv6KmwFuGunm9LdtKqTKcvsbW8 2ku5nTDp+OHzRjSaFTyFL3dYB3fj1Xy2+wJgUs1cWGQnE= This adds suspend/resume support for the 8250_bcm2835aux driver to provide power management support on attached devices. Signed-off-by: Stefan Wahren --- Since i don't have a RS485 setup, any test feedback would be great. drivers/tty/serial/8250/8250_bcm2835aux.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.34.1 diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c index 121a5ce86050..cccd2a09cb6f 100644 --- a/drivers/tty/serial/8250/8250_bcm2835aux.c +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c @@ -213,11 +213,34 @@ static const struct acpi_device_id bcm2835aux_serial_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, bcm2835aux_serial_acpi_match); +static int __maybe_unused bcm2835aux_suspend(struct device *dev) +{ + struct bcm2835aux_data *data = dev_get_drvdata(dev); + + serial8250_suspend_port(data->line); + + return 0; +} + +static int __maybe_unused bcm2835aux_resume(struct device *dev) +{ + struct bcm2835aux_data *data = dev_get_drvdata(dev); + + serial8250_resume_port(data->line); + + return 0; +} + +static const struct dev_pm_ops bcm2835aux_dev_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(bcm2835aux_suspend, bcm2835aux_resume) +}; + static struct platform_driver bcm2835aux_serial_driver = { .driver = { .name = "bcm2835-aux-uart", .of_match_table = bcm2835aux_serial_match, .acpi_match_table = bcm2835aux_serial_acpi_match, + .pm = &bcm2835aux_dev_pm_ops, }, .probe = bcm2835aux_serial_probe, .remove_new = bcm2835aux_serial_remove, From patchwork Sun Jun 30 17:19:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 808800 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 C9D0612D1F1; Sun, 30 Jun 2024 17:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719768015; cv=none; b=frHUEG1m9nQj98DEQA1iUS+LcD/h0O116uKv8kG7+7l+zVrCS72VBFkBBSAX93To7ed7Px+S7/wNi7rMoYDzOsjPAsnyoF6sR3S+EoPYwLZ2ARFygFIJXQZlqRZqWIEweIw3I/4mRtKNd3WtapyquxF+EyPzfuBCqpTQrE0GRVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719768015; c=relaxed/simple; bh=TwgxqCRks5hKhBV/6phe1u8rgr3lRsdIwXbXbOF9qug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C3LLqhv/e8BrhLuGlkUCjijnkUrM8cs04FYH/3Pousy0L8FQVuzy28VHSQRTI8eFIMwid3sbfTJ7pMTQsba5XWIjp4gFHiPS1gyZhGMqn59F67PkWF8BG3HtwS3NOjn7bP6CSKzglo+UqMKuejlwhnyTbbGocmvN0UsWALDk21c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=kHx9bke4; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="kHx9bke4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1719767983; x=1720372783; i=wahrenst@gmx.net; bh=TwgxqCRks5hKhBV/6phe1u8rgr3lRsdIwXbXbOF9qug=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=kHx9bke4Kg+R+wEbUy+3WT/t5SdDiSohZME11eY+ImacFKQ+fhcBsZskQZMxriTV LZw+i3WwoS14Ry2aOEe+1uS8JMHWz1kuQyTM6PEaTcxwKJyjMUAYz0oAvK+f3nLwh +aTs+KzeCE5wAscsHzVEHcJ3vON4zwOqsaGj5/EhCdAv8P1pnX1neNKEpP1J9DLV5 6SRFhf4gsgFnhXNQN5Spdi/RtWGXxLpgUx8DSl23U5GLj6sCi9DNpH0BaSzSTjitY 49iCtRaJv/+9IJBGAFs2uHM95/xC85FwzShoO6XkPXYFBk654CpuZAlzgYNgXGW+i XRL+EmT/yoAJ4YFiWw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MV67y-1sq7jd0H8o-00ORUC; Sun, 30 Jun 2024 19:19:43 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Thomas Gleixner , Jassi Brar , Ulf Hansson , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH 11/11] ARM: bcm2835_defconfig: Enable SUSPEND Date: Sun, 30 Jun 2024 19:19:26 +0200 Message-Id: <20240630171926.323426-1-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630153652.318882-1-wahrenst@gmx.net> References: <20240630153652.318882-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:Zqtyf/Sv3ew+qgoOSE4zRrcg9fRFBv468Pq4gY3jUBz8dUdUgD0 n2jEfMCDPZevDTgfj7KHz/L97w9v3kXpV3immPkEmlIGA/Hbv8bUG6gWxsy1ltCBzIoPssE 1hELuNvIbsUJatT3gtokpvJWs3DyyLo5R5hHZfS+nOZPBnKFYbRAyPVnT+Qh/Yrj9kpQHKX ItTNfpetMB5/vazmEMebA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:4JoxQbbPUq0=;EcqCyU0NoxnU+tpxe8XWkVyflO7 hKcYXlwL6ZpFanEiGw4G5OZR6he0TPBkxMT9h4g6QgIzgZ1qfnZeEJMJxIDGZ5WZYmFm1KzRZ zmYee1yAouEtibxABNEodMAQLGvt8YNfasmdJDlBOZR64mtxUXWVwI7QFDoyMPmpXBpaDNSp4 +qSQkuviA1giKrjF+ZbXFM+CztozF7XHTmoKF/ALl/w36IUaFLcnw0DwCZzCU1HpuHxscU17K 9MOvvKYGxfGZHm5mPn2/6bGHdXB6R269+t4RytybWp3e7tWetTn/UJBmzE2+H1+VoS3KSaiyp qWjcqfUduH4voP0cledTq9DoYZPTqOhxdy9IV/QwftjpKfbfKe++p8wlh9IXdG6+E1fqSJYpg vu96P4ElFDdjqQ7WQVf0P91UYRVQlzvH9daRI6QSvXOVRaA+XDQLJ4S8HWDcOTrJCZh5ouWQC klNyzJSSFZYNHzNHi3WmWFcsx3QJfDv1c7b4PW3wXozttRYeNwkMzLcnbRPljRuy18lNZAnZd fTzZLrEy5idQPGmm5JNfzu2ICCFMc62mjc3KOLnclUBzRn9aPpXRcTzJ0Irhqdib/gh3sMjbB h6owDQonwhO1TJi2iJasJwPf02uR6UozY6sqnBDaGU7q3/XENuoGzQYIw67YzHI0+G87Nwm/V zj+rx3EUqxs0R11MNiJNgX72KpVIeZtm0U8YSZ3X/BSRKpVH6RiEoaGu2vBGqLlOhl/LOzY8m zBHt5N3j/utJu/EeXZmdNfARrIxVFRC9LI66S/U4jlb8TpOYjICNhtPrsLcJggDn87vdGXLCC 4+MSE+zf6Y0GGG9NkyzvaCGI6+AJUqjzZUtseOeXz/Il4= Since the Raspberry Pi supports Suspend-To-Idle now, this option should be enabled. This should make power management testing easier. Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- arch/arm/configs/bcm2835_defconfig | 2 -- 1 file changed, 2 deletions(-) -- 2.34.1 diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig index b5f0bd8dd536..97632dee1ab3 100644 --- a/arch/arm/configs/bcm2835_defconfig +++ b/arch/arm/configs/bcm2835_defconfig @@ -38,8 +38,6 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPUFREQ_DT=y CONFIG_ARM_RASPBERRYPI_CPUFREQ=y CONFIG_VFP=y -# CONFIG_SUSPEND is not set -CONFIG_PM=y CONFIG_JUMP_LABEL=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y