From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 885E3C3279B for ; Wed, 4 Jul 2018 16:54:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4717F21A74 for ; Wed, 4 Jul 2018 16:54:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4717F21A74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888AbeGDQyC (ORCPT ); Wed, 4 Jul 2018 12:54:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41702 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbeGDQyA (ORCPT ); Wed, 4 Jul 2018 12:54:00 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w64GoJeR012201 for ; Wed, 4 Jul 2018 12:54:00 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k0xf313sr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Jul 2018 12:54:00 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Jul 2018 17:53:57 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 4 Jul 2018 17:53:54 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w64GrrVW39125224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Jul 2018 16:53:54 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1A6352051; Wed, 4 Jul 2018 19:54:18 +0100 (BST) Received: from oc4502181600.ibm.com (unknown [9.77.203.159]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7F8975204F; Wed, 4 Jul 2018 19:54:17 +0100 (BST) Subject: Re: [PATCH v2 2/2] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups To: Guenter Roeck , mpe@ellerman.id.au References: <1530695793-4584-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <1530695793-4584-3-git-send-email-shilpa.bhat@linux.vnet.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com From: Shilpasri G Bhat Date: Wed, 4 Jul 2018 22:23:51 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18070416-0020-0000-0000-000002A31862 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070416-0021-0000-0000-000020EF3A48 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-04_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=849 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807040192 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, Thanks for reviewing the patch. On 07/04/2018 08:16 PM, Guenter Roeck wrote: >> + /* Disable if last sensor in the group */ >> + send_command = true; >> + for (i = 0; i < sg->nr_sensor; i++) { >> + struct sensor_data *sd = sg->sensors[i]; >> + >> + if (sd->enable) { >> + send_command = false; >> + break; >> + } > > This is weird. So there are situations where a request to disable > a sensor is accepted, but effectively ignored ? Shouldn't that > return, say, -EBUSY ? This is because we do not support per-sensor enable/disable. We can only enable/disable at a sensor-group level. This patch follows the semantic to disable a sensor group iff all the sensors belonging to that group have been disabled. Otherwise the sensor alone is marked to be disabled and returns -ENODATA on reading it. And a sensor group will be enabled if any of the sensor in that group is enabled. I will make changes to the remaining code according to your suggestion. Thanks and Regards, Shilpa