Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp473524rbb; Sat, 24 Feb 2024 08:19:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNjDo4Z4XYuFcivtSg9Mjer1Ti9YbrFp4irchkxn9FQo5kP0lZFlQNd6fY1HNDv8ih+aYMjnvIpiyDAie5CwQdZ6VLEiFFBlfI6ev8wA== X-Google-Smtp-Source: AGHT+IG1Tf4jeRiIz8d01zhroG68MYiD6fSLj1k6clHFH6K743fsWQhFfOuwE+qf5EMWB3nLun5x X-Received: by 2002:a17:902:dad0:b0:1db:f03b:6f4b with SMTP id q16-20020a170902dad000b001dbf03b6f4bmr3451087plx.20.1708791580482; Sat, 24 Feb 2024 08:19:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708791580; cv=pass; d=google.com; s=arc-20160816; b=mMvNlMcxZlozGEnqQ78hzhRumFGnXDaDOvOOSOOh+HIVQ3vfiB89463f7r8TfiprOA 7KRTeUZeqpsa0B4muLAc6J8ClxgnZd5pPHV4LxLcyQqAKlxKr+hm4Bx4yxyOv/4kRSNM 5lYiw3SQKnRLmtYTjtYVhWn/6RP70WVFcqNZvRTQLyGR69HMwlUTFrwVuNSXVmBEnzAv sZwGppkuPEYDXea5OnSTfDA1rM1N6LGS/ezN807mbqcHDIuYQuKS7626WdiflfqI4Vbd XzAFi82fERAxQekoIGfvCHfVAxShNAP27cr7Gj2d5yu0EUJTx1/tqevStgwMbNv1YI1g X3jA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=JBNs0Oi94uBYMVQINhZjuNAnoif5ufke1sq/NtRZBoY=; fh=H1FDmTs5d05CQAEby+2GzQn3gD3FNKCopwejfr5LwEw=; b=fEQeky3eHqvbl/hyV3GqSMgr/RqDLRpoQNXu7tdNMn17wAAaYdUuuo3PK5w8PliB47 sRCERiTmcy6NqG4hSAuO2i73uyh+nhobCwWPFqbCSIoMnteOv2QO/HUgft/oENugbFwz 6nE3e0HGyHE/S/IhzOXxUgt9+RurzEmcsjasWcxv4mYA6I1botBEmbf1oaIkdMDp6bIS knLKPN1lb0BzCpPBykSlsnbgC91kUyJI0lc2thjDoIAbwZ/o3sQEi8K3yeO8bKyVYAD/ mzzLsjH3PwimEgeRr6FsI2AfWSApLycQUjdI61PEr6the+JMIwrtPgillEBB0SBg0U00 3kRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U+mSUysw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79737-linux.lists.archive=gmail.com@vger.kernel.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 c5-20020a170902d48500b001dc8dc26d73si312651plg.435.2024.02.24.08.19.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 08:19:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79737-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=@gmail.com header.s=20230601 header.b=U+mSUysw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79737-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79737-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 12C6F2823AC for ; Sat, 24 Feb 2024 16:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4423947A70; Sat, 24 Feb 2024 16:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U+mSUysw" Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 A65EBE559; Sat, 24 Feb 2024 16:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708791572; cv=none; b=dhjDQQxn32sq98QcDLKwU7l+tPIENHFhUDsLHTr8VzpzeJZZgV7QkfPyfBbNzbtWg4VpcvsmL9WLjNzdSB7qt/12W5nqBtYT6Am0bxwMAD7cV9BFazIxNg6PU5xw2sE6FvxytMdctb2AUhppFNfLvZOeUWvSu+kgOKjaeiAjubc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708791572; c=relaxed/simple; bh=R+RLgxsmQRIpqojcm4jtOaje2cFePuTttTDmu000CD8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D1jUjY/F+WLVS4Dmsj8N39BEanNFQuFL9abibJ7Pi04YbVNyY8qta8kscWiyR8UeJlSvCuTiBvDRB91nASwJ6QmZK60zuafxQdOveczYIZcMMF2IBtZ74XfP8S9RcHhgpF67gKaT7sPLoI6HPiorYdTb85NZ7CxdKX5mf/rBwPI= 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=U+mSUysw; arc=none smtp.client-ip=209.85.214.178 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-f178.google.com with SMTP id d9443c01a7336-1dbb47852cdso15311615ad.1; Sat, 24 Feb 2024 08:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708791570; x=1709396370; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=JBNs0Oi94uBYMVQINhZjuNAnoif5ufke1sq/NtRZBoY=; b=U+mSUyswagaeA+hb3plFgJtc701Ar0ka727MPT9uIO38KfCh80rxyFft1F9qnyqTyX iFxz2t6aYGTHpRMGVqKruUxN/qT2ZVCu8f8cmIPMyVeqGL2jnWGzz8nGCxDcdQ8KZobv c7dAajYxZxDrczm9xSdqq6biB7I+ExluvEGa+Ci4ZeRq/mdXQ/X62lc9iwq/8wBD+O0G TqHgsqnzhre8gWhk9eWugh3eVb0sJ4eAoATSKc6R29XrPrlSswaUxaeCyV08eVpSHe73 bk08RZEG3LrV3jdmkPhNP/jN49p2fN+1oh7ejPRMRPdCu94RzRmSUczb8Pb8ORzE6ljI uc/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708791570; x=1709396370; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JBNs0Oi94uBYMVQINhZjuNAnoif5ufke1sq/NtRZBoY=; b=VEQf2SmtdEldsHd48Iq/4YSZkwJv3MRTpA5iyXocYOHobDFJvSAiOoC2lcaiKiZldB KrtvQyLqXyK/PJQzBvuikodG3C7YugpMo//AEJp79JmjZKHomlD1ClPX+EaMjcwlq/31 5PO40FC9b+kxAx60kTnQiNHriK3rtWMld0swl1K3r8kzmg+cCWBlvLb9q0e+AN7rQ1Jf KqWfRlOX3CmNqQ3NL9UCIc5LWxpi8DoJplhBh0wN42Iuev7E2FBARe03pafcsmy8EDSp fR7WDBiOSr7WY83KHrpK/fZQ8rUoH4Q5QpQvK4U+ATxAirzEQfwddwMq4Bi0IWwkAe8/ V50Q== X-Forwarded-Encrypted: i=1; AJvYcCXeCR0Waah36J88vQqXEb7FlpVwZUB12F01NSGe9aPOjLL4WoqGrAXXUnlLx/R/Po7uHjDPSZ5V0AAPytmaPVls0Q3jyiaq4rwtwf1AdXQ= X-Gm-Message-State: AOJu0Ywj/FvOcHblDsHv8VB4vFsS8QssBQVKOQpBsAqsgYhmJEfrzgfK M79e8Blkxdb6Q4MPvWqoaysgnUOWCZ35A7p3gsZkOeSXXqglVwee X-Received: by 2002:a17:902:ed0d:b0:1dc:78ea:1ae with SMTP id b13-20020a170902ed0d00b001dc78ea01aemr2644698pld.26.1708791569725; Sat, 24 Feb 2024 08:19:29 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z2-20020a170902834200b001dbe88fe462sm1181903pln.220.2024.02.24.08.19.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Feb 2024 08:19:29 -0800 (PST) Sender: Guenter Roeck Message-ID: Date: Sat, 24 Feb 2024 08:19:27 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] watchdog: add in watchdog for nct6686 Content-Language: en-US To: Mark Pearson , David Ober , wim@linux-watchdog.org Cc: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, David Ober References: <20230912112747.285393-1-dober6023@gmail.com> <78da7ad0-cc11-4e6f-bf25-12bd5ec247a0@app.fastmail.com> <8458d626-8862-44ed-8966-2f60852c92bb@app.fastmail.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubm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pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <8458d626-8862-44ed-8966-2f60852c92bb@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/23/24 11:49, Mark Pearson wrote: > Hi, > > On Tue, Dec 19, 2023, at 3:05 PM, Mark Pearson wrote: >> On Tue, Sep 12, 2023, at 7:27 AM, David Ober wrote: >>> This change adds in the watchdog timer support for the nct6686 >>> chip so that it can be used on the Lenovo m90n IOT device >>> [ ... ] > > Would it be possible to get feedback on if anything else is needed for this patch please? > We have customers wanting to use it, and we've ended up having to provide it as an out-of-tree module. Would love to get this integrated into the kernel properly. > The locking in the driver is pretty much pointless since accesses will be serialized by the watchdog core. At the same time, all driver-local locking will not prevent access to the chip from the nct6683 hwmon driver (which also supports nt6686). If both are instantiated, I don't immediately see how they would not corrupt each other. Other than that, there is unexplained code such as nct6686_wdt_set_bank(), which writes two bytes into the chip, and nct6686_wdt_reset_bank(), which only writes one byte, but only conditionally if the bank is != 0. That doesn't really "reset" the bank; at best it selects bank 0xff unless bank 0 was requested. I don't really understand how that would be "play safe" since it is not explained what that means. Besides, the hwmon driver doesn't do that, so I don't understand the implications. Actually, looking into both the this patch and the hwmon driver, it seems that they are locking out each other, with "first driver to probe wins", by reserving the access memory range for themselves. That is not acceptable. I'll have to study the chip datasheets in detail to understand if there are other potential issues, and I have not had the time to do that. Guenter