From patchwork Sun Aug 25 13:19:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13776766 X-Patchwork-Delegate: kuba@kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 1CA3915443F for ; Sun, 25 Aug 2024 13:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724591970; cv=none; b=XxaIXVx/MniTBGYAU3mdjXOaqMaqmY/He7wllHKjMuktVNx7WV3wlR1MFqktMe0SRhuDtEQU1Hvr6d/lOWNYqgfmm4R6wIIjZgHj4MdgYstzCPnNHo1hXx0ma1plMeOHsFb+Bcc9eSatzRBhRRGwWWChruf7FC2QDHBZTs71lSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724591970; c=relaxed/simple; bh=8p+g2F4j/irnUuWLk9wAFcIimCjZHaUVQUI4HAdIsJI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PK8/HngFdNYCwhp2iAwy/IVrUDRKTvun0d4IqO6c7G4xpHTOjaubHwjczleuAagxDZyViOeyf4ozmmUc2/rxD92LqH897b/GqxHvzot0ORtzSOH0Qq2wiCrzrJkHVrQnnOR0zzPGangIxyAX9yjItgEqiNT+RMBtJWQuxrxQTEE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=B7i6b6rZ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="B7i6b6rZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724591967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Rp8G6qDMo1ZV9tsh/r13/jvaPvi4RD1NsdRYxXubRE4=; b=B7i6b6rZfa8wVYWkiregXs8TxWP/6M5hYgdcZlFq0knN7GqLm2TF5A/2sPuRzG6Ny3dg01 6bcmK4Mrhy9ahY1+bHZgfez/QIWjUY4JjjbkOYsMwKrFm+o57D/w2CQq9kejAUFMSnuyfA IQc/W1qUBY/SgIOKOrnVJzneROfZj8c= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-qKiT2DDrM7WXsrx48XD1Zg-1; Sun, 25 Aug 2024 09:19:26 -0400 X-MC-Unique: qKiT2DDrM7WXsrx48XD1Zg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D2A941955BF2; Sun, 25 Aug 2024 13:19:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.45]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2FA7719560A3; Sun, 25 Aug 2024 13:19:21 +0000 (UTC) From: Hans de Goede To: Johannes Berg , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Hans de Goede , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] net: rfkill: gpio: Do not load on Lenovo Yoga Tab 3 Pro YT3-X90 Date: Sun, 25 Aug 2024 15:19:16 +0200 Message-ID: <20240825131916.6388-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Patchwork-Delegate: kuba@kernel.org The Lenovo Yoga Tab 3 Pro YT3-X90 has a non functional "BCM4752" ACPI device, which uses GPIO resources which are actually necessary / used for the sound (codec, speaker amplifier) on the Lenovo Yoga Tab 3 Pro. If the rfkill-gpio driver loads before the sound drivers do the sound drivers fail to load because the GPIOs are already claimed. Add a DMI based deny list with the Lenovo Yoga Tab 3 Pro on there and make rfkill_gpio_probe() exit with -ENODEV for devices on the DMI based deny list. Signed-off-by: Hans de Goede --- net/rfkill/rfkill-gpio.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 84529886c2e6..c268c2b011f4 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -3,6 +3,7 @@ * Copyright (c) 2011, NVIDIA Corporation. */ +#include #include #include #include @@ -72,6 +73,20 @@ static int rfkill_gpio_acpi_probe(struct device *dev, return devm_acpi_dev_add_driver_gpios(dev, acpi_rfkill_default_gpios); } +/* List of DMI matches for devices on which rfkill-gpio should not load, + * to avoid firmware bugs. + */ +static const struct dmi_system_id rfkill_gpio_deny_table[] = { + { + /* Lenovo Yoga Tab 3 Pro YT3-X90, bogus "BCM4752" device in DSDT */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), + }, + }, + { } +}; + static int rfkill_gpio_probe(struct platform_device *pdev) { struct rfkill_gpio_data *rfkill; @@ -81,6 +96,9 @@ static int rfkill_gpio_probe(struct platform_device *pdev) const char *type_name; int ret; + if (dmi_check_system(rfkill_gpio_deny_table)) + return -ENODEV; + rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); if (!rfkill) return -ENOMEM;