From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbdGGPWO (ORCPT ); Fri, 7 Jul 2017 11:22:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38438 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdGGPWM (ORCPT ); Fri, 7 Jul 2017 11:22:12 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EE1A760AD3 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH V2] PCI: Do not enable extended tags on pre-dated (v1.x) systems To: linux-pci@vger.kernel.org, timur@codeaurora.org, wim.ten.have@oracle.com Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , linux-kernel@vger.kernel.org References: <1499439193-16628-1-git-send-email-okaya@codeaurora.org> From: Sinan Kaya Message-ID: Date: Fri, 7 Jul 2017 11:22:08 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/7/2017 11:07 AM, Sinan Kaya wrote: > On 7/7/2017 10:53 AM, Sinan Kaya wrote: >> + ret = pcie_capability_read_word(dev, PCI_EXP_FLAGS, &flags); >> + if (ret || ((flags & PCI_EXP_FLAGS_VERS) < 2)) >> + return 0; >> > > Never mind, there is a problem here. I shouldn't have added it here. > I'll remove these and post again. > I guess I'll wait until Bjorn gets a chance to review it. There is a decision that needs to be made here. Under normal circumstances, extended tags capability is a reserved field on v1 that's expected to be 0. Code is checking for extended tags capability being non-zero next before setting/clearing the bit. It should be safe to rely on capability being 0 on v1. However, we can go paranoid and add the check above to not even look at the capability like I did it. That's why, I thought this is redundant. I'll wait until Bjorn chimes in. It is OK to keep the code as it is. It is just doing too much validation in my opinion. Somebody can always say play safe. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.