From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 540B03770B for ; Sat, 11 Jul 2026 05:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783748367; cv=none; b=nY3xqaRo4mtevuaYMStx2RlPP8bbLbi3EX+QFijWCu3DNp6VPmxslPFxEF0uHwETO/0bjG8YcCgyFOQfqgDJlL0PzLJKqS5f44NHr1gn0xuLGENMeC66GVfUUR5NufBzbUhpTMPiCj00RFoU31oKzKqYo1F5J7lmo5SNdf+Pew8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783748367; c=relaxed/simple; bh=6NB1ligMnhLaNdPPWtbqnzPbWmcoC0+mgUEzLs/JWfk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jjkh4UaYJjBgGTw/jqBdKLMvsNj7jSQeS1fq3RW0t3IPGSh7oCImH95Q138AniMT938pGmxvu0kHntS5mZm09h6EZaWr/cPFA8k6c9RmuA62lOUCoGZLj+Ad9sI2ytytoJbmzFlCY7bTNm2PftsPAs6tX85j+MbXJvkn9pX9O8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2cc73e322dbso16332995ad.1 for ; Fri, 10 Jul 2026 22:39:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783748366; x=1784353166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=iGN4+dQCsMeYqkRhsx/ElejEzpuXe2xoOuPYa2sMmgI=; b=acbcr+rDFEbvDv8QglFQLLXUwknHIvX12qIgW4cW+okaPRqUMHVqHq4xwbBsxuMT9R uKXZcWVHeWsMTxeUu5rNmrCfRyACOQwKL3wiSGQVGJVcpB54ose8AVDMuL+DmUFzMfL0 CR4JkcEabsxP7Gli/+H++/+ica6MYtG1VQjxGN1EAJxzc5TPcPmB1G0iGVy5y0mDdwYj 7FRgTgMIimOnYnsN2mhCE9RyCKb5YJW0yr0sIIFqjKyn8YJzcNRwYEICWmKW/ux8QaZr DYMtUV6AZP94KWSypGDwsEVGSudaUeOWnrKLxSfPxY6vkGhBehWh/dFQ0iKHee8ZFmhu oyHQ== X-Forwarded-Encrypted: i=1; AHgh+RqbNxnNS+qjCyZdAJBjwTtMQpQDQU1WX5w/idTds1gwvWxW9Xs0c717Nr5PBE1pt+qoSJp4K9xnXDQ7KXw=@vger.kernel.org X-Gm-Message-State: AOJu0YyAsQ3Fn4VRbvaiUVl0BavvkZe5a0P+cspAbgOPOYo3+ADKQ0w6 OmsJdKPpqO+o3eXitruL+v7+yx24hk0cqMQpqv4aM4nqUppflEdkdzU= X-Gm-Gg: AfdE7cmPcQTqeCPTpa9H8hb3UDuKLjz89Td8tzUdxONv16tXZ2FXvWGBOlUlKYkYsIa in9GeMRC7Q5/F9XC5gzoHkAPs2E2I7fdojyJLvHSYjZ7GlPaY1qIGox56GQ2v9MAaB/B4tUDXNg E1KT/FQ2IZYRhJbCMdyRD3Y/UQ7iWVjai2SytUL7OLtLz4MkSMP0WrZ8FYPki1VUYfcATFpnfpn xCJWY5pXXbM9pVx33DupWFt1JGcCpP5i5+h1t4V4EBwkXSZKSwNqvdomBKAwJBNsQr0Wyotn0Jt H3debEuZcAVlYDBi8DzYAl2QWXpM0ltN8BPYznKyalm5zZx2wCenDohXAECZcXDg5hrcEkQj99p oNlnNxAQO2Y0thhP9DxA487rhmrfS/hxLvFh18/0J61qJD3jSgQAiLKm6+ESXrytU93UsRH3Qzt wGXJdWthNTYFYq7FVFRU+kPL6zO2MVcmUM2s/m5p+JPvd1Vr2rTCve54XU2cxHfTsrYTa7JKeY7 t+aLE/T1I8NwKO13e6PwOc5Lg== X-Received: by 2002:a17:902:d546:b0:2c9:cf62:6f61 with SMTP id d9443c01a7336-2ce9eac212bmr21722115ad.17.1783748365698; Fri, 10 Jul 2026 22:39:25 -0700 (PDT) Received: from penguin.tail0a1999.ts.net (61-228-52-13.dynamic-ip.hinet.net. [61.228.52.13]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9d3bc1fsm69011255ad.55.2026.07.10.22.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 22:39:25 -0700 (PDT) From: Shih-Yuan Lee To: Henrik Rydberg , Guenter Roeck Cc: Armin Wolf , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Shih-Yuan Lee Subject: [PATCH v3 0/1] hwmon: (applesmc) Convert to hwmon_device_register_with_info Date: Sat, 11 Jul 2026 13:39:14 +0800 Message-Id: <20260711053915.4834-1-fourdollars@debian.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710123236.10508-1-fourdollars@debian.org> References: <20260710123236.10508-1-fourdollars@debian.org> 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 Guenter, Armin, and Henrik, This is v3 of the patch series converting the applesmc driver from using the deprecated hwmon_device_register() function to the modern hwmon_device_register_with_info() API. Changes in v3: - Fix a recursive mutex deadlock in applesmc_hwmon_write() when writing to pwmX_enable by using applesmc_get_entry_by_key() to resolve the entry locklessly and then calling the underlying raw read_smc/write_smc functions directly under the mutex lock. - Fix a fallback fan label truncation bug by pre-padding the generated fallback string with four spaces so that the "+ 4" pointer arithmetic offset yields the correct label "Fan %d". Changes in v2: - Abandon the minimal dummy registration approach in v1. - Fully convert the driver to modern HWMON ABI standards by dynamically allocating temp and fan channels at initialization. - Rename legacy non-standard attributes to comply with the standard HWMON ABI: - fanX_output -> fanX_target (HWMON_F_TARGET) - fanX_manual -> pwmX_enable (HWMON_PWM_ENABLE) - Dynamically register the remaining non-standard fanX_safe attributes under HWMON class directory via extra_groups. - Load and cache fan positions in smcreg.fan_positions to support returning labels by reference in .read_string. - Clean up unused static attribute groups and show/store callback functions to avoid unused symbol compiler warnings. - Verified compilation and successfully tested on real MacBook hardware. We appreciate your review and comments on this refactoring. Shih-Yuan Lee (1): hwmon: (applesmc) Convert to hwmon_device_register_with_info drivers/hwmon/applesmc.c | 464 ++++++++++++++++++++++++++------------- 1 file changed, 315 insertions(+), 149 deletions(-) -- 2.39.5