Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1385871ybm; Tue, 21 May 2019 13:14:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGmdFM7DIIr5neN7zcU+52VaBrZZgstHwKRIPkUh2gv3GZb59YnW5VhT54cNEpNzWYEKHV X-Received: by 2002:a17:902:a508:: with SMTP id s8mr66899606plq.186.1558469642413; Tue, 21 May 2019 13:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558469642; cv=none; d=google.com; s=arc-20160816; b=kmz5W0ctO15laTZFbZ1vENdM/dW+K73KN0mweyT0eGKYnRp2fJ1Zr52Wa28uWachzI SAxps2jY9s9+yNtGDfBKotjsjwyJvfPs8KZ9jMwjDYwEsdIoL0kliLhwrFmPHSlJtgk0 xj0dWY0NQFenKpINh02WqLDqZUW2T/1BNaiPcKfIcjQ5+4iC4twCfDHB8PS/0rjx0K+X ASNVNKTCJXtaZpBVDXbItIFIuayG2oOZ+Av4Irmj6ycwmQlJuZdIctx/yp/VQi44I8vm c1LuxsEl93fk+7mb4GMIsJXi/PHhzmcF0yVajhRTjlZWUF/sippf9j0NEc5IXdjy6Gu/ PC5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kbK0pia+ZUDJFT5WiIJjh6XhzKexwGnWuOXpHluHwUM=; b=k0WIROo786kjOLMkrbyf+sO3QrVNl5JOUmgqbl7anHk0OXIyKlbC6wDcncm70bmabI iAoGsZf/T/C/c4RL89UZbVquaXgarfbOUAT0+QyzxJzF5XoZUiwW0D9co5918wsEt8At 79cbsrU15X1aBYf6/3RYM76yjfU8yrlT25YyO0sh8SHn7rr2r3M1wWk/6f043j5TUKV7 7qiOp1kM4sg4Uw0jU1ivH0tbshIoS4oUQ7Y7yeeZGEtwO9Lcro+9piM3wkI8LzVLeXxy 5GXa6UNIeh/YVIw5D2FGcr9cN4WtvhPLo6/m8qtSgLfzJS315J4QBkD7nHKI3Toqudk7 xeUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r1FyPMSy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si16408299pgv.338.2019.05.21.13.13.46; Tue, 21 May 2019 13:14:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r1FyPMSy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727754AbfEUUL6 (ORCPT + 99 others); Tue, 21 May 2019 16:11:58 -0400 Received: from mail-wm1-f42.google.com ([209.85.128.42]:50260 "EHLO mail-wm1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727719AbfEUUL6 (ORCPT ); Tue, 21 May 2019 16:11:58 -0400 Received: by mail-wm1-f42.google.com with SMTP id f204so4238018wme.0 for ; Tue, 21 May 2019 13:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kbK0pia+ZUDJFT5WiIJjh6XhzKexwGnWuOXpHluHwUM=; b=r1FyPMSyCECwO0EflXzfCEbOTpQIWVJEEdxo8Oafi8OnP4T7BNuPXG/QHCzjAi4GyN 3JtGpbbHqo8oU9ODKSdq8MjehLFHWhU+Eq25y7z/s3T/zjO1yNntwI9djMr6RkOQ1W3v QlfZKHlW4ANn2rcgEGLtuuRYK68c1vHpRb5cmaiIohlhNYd+bqEeziTjUCv6r8DWmE5G KOLCqtm9R+Ah+PiQEgL5E1Dg6lsy0+rtiIpyEqAytJQSbAnEaaQ/AIhuFQtvqOHU4K/E naSqKZScOk/PoOVxCdYGexWED+GKIhEigvlO4kd+A8awmMquPBNF9U7LjExEYZJEucvM MiFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kbK0pia+ZUDJFT5WiIJjh6XhzKexwGnWuOXpHluHwUM=; b=PkimEJWrW2IAtnFPQku3RoZyzgtrez9sPdabQt7Hg09gYoPo/uaQOTPSl+a+9TvZa6 KMUAEhwTJXYm8DA9aj4y+CmB6VkGVo5B/U+UokBxyhGf+fEOXouw/vAQLSyW/xzzac/0 I35OtSVx/NKnXZZrK9GqvZi8Rrw2Qy6Hn+APDLcwx/DgcFt4bhDKDb9Nqv4zkk+8ll7H gbhu2aZfxrCyr2nKOV/ELXpl3soZKQc31THykk2UEhenZoxgCA7T8fMZV7uEf6yU4ZrN qZJ85m0n4kbVFaD+9oZcG9QYmerDNK1Pt95uo15Iwt1Lb68pEv4dnUUZvSsWmIrXVwv2 gW3A== X-Gm-Message-State: APjAAAXRwdwfyDCZAz3mw5OF2p4m310qA3ZFIyW89duc6xfmJwnYQEJs u/dMU8E4o+s/VRDDy9vPjYm8jmOCboNgA3eLjguCDoFNfA== X-Received: by 2002:a1c:c1c8:: with SMTP id r191mr4228057wmf.99.1558469514761; Tue, 21 May 2019 13:11:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bjorn Helgaas Date: Tue, 21 May 2019 15:11:38 -0500 Message-ID: Subject: Re: VPD access Blocked by commit 0d5370d1d85251e5893ab7c90a429464de2e140b To: Himanshu Madhani Cc: Andrew Vasquez , Girish Basrur , Giridhar Malavali , Myron Stowe , Linux Kernel Mailing List , Quinn Tran , Linux PCI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [fix linux-pci, remove ethan.zhao (bounces)] From: Bjorn Helgaas Date: Tue, May 21, 2019 at 3:02 PM To: Himanshu Madhani Cc: ethan.zhao@oracle.com, Andrew Vasquez, Girish Basrur, Giridhar Malavali, Myron Stowe, , Linux Kernel Mailing List, Quinn Tran > [+cc Myron, Quinn, linux-pci, linux-kernel] > > From: Himanshu Madhani > Date: Fri, May 17, 2019 at 5:21 PM > To: ethan.zhao@oracle.com, bhelgaas@google.com > Cc: Andrew Vasquez, Girish Basrur, Giridhar Malavali > > > Hi Ethan, > > > > Our OEM partners reported to us that VPD access with latest distros wer= e returning I/O error for them. They indicated this to be issue only with n= ewer kernels. > > > > One of the distro vendor pointed out patch posted by you to be reason f= or IO error trying to VPD. The patch looks like blocks access to VPD by bla= cklisting ISP. > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/?id=3D0d5370d1d85251e5893ab7c90a429464de2e140b=EF=BB=BF > > > > I setup PCIe analyzer to reproduce this in our lab to root cause it and= discovered that after reverting the patch. I am able to get VPD data okay= with upstream 5.1.0 and I used RHEL8. > > > > I also used "lspci" and "cat" to dump out VPD data and do not see any = issue. > > > > # lspci -vvv -s 03:00.0 > > 03:00.0 Fibre Channel: QLogic Corp. ISP2722-based 16/32Gb Fibre Channel= to PCIe Adapter (rev 01) > > Subsystem: QLogic Corp. QLE2742 Dual Port 32Gb Fibre Ch= annel to PCIe Adapter > > Physical Slot: 15 > > Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASn= oop- ParErr+ Stepping- SERR+ FastB2B- DisINTx- > > Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast= >TAbort- SERR- > Latency: 0, Cache Line Size: 64 bytes > > Interrupt: pin A routed to IRQ 67 > > NUMA node: 0 > > Region 0: Memory at fbe05000 (64-bit, prefetchable) [si= ze=3D4K] > > Region 2: Memory at fbe02000 (64-bit, prefetchable) [si= ze=3D8K] > > Region 4: Memory at fbd00000 (64-bit, prefetchable) [si= ze=3D1M] > > Expansion ROM at fb540000 [disabled] [size=3D256K] > > Capabilities: [44] Power Management version 3 > > Flags: PMEClk- DSI- D1- D2- AuxCurrent= =3D0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) > > Status: D0 NoSoftRst+ PME-Enable- DSel= =3D0 DScale=3D0 PME- > > Capabilities: [4c] Express (v2) Endpoint, MSI 00 > > DevCap: MaxPayload 2048 = bytes, PhantFunc 0, Latency L0s <4us, L1 <1us > > ExtTag- AttnBtn- AttnIn= d- PwrInd- RBE+ FLReset+ SlotPowerLimit 0.000W > > DevCtl: Report errors: Correctable+ No= n-Fatal+ Fatal+ Unsupported+ > > RlxdOrd- ExtTag- PhantF= unc- AuxPwr- NoSnoop+ FLReset- > > MaxPayload 256 bytes, M= axReadReq 4096 bytes > > DevSta: CorrErr+ UncorrErr- FatalErr- U= nsuppReq+ AuxPwr- TransPend- > > LnkCap: Port #0, Speed 8GT/s, Width x8,= ASPM L0s L1, Exit Latency L0s <512ns, L1 <2us > > ClockPM- Surprise- LLAc= tRep- BwNot- ASPMOptComp+ > > LnkCtl: ASPM Disabled; RCB 64 bytes Di= sabled- CommClk+ > > ExtSynch- ClockPM- AutW= idDis- BWInt- AutBWInt- > > LnkSta: Speed 8GT/s, Width x8, TrErr- = Train- SlotClk+ DLActive- BWMgmt- ABWMgmt- > > DevCap2: Completion Timeout: Range B, T= imeoutDis+, LTR-, OBFF Not Supported > > AtomicOpsCap: 32bit- 64= bit- 128bitCAS- > > DevCtl2: Completion Timeout: 50us to 50= ms, TimeoutDis-, LTR-, OBFF Disabled > > AtomicOpsCtl: ReqEn- > > LnkCtl2: Target Link Speed: 8GT/s, Ente= rCompliance- SpeedDis- > > Transmit Margin: Normal= Operating Range, EnterModifiedCompliance- ComplianceSOS- > > Compliance De-emphasis:= -6dB > > LnkSta2: Current De-emphasis Level: -6d= B, EqualizationComplete+, EqualizationPhase1+ > > EqualizationPhase2+, Eq= ualizationPhase3+, LinkEqualizationRequest- > > Capabilities: [88] Vital Product Data > > Product Name: QLogic 32Gb 2-port FC to = PCIe Gen3 x8 Adapter > > Read-only fields: > > [PN] Part number: QLE27= 42 > > [SN] Serial number: RFD= 1706R22611 > > [EC] Engineering change= s: BK3210408-05 04 > > [V9] Vendor specific: 0= 10189 > > [RV] Reserved: checksum= good, 0 byte(s) reserved > > End > > Capabilities: [90] MSI-X: Enable+ Count=3D16 Masked- > > Vector table: BAR=3D2 offset=3D00000000 > > PBA: BAR=3D2 offset=3D00001000 > > Capabilities: [9c] Vendor Specific Information: Len=3D0= c > > Capabilities: [100 v1] Advanced Error Reporting > > UESta: DLP- SDES- TLP- FCP- CmpltTO- = CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- > > UEMsk: DLP- SDES- TLP- FCP- CmpltTO- Cm= pltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- > > UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- C= mpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol- > > CESta: RxErr- BadTLP- BadDLLP- Rollov= er- Timeout- NonFatalErr- > > CEMsk: RxErr- BadTLP- BadDLLP- Rollover= - Timeout- NonFatalErr+ > > AERCap: First Error Point= er: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn- > > MultHdrRecCap- MultHdrR= ecEn- TLPPfxPres- HdrLogCap- > > HeaderLog: 00000000 00000000 00000000 0= 0000000 > > Capabilities: [154 v1] Alternative Routing-ID Interpret= ation (ARI) > > ARICap: MFVC- ACS-, Next Function: 1 > > ARICtl: MFVC- ACS-, Function Group: 0 > > Capabilities: [1c0 v1] #19 > > Capabilities: [1f4 v1] Vendor Specific Information: ID= =3D0001 Rev=3D1 Len=3D014 > > Kernel driver in use: qla2xxx > > Kernel modules: qla2xxx > > > > # cat /sys/bus/pci/devices/0000\:03\:00.0/vpd > > RFD1706R22611ECBK3210408-05 04V9010189RV=EF=BF=BDx > > > > Can you share some more insight into where you encountered issue? I am = in process of reverting this patch from upstream kernel but wanted to reach= out and find out if you still have setup to provide more context. > > 0d5370d1d852 ("PCI: Prevent VPD access for QLogic ISP2722") prevented > a panic while reading VPD, so we can't simply revert it. > > Since you don't see a panic while reading VPD from that device, it's > possible that a QLogic firmware change fixed the VPD format so Linux > no longer reads the area that caused the problem. Or possibly your > system doesn't handle the config read error the same way Ethan's HP > DL380 does. Unfortunately we don't have an actual PCIe analyzer trace > from Ethan's system, so we don't know exactly what happened on PCIe. > > I suggest that you capture the entire VPD area and hexdump it, e.g., > with "xxd", and look at its structure. pci_vpd_size() parses it and > computes the valid size based on a PCI_VPD_STIN_END tag, and > pci_vpd_read() should not read past that size. > > And you *do* have an analyzer trace. If new QLogic firmware fixed the > VPD format, the trace should show that Linux read only the valid part > of VPD, and there should be no errors in the trace. Then it might > just be a question of tweaking the quirk so it allows VPD reads if the > firmware is new enough. > > But if the trace does show config reads with errors, then it might be > that your system just tolerates the errors while the DL380 did not. > Then we'd have to figure out exactly what the error was and how to > deal with it so things work on both your system and Ethan's. > > Bjorn