From patchwork Mon Sep 27 17:02:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514730 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f46:0:0:0:0 with SMTP id h6csp4152633ejj; Mon, 27 Sep 2021 10:23:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwoajvMogE//lxq/4FOG8RzJEp4JOgn/X1XfiT9scuFZtCph1U3+BfTFwOch+DZFUq7SdL X-Received: by 2002:a17:906:6948:: with SMTP id c8mr1318075ejs.187.1632763426368; Mon, 27 Sep 2021 10:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632763426; cv=none; d=google.com; s=arc-20160816; b=pRG4YKl58f4VafZT7kIG4STWVOjp22L+eO5+WKVtX5mO5WJnXaU5xUyc2V0e6nCL/b /lEzt9MacK/ModAc4y5qCpsT3sHnGPhpF7ry6dGFyMcsJ5rapRVVDolr7EmWv6nPWwhR ufBOeGwljsEd3RdYyxenKutWUORPpzFnVC/C7OSLvK/0RTdjyTt7a/BzjoQcCL/fvKdA b2gVeRgtEX8Au0TunJql2AdwXOk1JsW/lliuW34DWfHe/7IKNiL/eqv40gIc2P4JZoUR wJfC52OwIf6Xm+gx6rNakyYjsA9uTmzc4vBN/AH1qeQKTf8PE1pd758g0ggfQvBfDaqM sk6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l/CHWl0pUuBovn8F4Lby+0ULFaH6n6ZWc5B5D2KdqIo=; b=05mBJgEp1E3Y7g3W3PquSljPfKMGSm0vTEL84O+uhd7eSqajfRiop/vFgU9NoBEJ/n tOXvkBrnFovP2noKh0HmJa1vh03MDeVBpPocRYpXFpFfwf2wgbQHQnL1B7saN5Vit7JR gCjAg/Pm3bIPJi5vwtpLtBlidc+YE51ZKsY2lrPG3nahU7ZO713BmtHy5ZhbljH9JNMj k8bAX6/339m9qpGdodt8GCy6UjIBCPuIfPUNT0Iq7TEO+Gm1j4HNbIyhHtLMqG3+d3Vm 76AkfiqbE2oAiTow1SHzBY6EzSfSm1KcvALQqQQhC05dz6Lfzr4IeKcm9KCgwGHmFbYb YGOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Cup//lAf"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si20266732ejf.430.2021.09.27.10.23.46; Mon, 27 Sep 2021 10:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Cup//lAf"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236019AbhI0RZU (ORCPT + 11 others); Mon, 27 Sep 2021 13:25:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:35378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237205AbhI0RWb (ORCPT ); Mon, 27 Sep 2021 13:22:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3531E613DB; Mon, 27 Sep 2021 17:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632762857; bh=zt4hvOLZHDrFGgDXcjKuZKFvqo4FFHPtNctULI1Ifko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cup//lAff67sdI+gFpxsc9iyCXrZRANcpI/5UNUFN8XOUhNG1XBp1LPjMDGoFLS9d z+1lPOzUV+4M/0Vv2jLKvL9Z2F6RCR8ySVHhZ9UWhMR26ZFjOpaW4MJXX236ugAkTa nlOdozuL9r5KjGZCqdMeZh4vGTIMwrBib2Z1S3Ro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Russell King (Oracle)" , Mark Brown , "Russell King (Oracle)" , Andreas Schwab , Marco Felsch , Sasha Levin Subject: [PATCH 5.14 077/162] spi: Revert modalias changes Date: Mon, 27 Sep 2021 19:02:03 +0200 Message-Id: <20210927170236.125714829@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210927170233.453060397@linuxfoundation.org> References: <20210927170233.453060397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Brown [ Upstream commit 96c8395e2166efa86082f3b71567ffd84936439b ] During the v5.13 cycle we updated the SPI subsystem to generate OF style modaliases for SPI devices, replacing the old Linux style modalises we used to generate based on spi_device_id which are the DT style name with the vendor removed. Unfortunately this means that we start only reporting OF style modalises and not the old ones and there is nothing that ensures that drivers list every possible OF compatible string in their OF ID table. The result is that there are systems which have been relying on loading modules based on the old style that are now broken, as found by Russell King with spi-nor on Macchiatobin. spi-nor is a particularly problematic case for this, it only lists a single generic DT compatible jedec,spi-nor in the driver but supports a huge raft of device specific compatibles, with a large set of part numbers many of which are offered by multiple vendors. Russell's searches of upstream device trees has turned up examples with vendor names written in non-standard ways too. To make matters worse up until 8ff16cf77ce3 ("Documentation: devicetree: m25p80: add "nor-jedec" binding") the generic compatible was not part of the binding so there are device trees out there written to that binding version which don't list it all. The sheer number of parts supported together with our previous approach of ignoring the vendor ID makes robustly fixing this by adding compatibles to the spi-nor driver seem problematic, the current DT binding document does not list all the parts supported by the driver at the minute (further patches will fix this). I've also investigated supporting both formats of modalias simultaneously but that doesn't seem possible, especially without breaking our userspace ABI which is obviously not viable. Instead revert the relevant changes for now: e09f2ab8eecc ("spi: update modalias_show after of_device_uevent_modalias support") 3ce6c9e2617e ("spi: add of_device_uevent_modalias support") This will unfortunately mean that any system which had started having modules autoload based on the OF compatibles for drivers that list things there but not in the spi_device_ids will now not have those modules load which is itself a regression. Since it affects a narrower time window and the particularly problematic spi-nor driver may be critical to system boot on smaller systems this seems the best of a series of bad options. I will start an audit of SPI drivers to identify and fix cases where things won't autoload using spi_device_id, this is not great but seems to be the best way forward that anyone has been able to identify. Thanks to Russell for both his report and the additional diagnostic and analysis work he has done here, the detailed research above was his work. Fixes: e09f2ab8eecc ("spi: update modalias_show after of_device_uevent_modalias support") Fixes: 3ce6c9e2617e ("spi: add of_device_uevent_modalias support") Reported-by: Russell King (Oracle) Suggested-by: Russell King (Oracle) Signed-off-by: Mark Brown Tested-by: Russell King (Oracle) Cc: Andreas Schwab Cc: Marco Felsch Signed-off-by: Sasha Levin --- drivers/spi/spi.c | 8 -------- 1 file changed, 8 deletions(-) -- 2.33.0 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index e4dc593b1f32..f95f7666cb5b 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -58,10 +58,6 @@ modalias_show(struct device *dev, struct device_attribute *a, char *buf) const struct spi_device *spi = to_spi_device(dev); int len; - len = of_device_modalias(dev, buf, PAGE_SIZE); - if (len != -ENODEV) - return len; - len = acpi_device_modalias(dev, buf, PAGE_SIZE - 1); if (len != -ENODEV) return len; @@ -367,10 +363,6 @@ static int spi_uevent(struct device *dev, struct kobj_uevent_env *env) const struct spi_device *spi = to_spi_device(dev); int rc; - rc = of_device_uevent_modalias(dev, env); - if (rc != -ENODEV) - return rc; - rc = acpi_device_uevent_modalias(dev, env); if (rc != -ENODEV) return rc;