From patchwork Mon May 20 22:01:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asmaa Mnebhi X-Patchwork-Id: 1937143 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 4Vjs3P5YY1z20dK for ; Tue, 21 May 2024 08:01:37 +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 1s9B4T-0003Jk-Sn; Mon, 20 May 2024 22:01:29 +0000 Received: from mail-dm6nam12on2082.outbound.protection.outlook.com ([40.107.243.82] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1s9B4R-0003JN-Iz for kernel-team@lists.ubuntu.com; Mon, 20 May 2024 22:01:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U4L4CEo7ojnGph0EZvwIvDuXmeVehkDMS5XawQYirTu536/hz+cH3EOXOE++Ix84O8E7g1FSa0MpcjN55jOFGL1jOTJyua1yUqx5s2quQgtaZMxlFHvTbuvDV0cGI378mcXDFgMgmaLfAJKWv9+/R8irZZC3rkpw/z95jEMmuCnBPxhZoZkDfwqfDdelFgzGGzSev3ky+CbdWCFH/Z7/kWxf50asr/phkrxJFJrgBwNTv66uWsuutr0eGozl1J+memDM6GxBPOSySUDO9EAccE/1duCWVgWUfJ4vDqxkjt9r1eA7FqQI5wiECTH1uatLYrI0OQ+nFc8YxLpiRSpMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/itWjIvdw8QckU3ggsFndWdRBoDXvyXji7SmRbOPtsk=; b=ARpljFi2/ndRTf18OgqrAdEbwgWcWepIv349KVEAEjMRLVfxDK2AMRPVrOmdExe4U14yjLSVTZ717+1sVJbKSEykdrjANnXjEtjRomVUXz2ggx5ECkFMuD4DFiOZSpUaZhyALJUJPnAb45Y0QdF6XaCVSpqS30SVaGgWsW7Eevb4yFDKmNVsUa6iYxlmyd1JcmMqmmwpuLPdQLWdDFzhSFwNTUZ1nueQabDrtKS8LkGifotoL+Q4tb99A1d+h+DXy3K6CCfsSTw6jFjJaHzD+IKnt8xhK+OoJlSX3y/f//wf47wUzGTI38T9e2ub9zc3LppLYaNKkawyfOm35jzajA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) Received: from CH2PR18CA0001.namprd18.prod.outlook.com (2603:10b6:610:4f::11) by IA0PR12MB8932.namprd12.prod.outlook.com (2603:10b6:208:492::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 20 May 2024 22:01:23 +0000 Received: from CH3PEPF00000009.namprd04.prod.outlook.com (2603:10b6:610:4f:cafe::ad) by CH2PR18CA0001.outlook.office365.com (2603:10b6:610:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36 via Frontend Transport; Mon, 20 May 2024 22:01:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CH3PEPF00000009.mail.protection.outlook.com (10.167.244.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.14 via Frontend Transport; Mon, 20 May 2024 22:01:22 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 20 May 2024 15:01:09 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 20 May 2024 15:01:08 -0700 Received: from vdi.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 20 May 2024 15:01:08 -0700 From: Asmaa Mnebhi To: Subject: [SRU][J:linux-bluefield][PATCH v1 1/1] UBUNTU: SAUCE: gpio-mlxbf3: During reboot test, ipmb driver fails to load intermittently Date: Mon, 20 May 2024 18:01:04 -0400 Message-ID: <20240520220104.3602-2-asmaa@nvidia.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20240520220104.3602-1-asmaa@nvidia.com> References: <20240520220104.3602-1-asmaa@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000009:EE_|IA0PR12MB8932:EE_ X-MS-Office365-Filtering-Correlation-Id: 73ca7aee-55b7-44cb-5268-08dc79186325 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: +gXUHd1HWMMW3km0xgmL/6TErhYCLBzHu+QVV8xtIUlgi9HExhsHs8ABPE5ddchVFCTcITGAcuVdJy3RXUAffJh89EPPvUw9iz5uYrYDli/jO3rTej8r4AiseQrkAbkwVp0WQX3Y/JcaBk3ZgfnDl7N+yGra3zNDagPFI7UMtEUF5nJ3Ge3+0d+rVKWMS3Kx/bjMERzxbcOctSq6kmakphM9PvuoyLiXvd2tm19j5BHFvna+oYXp/EBrzm5gtmUwIVnH/OLqE9arCAY+XNQN8rftiWLrLjSMHjgJzWd5oUmLEKcChswRma7dSURppPdBvLpmxS8CrNEQDhbRgqfSqGoFh6Oc9G4XIpMOkQT6dD3yfTLXuemZFcIMlo5j3C0tYNHbuDgzXJe3Pb5O0ufyYmZ4F8Dz0t5hVtm7bWAOZOBVA6VdQ8qbIf+oWw8ipAwKVzYdm/QM3+vZtD+IjjB7PpisS+5L0nBAmKe9B1oEpRdd+5JfcNpiPvj+VAwmgfr/qliRM1As8Uzrl32nf+jpC8/G7Xyy35ANFWw75tmkL9t1BHcTRCv956nm2KNYtn6iFTg8xeeuqEcCKpMG6ekkfwr15ZBrrevDDhTUhYS3xy19KY74bHIFMP5OWa1l0BP7cpzf16KPsNJhvbWV71TBuVU2RfjYinw9ZNKe7vJ59stvs4qtER7niMD1HaMk+4IeZXeA4m5a7kKwnflXhr+kaE8ffkL+gSClsAwfeY/oKtuUcXqzfYlFDAOfVlARKzPuGj01mZimceFa6EoML1wX+g41j4otTOAAifOhsln9RLbfFYdeCLi6mztFnKZqE9dt9FWHt4zIe5J6H3zHPPM4ZggSSisQnf5+fdIg8UL/k2k9ITmYyB/hTLisII/j2rBydxms7i7EVT1sSot6fXl2cg9fwOWtw7oH6ETvkVxSQaAsoOVR7+6uiW7NjpSpmdWozreZ+yIM7Yfv95h/7LkUdOdGL9U62Cxr8Wf/weQrJHiku2DWGukXIuAcXHQgtkhPgqD+5h2m34Z17pEvfMxWFWEIiGVg3UEOOVVo/AGOEokfS2sq2hWYbthiOYu534ZmZtyQ9GlvdTyi810fJd38dWn056Rm/pIRSelOxVHpbzQf3G6wJxKWu1mVUlvvKu4mINPcSpZeIfGna49zYuyDKApm4d2zkiqomM2iBpsp77GGjopTfMtQN0RMZqUTyUmEHQTVNnwdLWb7BWb4P/oGPzWGxmi2Fl+8OdESSSORagNCBt26eTwGBVNr+rHMjqiTwy+2Wmknxv85nYV+T4U2pPz4fzRUXspEStpR/+I8X66QW5184vdfzbEbvzl1NvuSwcjfeSx7kfZnfDjbTaj9kpiJq4UtqFJlwrYHOEqhaJc= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2024 22:01:22.7927 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73ca7aee-55b7-44cb-5268-08dc79186325 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000009.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8932 Received-SPF: softfail client-ip=40.107.243.82; envelope-from=asmaa@nvidia.com; helo=NAM12-DM6-obe.outbound.protection.outlook.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: , Cc: Asmaa Mnebhi , David Thompson Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2066198 The ipmb driver failing to load is just the result of i2c-mlxbf not receiving interrupts. In fact, any driver dependent on the i2c-mlxbf driver will not work. How to reproduce this issue? - modprobe gpio-mlxbf3 - modprobe pwr-mlxbf - modprobe mlxbf-gige -> this calls into the gpio driver which enables the PHY interrupt (gpio10) - reboot linux -> graceful reboot does not remove modules so it doesn't disable the PHY interrupt via mlxbf3_gpio_irq_disable. Hence, the interrupt remains enabled. - In anolis, we don't enforce the dependency between gpio-mlxbf3 and mlxbf-gige. So the next time linux boots and loads the driver in this order, we encounter the issue: - modprobe mlxbf-gige. The gige driver uses polling in the case where it loads before the gpio driver. Note that the interrupt at GPIO10 is still enabled at this point so if the interrupt triggers, there is nothing to clear it. - modprobe gpio-mlxbf3 - modprobe i2c-mlxbf. The interrupt wouldn't work here because it is shared with the gpio interrupts which was not cleared. The solution is to add a shutdown function to the gpio driver to clear and disable all interrupts. Also make sure to clear the interrupt after disabling it in the disable irq function. Signed-off-by: Asmaa Mnebhi Reviewed-by: David Thompson --- drivers/gpio/gpio-mlxbf3.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c index 9d1bd3f6e23f..1646325f1283 100644 --- a/drivers/gpio/gpio-mlxbf3.c +++ b/drivers/gpio/gpio-mlxbf3.c @@ -39,6 +39,8 @@ #define MLXBF_GPIO_CAUSE_OR_EVTEN0 0x14 #define MLXBF_GPIO_CAUSE_OR_CLRCAUSE 0x18 +#define MLXBF_GPIO_CLR_ALL_INTS 0xFFFFFFFF + struct mlxbf3_gpio_context { struct gpio_chip gc; @@ -85,6 +87,8 @@ static void mlxbf3_gpio_irq_disable(struct irq_data *irqd) val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); val &= ~BIT(offset); writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); + + writel(BIT(offset), gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE); raw_spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); gpiochip_disable_irq(gc, offset); @@ -267,6 +271,15 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev) return 0; } +static void mlxbf3_gpio_shutdown(struct platform_device *pdev) +{ + struct mlxbf3_gpio_context *gs = dev_get_drvdata(&pdev->dev); + + /* Disable and clear all interrupts */ + writel(0, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); + writel(MLXBF_GPIO_CLR_ALL_INTS, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE); +} + static const struct acpi_device_id mlxbf3_gpio_acpi_match[] = { { "MLNXBF33", 0 }, {} @@ -279,6 +292,7 @@ static struct platform_driver mlxbf3_gpio_driver = { .acpi_match_table = mlxbf3_gpio_acpi_match, }, .probe = mlxbf3_gpio_probe, + .shutdown = mlxbf3_gpio_shutdown, }; module_platform_driver(mlxbf3_gpio_driver);