Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4026387ybg; Fri, 25 Oct 2019 12:16:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQhFx1jQJ+UgYOu1jTb8EfI41/bBs9e3icfd/80X5j15IIPBrMsMPVpsAkTYg+cjnMH1aQ X-Received: by 2002:a17:906:e2d6:: with SMTP id gr22mr5002723ejb.160.1572030969655; Fri, 25 Oct 2019 12:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572030969; cv=none; d=google.com; s=arc-20160816; b=ZBJ2oHtG+oEwnM4xHr1xPKaUd48Bzg0MzcEjQzEPiJoquFrznuQy/PP83Izl85mA0d DbM8xkBf5dPC80MkkPRr7bs1JMkksMnLAnDNZXwTsW+rFnICu3HIWBZmk5AXl315N4z9 YyHsgOZ+rqvGedn7hjaTK/nMnlRJhC/Vcw2eLoczi+rMR6O8TWrlMN3EzJSvG21AxWcC /E45aomlFiDU+vH/Rgf2Z0AtKujD1MPb8vIumXBzyn26gZLvODKKiKVFz6ikXyHtU9NI sfcpPTGrt3bNAWIWyRorFo6wPkc1pNmSxNmRUIx0T2qn9BB8NG6W/x2sOkWaGJvn+S7o BWhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=YTU3QExDGlNnPnK1VLpa+NSxP5kTQZTtvWYPzdxq1EY=; b=I+2Zcew+RbVbdn01IQhPqoBbu1uUXDLQzSYJXAaYjWEbJx4iaF3DPyhQylLv45xhNl zgwLSXRkydG7EjpKfzqCCMKAlO3bshKKWfYeI6yl7onzRjQHFnc7ToQDs+y7cljbBdXY utIi/fQnV2eRXSSTAYNvRPn4asD2D/mWFBR4CX80k/URbOxNO5riZBkc2eB0w1ZDEhKN 11RGgJnApZXFEoyseJxN3KOo+V35BLtgVaq/QnGtUc4Cx3in1napjCEkhPecZCTosN+/ 1jcPfxoHZ37SpCUnFKCKSA7bvhlOiUNxW73+oajV7F6yCkgbu708Rbn3Aw1a/u81C6Ev zamA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m7Tl4gb3; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si1864033ejf.379.2019.10.25.12.15.44; Fri, 25 Oct 2019 12:16:09 -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=@gmail.com header.s=20161025 header.b=m7Tl4gb3; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730253AbfJXXW5 (ORCPT + 99 others); Thu, 24 Oct 2019 19:22:57 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:38850 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbfJXXW4 (ORCPT ); Thu, 24 Oct 2019 19:22:56 -0400 Received: by mail-ot1-f65.google.com with SMTP id e11so533870otl.5; Thu, 24 Oct 2019 16:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YTU3QExDGlNnPnK1VLpa+NSxP5kTQZTtvWYPzdxq1EY=; b=m7Tl4gb3PNDo3lTXX3PzsM1vK4HBCiVJWQfuDvlkoNKJWRe51IHqKs5/TpJtlfbU/W t/a6FAx9F3H6pK+rXRG4oSCIh49Bf2PsW2uxynoDJ8NMvg9z4Iyrj8I5z6K1qr5dx0YU 20Yo8sVxc+P+wG0wAFvcWDAgkl12LRjqMBaTMSG8HHL1LZWVyNBko0ouGPRSm0gwc6PH tESmKkO9r5/8jAS0ahOX+DC/pyE1viU5/tuB199A3GXDx9uzxoSfTmBo7LNS6d+66Kq1 CG7kxCYQK6yse1fwZd4Nv6k8CEaVjA73eNI0ODJRO0AA5HGDw9W/TD5EK/lHcp+l4+5m 0A+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YTU3QExDGlNnPnK1VLpa+NSxP5kTQZTtvWYPzdxq1EY=; b=Wl1DVfLMwzE//DcATCxePUZZ4SyBOKhGTa9rI8YP2/yVubvE5Bog9LMS7egBSB64rQ YAFu9vvGFUQNHRLmLKwEtVhAiwNK5JRExxOV852qGkcaeoQw+BnuUkNExWWfP2hD/b09 1KK+nXBQ1nD0fl9C7xb+EYzxMBuzWDgj1nChi6g/ERk8F5ljfvL9iY9LsG1MMmg5Tp7l GHGTMU8NYaGH5qhci2NvTQHfEMDunBfCG3PAXmk1R0p1d5QLE9qsPIm2gWVgonKQ/yRN 0l1vPZLlDXnyBWcjWlSJyuCIqsTjApnJ5q6aCXKjfb1h+1eECIr8PDxIJErfa/CiOnsV T4qw== X-Gm-Message-State: APjAAAVERAECBwRuEIsx441AcBWA24BPeT1x5oYlChpFWGHYRz5Lq/cM jEM5kAP6xjLGQZaSSnbfzqGi9MdtJQk7czQbPFA= X-Received: by 2002:a9d:58c6:: with SMTP id s6mr310273oth.215.1571959371946; Thu, 24 Oct 2019 16:22:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:648:0:0:0:0:0 with HTTP; Thu, 24 Oct 2019 16:22:50 -0700 (PDT) In-Reply-To: References: <20191020090800.GA2778@light.dominikbrodowski.net> <20191021160952.GA229204@google.com> <20191021184701.GA1823@light.dominikbrodowski.net> From: "Michael ." Date: Fri, 25 Oct 2019 10:22:50 +1100 Message-ID: Subject: Re: PCI device function not being enumerated [Was: PCMCIA not working on Panasonic Toughbook CF-29] To: Bjorn Helgaas Cc: Dominik Brodowski , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Trevor Jacobs , Kris Cleveland , Jeff , Morgan Klym Content-Type: multipart/mixed; boundary="000000000000f7a9680595b04fb2" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000f7a9680595b04fb2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I just tried to do a kernel compile on Debian Sid running kernel 5.2. Downloaded 4.19.80 modded the quirks file, please find modded file attached, and started the compile. About an hour into it it fails with: CC drivers/pci/quirks.o drivers/pci/quirks.c:2945:1: error: expected identifier or =E2=80=98(=E2=80= =99 before =E2=80=98-=E2=80=99 token 2945 | -static void ricoh_mmc_fixup_rl5c476(struct pci_dev *dev) | ^ drivers/pci/quirks.c:2974:1: error: expected identifier or =E2=80=98(=E2=80= =99 before =E2=80=98-=E2=80=99 token 2974 | -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_RL5C476, ricoh_mmc_fixup_rl5c476); | ^ drivers/pci/quirks.c:2975:1: error: expected identifier or =E2=80=98(=E2=80= =99 before =E2=80=98-=E2=80=99 token 2975 | -DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_RL5C476, ricoh_mmc_fixup_rl5c476); | ^ drivers/pci/quirks.c:2976:1: error: expected identifier or =E2=80=98(=E2=80= =99 before =E2=80=98-=E2=80=99 token 2976 | - | ^ In file included from ./include/linux/export.h:45, from ./include/linux/linkage.h:7, from ./include/linux/kernel.h:7, from drivers/pci/quirks.c:16: drivers/pci/quirks.c:3026:74: error: =E2=80=98ricoh_mmc_fixup_r5c832=E2=80= =99 undeclared here (not in a function) 3026 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); | ^~~~~~~~~~~~~~~~~~~~~~ ./include/linux/compiler.h:296:53: note: in definition of macro =E2=80=98__= ADDRESSABLE=E2=80=99 296 | __PASTE(__addressable_##sym, __LINE__) =3D (void *)&sym; | ^~~ ./include/linux/pci.h:1847:2: note: in expansion of macro =E2=80=98__DECLARE_PCI_FIXUP_SECTION=E2=80=99 1847 | __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/pci.h:1892:2: note: in expansion of macro =E2=80=98DECLARE_PCI_FIXUP_SECTION=E2=80=99 1892 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/pci/quirks.c:3026:1: note: in expansion of macro =E2=80=98DECLARE_PCI_FIXUP_EARLY=E2=80=99 3026 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); | ^~~~~~~~~~~~~~~~~~~~~~~ make[5]: *** [scripts/Makefile.build:304: drivers/pci/quirks.o] Error 1 make[4]: *** [scripts/Makefile.build:544: drivers/pci] Error 2 make[3]: *** [Makefile:1046: drivers] Error 2 make[2]: *** [debian/rules:4: build] Error 2 dpkg-buildpackage: error: debian/rules build subprocess returned exit statu= s 2 make[1]: *** [scripts/package/Makefile:75: deb-pkg] Error 2 make: *** [Makefile:1359: deb-pkg] Error 2 root@michael-desktop:/home/michael/Debian/linux-4.19.80# I will try later with the latest 5.4-rc to see if the diff is incompatible with 4.19. Cheers. Michael On 22/10/2019, Michael . wrote: > Thanks Domunik I'll get onto this and report back the results. > > On 22/10/2019, Dominik Brodowski wrote: >> On Tue, Oct 22, 2019 at 05:17:12AM +1100, Michael . wrote: >>> Thank you Dominik for looking at this for us and passing it on. >>> >>> Good morning Bjorn, thank you also for looking into this for us and >>> thank you for CCing us into this as non of us are on the mailing list. >>> One question how do we apply this patch or is this for Dominik to try? >> >> That's for you and/or other users of this hardware; I cannot test this >> myself, sorry. As to how to apply the patch: you'd need to apply the >> patch >> for the linux kernel sources, and then build a custom kernel. Some hints >> on >> that (details depend on the distribtion): >> >> https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel >> https://wiki.ubuntu.com/KernelTeam/GitKernelBuild >> https://wiki.archlinux.org/index.php/Kernels/Arch_Build_System >> https://kernelnewbies.org/KernelBuild >> >> Best, >> Dominik >> > --000000000000f7a9680595b04fb2 Content-Type: text/x-csrc; charset="UTF-8"; name="quirks.c" Content-Disposition: attachment; filename="quirks.c" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEdQTC0yLjAKLyoKICogVGhpcyBmaWxlIGNvbnRh aW5zIHdvcmstYXJvdW5kcyBmb3IgbWFueSBrbm93biBQQ0kgaGFyZHdhcmUgYnVncy4KICogRGV2 aWNlcyBwcmVzZW50IG9ubHkgb24gY2VydGFpbiBhcmNoaXRlY3R1cmVzIChob3N0IGJyaWRnZXMg ZXQgY2V0ZXJhKQogKiBzaG91bGQgYmUgaGFuZGxlZCBpbiBhcmNoLXNwZWNpZmljIGNvZGUuCiAq CiAqIE5vdGU6IGFueSBxdWlya3MgZm9yIGhvdHBsdWdnYWJsZSBkZXZpY2VzIG11c3QgX05PVF8g YmUgZGVjbGFyZWQgX19pbml0LgogKgogKiBDb3B5cmlnaHQgKGMpIDE5OTkgTWFydGluIE1hcmVz IDxtakB1Y3cuY3o+CiAqCiAqIEluaXQvcmVzZXQgcXVpcmtzIGZvciBVU0IgaG9zdCBjb250cm9s bG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uKSk7CgkJCXBjaV9hZGRfZG1hX2FsaWFzKHBkZXYsIGRldmZuKTsKCQl9 Cgl9CgoJcGNpX2lvdW5tYXAocGRldiwgbW1pbyk7CglwY2lfZGlzYWJsZV9kZXZpY2UocGRldik7 Cn0KI2RlZmluZSBTV0lUQ0hURUNfUVVJUksodmlkKSBcCglERUNMQVJFX1BDSV9GSVhVUF9GSU5B TChQQ0lfVkVORE9SX0lEX01JQ1JPU0VNSSwgdmlkLCBcCgkJCQlxdWlya19zd2l0Y2h0ZWNfbnRi X2RtYV9hbGlhcykKClNXSVRDSFRFQ19RVUlSSygweDg1MzEpOyAgLyogUEZYIDI0eEczICovClNX SVRDSFRFQ19RVUlSSygweDg1MzIpOyAgLyogUEZYIDMyeEczICovClNXSVRDSFRFQ19RVUlSSygw eDg1MzMpOyAgLyogUEZYIDQ4eEczICovClNXSVRDSFRFQ19RVUlSSygweDg1MzQpOyAgLyogUEZY IDY0eEczICovClNXSVRDSFRFQ19RVUlSSygweDg1MzUpOyAgLyogUEZYIDgweEczICovClNXSVRD SFRFQ19RVUlSSygweDg1MzYpOyAgLyogUEZYIDk2eEczICovClNXSVRDSFRFQ19RVUlSSygweDg1 NDEpOyAgLyogUFNYIDI0eEczICovClNXSVRDSFRFQ19RVUlSSygweDg1NDIpOyAgLyogUFNYIDMy eEczICovClNXSVRDSFRFQ19RVUlSSygweDg1NDMpOyAgLyogUFNYIDQ4eEczICovClNXSVRDSFRF Q19RVUlSSygweDg1NDQpOyAgLyogUFNYIDY0eEczICovClNXSVRDSFRFQ19RVUlSSygweDg1NDUp OyAgLyogUFNYIDgweEczICovClNXSVRDSFRFQ19RVUlSSygweDg1NDYpOyAgLyogUFNYIDk2eEcz ICovClNXSVRDSFRFQ19RVUlSSygweDg1NTEpOyAgLyogUEFYIDI0WEczICovClNXSVRDSFRFQ19R VUlSSygweDg1NTIpOyAgLyogUEFYIDMyWEczICovClNXSVRDSFRFQ19RVUlSSygweDg1NTMpOyAg LyogUEFYIDQ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