From patchwork Thu Jun 20 10:31:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 167318 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp1665043ock; Thu, 20 Jun 2019 03:33:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw93a7iZe5B0oiTqCNEF4UU1oEoyZm+S0Q5JtYKxX6LfvlQ5UALRfKiBAZ1IVhvJkWQFDsO X-Received: by 2002:a17:902:9a49:: with SMTP id x9mr104451238plv.282.1561026826518; Thu, 20 Jun 2019 03:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561026826; cv=none; d=google.com; s=arc-20160816; b=yCbLYqERwj1eLGJNn+k+hkr8ZXwDuZg9OQi3yKBDO/gIO/PyP/Px7mBMSfswaO/UZ8 H1WUhqfXCvems3xn75YBggfKtmOtnT1gw2Yo9EpGbj12yA7OeKssjpj+MNDCCDcDGHjW eG2C0/qtPSxeX3JHfmnCc8j01rrIIKJTp4KaHD5875x1yc5Po4JQKpkKs8ZHtWUrTTR6 kLQXIX3Xgyyxaaa1HgezB7vO5XsQCQH3f1F8+pCJUHBi9R6JtFgSwfYeULSAbU4QsyWJ M5zBHqxt+M21chew68KEVb7f8IRMff32McQo0+NXYdsMW0dCHgUr7XfehFLfeRfQs25W wNSg== 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 y10si5534489pgq.173.2019.06.20.03.33.46; Thu, 20 Jun 2019 03:33:46 -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 S1731591AbfFTKdo (ORCPT + 30 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 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