Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp906709rdb; Tue, 30 Jan 2024 02:05:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkDLVaP90m3RpxJCRLFeOCeeo+gTwgMrkam2NvM/O/hM6p0mq7+9jprtESvI6xmRu7c6W+ X-Received: by 2002:a05:6e02:963:b0:363:7b67:af23 with SMTP id q3-20020a056e02096300b003637b67af23mr4996193ilt.26.1706609159404; Tue, 30 Jan 2024 02:05:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706609159; cv=pass; d=google.com; s=arc-20160816; b=rDm54E8iXKw2r6/Tuht4oRRdoig30KoWtIsmQ6VufQtBDUgjOOhvGRzlcmrt+VScJA g25bg0ZCDYn7GX2a6jiWDUM0ZkX6SwWkG+wiX3iLgzMC9v5+dUFJpLacOFlz2lAbVwn/ yH8bRHCjmNRqBKEq7MU61vg6KIVih69ePhNqGqGTfjRlcE//3mu3LG/z+VPF4Rcx45wW cJYXS7OnYCeMciwj2x8TlC84F6U/wJ4CMdZP616CulgS37yZhR3aQycHhThTSMfg+zIK w3RavRdRK3lEA6NZgZDa/6dfzVy+n20G90xJ6taWCM76g811LSXGz4AUnHMFgOzCifUJ nXiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=1E8FaeEXOaFC0eCzbjnFP8K081LnYEvpyUI9em1l5vI=; fh=T29NK0a2UgpyPMJNdRdxOwtTMCeLNbJCj+OzYaaxEOg=; b=l8V+/c0fukARGB8EjebXNOkcWsYyBvkNnTudJt3FUoF4foKWZ8uGwHoPgsdughWnIq g8+n5DoN246WP1z5J/EFbKeiXEx/JHgRYsuxA82BPvkd+4sVCfHx3gL2DwMOtm2xIZSe Sp4kiceaWmdrHtcUrVW1OVo4k27LpUroh1EhuUO6U/COP4H4w0wPMxdDFkyejr+iVPq/ gknyljt8nuKaRA+ulyF+wEraL3IOr3E3LqM+CKR3yDHsgRCRdD9gX4qqrbKckxeQdc/x bglUBz7TXQ0zLUIG6isPoJRTXZ88aQUzP4twNoPAN/nObSwvkLqcOoSqN0k2jk26Vnal eUBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="nIMEjC0/"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-44332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j191-20020a6380c8000000b005ce0b38a6dbsi7132416pgd.580.2024.01.30.02.05.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="nIMEjC0/"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-44332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A5EC228D5F6 for ; Tue, 30 Jan 2024 10:01:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD93C664D5; Tue, 30 Jan 2024 09:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nIMEjC0/" Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E04960864 for ; Tue, 30 Jan 2024 09:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608622; cv=none; b=Yet2L5PdL/zy54E015SLZDtzCGEsVWvqkg8AQ6lDhCX8GD9CZ71YirpOGRpi78WWNHJSPEJK7jZHFFV7mvbzaRm70uV9dm7btrOgUNh2r5OzeaXWlu0vHMUmqxoKqoU6mZ8DuO6VADEJO/Yd7nMvx/z5pnd04bPjwBgoYs13usA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608622; c=relaxed/simple; bh=vbI813naE0KfjH2XtPSzIzbimxv0FRdKAx6o32QdIqU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ocvsU6VHGaNwxV9N6GQz6baEIDbwB1xhdLhI2uVLKuq/waB7ARFl7fbHt6UI6e40C0q97ILPe0q3kf3bELVGSiCIebW9ZRW2LxKWEuoTuOmNZgRgxi6D7E1V1o6zsDBQHPmmJG6E9bLYNNw1aS9zjWX2s0mQlWrtteeD0xPwhx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nIMEjC0/; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-290b37bb7deso3092619a91.0 for ; Tue, 30 Jan 2024 01:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706608621; x=1707213421; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1E8FaeEXOaFC0eCzbjnFP8K081LnYEvpyUI9em1l5vI=; b=nIMEjC0/cwtqXVX+ERGx3L8ckgsZ6ls5Byo9mia0c+FGDiQzN/7S5vpRy0P+/BByIM 4Iu4AyBJ7ZxCn2Yjtq4/H2IMwL5nB9bBqKvGuuaH1XRjvGfSGAoF1Y2ZQ3sps6SGx215 SlHXdwOuxLLZbv28fLVlbXazPM5ZPvSHtYI9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706608621; x=1707213421; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1E8FaeEXOaFC0eCzbjnFP8K081LnYEvpyUI9em1l5vI=; b=qbRyNdU4POlRKEYliKP9TA1A8IDvmTEEgHOv5kdjYTtOI0fzd+PWTTIoEm6i5l7Rwm GzvlAabezYkbfcCKCmF5A4iDq36ErGFvbgrNzMOvDLAEivGh8ZnYKrKoyFlZ6aAdIw/9 6DLNnJuLEPqr23M7tORqxrflo88gUb4z+Q4H32FHk7j5kdWcj9x5j3Aqe8ZNzJsWzFv5 xpx/bryO9CiSVYw7SDVBOR13t2RKSBgQN79QILDHYtw/ta8OFz+SEM8Gu8bZVsqtoKUq rPrQ6ArS59dYtMCANyq6YF2NaLpRoSDwnDCoHauRDa7NcYhPqXc6inbrnaboXZkvhRM2 IfYg== X-Gm-Message-State: AOJu0YxyeXucyk55LCpdgeYTtz20xnkDQasmQ6tDTVpzBKTq/Pt3iv/d 6BMmMUiYEwXJBXWwYk7C1K0xlLYFb7FSi+WYrp2vrFohZolMERG0OP1MbHQokw== X-Received: by 2002:a17:90a:6303:b0:28d:74eb:97c7 with SMTP id e3-20020a17090a630300b0028d74eb97c7mr5294648pjj.34.1706608620693; Tue, 30 Jan 2024 01:57:00 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:469:110f:d748:6896]) by smtp.gmail.com with ESMTPSA id sm5-20020a17090b2e4500b0028ffea988a2sm8069810pjb.37.2024.01.30.01.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 01:57:00 -0800 (PST) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla Cc: Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, William-tw Lin Subject: [PATCH 0/3] soc: mediatek: mtk-socinfo: Fixes and cleanup Date: Tue, 30 Jan 2024 17:56:50 +0800 Message-ID: <20240130095656.3712469-1-wenst@chromium.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, The new mtk-socinfo driver has a double put of the nvmem device used to read the socinfo data. While fixing it, I rewrote the read function to make better use of the device node and device relationship. Patch 1 rewrites the cell read function in the mtk-socinfo so that no resource leaks happen, and device lookup is more efficient. Sidenote: I think the cell read function could be reworked a bit more to return different error codes for different failure modes. Patch 2 adds an extra socinfo entry for MT8183. It seems that some units have chips that have this one. At least mine does. Patch 3 drops the custom nvmem device name from the mtk-efuse driver. This was previously used for nvmem device lookup, but on MT8183 with two efuses, one would fail to probe due to this. Since after patch 1 this is no longer used, we can just drop it. Please merge. On the MT8183 ChromeOS devices this currently crashes. Thanks ChenYu Chen-Yu Tsai (3): soc: mediatek: mtk-socinfo: Clean up NVMEM cell read soc: mediatek: mtk-socinfo: Add extra entry for MT8183 nvmem: mtk-efuse: Drop NVMEM device name drivers/nvmem/mtk-efuse.c | 1 - drivers/soc/mediatek/mtk-socinfo.c | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) -- 2.43.0.429.g432eaa2c6b-goog