From patchwork Tue Aug 11 08:10:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1343200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BQlrN08hrz9sTR for ; Tue, 11 Aug 2020 18:10:28 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=QRuyFre7; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BQlrM3T3SzDqSR for ; Tue, 11 Aug 2020 18:10:27 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BQlrH2MQvzDqL5 for ; Tue, 11 Aug 2020 18:10:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=QRuyFre7; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BQlrF0gycz9sTN; Tue, 11 Aug 2020 18:10:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1597133421; bh=4FDUJOi6qRZhn2vYdHI/apR9nSE/TDO98TlQfuigapI=; h=From:To:Cc:Subject:Date:From; b=QRuyFre7hNwnYpIkTAAk9Wf+MwJx71uAfEV9DxLaB7yaiZ0+nKsDuKTRvD4tTmqYr r2tX5AltovUsx5yM6HCPRyHQT+suGbOvM0eEAFBeoA9RNETPrOTgN0Fy9N26PLVfbr gdHly+FbnFiX0+3RhkV8sgqMxSuGwkqL1mKH3DD+99S+431Y14glfKYobNNKNv9B8L yTjQH7VOPZKDo8vTPh64IND75PdDzXxWD4zslSsCzVs70mPEml0FnmhwX7rP0JFjh1 lh6ylgt2FMVPW9u4VAyYcCXjyXpJulnaAx8J38ydVJQutJKme3TIjklHDxXoiI0c5w dEiCPysT62qEA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Tue, 11 Aug 2020 18:10:07 +1000 Message-Id: <20200811081007.138447-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Pdbg] [PATCH] libpdbg: Drop target status check from fsi_(read|write) X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" FSI devices use fsi_(read|write) during probe, so the target status is not yet set and there is no way to reliably know if the access is from within the library or not. Signed-off-by: Amitay Isaacs --- libpdbg/target.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libpdbg/target.c b/libpdbg/target.c index 69f8b24..8a7d1a6 100644 --- a/libpdbg/target.c +++ b/libpdbg/target.c @@ -277,10 +277,6 @@ int fsi_read(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t *data) uint64_t addr64 = addr; fsi_dt = get_class_target_addr(fsi_dt, "fsi", &addr64); - - if (pdbg_target_status(fsi_dt) != PDBG_TARGET_ENABLED) - return -1; - fsi = target_to_fsi(fsi_dt); if (!fsi->read) { @@ -301,10 +297,6 @@ int fsi_write(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t data) uint64_t addr64 = addr; fsi_dt = get_class_target_addr(fsi_dt, "fsi", &addr64); - - if (pdbg_target_status(fsi_dt) != PDBG_TARGET_ENABLED) - return -1; - fsi = target_to_fsi(fsi_dt); if (!fsi->write) {