From patchwork Tue Jun 25 09:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fpM1X3Zz20X1 for ; Tue, 25 Jun 2024 19:35:55 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2ab-00020Z-HJ; Tue, 25 Jun 2024 09:35:49 +0000 Received: from mail-pg1-f174.google.com ([209.85.215.174]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2aa-0001x8-4g for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:35:48 +0000 Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-710437d0affso3962800a12.3 for ; Tue, 25 Jun 2024 02:35:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719308146; x=1719912946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cbqO0q1rncmk5p/M6LXJZmyO/+j/VdBEIzm07lGNUJY=; b=ZItK9u1ayayn94FvcNH5X+dZz5TdQx+7pf3wcgxE8XLUp1uUTYGf1iWMmXpqD3Vriv eI9pVfg7QORT9+x0CyKoOSJ0QCZ8q2ArW0ewUWKbJXyDxIdpq5RxsqFGP8r2Q5mq+iHQ ChQ10oE/lEDl9qTNNlSKUYoBt2tTOirb0y12t7+kMl1sarg216zFwlWQHXfvd1nQ/CmB u94HfioNZ8lXHe+t95dgB1LQOP3MnKt5h2FMy6mgsVn3JRhk+S/SQy/ZlXcHml5BQF+6 T9b8VdLcmZhjyQ9jVpIpLTmjVRAnDIT5+giOMdsmoTkDhYlW1bRbZsIhyH8fQb2HUEwR 3K7g== X-Gm-Message-State: AOJu0Yx8vgYbWdgmCWGi0FgxmPr6PfLee+fZ5xS0vCGXcXOAh9hmyq8w PKYWvjyrJPAVnwgW8G/BHfMwFd9XGrS9U90gu9Bout2pOfMXNgDTqxLY0fLs X-Google-Smtp-Source: AGHT+IHlKecPcn20ti9g0jPAtRaFaWQ4XbyHszRZgqU8RVtW1dAvYYpXPqRrEOoYnDv6dnTpOSdzbA== X-Received: by 2002:a05:6a20:f3b0:b0:1b8:92f4:ebb4 with SMTP id adf61e73a8af0-1bcf8027d15mr5389362637.62.1719308145945; Tue, 25 Jun 2024 02:35:45 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c819db9803sm8176683a91.45.2024.06.25.02.35.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:35:45 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/7][Unstable] UBUNTU: SAUCE: mei: vsc: Enhance IVSC chipset stability during warm reboot Date: Tue, 25 Jun 2024 17:35:17 +0800 Message-ID: <20240625093520.3804382-5-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093520.3804382-1-vicamo.yang@canonical.com> References: <20240625093520.3804382-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.174; envelope-from=vicamo@gmail.com; helo=mail-pg1-f174.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 During system shutdown, incorporate reset logic to ensure the IVSC chipset remains in a valid state. This adjustment guarantees that the IVSC chipset operates in a known state following a warm reboot. Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") Cc: stable@vger.kernel.org # for 6.8+ Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/all/20240624014223.4171341-2-wentong.wu@intel.com/) Signed-off-by: You-Sheng Yang --- drivers/misc/mei/vsc-tp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c index e6a98dba8a73..5f3195636e53 100644 --- a/drivers/misc/mei/vsc-tp.c +++ b/drivers/misc/mei/vsc-tp.c @@ -568,6 +568,19 @@ static void vsc_tp_remove(struct spi_device *spi) free_irq(spi->irq, tp); } +static void vsc_tp_shutdown(struct spi_device *spi) +{ + struct vsc_tp *tp = spi_get_drvdata(spi); + + platform_device_unregister(tp->pdev); + + mutex_destroy(&tp->mutex); + + vsc_tp_reset(tp); + + free_irq(spi->irq, tp); +} + static const struct acpi_device_id vsc_tp_acpi_ids[] = { { "INTC1009" }, /* Raptor Lake */ { "INTC1058" }, /* Tiger Lake */ @@ -580,6 +593,7 @@ MODULE_DEVICE_TABLE(acpi, vsc_tp_acpi_ids); static struct spi_driver vsc_tp_driver = { .probe = vsc_tp_probe, .remove = vsc_tp_remove, + .shutdown = vsc_tp_shutdown, .driver = { .name = "vsc-tp", .acpi_match_table = vsc_tp_acpi_ids,