Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4995786iob; Mon, 9 May 2022 06:33:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOpUcRBbIX2upcuiFAXdu45xOcoeBR/lUY6x2k6GBsvmGbeJ1dKPnbOK12d1T2yo1p+uwa X-Received: by 2002:a17:90a:cf89:b0:1d7:7055:f49c with SMTP id i9-20020a17090acf8900b001d77055f49cmr18708210pju.12.1652103211663; Mon, 09 May 2022 06:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652103211; cv=none; d=google.com; s=arc-20160816; b=ESIua6gSDLa/0AtaH2lYhT//Wv7rTAPeCZMkRBq0UBsrVvEZ+53odmT34NeaUoSJ0Y 4HV92PVJNgyh2OkETZoah0lfLQskllV5fnmHeGCuHNxTeYz0SOQVBgJ0wLyV2D/qT+Dz fKiuhSzCBZRvEXPie9FUWoP8QgNOFsj1VvQeiHdGyeyhNSupA0tOZ2+1Gjlk8aHzug9s g3Ii6PXiqGwhD37UL2S1Z/YMKOJfXTVOoW/bIR8pbqf3BLfUGtndBBfBEmui0Ro6ZfLv BaN5iVltqflT4f05EAyV8S+e8leOVe5tB9BaNWv4KeIv1QBvyhfJ4J/VEyAElPekH86y jAcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=HtoNB9b8qAI6phDM9MY0FWngDy3WU/NlhF6WY/stdrM=; b=g7TjeWiW1M/RwWD9Rt1Zn+XgXo7FLsZ5IQof5/SwbIUX6aJpUgMwGlJPSRNZAqRft3 DXj8HJx7NeIaWMaiHot/Wp2IvosM8LX/Y4GmR7JrueM1W7UdHERdvOmxR/hREKA7HCTQ 4618vA65w4XUyBfy6dbaf8qCo7qY1R5la0jrFvglzk6tuPsBtQ77d1Fq7kmxeuY1BqeL +oZQOdymQ4hPZn9vJdJ2R/W+msfhhJaMdOmUj8COq/TBG65h47uvQF0NuhycZnMZKABY EmHsQ9RSCY1EaG5fZQ/69f0uZk/SO0rN7E9+ngLZQoosEeEah20YkUYAspVkNYySeBSz LhsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YN4LMFpv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n13-20020a17090a2fcd00b001cd57ed2fa8si13280672pjm.39.2022.05.09.06.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 06:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YN4LMFpv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E89F71BA8DB; Mon, 9 May 2022 06:22:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235899AbiEINZk (ORCPT + 99 others); Mon, 9 May 2022 09:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235709AbiEINY7 (ORCPT ); Mon, 9 May 2022 09:24:59 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47C4E2CDD5 for ; Mon, 9 May 2022 06:20:51 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id kq17so26789759ejb.4 for ; Mon, 09 May 2022 06:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=HtoNB9b8qAI6phDM9MY0FWngDy3WU/NlhF6WY/stdrM=; b=YN4LMFpv9qxijIDo4TPAPru3w9yn9J1ojjAMfhc6QOzXRbFaR/WHwxl9ZbU+rCRbSB 8nHxgw5Y98u5B8TQk1kwuQOOJJskwwcihjFCt6X9SnvcnJyISTqgkpdkpsy+ruAaQDcv nR281RVGw3lVkjT8M1g+m3W61RT1yibKFqLr2NwYQpS7gdOP39bkf8dVGcWQsFSJWNKX b/i3FkIN02ZblJPP/MpCziaoUzDrv+z4B9uIFF9srg/4A3DB/3T5qmUTSwhz4ii05izS DPOlLqILZjzP+sr9ldiG+UCQT/IwdF3ULGI49D0WVbhyXOjiO8XCLBeXfIpBrfUexP/w tK+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=HtoNB9b8qAI6phDM9MY0FWngDy3WU/NlhF6WY/stdrM=; b=TG0rfhgJ4IEPpm+Xt/J3z+OhNXqLa672GSasfkiKdhC0u/D0vexKNQbc8gK1iCnNxE 783Cb8xvIe+HzVMvra4Da8CJCoMdI7nckIaohXvAs60yAO5gda9acQ/t06AU2WyT01rh gN7RNGmA+hRmm+PBh0Iv0LqMvEdjglxOmVHxIxZASKYIiDq8XKiIaUK+61ysFJGps45q 0jkJKDCiItsPIChupIhdA1uLQ76bJ8/ojMiY4orOVj0TRe5IKowETfAZ1RSTn1Q/vwta zIUu+PWvckASTcDxPvA4smpQRwwSDih4IyeoSbjKBM0itZQQWE8Wzu1dIP0s537BL8UD k+tA== X-Gm-Message-State: AOAM532n2pCna0b7ydCZJHlTI8rIZqkB2MQXLq5jInWKl1Am21c4JNUK XpGNZSINQDZ8zLBP+PXPaD44lA== X-Received: by 2002:a17:906:9c83:b0:6df:839a:a6d0 with SMTP id fj3-20020a1709069c8300b006df839aa6d0mr14599010ejc.419.1652102449791; Mon, 09 May 2022 06:20:49 -0700 (PDT) Received: from [192.168.0.246] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id em10-20020a170907288a00b006f3ef214e6dsm4980564ejc.211.2022.05.09.06.20.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 May 2022 06:20:49 -0700 (PDT) Message-ID: Date: Mon, 9 May 2022 15:20:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 1/4] scsi: core: constify pointer to scsi_host_template Content-Language: en-US To: John Garry , Christoph Hellwig Cc: "Ewan D. Milne" , "James E.J. Bottomley" , "Martin K. Petersen" , Alim Akhtar , Avri Altman , Doug Gilbert , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, james.smart@broadcom.com References: <20220408103027.311624-1-krzysztof.kozlowski@linaro.org> <2a88a992-641a-b3ff-fe39-7a61fff87cb6@huawei.com> <4c3be5b6-50ef-9e9a-6cee-9642df943342@linaro.org> <7b3885e3-dbae-ff0b-21dc-c28d635d950b@huawei.com> <24bfb681-faec-3567-3089-9cd5ee182710@linaro.org> <1bb53912-c5c3-7690-e82f-cf356ca87404@huawei.com> <6f28acde-2177-0bc7-b06d-c704153489c0@linaro.org> <4510c5dc-3d7d-fc5f-cb80-34da7dbaaa8e@huawei.com> From: Krzysztof Kozlowski In-Reply-To: <4510c5dc-3d7d-fc5f-cb80-34da7dbaaa8e@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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 On 09/05/2022 13:28, John Garry wrote: > > For some reason I cannot fetch your git due to "error: RPC failed ..." > which I think is a timeout. I seem to have this problem recently > whenever a linux.git clone has branches based on linux-next.git . Maybe > a git config issue for me... Just to be sure - the link was not a git remote, but direct link for a web browser. The repo is: https://github.com/krzk/linux.git branch: n/qcom-ufs-opp-cleanups-v2 >> However this does not solve the problem. The SHT has "module" which gets >> incremented/decremented. Exactly like in case of other drivers >> (driver->owner). > > Ah, I missed that this could be a problem. So we have this member to > stop the SCSI host driver being removed when we have disks mounted, etc. > > But isn't scsi_host_template.module just a pointer to the local driver > module data (and that data gets incremented/decremented)? I am looking > at the THIS_MODULE definition in export.h: Yes, it is just a pointer, just like 'struct device_driver.owner' is. > > extern stuct module __this_module; > #define THIS_MODULE(&__this_module) > > However I do see scsi_device_dev_release(), which does: > > sdp->host->hostt->module = NULL > > I am not sure how necessary that really is. I would need to check further. > > Did you see if there other places which set hostt->module dynamically? I think all SHT set it statically. Then it is being dynamically incremented when needed and in scsi_device_dev_release() is being nullified (as you mentioned above). I guess this SHT->module is actually duplicating what most of drivers (e.g. PCI, platform, USB) are doing. If I understand correctly, the Scsi_Host is instantiated by the probe of a driver (pci_driver, virtio_driver etc), therefore the SHT->module could be simply stored in Scsi_Host. >> >> I started moving the SHT->module to a new field scsi_host->owner and >> trying to use the parent's driver (so PCI, USB) owner. >> I am not sure if it is correct approach, so before implementing such big >> change affecting multiple subsystems (USB, ATA, SCSI) - can you share >> ideas/opinion? >> >> The Work-in-Progress looks like this (last commit): >> https://github.com/krzk/linux/commit/17609caecd53df20f631703ea084a70e7735b5d7 Best regards, Krzysztof