Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1772282ybi; Thu, 20 Jun 2019 03:34:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYJGC/cmjKn6wojZ3gQ1mdrtHloy+ToxbohcsM74gcBf/MCrDdaUpIdJdrl1QnGpxz2QFh X-Received: by 2002:a63:d354:: with SMTP id u20mr11876120pgi.129.1561026853836; Thu, 20 Jun 2019 03:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561026853; cv=none; d=google.com; s=arc-20160816; b=nsQh4H8HCzG/7FJgcsiM30qORSWItNmRYrTeapdD+oE22JOcwLg3H/MJE20ypwmM7S cvWBuhXGISAQhXqKyFizkQ2yVK77Amr6GqXF1SmM1lgQ+nWh4+fzJ/Y812iFCQYr6qYF 681f+qvueTggrmn1amrl1RtmdRqcDqTQaP4sTHbmxAApN0+TxJB/TVdvuhqKjmVwRVkl wK1had5LiMvyCFoElZ88x/Lmfvsopb6HJrGXA9A3ah06wQeU31fH1z117EQ6HbM2Pwxd ZMRTI1kO9u70eFg1wZELtxBRiMCfvuZruFFweS91fa5uAmztGTt/l5mBONG/wYXd9MYu XpoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=hFA9Zq27Cl5Ic1SePwwdV9fiTHZ5YZKAWfWcUCIjAjM=; b=OvnyWrns4YdEBa48uWhOO34qwsrHRUft32FPQfCr5vQ324LsECVtBlNeI4GHYGuQw6 4HweHbI8TPUyft891fjlUfaeksifi+47qsf+TSvklea6xwKJ7nyGBZOQyqMWEaxcOnB9 AkeaPSxqtlvvzmRlUQZsjLYL4UBW/1aMTYHubmaMnKj8XeHpz6StzRlYckipNAUyT266 DCpAqcnWRWKENFVH/igevwNmgrzz7yNK5w/nBZl/2PupzijwKVNfi3Ehmhj6jvJ8nW83 8vJJQ09ziBDYqzk9AEO4qGNcK1aGI1+iaQvbp9S5ODCSzV7JcCCb037tJujyNmdipKjQ tjCw== ARC-Authentication-Results: i=1; mx.google.com; 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 g10si3830660pjp.74.2019.06.20.03.33.57; Thu, 20 Jun 2019 03:34:13 -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; 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 S1731578AbfFTKdo (ORCPT + 99 others); Thu, 20 Jun 2019 06:33:44 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:18650 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731400AbfFTKdh (ORCPT ); Thu, 20 Jun 2019 06:33:37 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D7DAC6567D15C60CAF22; Thu, 20 Jun 2019 18:33:32 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Thu, 20 Jun 2019 18:33:25 +0800 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH 0/5] Fixes for HiSilicon LPC driver and logical PIO code Date: Thu, 20 Jun 2019 18:31:51 +0800 Message-ID: <1561026716-140537-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As reported in [1], the hisi-lpc driver has certain issues in handling logical PIO regions, specifically unregistering regions. This series add a method to unregister a logical PIO region, and fixes up the driver to use them. RCU usage in logical PIO code looks to always have been broken, so that is fixed also. This is not a major fix as the list which RCU protects is very rarely modified. There is another patch to simplify logical PIO registration, made possible by the fixes. At this point, there are still separate ongoing discussions about how to stop the logical PIO and PCI host bridge code leaking ranges, as in [2]. Hopefully this series can go through the arm soc tree and the maintainers have no issue with that. I'm talking specifically about the logical PIO code, which went through PCI tree on only previous upstreaming. Cc. linux-pci@vger.kernel.org [1] https://lore.kernel.org/lkml/1560770148-57960-1-git-send-email-john.garry@huawei.com/ [2] https://lore.kernel.org/lkml/4b24fd36-e716-7c5e-31cc-13da727802e7@huawei.com/ John Garry (5): lib: logic_pio: Fix RCU usage lib: logic_pio: Add logic_pio_unregister_range() bus: hisi_lpc: Unregister logical PIO range to avoid potential use-after-free bus: hisi_lpc: Add .remove method to avoid driver unbind crash lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration drivers/bus/hisi_lpc.c | 43 ++++++++++++++++++--- include/linux/logic_pio.h | 1 + lib/logic_pio.c | 78 ++++++++++++++++++++++++++++----------- 3 files changed, 95 insertions(+), 27 deletions(-) -- 2.17.1