From patchwork Thu Jul 30 01:45:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 11692159 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 418CF6C1 for ; Thu, 30 Jul 2020 01:48:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 194C42082E for ; Thu, 30 Jul 2020 01:48:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uy71FgtP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h2UPIKAr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 194C42082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Fwcu+osMTdrzbR/kfoHEb8H6H6NBMIb8HvY0BLg5fdA=; b=uy71FgtPbFPjgqPwiOsQbHVYyS j+3t6SaV3g6kCMNGSPtGHGffC3GwBnXAXX+jXdWVwHIB6v58RXx6tLHjieS4UG352fUH6G1Z756kz c4n+zc+giw0VyoO8aaOfI6tPLOaUjlxbIssmlZJExJN5Y1glygmjlm59IRncFuMtsR7grF2yW5Y/o ae3AqtkjX+brQ68VAVGbn1q5Z58iy67XY9w9n/7fKex/IBsp4ubCLmuCi7BjVtZQUBbLOrs/lmTLK YXzX6VCHUED9ASDItykEY8LVmETQZURA/RF6ze/cSvreiPjty/o5nHH5ty8WHSFTojAvVbiJSpNqI Cc/3sdOQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0xdt-0002xU-JI; Thu, 30 Jul 2020 01:45:57 +0000 Received: from us-smtp-2.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0xdp-0002wr-6G for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2020 01:45:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596073551; 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; bh=rwN0eez4rZTAgwKgZV7X7J7rdUH4us8JUhLX6MHfHds=; b=h2UPIKArfK0WbCWzqet8+g3essYQcqE29MpQjh8PidV7vWs/FX7vJlxinG3mU5/qeqS1sF 8cKrchEhKuW89Si4KC+I1wOY8GTlw14mrSaB1EHpATe4Ua/rsDTY02LcAU2v0M7zNVOlN/ 1zu9mD5OF6kj9x8YCRrLzzdn4lTRky8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-QhW7QtbdPSq_25nFea-jzQ-1; Wed, 29 Jul 2020 21:45:50 -0400 X-MC-Unique: QhW7QtbdPSq_25nFea-jzQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A961258; Thu, 30 Jul 2020 01:45:48 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-54.bne.redhat.com [10.64.54.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A96660C84; Thu, 30 Jul 2020 01:45:45 +0000 (UTC) From: Gavin Shan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 00/15] Refactor SDEI client driver Date: Thu, 30 Jul 2020 11:45:15 +1000 Message-Id: <20200730014531.310465-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200729_214553_405447_CD2CA67B X-CRM114-Status: GOOD ( 14.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [207.211.31.81 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [207.211.31.81 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, james.morse@arm.com, shan.gavin@gmail.com, Jonathan.Cameron@huawei.com, will@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This series bases on 5.8-rc7 and refactors the SDEI client driver. It's the preparatory work of virtualizing SDEI afterwords. The series is organized as below: * PATCH[1-13] refactors and clean up the code. They shouldn't cause any functional changes. * PATCH[14-15] exposes "struct sdei_event", which will be dereferenced on virtualizing SDEI. After it's applied, the SDEI event is identified by the instance of "struct sdei_event" instead of event number. The series can be checked out from: git@github.com:gwshan/linux.git (branch: "sdei_client") Testing ======= I have the SDEI virtualization code implemented as part of KVM module. With that, the SDEI event can be registered/unregistered/enabled/disabled. Also, the SDEI event can be injected from host and the guest handler runs properly. The code can be found from: git@github.com:gwshan/linux.git (branch: "sdei") Changelog ========= v4: Rebase to last upstream kernel (Gavin) Use @event_el for SDEI internal event and use @event to cache SDEI event if needed (Jonathan) Rename @se to @event for APIs (Jonathan) v3: Rebase to 5.8.rc7 (Gavin) Pick rbs from Jonathan (Gavin) Correct spellings in commit logs (Jonathan) Rename "out" to "unlock" tag (Jonathan) Keep the empty line in sdei_event_unregister() (Jonathan) Drop tabs between type and field for struct sdei_crosscall_args (Jonathan) Use smp_call_func_t for @fn argument in CPU callbacks (Jonathan) Split struct sdei_event into struct sdei_{internal,}_event (Jonathan) Remove last two patches and get it reviewed later (Jonathan) v2: Rebase to 5.8.rc6 (Gavin) Improved changelog (James/Gavin) Split patches for easy review (Gavin) Drop changes to reorder variables (James) Drop unnecessary (@regs removal) cleanup in sdei_event_create() (James) Fix broken case for device-tree in sdei_init() (James) Gavin Shan (15): drivers/firmware/sdei: Remove sdei_is_err() drivers/firmware/sdei: Common block for failing path in sdei_event_create() drivers/firmware/sdei: Retrieve event number from event instance drivers/firmware/sdei: Avoid nested statements in sdei_init() drivers/firmware/sdei: Unregister driver on error in sdei_init() drivers/firmware/sdei: Remove duplicate check in sdei_get_conduit() drivers/firmware/sdei: Remove Drop redundant error message in sdei_probe() drivers/firmware/sdei: Remove while loop in sdei_event_register() drivers/firmware/sdei: Remove while loop in sdei_event_unregister() drivers/firmware/sdei: Cleanup on cross call function drivers/firmware/sdei: Introduce sdei_do_local_call() drivers/firmware/sdei: Remove _sdei_event_register() drivers/firmware/sdei: Remove _sdei_event_unregister() drivers/firmware/sdei: Expose struct sdei_event drivers/firmware/sdei: Identify event by struct sdei_event drivers/firmware/arm_sdei.c | 459 +++++++++++++++++------------------- include/linux/arm_sdei.h | 16 +- 2 files changed, 231 insertions(+), 244 deletions(-)