From patchwork Mon Feb 12 14:50:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 199864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2474716dyd; Mon, 12 Feb 2024 06:51:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTB9WdiSSjsBeAqTLlAIW5NLW3EM0U99IlXOvnOypXVh96bthFFwgx9X2DZglalLBLA5PY X-Received: by 2002:a17:907:7e83:b0:a3b:ca3a:128c with SMTP id qb3-20020a1709077e8300b00a3bca3a128cmr10174200ejc.22.1707749519468; Mon, 12 Feb 2024 06:51:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707749519; cv=pass; d=google.com; s=arc-20160816; b=JZ6T4BfekJvzFgWIN+pM05YYkTSQpWW3iPHQ0IwW+tohX3fNeL62dvuFKNkN8TCPLm 5ykugC/darARIQF2rI9s0yTsLk9rJQexXQgo9qTkem95XJpdooPkh9s1f0L+Oci3aeBK 1eF40GeSA2AvKirjYYnWX1qoAghZYQRbDdoOfoLdMuNh9fcali8XAxKxiJKKqpbxJCLy NxEQ80ewOeTpucsLN4wu1eiVQyaIyC/KFVajaFt1qbzCEqA+SacgTCnhjIlzj9V0lVhI SCOvja2ZC1KEd8zq+JpfKumSWxpGwo8s7idCVHPKv+YYpPE8J/WMhBJ1QEGTcGr78pyb 3jBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=h/x/3y1n/LIJrYQs7R5jPDtBYiOho5M7BtfSUmdM2qU=; fh=H2WJ/tNgLiEMww3V0N5/jxvXCXpPJMjXZbK2aXel9C0=; b=UPWEaiJCb4yk3A2R79HCCqhWr+3DNJJODrrtgJEnw/QBC+dUOVXoRmBZWtkHuGmOUW xkxt5QGRSGa99A9B466XwH0BY9SnZWE6ROf6L3uWmw5NLSciLlBEGT0N75cX+IY8OAqO xpei5+TeVxstodslweT6C0v9KVM0aYZtjMws6TiCfwA51iSw0WUY0Cn3CKKLy5q3DPBU 2za6HkbT7j2SHYTiFJAd93uEFO4Ckik8hdmgoNR/FMHFV3wygpunN2o8e6UdXy2apWPe CCuOAN62y9QcxPq6zBzZC3avPNK41GMM7hBk+mk8wioOLuROtE2SBPLZrmUT2TLM/yFY RBSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=u3EpcVKE; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-61841-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61841-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCVPeT7fSxD9uBv/xmIXaiHIw+NEDDpWhPROmmSACufv8CmauWsqjtcTR9zKXrNuevA4l67LoSLxuBYp4iZpwTsAEN3dJQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f19-20020a1709067f9300b00a384f7dac1asi268255ejr.78.2024.02.12.06.51.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61841-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=u3EpcVKE; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-61841-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61841-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 234581F22A7D for ; Mon, 12 Feb 2024 14:51:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5EB73C491; Mon, 12 Feb 2024 14:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="u3EpcVKE" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 723983BB34; Mon, 12 Feb 2024 14:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707749486; cv=none; b=iyiPFVLAfm4i/vTJYhgYNx7srWLvNnr8nMVFPIbsKzjhgkD3ML8BimqHFtdOpulPr7nR2VO+Cye1ZdYU0FsaZfSnDUBL4ss5v3xkq7iq/NtebhhcUsPo7MIJfdR7cuAIpibOSqbMKCjUIpevpJSknBrRGD/cVRFYWW7JqzRQePc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707749486; c=relaxed/simple; bh=OiujR5lhNKhEimBkSB+EFRf6rM0jXBiQhXbfsxIV9UE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Axr3lIZZoUARrUmDPsZ8DoiUMmMIir94rlfbJJeziPBMLOZiUFQn7kyO+r8HOFWqjS+qlEuLXWaavOIG4T9K4O37UOhW5ZZR19A3HqItArnSa2/foANO+mgeK3hqBkEwelvsVouMyI5etZ6uwOhAUpxKW2MDCA0NPG8Mh7cYgHI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=u3EpcVKE; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707749482; bh=OiujR5lhNKhEimBkSB+EFRf6rM0jXBiQhXbfsxIV9UE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=u3EpcVKEmcqpDIx/5waMjmUKIUIl0Boy2XqZqUi01fAXxocc0wSx+sXm6HN4uQy5/ sXZITsUKLcGkbFg5ity4LvFazzYGWMSogdiQdLFlO7+Bb0DhGbHZxNgyh/1fRQD/kZ rGjpPm8YYdNYAFPXd7seJX1G1YCVx4UYgjZuwDjVDwqsStncmt+/yMI3+DdnJA/3e2 Q13eGoqmTLdyHKgjLRdqJ+0ariP7aibUNHU2ZqdNJcEOzJwWwY54atV0+wFfmLsiHW XjRjl6RnKlhtRCTpQsQ5CV4J+t+8nGG/Nr/qZRkauyG1rdZ5OkN1PJNwR4O2sp4nJ0 6suxZhvZcRxvQ== Received: from [192.168.1.30] (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 9C5FD37810EF; Mon, 12 Feb 2024 14:51:19 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Date: Mon, 12 Feb 2024 09:50:05 -0500 Subject: [PATCH v4 1/4] firmware: coreboot: Generate modalias uevent for devices Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240212-coreboot-mod-defconfig-v4-1-d14172676f6d@collabora.com> References: <20240212-coreboot-mod-defconfig-v4-0-d14172676f6d@collabora.com> In-Reply-To: <20240212-coreboot-mod-defconfig-v4-0-d14172676f6d@collabora.com> To: Tzung-Bi Shih Cc: Arnd Bergmann , Brian Norris , Julius Werner , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Catalin Marinas , Will Deacon , AngeloGioacchino Del Regno , Andy Shevchenko , Greg Kroah-Hartman , kernel@collabora.com, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Mailer: b4 0.12.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790705160479949774 X-GMAIL-MSGID: 1790705160479949774 Generate a modalias uevent for devices in the coreboot bus to allow userspace to automatically load the corresponding modules. Acked-by: Brian Norris Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Brian Norris Signed-off-by: NĂ­colas F. R. A. Prado --- drivers/firmware/google/coreboot_table.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c index 2a4469bf1b81..c1b9a9e8e8ed 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -53,11 +53,20 @@ static void coreboot_bus_remove(struct device *dev) driver->remove(device); } +static int coreboot_bus_uevent(const struct device *dev, struct kobj_uevent_env *env) +{ + struct coreboot_device *device = CB_DEV(dev); + u32 tag = device->entry.tag; + + return add_uevent_var(env, "MODALIAS=coreboot:t%08X", tag); +} + static struct bus_type coreboot_bus_type = { .name = "coreboot", .match = coreboot_bus_match, .probe = coreboot_bus_probe, .remove = coreboot_bus_remove, + .uevent = coreboot_bus_uevent, }; static void coreboot_device_release(struct device *dev)