From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f52.google.com ([209.85.167.52]:39855 "EHLO mail-lf1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387519AbeHAUjS (ORCPT ); Wed, 1 Aug 2018 16:39:18 -0400 Received: by mail-lf1-f52.google.com with SMTP id a134-v6so14049997lfe.6 for ; Wed, 01 Aug 2018 11:52:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: gokul cg Date: Thu, 2 Aug 2018 00:22:07 +0530 Message-ID: Subject: Re: Possible race condition in the kernel between PCI driver and AER handling To: Thomas Tai Cc: linux-pci@vger.kernel.org Content-Type: multipart/alternative; boundary="0000000000000112c10572643167" Sender: linux-pci-owner@vger.kernel.org List-ID: --0000000000000112c10572643167 Content-Type: text/plain; charset="UTF-8" HI Thomas , Yes , its surprise removal . But as far as I know , linux kernel will handle surprise removal of PCIe device without panic. The driver will suddenly start reading all 0xff and will then need to abort whatever it was doing. Usually all drivers handle this just fine. Nothing, the driver individually needs to handle the fact that it might at any time, start getting invalid data. If it doesn't, it needs to be fixed. Whether AER driver that does not handle this properly? Regards, Gokul On Wed, Aug 1, 2018 at 11:17 PM, Thomas Tai wrote: > > > On 08/01/2018 01:42 AM, gokul cg wrote: > >> Hi Thomas, >> >> In my hardware, there is i2c power control chip for PCI card, I just >> powered down using i2c command . >> > > Hi Gokul, > When you power off the card via the i2c, it forcefully power off the card > without notify the kernel? That is, during the card power off sequence it > manages to send a last AER isr to report the error and die? I am kind of > expect the pcie surprise removal or hot plug driver will handle it > correctly. > > Thanks, > Thomas > > >> Regards, >> Gokul >> > --0000000000000112c10572643167 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
HI Thomas ,=C2=A0


Yes , = its surprise removal .

But as far as I know , linu= x kernel will handle surprise removal of PCIe device without panic.

The=C2=A0driver will = suddenly start reading all 0xff and will then need to
abort= =C2=A0whatever=C2=A0it was doing<= span style=3D"font-family:"Helvetica Neue",Arial,sans-serif;text-= decoration-style:initial;text-decoration-color:initial;float:none;display:i= nline">. Usually=C2=A0all drivers handle this j= ust fine.

Nothing, the driver = individually=C2=A0needs to h= andle the fact that it might
at any time, s= tart=C2=A0getting invalid=C2=A0data. If it doesn't, = it needs to be
fixed. Whether AER=C2=A0 dri= ver that does not handle this properly?


Regards,
Gokul=C2=A0<= /div>

On Wed= , Aug 1, 2018 at 11:17 PM, Thomas Tai <thomas.tai@oracle.com> wrote:


On 08/01/2018 01:42 AM, gokul cg wrote:
Hi Thomas,

In my hardware, there is i2c power control chip for PCI card, I just powere= d down using i2c command .

Hi Gokul,
When you power off the card via the i2c, it forcefully power off the card w= ithout notify the kernel? That is, during the card power off sequence it ma= nages to send a last AER isr to report the error and die? I am kind of expe= ct the pcie surprise removal or hot plug driver will handle it correctly.
Thanks,
Thomas


Regards,
Gokul

--0000000000000112c10572643167--