Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5455174iob; Mon, 9 May 2022 17:18:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj8bGnXmXYN+ALwalGSjAUpEHyKEuEm2F4qmeq5QM7RPqHcTwtKDAnN0MJoL5aYGNAquRq X-Received: by 2002:a05:620a:2903:b0:6a0:4d8f:8b88 with SMTP id m3-20020a05620a290300b006a04d8f8b88mr11810794qkp.328.1652141936020; Mon, 09 May 2022 17:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652141936; cv=none; d=google.com; s=arc-20160816; b=ryPdSgG36vb5+4G5jZPOm7N16H3m+QCSKNdCQp6m2VJMKEAWNFQydETx84j9qdl7Zd pT5ALzkZ9bYflESmdERxCUrYjjf7kynzJ1z+JHyvFfoYnmUq1Jg7iJ0cMnt61p9n7J6k pvBzeIFUfgDq8Zu1DRZyJqLqk4AWgvXH3aBCOqm/oVME4hMzP8KROAmxPdLsfkXON+XY DXFkLkA7vpGCwzmnaAwOwwF7MACOOXhHZ4HlDWgwcmgtqoQhfiLrWadv2kc7d8eoT5tR GIMXWbiyEzEYkTv4zT8OWgZ/ILAz3GEy0HT6pQuGctF63gFvZ+z8NB2krOwqCbNXntHH ubvQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EmgXIp6wMnmBy4zjwHY36GV+5Al3/f1oiVUfAfxCvxk=; b=mT04Km9rYAHDnvH2uf9cClE79OviR0CLFUoP4gv5E/RAjs/BhTVLvs0WU8XIouRQTj AUcCpAQt8jkBprABJZPpV/XJGo2BcYVwgDldrlB9pHM7DUABXV+wO0iK9h0HIGovaA07 Ze6kWa1W0Q7Ss+sc/QKSKq77sfvb6ExFgxzOz9k8UNEt8i2kH6mzHMYu8kQqbGV2TzyN wlHzCf7M1YNtSY+AHgcjT4ydb9sHbU1BQpUWM8juEIcfdOPBT+Q444adA075+NjKEsTP dqYfousA/VTNTXJS3RLpETxmCfY9Vsx6Hvx2LVJNaOwacbaGCORv5wSvXkJf660ZSeNo 3uQA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f25-20020a05622a1a1900b002f3ba05e3easi9298556qtb.353.2022.05.09.17.18.41; Mon, 09 May 2022 17:18:56 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232256AbiEIXQY (ORCPT + 99 others); Mon, 9 May 2022 19:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbiEIXQX (ORCPT ); Mon, 9 May 2022 19:16:23 -0400 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 085B92A3773; Mon, 9 May 2022 16:12:28 -0700 (PDT) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-d6e29fb3d7so16432631fac.7; Mon, 09 May 2022 16:12:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=EmgXIp6wMnmBy4zjwHY36GV+5Al3/f1oiVUfAfxCvxk=; b=k5jxUUGjw3xPc9EL8QU3bBdnolB6+FtcBPTVtvBjchZYxk2EGWi08QdyfKmITvU3mD +OoTsNjuJXGcIl1/zR9XT7Z3J5fFePpJ3oxFxsgCwX/aoIMdtriGYcp0tctO+VJIP6bL XRv47Mv/GyUyomS9jBHx1DX9SFFrhbvr5ZE62Yo+OERyZKEbEdoRBWBNa3NDVRlcyJCd PR1gl89jts91sadW81hmuuTC28Av+wEf9ugXSRXp5naG6A7PudcwBcMuTTHUU/XMY4j/ F0CPTHbsoSPD0JfnH8Q+S8UTE9JVNpNm1wwDNiwj3tyHG4+IJeqEArLEwAwCfbXXcjdX iJvw== X-Gm-Message-State: AOAM532U2XUYrn1g5roxAPFTvXKl97SHwqxbSuDKzHdLiK5jrXkQHpuZ KYWYMmGfMXLRCV3uagUb3w== X-Received: by 2002:a05:6870:c698:b0:de:8a16:c37 with SMTP id cv24-20020a056870c69800b000de8a160c37mr11542610oab.191.1652137947285; Mon, 09 May 2022 16:12:27 -0700 (PDT) Received: from robh.at.kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id x7-20020a056870a78700b000e686d13897sm4746599oao.49.2022.05.09.16.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 16:12:26 -0700 (PDT) Received: (nullmailer pid 393081 invoked by uid 1000); Mon, 09 May 2022 23:12:25 -0000 Date: Mon, 9 May 2022 18:12:25 -0500 From: Rob Herring To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Marc Zyngier , Thomas Gleixner , Bjorn Helgaas , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Petazzoni , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Marek =?iso-8859-1?Q?Beh=FAn?= , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/6] irqchip/armada-370-xp: Implement SoC Error interrupts Message-ID: References: <20220506134029.21470-1-pali@kernel.org> <20220506134029.21470-3-pali@kernel.org> <87mtfu7ccd.wl-maz@kernel.org> <20220506183051.wimo7p4nuqfnl2aj@pali> <8735hmijlu.wl-maz@kernel.org> <20220506185546.n5rl3chyyauy4bjt@pali> <87levd7m2n.wl-maz@kernel.org> <20220507092054.b7yu23nj667l6xhy@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220507092054.b7yu23nj667l6xhy@pali> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Sat, May 07, 2022 at 11:20:54AM +0200, Pali Roh?r wrote: > On Saturday 07 May 2022 10:01:52 Marc Zyngier wrote: > > On Fri, 06 May 2022 19:55:46 +0100, > > Pali Roh?r wrote: > > > > > > On Friday 06 May 2022 19:47:25 Marc Zyngier wrote: > > > > On Fri, 06 May 2022 19:30:51 +0100, > > > > Pali Roh?r wrote: > > > > > > > > > > On Friday 06 May 2022 19:19:46 Marc Zyngier wrote: > > > > > > On Fri, 06 May 2022 14:40:25 +0100, > > > > > > Pali Roh?r wrote: > > > > > > > > > > > > > > +static void armada_370_xp_soc_err_irq_unmask(struct irq_data *d); > > > > > > > + > > > > > > > static inline bool is_percpu_irq(irq_hw_number_t irq) > > > > > > > { > > > > > > > if (irq <= ARMADA_370_XP_MAX_PER_CPU_IRQS) > > > > > > > @@ -509,6 +517,27 @@ static void armada_xp_mpic_reenable_percpu(void) > > > > > > > armada_370_xp_irq_unmask(data); > > > > > > > } > > > > > > > > > > > > > > + /* Re-enable per-CPU SoC Error interrupts that were enabled before suspend */ > > > > > > > + for (irq = 0; irq < soc_err_irq_num_regs * 32; irq++) { > > > > > > > + struct irq_data *data; > > > > > > > + int virq; > > > > > > > + > > > > > > > + virq = irq_linear_revmap(armada_370_xp_soc_err_domain, irq); > > > > > > > + if (virq == 0) > > > > > > > + continue; > > > > > > > + > > > > > > > + data = irq_get_irq_data(virq); > > > > > > > + > > > > > > > + if (!irq_percpu_is_enabled(virq)) > > > > > > > + continue; > > > > > > > + > > > > > > > + armada_370_xp_soc_err_irq_unmask(data); > > > > > > > + } > > > > > > > > > > > > So you do this loop and all these lookups, both here and in the resume > > > > > > function (duplicated code!) just to be able to call the unmask > > > > > > function? This would be better served by two straight writes of the > > > > > > mask register, which you'd conveniently save on suspend. > > > > > > > > > > > > Yes, you have only duplicated the existing logic. But surely there is > > > > > > something better to do. > > > > > > > > > > Yes, I just used existing logic. > > > > > > > > > > I'm not rewriting driver or doing big refactor of it, as this is not in > > > > > the scope of the PCIe AER interrupt support. > > > > > > > > Fair enough. By the same logic, I'm not taking any change to the > > > > driver until it is put in a better shape. Your call. > > > > > > If you are maintainer of this code then it is expected from _you_ to > > > move the current code into _better shape_ as you wrote and expect. And > > > then show us exactly, how new changes in this driver should look like, > > > in examples. > > > > Sorry, but that's not how this works. You are the one willing to > > change a sub-par piece of code, you get to make it better. You > > obviously have the means (the HW) and the incentive (these patches). > > But you don't get to make something even more unmaintainable because > > you're unwilling to do some extra work. > > > > If you're unhappy with my position, that's fine. I suggest you take it > > with Thomas, and maybe even Linus. As I suggested before, you can also > > post a patch removing me as the irqchip maintainer. I'm sure that will > > spark an interesting discussion. > > You have already suggested it in email [1] but apparently you are _not_ > maintainer of mvebu pci controller. get_maintainer.pl for part about > which you have talked in [1] says: > > $ ./scripts/get_maintainer.pl -f drivers/pci/controller/pci-aardvark.c > Thomas Petazzoni (maintainer:PCI DRIVER FOR AARDVARK (Marvell Armada 3700)) > "Pali Roh?r" (maintainer:PCI DRIVER FOR AARDVARK (Marvell Armada 3700)) > Lorenzo Pieralisi (supporter:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS) > Rob Herring (reviewer:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS) Please just refactor the code in question. You've wasted more time arguing about it than it would take to do. Having done a bit of PCI refactoring, I can tell you hardly anyone else does. I can barely even get comments/acks on refactoring until I break platforms (which happens a lot). Maintainers have no other leverage other than what Marc pointed out. In any case, I think there's no way the PCI maintainers will take this as-is at this point. Rob