Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1193160imn; Sat, 30 Jul 2022 19:45:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vSMXfMjWEo7Yrq8lWZ/wLy6cNY7L8dqDwgWJ8MSS3GK3C+SQVOsf4whLgJlqs8SnZJdaxj X-Received: by 2002:a05:6402:34c8:b0:43b:e7b1:353c with SMTP id w8-20020a05640234c800b0043be7b1353cmr9907806edc.171.1659235546395; Sat, 30 Jul 2022 19:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659235546; cv=none; d=google.com; s=arc-20160816; b=FWrraurJSJPts62C97eKrcT7392/ZXF/hvwNe8OLXNiZnoAzfSSFa5sHplbsB93nGg F8Oh0Ws7BLfmQ2TPI6TkYD0xlxUnCMiK9KL4/ZFD5ojeN7jGLUtc7ET8YT/bUdwmw5PJ d7EP/9bwPEqazTO1W2n3mgZd9YFCWqMwd7tIP3iyXNunqcI1WFmhNDFSs4e0lq3zhj7V AkYxlZvcKxvPOzh3HGdd+utuNrUuACMmkMKt6kgJQBxeYZMhRR/+Z0Wj9WzW4V9dJke7 zp/hOV/fyzzOK2BKbfzECaynzaMDIpI9Z8IO5BMLSPLwqSma5Qo/Zq5XpJmS12dFiKHe wAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=T481nvKuJ0ZTtRo/nf05qojcNx9GtNMP4sCJDBL+oLQ=; b=bJtxQelQzCblH12VE5gr+L8rgoGoGmygvgcmm2RHAR/kMzkWX+Gf+W/Ta/S8xpZxNH aSjJzmVx+O1hRIXaZFMT5gZHXXePBjR8LaJXPbQNmROUJyjMKd781lwvIfmOlAvC7OGW uKB9mcCOJJxWUfUROndP6+PNjOymBa54hFXSKOJE5LmmTYHZ8j8xk5olq9JCyd0VId0N 9l2NaTr7eweY4/LxytDSQOVTr0/PtA3bN0UNq7ywD2y5Ga39yRYL9568emBJiYl3fzqS S/ExMiDHz1TAJWH99aDCR2mrVvXyfAczYH9dI7RWqpKHhbxNdrC2D0z6dYPgw1jOpoMm jeow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DTGDdewi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s26-20020a50ab1a000000b0043c06d49f38si4648539edc.242.2022.07.30.19.45.08; Sat, 30 Jul 2022 19:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DTGDdewi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232779AbiGaCeb (ORCPT + 99 others); Sat, 30 Jul 2022 22:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiGaCea (ORCPT ); Sat, 30 Jul 2022 22:34:30 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70F0513E12; Sat, 30 Jul 2022 19:34:29 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id z20so1785475ljq.3; Sat, 30 Jul 2022 19:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=T481nvKuJ0ZTtRo/nf05qojcNx9GtNMP4sCJDBL+oLQ=; b=DTGDdewi7Ruokf1EYnkRlH8lX3VbWOoeATFlk05uc3Gu1p63jpPWePHa8NrNOBo19M Mi0jWpOVxA+dGf2JJtqijlJNDoAjLKLfuR0Vkp3oFO2sVLVrTXSv97Xw91kK+Rn54Kp6 O7UXGI4+zZ+WKmIyN6Vpj6SEQKPrT7VvFAdqsPG2d8UFp1H/aqqWkBqhUiCmsQG6UkCP +cw9EN/tCIjt4wP5Opew/7l3npzALT0iQ9LNqswu016+FkHl09KNJYH86CGzIBKfc2zl ufy6pPKD0qjes1XJMmx+ygJJHp7Z5jCCu/3YvHqbRl9EBfAK3GzeSvgpPt14jFYNtF3H 65Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=T481nvKuJ0ZTtRo/nf05qojcNx9GtNMP4sCJDBL+oLQ=; b=hTK6fJ3OBFT7jBmu1IgsFFLa3SBWWbjM/V45elpm5cbQCXd3B/0AeOxgc4fyV1cHrM 4oJi9TBjdLyL4+W8XfscRNIx2Qd5aBPiF2eFNzFWnpmyXBd1dWKFFEbv8HtBQeVEI4l+ QG47Hf/0jqo69ca2aubmD1y0mU28t1Gtq15L+ZgWjp6CQ63fcyRLpT6vXr5KHNhGp716 /URaBqTJzeTHNmJA7EVkUBwHb3x//9ii7r7ToxiLQzvky8Wl4keI8w+oq2qkpQ1OWebd L2H1ziJrT9AuiQu7UIIUqJm3dLxp0NYUhuGn4W8ZECja1N7oEX3/wFfLA4tT7+oBjkOR BY7A== X-Gm-Message-State: AJIora/2vOLp6+05lLFuC1Oqn+Sa5xEFaJ9noSBqbMdp+aEWe1jzjCXC p952T5iN6PGTyuoNJEBoNHoUAi8N3OP2s9nHLI0= X-Received: by 2002:a05:651c:886:b0:25e:3440:9518 with SMTP id d6-20020a05651c088600b0025e34409518mr3331600ljq.248.1659234867669; Sat, 30 Jul 2022 19:34:27 -0700 (PDT) MIME-Version: 1.0 References: <20220725030605.1808710-1-klimov.linux@gmail.com> <7770401d-fe3d-bda4-a2e2-55cd004a2d07@suse.com> In-Reply-To: <7770401d-fe3d-bda4-a2e2-55cd004a2d07@suse.com> From: Alexey Klimov Date: Sun, 31 Jul 2022 03:34:16 +0100 Message-ID: Subject: Re: [PATCH v5] watchdog: add driver for StreamLabs USB watchdog device To: Oliver Neukum Cc: Greg KH , linux-watchdog@vger.kernel.org, wim@linux-watchdog.org, Guenter Roeck , USB list , Linux Kernel Mailing List , atishp@rivosinc.com, atishp@atishpatra.org, Yury Norov , Alexey Klimov , Aaron Tomlin Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 26, 2022 at 8:48 AM Oliver Neukum wrote: > > On 26.07.22 02:21, Alexey Klimov wrote: > > On Mon, Jul 25, 2022 at 9:51 AM Greg KH wrote: > >> > >> On Mon, Jul 25, 2022 at 04:06:05AM +0100, Alexey Klimov wrote: > > > > [..] > > > >> Anyway, driver looks good to me, nice work! > >> > >> Reviewed-by: Greg Kroah-Hartman > > > > Thanks, Greg. If you don't mind I'll use your tag in next version > > after making changes suggested by Guenter since there will be no > > significant functional changes. If code will change a lot, then the > > process (Documentation/process/submitting-patches.rst) will require me > > to drop the tag. > > Hi, > > while thinking about this a question arose. How does this > device react to a USB reset? A watchdog that can be disabled > by a simple reset does not like very reliable to me. > Do you need to implement pre/post_reset() ? You're right. Upon reset the watchdog is disabled even if it was active before. Adding empty ->pre_reset() and ->post_reset() helps to avoid that, but looking at Documentation and other drivers it seems that I need to do: in pre_reset(): mutex_lock() to block any other I/O to the usb device; __usb_streamlabs_wdt_cmd(STOP) to stop the watchdog; and do not unlock the mutex; in post_reset(): if (watchdog_active()) __usb_streamlabs_wdt_cmd(START); mutex_unlock() to allow other's I/O to the usb deivce. Seems right? Best regards, Alexey