From patchwork Wed Nov 23 14:41:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 2121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2834141wrr; Wed, 23 Nov 2022 06:48:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6NjZEk3VPGqPKfIuB4fIWZjsdKz0pynRhmFpdFp4QSRCDwo+FOXzThpSrnhVB6zNUkV5lm X-Received: by 2002:a17:902:7087:b0:189:4de4:e71b with SMTP id z7-20020a170902708700b001894de4e71bmr1741472plk.159.1669214916316; Wed, 23 Nov 2022 06:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669214916; cv=none; d=google.com; s=arc-20160816; b=is6nG7MazHqmnLEOvfRhM8C2UD3uT9ag0RFLHZQ+ja38cxevPEjNNQw3DmWhBcRxdd Q7C+5ImqBiXZanOYQf5ywOCtthKuhkZQgYjXIcDU1P0KpdwpGXGUIUhzixrH1Doztx3V kvKw1dNmxRk34eK3GCawBDrnjkefr4URJO3CcB6JiDdZyjZ07AGdijjzkh0ma3Hum/zs BWWi709MjJnj+CVgeqdhrdqVENc1LUURdZrqEsG9eMlApQs5Cm8DMcRya6zKhh45nJKE bB3Gn1oGW6e0bmDG4mNrw7aQ4C9E1W6LNTBg9jso2SHmvtErefzmP8mhh02TyBtB2ybn UE/A== 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 :message-id:date:subject:cc:to:from; bh=YLrvW81FULiQ6NJDceqhvYd50Bb/osaXC/wEjrgFD0s=; b=ok+kmasjok3KObm0Gy+sYx6ZPI822j3sGj6hsdSj4fj/Lc0pZRUTiZfOCASe18T/B/ 1uAT3q+ysr6H5Nr60J9M7IhXBWq7WzPI+15npvqcRv95DRhtlu3Ct+jojOmed+DvQnbN lr9T9rNQHmmyo7r+nGVYZe1BOr4A2iY/O59J04MBnYofnDhpwy60QBHqS57pZRYQZEoj cdLYSxSAjVpFEtxmIsExZ/go1VQH3vG8akQWXAp+1wpgVkgTi/tglNPTE0NeMeZLgtv1 dumTrBkSAv2ZIPtewtxTCwoh6pp1ulghX1DKiHIyQv/4/u9BWyuRQmSdCvSEOvfM3j2h kWRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170902ed1100b00186c3aface9si16244690pld.179.2022.11.23.06.48.21; Wed, 23 Nov 2022 06:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238839AbiKWOl4 (ORCPT + 99 others); Wed, 23 Nov 2022 09:41:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238034AbiKWOli (ORCPT ); Wed, 23 Nov 2022 09:41:38 -0500 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 542EC5916F for ; Wed, 23 Nov 2022 06:41:33 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:881b:815b:474d:c3fd]) by albert.telenet-ops.be with bizsmtp id nqhS2800949U0Rd06qhSTc; Wed, 23 Nov 2022 15:41:30 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oxqwH-001Rqf-F7; Wed, 23 Nov 2022 15:41:25 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oxqwH-0012HA-00; Wed, 23 Nov 2022 15:41:25 +0100 From: Geert Uytterhoeven To: Krzysztof Kozlowski , Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Mark Brown Cc: Philipp Zabel , Sergey Shtylyov , Wolfram Sang , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 0/6] memory: renesas-rpc-if: Rebind fixes and misc cleanups Date: Wed, 23 Nov 2022 15:41:16 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750298700125224901?= X-GMAIL-MSGID: =?utf-8?q?1750298700125224901?= Hi all, The Renesas RPC-IF provides either HyperFlash or SPI host access. To handle this, three drivers are used: 1. The RPC-IF core diver, 2. An HyperFlash child driver, 3. An SPI child driver. Currently this driver collection suffers from a sub-optimal division of roles and reponsibilities, leading to (un)bind issues: after manually unbinding the child driver, rebinding the child driver fails with -EBUSY. This patch series aims to fix this, by splitting off private data and making the RPC-IF core driver responsible for resource acquisition. After that, a few customary cleanups are provided. This has been tested on the Salvator-X(S) and Ebisu-4D (HyperFlash) and White-Hawk (QSPI FLASH) development boards. Changes compared to v1[1]: - Move the two fixes forward and add Fixes-tags to ease backporting, as requested by Krzysztof, - Add Acked-by, - Rebased cleanups, - Remove Runtime PM wrappers, - Drop patch to add system suspend/resume support to the RPC-IF core driver, as this is apparently not needed on R-Car M3-N and R-Car E3, nor fixes the issue on R-Car H3 ES2.0. I will reply to the original patch with my latest investigation results. Thanks for your comments! [1] [PATCH 0/7] memory: renesas-rpc-if: Rebind and s2ram fixes https://lore.kernel.org/r/cover.1656341824.git.geert+renesas@glider.be Geert Uytterhoeven (6): memory: renesas-rpc-if: Split-off private data from struct rpcif memory: renesas-rpc-if: Move resource acquisition to .probe() memory: renesas-rpc-if: Always use dev in rpcif_probe() memory: renesas-rpc-if: Improve Runtime PM handling memory: renesas-rpc-if: Pass device instead of rpcif to rpcif_*() memory: renesas-rpc-if: Remove Runtime PM wrappers drivers/memory/renesas-rpc-if.c | 152 ++++++++++++++++++++------------ drivers/mtd/hyperbus/rpc-if.c | 18 ++-- drivers/spi/spi-rpc-if.c | 14 +-- include/memory/renesas-rpc-if.h | 34 +------ 4 files changed, 118 insertions(+), 100 deletions(-) Reviewed-by: Krzysztof Kozlowski Acked-by: Wolfram Sang