Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8125767imu; Thu, 15 Nov 2018 07:02:06 -0800 (PST) X-Google-Smtp-Source: AJdET5eVdzFboQut6wtEF3dkrpCHH1ypdjUSNhFiCLlpaaAnAkbAUd88HicumfEuCUGP7SlSmuci X-Received: by 2002:a63:9f19:: with SMTP id g25mr6024755pge.327.1542294126200; Thu, 15 Nov 2018 07:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542294126; cv=none; d=google.com; s=arc-20160816; b=Wwlnw6dRqAjbjikhDkm2vsy3seeI0VAS+z17ZBpVAsSb5hvpcB9uK+FhJQhJgm+u9P SnrCLZiTCvdEaT4or/Tp8K6yBM+9EyV/7ez06GOckPq2bJQy1ysEfUeaiRibkDPLcHtz zbEWTxdRZTP9optdmwA3MNDNqg6nFf6DtV4OT5zecM338kgY4W6IBRc5LoXlmxdtwb7G MzynyUMVltfkwuX8bCoc9RjlrhrKb4/1lvvtBfDgDqgsxjm2kmasGwTEtExUh/Q4huz9 OPOHtlwDgGDlmvvAt95CURZsH1tvx6Xk6xpa30pRiq2wCYdUYYI6kQ/hoaX8eeUWN7JW 0UBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=JcLgJnD6eOHQXjlmSk/bIMlwhUbgE58oh5D2cAkD/9I=; b=BIahAeJZVfRGaYU/5e9sAFuopGJuQQlBWcOgNNK5nbnPkNvm8FlGdbF94DErP5GMiy ZYi6CrbBguJo6LCak+bt9NH5bLPACCZoid17uWKxSVPfvnO7yF9YzMM/vynR7q/SqsNW UlkEg81qwIjTtHS3DkG43KOCsokvzy+9dHlL9zgnT9g5eLfwq2r3kLlMjMBy9nQBPKfn 6qB1YtafCwg2NHYYVM5t0tjJb9H83asc9EUyLZ/cKRKQAx46QXLs+Z9ntktC0BRS507q ZsxCNO5tFs4BhUjTgYvnaPfReCwp4T9DJbFO5Q1z4tIJM3b8zpSVOmKoVcCMWhf2yZ80 Wl3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=IUWOUwjQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c85-v6si29618430pfe.60.2018.11.15.07.01.43; Thu, 15 Nov 2018 07:02:06 -0800 (PST) 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=@agner.ch header.s=dkim header.b=IUWOUwjQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388427AbeKPBIp (ORCPT + 99 others); Thu, 15 Nov 2018 20:08:45 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:33834 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbeKPBIp (ORCPT ); Thu, 15 Nov 2018 20:08:45 -0500 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id AB1E15C01B3; Thu, 15 Nov 2018 16:00:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1542294032; 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=JcLgJnD6eOHQXjlmSk/bIMlwhUbgE58oh5D2cAkD/9I=; b=IUWOUwjQzgsY4q1kPedE5JN5AGPSx7M7AXtd9Lw/NcAzl+GRlKccx4mB2nbyHXLct39pjJ p2BfxZ/2qAv2ZOn7mkXwtI+itgHwXQ3gzlAiG61WbyE+ATtnp2BMWMNKnZYqQ6HZLN++Xk SQHxJ8XACQA3Z6KOJfdia6OSqiBlrLY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 15 Nov 2018 16:00:32 +0100 From: Stefan Agner To: Trent Piepho Cc: jingoohan1@gmail.com, l.stach@pengutronix.de, gustavo.pimentel@synopsys.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com Subject: Re: [PATCH] PCI: dwc: Limit config space size for i.MX6 In-Reply-To: <1542224641.30311.478.camel@impinj.com> References: <20181019111350.6170-1-stefan@agner.ch> <40d0c27d612534033d146497029b1922@agner.ch> <1542224641.30311.478.camel@impinj.com> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.11.2018 20:44, Trent Piepho wrote: > On Wed, 2018-11-14 at 16:49 +0100, Stefan Agner wrote: >> On 19.10.2018 13:13, Stefan Agner wrote: >> > Reading the full 4k config space through sysfs leads to an >> > external abort. Testing on a platform showed that the upper >> > limit is 512. Limit config space to 512. >> >> Any comment on this patch? >> >> Since other devices use similar quirks, I guess the fix can't be far >> off? >> >> Maybe restricting to the PCI device ID used in i.MX 6 only is too >> restrictive, but I guess better restrictive for now? > > To trigger this bug I should read the sysfs "config" file for the PCI > bridge device? > > Tested on imx7, no problems. > > # hexdump -C > /sys/devices/platform/soc/30800000.aips-bus/33800000.pcie/pci0000:00/0000:00:00.0/config > > > [stuff] > 00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > |................| > * > > 00000400 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff > |................| > * > > 00000700 76 00 63 01 ff ff ff ff 04 00 00 07 00 f0 f0 1b > |v.c.............| > [more stuff] > > The bridge on imx7d is 16c3:abcd, same as patch I believe. I do have a > pci-e device connected, unlike the original bug. Maybe that is > related? Or maybe this problem is fixed in imx7d? The i.MX 7D seems to have a different register set... I don't think it is related to whether a PCIe device is connected or not. The fact that i.MX 7D has the same device id and does not suffer the problem actually shows that the approach this patch takes is not ideal... Will send a patch limiting register access on a per driver/compatible string level. -- Stefan > >> > >> > #define PCI_VENDOR_ID_SYNOPSYS 0x16c3 >> > +#define PCI_DEVICE_ID_SYNOPSYS_IMX6 0xabcd >> > >> > #define PCI_VENDOR_ID_VITESSE 0x1725 >> > #define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174