Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4155539imm; Mon, 20 Aug 2018 10:44:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz1FnLdwjO4DlR1T9fqjMJlVypWy6aD/HsjdJs21SO/7F8ncyufV1QFlRYGWl0XYsTZgUh7 X-Received: by 2002:a17:902:74ca:: with SMTP id f10-v6mr14931829plt.260.1534787089217; Mon, 20 Aug 2018 10:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534787089; cv=none; d=google.com; s=arc-20160816; b=e4aV09MI9oiYDFQkDJ/D1uPF0c4oWEs1zmN6TMVleSrym0VpLk5OgBByE+7u0HF3C1 kuv0PUVVh/LTWFT4cQdRBqbLwpAuusccZk2Eo+OfS3nmEzeNCS1vlDXnO4VsMFUR3cGs oF4KEv3Jp1x8uRvm3WRcZXZ8ahaSP+7vhv14QTME+1leSdwX4oDJN3ClL5YECG23Jbf7 GrXLR6//yl4rhSgq5pIaU0uSVo4I8LZpSK89jyhU7HWK3qy1KCni1KrmLqx7yv2uGV6c 7HkI4k+fjKwzrwlQmiCjxiQf35BRuKzXnTQGaBPXmLaUa8rPcbF25YA98wJnDNBMVh5I W7cA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=JgQOLmR0csyl2uLTN21ZkV1n0qmkMxFt8+7NB54PSzw=; b=bjCkyYDbe0y0hr0HKIEmokjoBoKOi7yOcVaXQHRZJTMCDDa8yX4y43FLMBrR5z4HXJ B+EW0/InKc4zFkk30n91OtLyYDJ60Hz9yptfzYrgxa4udlbN0iIVUIAI4T/zxN3AA5UF kdAIqkd+q1KXK5zjdSfmxwPI0AVAHucwSjdO4gMLOhXGONCCaVKzDtICitc8GTN0EEII MWxVQ+tYOo0RcYIKIq53gsjBtWeQZVZmMfFvljagacTwA7CEjSlEUO7ppywoRFjwHW+/ jkUzcnSQczkm4RuMnN6BWf5g5251Cb9XkAZSy3kshBMsy1e6hGw2s0cDkviKUWIX7Mzo Dpsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ot5GXT4D; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si9718037plr.382.2018.08.20.10.44.33; Mon, 20 Aug 2018 10:44:49 -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=@kernel.org header.s=default header.b=Ot5GXT4D; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726346AbeHTVAA (ORCPT + 99 others); Mon, 20 Aug 2018 17:00:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:36604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726106AbeHTVAA (ORCPT ); Mon, 20 Aug 2018 17:00:00 -0400 Received: from [192.168.0.114] (cpe-174-109-247-98.nc.res.rr.com [174.109.247.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08BC121473; Mon, 20 Aug 2018 17:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534787006; bh=7tLkMFMr/o1N3ZqcMkPOIu4owKJjoZO0QGPq1ozaRqk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Ot5GXT4Dsb7t2drWPVjq2eQiN6sGX21NGjWA4DmeZduYbHkGLQl7QAREctjau7ih0 BSbBgMzLa5k5TE9WtgpHR9cEzx+t/sHwd0MNpnrJCyDQq/4oT7AG+p5WP+d0Rsr5Pu HcwOIMYJNpl01zsTAwPWN1jTifZXBrqGZ24sF/8s= Subject: Re: [PATCH v8 2/2] PCI: pciehp: Mask AER surprise link down error if hotplug is enabled To: Lukas Wunner Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Andy Shevchenko , Mika Westerberg , open list References: <20180818065126.77912-1-okaya@kernel.org> <20180818065126.77912-2-okaya@kernel.org> <20180820082150.r4q47ppqqclaschd@wunner.de> From: Sinan Kaya Message-ID: <38fd0d0a-6d60-c8db-f155-e6078260513b@kernel.org> Date: Mon, 20 Aug 2018 13:43:22 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180820082150.r4q47ppqqclaschd@wunner.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/20/2018 4:21 AM, Lukas Wunner wrote: > On Fri, Aug 17, 2018 at 11:51:10PM -0700, Sinan Kaya wrote: >> +static int pciehp_control_surprise_error(struct controller *ctrl, bool enable) > > The return value isn't checked, so this could return void. > Sure, I can do that. > >> @@ -280,6 +303,9 @@ static int pciehp_probe(struct pcie_device *dev) >> >> pciehp_check_presence(ctrl); >> >> + /* We want exclusive control of link down events in hotplug driver */ >> + pciehp_control_surprise_error(ctrl, false); >> + >> return 0; > > Hm, if the platform firmware hasn't granted native hotplug control to OSPM, > or if some other hotplug driver than pciehp is used, shouldn't surprise down > be ignored by error recovery as well? If yes, the mask would have to be set > in generic code somewhere in drivers/pci/probe.c I guess, based on the > is_hotplug_bridge bit in struct pci_dev. I could move this code if we know that is_hotplug_bridge flag is set regardless of OS hotplug driver control or not. > > (Interestingly, PCI_ERR_UNCOR_MASK is already changed in probe.c by > program_hpp_type2(). That seems to be ACPI-specific code, which kind > of begs the question why it's not in pci-acpi.c?) Yes, you can tell the OS what AER mask to set following hotplug insertion via ACPI HPP table especially if you remove a hotplug bridge. This is used during ACPI hotplug. > > Thanks, > > Lukas >