Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2517682pxa; Fri, 7 Aug 2020 13:10:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmaC6rPMWcXzzbfsk/7e05T0957et1E+zpBV8rH2SGLVQ02QvO5fMzYg+XUrTeUeL3m9fj X-Received: by 2002:a17:906:fc10:: with SMTP id ov16mr11383298ejb.171.1596831012338; Fri, 07 Aug 2020 13:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596831012; cv=none; d=google.com; s=arc-20160816; b=duYgRaBVkrK126atJQiloAcdQl0aFzanKlL4ON0n/VHaE4/+bw1AaBJxCa9wdT+R/b kUa5bPDFf62b+iqEzWwqq9WpIUrewLZDmRwy+jDNokzwvnNN7ZdVrXztTUednIhys0rw JSdYuPjxA47SPVQySkWzcKEV5pWVYYtlkwfCn1eOo+5PiP0zDnmj9W7oVFmkRHZRZmPw 9bhRRsjUkYQCxDOWfZAqqnHpsL6P/wB/aSjeJ/Gpix1jySUGknqmL5XjSTucXi0ANbnE z2DtziRF9jZXhw+E5y2czLYke0L63w08z1YKlkRWpI5jKt5heVNB0A/wzEGFIx13Cwn6 iP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=v6shjW3mv0CzotYibzehFT5/hINT+XFxzYyCDrE83Dc=; b=oFX/zmE2Mt1nNpnYIC90ax+Ey08QVZ1IezjuerVKQSjWwPLY5aqT+N+EGJCmQlGunT N7xlXCML5tvgGDduFgMZ3ucGyNVjL7rFmpGVKHYXo5Qh782++RwSyJb9bJKuVrhn0XR9 En257eg6vdKFGqcbXEoCYWxNpL66WTbReSvQ+oRQgm0180VsMjOIggxrqQtp1T+iXPRY 2Hb2SDq89df22nRYjrv1Tgu5L77Ji2Ioc91ABwBi7pP6FSn+2Nv8UAnWCvgbk+sT/yfu YqG5imANeuJraU5/vwRK3+YEC98mFpfKjMExOphep5IyCPriHqmuwbn8d6sFFv8a7kUS kU8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Ve3N/HXw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si5813217edr.317.2020.08.07.13.09.49; Fri, 07 Aug 2020 13:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Ve3N/HXw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726066AbgHGUJJ (ORCPT + 99 others); Fri, 7 Aug 2020 16:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgHGUJJ (ORCPT ); Fri, 7 Aug 2020 16:09:09 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2F7EC061756; Fri, 7 Aug 2020 13:09:08 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id l64so2847648qkb.8; Fri, 07 Aug 2020 13:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=v6shjW3mv0CzotYibzehFT5/hINT+XFxzYyCDrE83Dc=; b=Ve3N/HXwsKv8ySPPGskSnRr5Uacjl8x1Kputs8iftdehBMa8UVQ30VCtrkGpg4pA1J fIoi7mUMWwDUbL7lEeZUzkTSYGzk+kavkV3YwUrCg/Mwi3/cIdkw99a23kUQ7rCks1JB iNXh7CbDevDlHYGKRcsjuxVLIdZXq2glnT7xi9PaTrPbe0nPQ0ZKS+DRaz/K/n9+sm/d t3DWG4TtMRUPtUs1Mx8bhJOie6SGgh6iidRRoOxIxioT+YZ1N2ydkIJpRx8FGnVP8Kcb 6kPOrnKsaXZ70kQ0DYDruyvlDh4M8PC44n/c9Fr6354XzrS8/QYdmCjbtOcok5at1VYm 6ILQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=v6shjW3mv0CzotYibzehFT5/hINT+XFxzYyCDrE83Dc=; b=GHzdK+x32F4QVXwpqujAG2jNBg9RHkJuSMJp/VjLrK1sp9Yj8XzWH1ubAE+qQ676gg 9i2LFrcC9GJMfDF30vFQ//CYPF5PjIDkYWLEP2aj16sPAE4isEuti5BuP79RwUfwpaXL EW6hnPWeXDfSEzJmxMyLojWvlx9Eoyb0TcV8pj9fZRXa5kOwemyF/BtXkwYRzHEMiYSJ /8AWjBcmLtcPVyPde42uAgquczsjcSzmT0tDZML0zEXeWWkaCEswrvWNNx4pz/HoQ+Nw yeVmDVa8r8Q9oEf7skudFxLfkSsoqSwNoKOoEq5a81QlkqirNX0MHq++yL4zup6DifW+ 7BBA== X-Gm-Message-State: AOAM530tQXgDsCQIkW9VU8GV65A0tZLGKsQHzL/OG3PuTHhzeOMERYw6 xxg/NGJxJ4urPTAfbf45/3M= X-Received: by 2002:a37:a6c3:: with SMTP id p186mr14827311qke.135.1596830947429; Fri, 07 Aug 2020 13:09:07 -0700 (PDT) Received: from [192.168.1.3] (ip68-111-84-250.oc.oc.cox.net. [68.111.84.250]) by smtp.gmail.com with ESMTPSA id n127sm8006909qke.29.2020.08.07.13.09.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2020 13:09:06 -0700 (PDT) Subject: Re: [PATCH] drivers: watchdog: rdc321x_wdt: Fix race condition bugs To: Guenter Roeck , madhuparnabhowmik10@gmail.com Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, andrianov@ispras.ru, ldv-project@linuxtesting.org References: <20200807112902.28764-1-madhuparnabhowmik10@gmail.com> <20200807162141.GA41980@roeck-us.net> <8dca64a1-8cd9-6a41-b61d-1c4c14e5cd5e@gmail.com> From: Florian Fainelli Message-ID: <1b9db5ad-0edf-091b-a04e-a8f3a6ac08e2@gmail.com> Date: Fri, 7 Aug 2020 13:09:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/2020 12:08 PM, Guenter Roeck wrote: > On 8/7/20 11:08 AM, Florian Fainelli wrote: >> >> >> On 8/7/2020 9:21 AM, Guenter Roeck wrote: >>> On Fri, Aug 07, 2020 at 04:59:02PM +0530, madhuparnabhowmik10@gmail.com wrote: >>>> From: Madhuparna Bhowmik >>>> >>>> In rdc321x_wdt_probe(), rdc321x_wdt_device.queue is initialized >>>> after misc_register(), hence if ioctl is called before its >>>> initialization which can call rdc321x_wdt_start() function, >>>> it will see an uninitialized value of rdc321x_wdt_device.queue, >>>> hence initialize it before misc_register(). >>>> Also, rdc321x_wdt_device.default_ticks is accessed in reset() >>>> function called from write callback, thus initialize it before >>>> misc_register(). >>>> >>>> Found by Linux Driver Verification project (linuxtesting.org). >>>> >>>> Signed-off-by: Madhuparna Bhowmik >>> >>> Reviewed-by: Guenter Roeck >>> >>> Having said that ... this is yet another potentially obsolete driver. >>> You are really wasting your (and, fwiw, my) time. >>> >>> Florian, any thoughts if support for this chip can/should be deprecated >>> or even removed ? >> >> I am still using my rdc321x-based SoC, so no, this is not obsolete as >> far as I am concerned, time permitting, modernizing the driver is on my >> TODO after checking/fixing the Ethernet driver first. >> > > Do you have a manual ? I'd give it a try if you can test it - conversion > should be simple enough (I have a coccinelle script which partially > automates it), but this chip seems to have a fast timeout, and the > comments in the code ("set the timeout to 81.92 us") seem to be quite > obviously wrong. Yes, there is a public manual for that SoC, search for RDC R8610 and the first link you find should be a 276 page long manual for the SoC. I probably won't be able to test anything until the middle of next week though. -- Florian