From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8095C433EF for ; Wed, 22 Sep 2021 02:58:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7475360F21 for ; Wed, 22 Sep 2021 02:58:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7475360F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.dev Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To:Cc:To:Subject: Message-ID:From:Date:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qe4MoxK5JMO13SbXbNcXUuDo/DrIZnAm6Bdd8srfCTw=; b=lLyj3FygaW71HW SYxlPkGpKNeWXx93CD6PQnj+940sYvjoTOYGidJVOobRdgomK8Xj6Ndi4CjX8YsUTcPxuvMMS0C8w 5kx3pvxz2hPE/I2U64lgOLLa1+QwZl5BKzhjlMqICBfoFeHcVpnuriTtj5fIUvKQu/c6V8ISiWb5U Rx49p+s5JaQS0qWB2SVLok4j4heUyw3rvwHBsozLC5qvDBl+18tsTbE1y7CI+tRcu+dZSle8sK7GE ikTWxHydCHW1RgikIQBuT227I4+hmv43X/gZ4eY/vBVidGKsWOreynprACemSwUoHOHp81FMdhkeD UM6BpuuZIJ3YAWtZDV9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSsQH-006jaW-Bz; Wed, 22 Sep 2021 02:55:49 +0000 Received: from out0.migadu.com ([2001:41d0:2:267::]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSsJx-006gjP-Ef for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 02:49:20 +0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1632278953; 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=SP3h9uvIfQUYyLgWGd0dYYt1XTjq02DEM9WtTipdzus=; b=AIgWb197+pb8H0WDkh0Ks1zqTEX0Fox34J3FV6wKYbPo589pBxczqyIavGAS8hGqdBOwSp hNMbPkCN2nQqIu6PcjWxaD5aeWH9N9lseQNYH3DxWMBjb4MV3/paql8a6SIgyuIcwAw+Jb RaL710wMrAu4kEQKdjI/G7YrdEQM1ZU= Date: Wed, 22 Sep 2021 02:49:13 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: yajun.deng@linux.dev Message-ID: Subject: Re: [PATCH linux-next v2] arm64: PCI: Introduce pcibios_free_irq() helper function To: "Lorenzo Pieralisi" Cc: catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <20210921154731.GA2756@lpieralisi> References: <20210921154731.GA2756@lpieralisi> <20210826060406.12571-1-yajun.deng@linux.dev> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: yajun.deng@linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210921_194917_717424_9232548D X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org September 21, 2021 11:47 PM, "Lorenzo Pieralisi" wrote: > On Thu, Aug 26, 2021 at 02:04:06PM +0800, Yajun Deng wrote: > >> pcibios_alloc_irq() will be called in pci_device_probe(), but there >> hasn't pcibios_free_irq() in arm64 architecture correspond it. >> pcibios_free_irq() is an empty weak function in drivers/pci/pci-driver.c. > > "pcibios_alloc_irq() is a weak function called to allocate IRQs for > a device in pci_device_probe(); arm64 implements it with > ACPI specific code to enable IRQs for a device. > > When a device is removed (pci_device_remove()) the pcibios_free_irq() > counterpart is called. > > Current arm64 code does not implement a pcibios_free_irq() function, > and therefore, the weak empty stub is executed, which means that the > IRQ for a device are not properly disabled when a device is removed. > > Add an arm64 pcibios_free_irq() to undo the actions carried out in > pcibios_alloc_irq()." > > This is a stub commit log. Then you need to describe the bug you > are fixing (if any, or it is just code inspection ?) > It is just code inspection. >> So add pcibios_free_irq() for correspond it. This will be called >> in pci_device_remove(). >> >> ==================== >> v2: remove the change in pcibios_alloc_irq(), and modify the commit log. >> ==================== > > Don't add versioning in the commit log, it does not belong here. > > I don't think we should send this to stable kernels straight away, > it is best to make sure we are not triggering any regressions first. > > Lorenzo > >> Signed-off-by: Yajun Deng >> --- >> arch/arm64/kernel/pci.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c >> index 2276689b5411..6ffd92126f65 100644 >> --- a/arch/arm64/kernel/pci.c >> +++ b/arch/arm64/kernel/pci.c >> @@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev *dev) >> >> return 0; >> } >> + >> +void pcibios_free_irq(struct pci_dev *dev) >> +{ >> + if (!acpi_disabled) >> + acpi_pci_irq_disable(dev); >> +} >> + >> #endif >> >> /* >> -- >> 2.32.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B0C4C433F5 for ; Wed, 22 Sep 2021 02:49:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CFE861166 for ; Wed, 22 Sep 2021 02:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbhIVCup (ORCPT ); Tue, 21 Sep 2021 22:50:45 -0400 Received: from out0.migadu.com ([94.23.1.103]:26640 "EHLO out0.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhIVCun (ORCPT ); Tue, 21 Sep 2021 22:50:43 -0400 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1632278953; 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=SP3h9uvIfQUYyLgWGd0dYYt1XTjq02DEM9WtTipdzus=; b=AIgWb197+pb8H0WDkh0Ks1zqTEX0Fox34J3FV6wKYbPo589pBxczqyIavGAS8hGqdBOwSp hNMbPkCN2nQqIu6PcjWxaD5aeWH9N9lseQNYH3DxWMBjb4MV3/paql8a6SIgyuIcwAw+Jb RaL710wMrAu4kEQKdjI/G7YrdEQM1ZU= Date: Wed, 22 Sep 2021 02:49:13 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: yajun.deng@linux.dev Message-ID: Subject: Re: [PATCH linux-next v2] arm64: PCI: Introduce pcibios_free_irq() helper function To: "Lorenzo Pieralisi" Cc: catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <20210921154731.GA2756@lpieralisi> References: <20210921154731.GA2756@lpieralisi> <20210826060406.12571-1-yajun.deng@linux.dev> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: yajun.deng@linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org September 21, 2021 11:47 PM, "Lorenzo Pieralisi" wrote:=0A=0A> On Thu, Aug 26, 2021 at 02:04:06PM +0800, Yajun Deng wr= ote:=0A> =0A>> pcibios_alloc_irq() will be called in pci_device_probe(), = but there=0A>> hasn't pcibios_free_irq() in arm64 architecture correspond= it.=0A>> pcibios_free_irq() is an empty weak function in drivers/pci/pci= -driver.c.=0A> =0A> "pcibios_alloc_irq() is a weak function called to all= ocate IRQs for=0A> a device in pci_device_probe(); arm64 implements it wi= th=0A> ACPI specific code to enable IRQs for a device.=0A> =0A> When a de= vice is removed (pci_device_remove()) the pcibios_free_irq()=0A> counterp= art is called.=0A> =0A> Current arm64 code does not implement a pcibios_f= ree_irq() function,=0A> and therefore, the weak empty stub is executed, w= hich means that the=0A> IRQ for a device are not properly disabled when a= device is removed.=0A> =0A> Add an arm64 pcibios_free_irq() to undo the = actions carried out in=0A> pcibios_alloc_irq()."=0A> =0A> This is a stub = commit log. Then you need to describe the bug you=0A> are fixing (if any,= or it is just code inspection ?)=0A> =0AIt is just code inspection.=0A>>= So add pcibios_free_irq() for correspond it. This will be called=0A>> in= pci_device_remove().=0A>> =0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=0A>> v2: remove the change in pcibios_alloc_irq(), = and modify the commit log.=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=0A> =0A> Don't add versioning in the commit log, it= does not belong here.=0A> =0A> I don't think we should send this to stab= le kernels straight away,=0A> it is best to make sure we are not triggeri= ng any regressions first.=0A> =0A> Lorenzo=0A> =0A>> Signed-off-by: Yajun= Deng =0A>> ---=0A>> arch/arm64/kernel/pci.c | 7 ++= +++++=0A>> 1 file changed, 7 insertions(+)=0A>> =0A>> diff --git a/arch/a= rm64/kernel/pci.c b/arch/arm64/kernel/pci.c=0A>> index 2276689b5411..6ffd= 92126f65 100644=0A>> --- a/arch/arm64/kernel/pci.c=0A>> +++ b/arch/arm64/= kernel/pci.c=0A>> @@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev= *dev)=0A>> =0A>> return 0;=0A>> }=0A>> +=0A>> +void pcibios_free_irq(str= uct pci_dev *dev)=0A>> +{=0A>> + if (!acpi_disabled)=0A>> + acpi_pci_irq_= disable(dev);=0A>> +}=0A>> +=0A>> #endif=0A>> =0A>> /*=0A>> --=0A>> 2.32.= 0