Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1217311rdh; Fri, 24 Nov 2023 07:33:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWfCLE/7ZSk89WD4QfR0n9VacV85GglLuECERucUpVakj79rit1IWnqR1SYDskkDhuysen X-Received: by 2002:a17:902:f68e:b0:1cf:9bd1:aaea with SMTP id l14-20020a170902f68e00b001cf9bd1aaeamr4124774plg.11.1700840001096; Fri, 24 Nov 2023 07:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700840001; cv=none; d=google.com; s=arc-20160816; b=uWVYq3XF+jlMLXJUgxm+5nt38uliza5oEqxyhQOrvrsmtex/5t8zeBR8dKh0TmanQN wG2UogkrSdZTRPkvo6xBHWMi31wRLXWckEvnxt/U+D7P+xLNkLWOZpLzdTSFlGEUhSZe pPOBtDQ3dpRi1vrOInG3UhhhZny9syncvLolLu/2C6Lwa2c/udw8y7kOmDaRLGglP7M7 ZE4uAWBsf41uF7bVxJFk17INTEKlwmpVF4vmobxRDxxN299qBozd7lvFcgVU1tSNplbo fR99e72L3Oc7/EliFGXEF3Hg9gJZd9maDHNnn7I2wQod/gt6gOkIqNbJU2KhFeOhv9ow SzNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=eRK+vExLgDNmQIkKz5bLbrtvkKYmpG6qoQ5cgKImwFM=; fh=+0Fond1Dc8+jA3NhViuh3TxbJ/XCjS4RLpvcSsxKs1s=; b=FfZCdi4M8kaIrta8folwmdinmY3iW2yd5zzpwmvdb22ze+2pVEe0aVviBYZWi8ZuD3 RvEbkG3pYHm6vtwqKeeTR6uULAUkbScq095BrytiGoybpzpgtmu1XilfRDgWO7Zb75CB HAsW3tnaAEqIoRNO1jCFE2dTBWYVjvf3PbuszbeEKuF5Ng6y8WJsMatSBy8fVwhN0hrP lrJNld6/bgFEC4zurLBctdTzkVmlA+hv5AJUH3V9gqYvssqUdm98oIdT81sX5n8csUUs WB3m5Y3xrwvx1AI/uh239++upaq9nBIzt+now89Z33pAvv04OslHJ19UREeddIibRWrs ZkCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ITfUEpdu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x4-20020a170902820400b001ce078b233fsi3486213pln.609.2023.11.24.07.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:33:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ITfUEpdu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 49351832D4CB; Fri, 24 Nov 2023 07:33:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345736AbjKXPdF (ORCPT + 99 others); Fri, 24 Nov 2023 10:33:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbjKXPdD (ORCPT ); Fri, 24 Nov 2023 10:33:03 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 426E310FB for ; Fri, 24 Nov 2023 07:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700839989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eRK+vExLgDNmQIkKz5bLbrtvkKYmpG6qoQ5cgKImwFM=; b=ITfUEpdu6EInmkv+2dSc92eVJo4d6mf1qfs4jOw9wN952/SH2D/Z/H5i1qkkhPK9hNFaZO W1YSWnUOgrRj7t4h+cBUSYdZYaoPUV4/XhTI9q3pHVgtFykTLGQeEOD/XwOTXkSoGVM464 XGoMqUv8BOIbQQn1tZB3cV9AQu8bILE= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-33-XbYeKowlPiyGnhL2LBJ1fQ-1; Fri, 24 Nov 2023 10:33:08 -0500 X-MC-Unique: XbYeKowlPiyGnhL2LBJ1fQ-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-54848173cf8so216601a12.1 for ; Fri, 24 Nov 2023 07:33:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700839987; x=1701444787; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eRK+vExLgDNmQIkKz5bLbrtvkKYmpG6qoQ5cgKImwFM=; b=MgD1o4TJ8wUmsC47KYxC4BRxcdQxIhfuGJsS9C5atu+7ASX/zy7J5vCvPtPSY7DbRc v6ciP4pC8jhEayQjxT4PqQHJWZ4H+0iQ+1Td2j/FHp+3cfH/5YXdyzP3rqSuRKy8HtDf fDCJyo/rvcSQ4ERqOp1sexn8pm8teko8P5crTyTNzTWR9/gRCV6XCOta7+ar218Ky1TF JJ6koo/AiqaFMLemz25YbBdm25J2lb3M0/ohlSq+EMsXLBeOz2+NukqJtruVdeU8QpDP ooT++67Y2CyCo/tOHPkb8VKhcQelg6kk1/2QhC5QIPQ7b6f/Dajas7Yk/KSKMWvabiCa gysA== X-Gm-Message-State: AOJu0YwwQ32iVmmchTH6kKTs9qI8MeYmF00LjpHfrk+HLNTBLxa1Z23a W5B48eRRPJPtKQGHKJQy3z/1FhQqjLcru6FqdVzmgrDD6wERLx/Pg5U/0m3DInCtqaHyVRDE6a1 tVu1t5+zNBmSvuFn7kAw5RBVx X-Received: by 2002:a50:ec96:0:b0:543:6222:e37c with SMTP id e22-20020a50ec96000000b005436222e37cmr2170175edr.0.1700839986937; Fri, 24 Nov 2023 07:33:06 -0800 (PST) X-Received: by 2002:a50:ec96:0:b0:543:6222:e37c with SMTP id e22-20020a50ec96000000b005436222e37cmr2170168edr.0.1700839986567; Fri, 24 Nov 2023 07:33:06 -0800 (PST) Received: from gerbillo.redhat.com (146-241-241-213.dyn.eolo.it. [146.241.241.213]) by smtp.gmail.com with ESMTPSA id n3-20020aa7c783000000b0054901c25d50sm1876098eds.14.2023.11.24.07.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:33:06 -0800 (PST) Message-ID: <9e2bba3c98cd24ebf1b6d9fde2e0b9229ad6b99f.camel@redhat.com> Subject: Re: [PATCH 2/4 net] qca_spi: Fix SPI IRQ handling From: Paolo Abeni To: Stefan Wahren , "David S. Miller" , Eric Dumazet , Jakub Kicinski Cc: Lino Sanfilippo , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 24 Nov 2023 16:33:04 +0100 In-Reply-To: References: <20231121163004.21232-1-wahrenst@gmx.net> <20231121163004.21232-3-wahrenst@gmx.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 24 Nov 2023 07:33:18 -0800 (PST) On Fri, 2023-11-24 at 15:01 +0100, Stefan Wahren wrote: > Hi Paolo, >=20 > Am 23.11.23 um 12:37 schrieb Paolo Abeni: > > On Tue, 2023-11-21 at 17:30 +0100, Stefan Wahren wrote: > > > The functions qcaspi_netdev_open/close are responsible of request & > > > free of the SPI interrupt, which wasn't the best choice. Currently > > > it's possible to trigger a double free of the interrupt by calling > > > qcaspi_netdev_close() after qcaspi_netdev_open() has failed. > > > So let us split IRQ allocation & enabling, so we can take advantage > > > of a device managed IRQ and also fix the issue. > > >=20 > > > Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for= QCA7000") > > > Signed-off-by: Stefan Wahren > > The change makes sense, but the changelog is confusing. > >=20 > > qcaspi_netdev_close() and qcaspi_netdev_open() are invoked only via > > ndo_open and ndo_close(), right? So qcaspi_netdev_close() will never be > > invoked qcaspi_netdev_open(), failure - that is when IFF_UP is not set. > sorry, i missed to mention an important part. This issue is partly > connected to patch 3. > Please look at qcaspi_set_ringparam() which also call ndo_close() and > ndo_open().=C2=A0 Ah, I see it now. IMHO root cause of the problem is there. The ethtool op should not flip the device state.=C2=A0 A more narrow fix would be to park/unpark the thread inside set_ringparam() - instead of the whole patch 1 && 2 I suspect. IMHO the changes in this still make sense - a refactor for net-next. Cheers, Paolo