Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2497221iof; Wed, 8 Jun 2022 06:15:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTf48pHzVvg5P4SkuVNwia2aXX5UrVyg34BkPaTDY3yR8XoDr9ZYZ7D8e9cIi7MauoObZy X-Received: by 2002:a17:90a:e68a:b0:1e3:252f:24e0 with SMTP id s10-20020a17090ae68a00b001e3252f24e0mr49212701pjy.122.1654694154990; Wed, 08 Jun 2022 06:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654694154; cv=none; d=google.com; s=arc-20160816; b=wsqkIKBS+g04xkJxayA7H9BnlYxX+5pUgXgfQK6YKxZTMPDjD2kGTbb6/PO7YKkrA7 NtYA1e5PnEUhFwkbqEnqWfCpwwY97XJIIOcN6mf52siovmg2dn/P9AJHFQb7YO+ldERF /2a1UuyEBLL7gfv1lj8nlr65aLFf8PUC02ZsnqQmXz36XYf9yUxKII6it9ln8q+kJ7l6 oOOKSWFKAil715tpIz/PbiGT/z6D3avVPaup65xZ4CrcPlfIQAhGyqQoMBpTuhCLzlt4 9yf77huvD8S1ai/Notyle2l0yXHHL+LIrNKEH4AjciAaSzDzSBTjNaupofiHgS5OgpoM AI8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Ly4PphYlHbTt2w07Bt1mEJ+CFdsurRW+zLnlwgb8Oe8=; b=fGCM/uRF2g8wQcEwlTdof8gzC4UJ/bERsjpxb89Xuweyn2nQo/VCMqd8EKCJg8/qg/ z2iWZcbSnm2ERz4HGiyqOFlOi71u3GKTug1IOe78Bi8jq1VIVunzNdA2SyWSzq6C7HH1 5M5FhMXBUB0gG3mONb3U+pt5sj6Y+n/R9Lp4udxq18jZo0QY/wD5dteUAaTcGmm2buci dLuEqm0MWcfP3hBqkO9ogcU1tbIB1CGndiKMJGpwKZiiBUemeBwROw0yk+6euAd7S6Ds SFF57JMH168O0aqlHT2j4z+FEB25Ec/gQ7alXP9GqghT8U1BRn+2eOVU1bLMmjTpVc8u r19w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=Xd6c2e+l; dkim=pass header.i=@tq-group.com header.s=key1 header.b=ktD4l9Wd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s17-20020a63ff51000000b003fadb07ee46si28939657pgk.442.2022.06.08.06.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 06:15:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=Xd6c2e+l; dkim=pass header.i=@tq-group.com header.s=key1 header.b=ktD4l9Wd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 062991E2265; Wed, 8 Jun 2022 05:50:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239739AbiFHMuA (ORCPT + 99 others); Wed, 8 Jun 2022 08:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239637AbiFHMto (ORCPT ); Wed, 8 Jun 2022 08:49:44 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 236921952C0; Wed, 8 Jun 2022 05:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1654692582; x=1686228582; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ly4PphYlHbTt2w07Bt1mEJ+CFdsurRW+zLnlwgb8Oe8=; b=Xd6c2e+ldjpfxt94VsSsrRBnIJJSK+hPfbfqip+1xRRgAKcSQgYXXo8E LSY1Oyft9Xhqp+eHznK3pcZkD5LeIpKG69a/VY4T2CElsHZIbzXjNoTeJ +H9+zfzi3e6R6NwkIJF2qlHZMYpxXC4SnhPKuNZOLGvnC59D9/uAFdG9X MT4K2Tb6gqsPycCMVPqdO4HkZMld/gR/+EmgM3IfKn6peYHZWzFjb/Z+m VMBUlEYZesbXU4HyCKYvujS5XYN4AwbwUhMzNEdI1FSTOk5fUidg7Jzub QPELgiU0Nb6Ad14lySZYI4OF1k8hlmwcLaAKhXwsQcc2eAtxtr3QLvmcW w==; X-IronPort-AV: E=Sophos;i="5.91,286,1647298800"; d="scan'208";a="24330544" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 08 Jun 2022 14:49:31 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 08 Jun 2022 14:49:31 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 08 Jun 2022 14:49:31 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1654692571; x=1686228571; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ly4PphYlHbTt2w07Bt1mEJ+CFdsurRW+zLnlwgb8Oe8=; b=ktD4l9WdveK5/JV0Hz7cHud6JBkCdAjGN6JUSzuzKnKODoV57+VIvxxz dajtPVcIgDMFNFyYgJU10OE6rJ6rN1jD2/wMzal4xKH4BCN308S04ir8E qvvY2eWG2fi+ZdnqwUUAvnmZa6lM5jFERDfEuzP5yMOA3uHx9wnQDH0yZ QmntPwlJl0D/Wi1dm8ThK1ka77r00SLUK3FAB7Ex3YhcgXp/8QWN7tt2O PdyUy38vUok/ckv6v7p5DNA5Mc/YzkjsIq4eK/980rkGNykkYptPAG20M vqVsFYbinY+TlbROYHJsuwUio5sUCHQoSLlNMn494wAkVF4+2uNNl+9bc Q==; X-IronPort-AV: E=Sophos;i="5.91,286,1647298800"; d="scan'208";a="24330543" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 08 Jun 2022 14:49:31 +0200 Received: from localhost.localdomain (SCHIFFERM-M2.tq-net.de [10.121.49.136]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 69ADE280056; Wed, 8 Jun 2022 14:49:31 +0200 (CEST) From: Matthias Schiffer To: Dmitry Torokhov Cc: Lyude Paul , "Jason A. Donenfeld" , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH 5/9] Input: synaptics-rmi4 - reset after writing partition table Date: Wed, 8 Jun 2022 14:48:04 +0200 Message-Id: <20220608124808.51402-6-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220608124808.51402-1-matthias.schiffer@ew.tq-group.com> References: <20220608124808.51402-1-matthias.schiffer@ew.tq-group.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When recovering from a bad partition table (for example after an interrupted update), a reset is necessary for the new partition table to become effective. Without this reset, writing the core code partition will fail with status 0x03 (Invalid Command). Signed-off-by: Matthias Schiffer --- drivers/input/rmi4/rmi_f34v7.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/rmi4/rmi_f34v7.c b/drivers/input/rmi4/rmi_f34v7.c index 19b94b1c1a33..9b78f98bb21c 100644 --- a/drivers/input/rmi4/rmi_f34v7.c +++ b/drivers/input/rmi4/rmi_f34v7.c @@ -1146,6 +1146,14 @@ int rmi_f34v7_do_reflash(struct f34_data *f34, const struct firmware *fw) goto fail; dev_info(&f34->fn->dev, "%s: Partition table programmed\n", __func__); + /* + * Reset to reload partition table - as the previous firmware has been + * erased, we remain in bootloader mode. + */ + ret = rmi_scan_pdt(f34->fn->rmi_dev, NULL, rmi_initial_reset); + if (ret < 0) + dev_warn(&f34->fn->dev, "RMI reset failed!\n"); + dev_info(&f34->fn->dev, "Writing firmware (%d bytes)...\n", f34->v7.img.ui_firmware.size); -- 2.25.1