Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp360143rdb; Thu, 1 Feb 2024 10:26:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXDHkIM0a1YcdqEuBBm2u5rQyvfzr3ZwN3d/cBBCjZChRX45EZYFrWMiPuN7WdhHAuFrAj X-Received: by 2002:a9d:7753:0:b0:6e1:1492:3653 with SMTP id t19-20020a9d7753000000b006e114923653mr6308072otl.5.1706812013666; Thu, 01 Feb 2024 10:26:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706812013; cv=pass; d=google.com; s=arc-20160816; b=kCWRx4we2ttejT7pE2aZtIV9uS6BbjGB0IXIKhy45n59W4q6YnBQjL4LsPz1XtFsrD WbJmarmh4Nwt9aZNDcAwiZZLc4PNbkiDzDff544E5J3PhZDBwAwU/Y4MZ7gMGUrKxaBj WheN9DXz5iLWWe078nA8Nd9lR2CBhpmfJxyz4nnzQbT3rS9cmVpO+ZlRaOtbtlObd+Op KaO7963VUOyPTZW8E7k8/aD3u90dgf53cLRhGh31VDLtXmW9uu0n4O8zTJgtItEAdHBF Yi2Pip52QHWhgJ+hYsQGMRcvlcBkiKceN3gSUqfbndDQTkTPddu+RX1Z9b9yUu+XIowR QAJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=hwmvsN2Ntz2KqUUIBBoM0a9JofCC8LHROVWl1waNCjg=; fh=RnFPykGKOHg7EhYeu7SLk1xX8tbYzgHvi0SNbeW8ioU=; b=1GSCt4C7wUhXBHPZhRFoPs0aan1RNFFGcJJX4YbEzazuCustq2PDXNLOTxSIBf8nk8 yLQw+a5FeavXWoVP7ycMEvsewxJ/22R+AJKxyYNAC97AITzgBUkHzEbKsXvDc+BRGDp0 mbxUv2/mwLXC+Nvyh39+IhRK6VaziG+PdGtSJQpcn6TRND2wVMFTOjBc9x0Qm8quCPut D/0dMAvPyeXgUgbHUbCQkmivumJ+UlkZ+wmDZ4aHUC0q73g62pJcsvSMOFJ/nHxCHqbs xy9DCGVcuFH6PxhmFihSUqahhTR/1vhZEujCl4kQOccuraYI7KiiybYDXtigJ8/Z5168 SNcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eBNc7Fuw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48696-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCW1kx0OByi2mlHSB9xdQYeiInwuwi7tcYXtMtBtY/Cq8k6s2PQinmmGFXHwmAfC8RxnYjYHGfdKNYsW0y2QNF2TNG66LR8/qryvn/GEbQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h5-20020ac85845000000b0042ab5900084si63096qth.21.2024.02.01.10.26.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:26:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eBNc7Fuw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48696-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 575E91C20F3D for ; Thu, 1 Feb 2024 18:26:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 306D27429E; Thu, 1 Feb 2024 18:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eBNc7Fuw" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 BC5D612FB0E; Thu, 1 Feb 2024 18:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706811987; cv=none; b=mGG1kUDM2GIxQKHP2k2DWvGEuGjZBRYNkGUWfSBthZSRxbg57oQjWCVKaP1/eQmDLVjBKE2TgWcjBoYRZ86jUgysSaVltc5jm3q1/zNWhvYgsOXKv1xqrwt4fNCPV8wT9sOmQozue/QlQYmtJ+MEeHaaeJihHYUqp2Hxbx6m668= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706811987; c=relaxed/simple; bh=FVTBCN2du4zlWLyaWqxrGSTkTvzubs6Y4PI45j7s9XM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=exVOkgK8RGKz2NkfUKd7ZMAGfYgscvSG8AT27+5xf74MKMMUJAwnLnBmOpd5J4rty+2ksbKulBVtqWbUIGpJqox8DdAJdxf/+41zu56sl4uJAk9mzNCkNAd7i1UL8tMN8AowHfTskUDZXKP0crLjAn7oB2uHz0O/CicpQtZEj2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eBNc7Fuw; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d72f71f222so10799675ad.1; Thu, 01 Feb 2024 10:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706811985; x=1707416785; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=hwmvsN2Ntz2KqUUIBBoM0a9JofCC8LHROVWl1waNCjg=; b=eBNc7FuwzMrOkLT0kaiJQQLPA0qSIbhbk+EIRbfP0OpKGkVR5Wfgz/RD7Rp0/WPrSm 5Qq1zAqDgVtmOXgFuP0t6sMN7Q/rC6D2t4OJCbciRH7bhgBlYfThUjuKKVSizGqjTiHg wSe+Ssnu6F/+fnxaynFVuxh9sP+L5nJQe22c04gZDqh7+MvMAHS3Q6zi/96DqfGDNthO BJ7tQLG+H2J9fPh10wbYbEOEsHkAjkC4xW8z6gJbA+lYOKAjV8S/qUUl+acP442N98bB EtNS70JzdMS0MwrBGS5PRlHmX04Sgz927fhlfFrl2Chnrwf84Uo9unBAoAOj5JkI6PH5 ZUrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706811985; x=1707416785; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hwmvsN2Ntz2KqUUIBBoM0a9JofCC8LHROVWl1waNCjg=; b=i2opzZT+M++WtoD6wOWm1X+rn6ttJenjhMExbDg4U2qrO6frMoQaLJ5xN6+2dRmmy0 sEN6TO0DVX9yLtmmixVljZ+Am69ixpz5EE1djkqHp869cbASjpb6fcMTwHR/XSGMywFt AySfKzwwbHbv8GEN86ZYCgTmcva3pjml1vg0FlashQMarCks3kie74oGgx5JxFqZBKCo o6UMlmlMaNtE/cZn42+6ztFB08ArIHz4zGk834jzMByYHyLz3oAZURwbqU1TcpmCcRzi RWRO4uvC0fuxdaROrL56qpmRYact6xdvXSiddmXthb9szQIRKxXR1OyybC2PaV5W1Hih 1ztA== X-Gm-Message-State: AOJu0YzKbITNLWvJ1twFc/WVYJBosqtrKwEHgEnyspiWRpQ7CYcOUtaj SODoFtI5fR5wnjV6YbRSrFSXhzdPgzQGNDMCZBtO2RR5mByX+Xr7 X-Received: by 2002:a17:902:d590:b0:1d9:427a:99b with SMTP id k16-20020a170902d59000b001d9427a099bmr5910320plh.32.1706811984997; Thu, 01 Feb 2024 10:26:24 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXJt9er2Oe/D78iSMdGinSF1rdGyGo50IHP1ZZ2fCvGk6/+VT7Znkbx2lE5lFgA6SaiprC5NEbqgW9kMhJyeKZIbyakvpqM/J0TJMFhkyrfVyeB+DeUz1mRJnnBL7daAee+zjmaLrfsmJ3BA9mk2va/eC9atWlLef9U9aizsP3x0bq4LoqUEwcgmblnSe4nzbdV2tb759DWzAjY+lKVdKj3qFjPEc73FH5fgfZe+tvkcfD61q8gMM6xZJbv19aJuQYrDsBmUJQ3nQIvmnKvoUHrAmQYw0+rZXh0Fn/6qyvEjOnDACZHK61xGWxrVsPoBgYXCFvJXZnt/yBItHWainrXh1t0aJYs5L1xQHlAnSNNP6DoDmZy8460xtWScYQh9tF95A== Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id v11-20020a170902d08b00b001d7134d149dsm112730plv.256.2024.02.01.10.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:26:24 -0800 (PST) Sender: Guenter Roeck Date: Thu, 1 Feb 2024 10:26:23 -0800 From: Guenter Roeck To: Dimitri Fedrau Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jean Delvare , Stefan Eichenberger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: Re: [PATCH v5 net-next 08/13] net: phy: marvell-88q2xxx: add support for temperature sensor Message-ID: <0f9c8083-7287-40af-a084-98c692166b40@roeck-us.net> References: <20240122212848.3645785-1-dima.fedrau@gmail.com> <20240122212848.3645785-9-dima.fedrau@gmail.com> <65071184-428b-4850-9e0c-baaa73513c6d@lunn.ch> <20240201071137.GA41347@debian> <5dc7d495-dd41-4b1f-b0e0-1fe512f1687c@roeck-us.net> <20240201161435.GA48964@debian> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201161435.GA48964@debian> On Thu, Feb 01, 2024 at 05:14:35PM +0100, Dimitri Fedrau wrote: > Am Thu, Feb 01, 2024 at 05:34:05AM -0800 schrieb Guenter Roeck: > > On 1/31/24 23:11, Dimitri Fedrau wrote: > > > Am Wed, Jan 31, 2024 at 04:17:06PM +0100 schrieb Andrew Lunn: > > > > > +static int mv88q2xxx_hwmon_probe(struct phy_device *phydev) > > > > > +{ > > > > > + struct device *dev = &phydev->mdio.dev; > > > > > + struct device *hwmon; > > > > > + char *hwmon_name; > > > > > + int ret; > > > > > + > > > > > + /* Enable temperature sensor interrupt */ > > > > > + ret = phy_set_bits_mmd(phydev, MDIO_MMD_PCS, > > > > > + MDIO_MMD_PCS_MV_TEMP_SENSOR1, > > > > > + MDIO_MMD_PCS_MV_TEMP_SENSOR1_INT_EN); > > > > > > > > You enable an interrupt, but i don't see any changes to the interrupt > > > > handler to handle any interrupts which are generated? > > > > > > > Hi Andrew, > > > > > > you are right. Have to remove these lines. Besides enabling the interrupt > > > in MDIO_MMD_PCS_MV_TEMP_SENSOR1, there are two further register writes > > > necessary to make the interrupt propagate. I didn't want it to propagate. > > > Anyway it's wrong. I couldn't find a good solution to use the temperature > > > interrupt. Will have a look into this, and probably figuring out how to > > > do so. But it won't be part of this patch series. > > > > > > > From hwmon perspective, the expected use of such an interrupt would be > > to call hwmon_notify_event() with the affected limit attribute as argument. > > This would notify the thermal subsystem if the sensor is registered with it > > (your patch doesn't set the necessary flag when registering the driver, > > so this would not happen), it will send a notification to the sysfs > > attribute, and generate a udev event. > > > Thanks, noted it down. Didn't know about the notification to the thermal > subsystem and the generated udev event. :) > Note that you'd have to add something like HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), to the code to register the sensor as thermal zone. Guenter