Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4321118rwl; Tue, 28 Mar 2023 05:51:07 -0700 (PDT) X-Google-Smtp-Source: AKy350auoucSllJnHgT0Nkawxhno1RGbKS2BF9GIaf1IzZ2qhYpRvS5nnIpnb1XflSem+Ncpnng+ X-Received: by 2002:a17:902:f9c5:b0:1a1:c98d:179b with SMTP id kz5-20020a170902f9c500b001a1c98d179bmr13234304plb.60.1680007867688; Tue, 28 Mar 2023 05:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680007867; cv=none; d=google.com; s=arc-20160816; b=tuv2s3Xrwmq2VGaQg+XWJ9B+oMBM1BUTQI9r7XdlLUHAYoW8IUil5UnxH0YCapQh2k gerPTdrmiL8mLwYKF2G+QXP1H4RtH1Zuo5MLT1Op9dqS6kiwlWR/m1Uu+qamzk0wW6g2 QjcY1W2/QP+bqDocLuzOWyQGnwkaLBSWmf8fAoybcxobcljypjq9JOsulRPRo9qaBsef 0JLvZOUYxefrTQRemYS7293sZbTnKMZ8i3qdtXDEZ1iXc9IFLkBfjjpkxLeCRHroBnqG DOA6kJslC0CyutRXDiGqL9KOJ4dA0iOLbUCYzdTasRKiLEyT4YWESI8tUK4QjnVjQSUn lgiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UJ7P8VBaiLg49RuYw/oKsEep6xQ3Jo2s7Z5ZH26ZQco=; b=SkAbtt/sboscwPstpz1AjgYqsR6pmXi6jXce2ngRPN0p3VWDY7Crtr10n6wKCXjEEz JLRtcsX2CZ48+WpzY8rkSMvfJZ6X7QZlxrSttBTn17jGkHTT5dP1fzcEc9UzG3NA0D+r vQNd21R8iIFa5pLZtV7kemGJhCmgbf/dJ+t35dAilhM/O+9FUtV8HMFBGdDPw8v+QINZ urGxpexjiuoJUaqKwkBOLbi3+qvPLlUD8XEvas6sPsGmrrq8NmkiH61sDggJ4SPaCSsi binK8F1atIpW8/ljYyLKlYaU9Cqb9kE5RbhRSJ/1bFaGKZ56cq49hdGEaiRJsIlcqiAf myRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=YUgaphPO; 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=REJECT sp=REJECT dis=NONE) header.from=nic.cz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a170903409100b0019ce0ea2b56si27978900plc.39.2023.03.28.05.50.55; Tue, 28 Mar 2023 05:51:07 -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=@nic.cz header.s=default header.b=YUgaphPO; 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=REJECT sp=REJECT dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232993AbjC1Msb (ORCPT + 99 others); Tue, 28 Mar 2023 08:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232706AbjC1MsT (ORCPT ); Tue, 28 Mar 2023 08:48:19 -0400 Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96129AD15; Tue, 28 Mar 2023 05:47:59 -0700 (PDT) Received: from kandell (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPS id C5BBA1C147B; Tue, 28 Mar 2023 14:47:54 +0200 (CEST) Authentication-Results: mail.nic.cz; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1680007675; bh=HAg+KDLLnm2gtSA7y8AFWHCygEKFrbfSNudr8b36DU4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Reply-To: Subject:To:Cc; b=YUgaphPOQa0LwjUvK7e7VwILMLTR4FeRYzBJNdL6//XE8UjfCQsnoe/aeO5Jphh99 cHfBLny+PY8H9Kgt/bbXhE8niton9LmUbtH2e58MNYJl5+MSgopj2ogsK9t6Rkysy/ pUOYTyZdy9NTH3CFGWAKYvyIVniO9XuACcf7YUC4= Date: Tue, 28 Mar 2023 14:47:54 +0200 From: Marek =?utf-8?B?QmVow7pu?= To: Andrew Lunn Cc: Gustav Ekelund , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , kernel@axis.com, Gustav Ekelund , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: mv88e6xxx: Reset mv88e6393x watchdog register Message-ID: <20230328124754.oscahd3wtod6vkfy@kandell> References: <20230328115511.400145-1-gustav.ekelund@axis.com> <20230328120604.zawfeskqs4yhlze6@kandell> <9ba1722a-8dd7-4d6d-bade-b4c702c8387f@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ba1722a-8dd7-4d6d-bade-b4c702c8387f@lunn.ch> X-Virus-Scanned: clamav-milter 0.103.7 at mail X-Virus-Status: Clean X-Rspamd-Action: no action X-Rspamd-Server: mail X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spamd-Result: default: False [-0.10 / 20.00]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; WHITELISTED_IP(0.00)[172.20.6.87]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: C5BBA1C147B X-Spamd-Bar: / X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: WHITELISTED_IP 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, Mar 28, 2023 at 02:30:37PM +0200, Andrew Lunn wrote: > > > +static int mv88e6393x_watchdog_action(struct mv88e6xxx_chip *chip, int irq) > > > +{ > > > + mv88e6390_watchdog_action(chip, irq); > > > + > > > + mv88e6xxx_g2_write(chip, MV88E6390_G2_WDOG_CTL, > > > + MV88E6390_G2_WDOG_CTL_UPDATE | > > > + MV88E6390_G2_WDOG_CTL_PTR_EVENT); > > > + > > > + return IRQ_HANDLED; > > > +} > > > > Shouldn't this update be in .irq_setup() method? In the commit message > > you're saying that the problem is that bits aren't cleared with SW > > reset. So I would guess that the change should be in the setup of > > watchdog IRQ, not in IRQ action? > > I think it is a bit more complex than that. At least for the 6352, > which i just looked at the data sheet, the interrupt bits are listed > as "ROC". Which is missing from the list of definitions, but seems to > mean Read Only, Clear on read. So even if it was not cleared on > software reset, it would only fire once, and then be cleared. > > The problem description here is that it does not clear on read, it > needs an explicit write. Which suggests Marvell changed it for the > 6393. > > So i have a couple of questions: > > 1) Is this new behaviour limited to the 6393, or does the 6390 also > need this write? OK I am looking at the func specs of 6390 and 6393x, at the table descrinbing the Data Path Watch Dog Event register (index 0x12 of global 2, which is the one being written), and the tables are exactly the same. For every non-reserved bit there is the following: This bit is cleared by a SWReset (Global 1 offset 0x04). It will automatically be cleared to zero if the SWReset on WD bit (index 0x13) is set to a one and this event's Func bit is cleared to zero (index 0x11). Moreover only bit 0 of this register (ForceWD Event) is RWR. Bits 1 to 3 (EgressWD Event, QC WD Event and CT WD Event) are all RO. Bits 4-7 are reserved. (Once again, exactly as in func spec of 6390.) So I am not exactly sure what is going on. The errata document I have does not mention watch dog at all. Marek > 2) What about other interrupts? Is this the only one which has changed > behaviour? > > Andrew