Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1187566imu; Wed, 16 Jan 2019 14:23:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN5XPYsHu9lnadq6XgYvAfS/Ab2zbuHo5N+8ahoexPCMAHUKskjENgTw3D/yDaYqt1O4DIWy X-Received: by 2002:a62:8d4f:: with SMTP id z76mr12493848pfd.2.1547677439635; Wed, 16 Jan 2019 14:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547677439; cv=none; d=google.com; s=arc-20160816; b=SmbdtuGqvfyp6u9146D/VWxuZ9LTZpnjWLK9EFxkoYcZhfIUGT4sEfadi1oCFaadsJ jwK/QOAKXHUf06f3gv0XjxQ7Hek1Fgdb7HbX4rJVivgfTLBYkBdbTvp6RHHBYjoNk3Ca hRrc4CLG6Xe4a58wQIsZOvTW4z1I7p8iTc2Ofw0hB+p/o9hizYkJ2y7qRQoD1R0Frqul 3ktOfMdnZDQpohEHROmILTpfhCWXx1xiawKPTR1hELEmp3MvUNNjcBIoguUNBMrC4KgW 9JkBoE10ubKS0uEK3HHND9HEzhqDGySS/4TV28/uLi+DnjDO+8Q7LJW3Flu6zHH5Q/ox moRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=S6I8uhahjJO+OPiisBWetCDPi8KDnphGA2NDM+a+nUg=; b=rUCdzZDCeH2TJSri173k8SYFX60JsNd6RW6yWJVNr+jMPDGdsa5p+Dv16O06Fa3+6z 7cceThNXQCebc87ELDaFNlHG03wP+8NjnYSIlE0bI5RMTgyUbtTwrbXVaN4SSd6EM9i/ zoU+gIcVKqgTu6Ki+Mtb9jwpmP3oOLSzCGrgeNYD0qa5oM49uw0bViINPCgPE6/Cxn5k NXdJ3xurU9IqzAOCm5GiHEo6KMprXGsXbT2Swltq5G5W7gHZ5FmCc7t4/b57XMr0lxAo rP8l7WhdVnHblvc01JxfD1JniUPcy5v/hjLlxl5jxVy+zZEObOKv3fVlUyNmK2UgHIEM g/Ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s62si7653266pgc.113.2019.01.16.14.23.44; Wed, 16 Jan 2019 14:23:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393736AbfAPOpB (ORCPT + 99 others); Wed, 16 Jan 2019 09:45:01 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:37990 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387478AbfAPOpB (ORCPT ); Wed, 16 Jan 2019 09:45:01 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D8051284502F73FCD192; Wed, 16 Jan 2019 22:44:56 +0800 (CST) Received: from [127.0.0.1] (10.202.226.43) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Wed, 16 Jan 2019 22:44:48 +0800 Subject: Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host() To: "Martin K. Petersen" References: <20190108205043.3122-1-logang@deltatee.com> <20190109184105.GB22070@lst.de> <8d96b40d-fc83-9218-9479-3de423594ddb@huawei.com> <0ffaf166-c7e5-b135-fdc5-bcac24148e62@huawei.com> CC: Christoph Hellwig , Logan Gunthorpe , , , , Intel SCU Linux support , Artur Paszkiewicz , "James E.J. Bottomley" , Jens Axboe , Jeff Moyer , chenxiang From: John Garry Message-ID: Date: Wed, 16 Jan 2019 14:44:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.43] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/01/2019 02:54, Martin K. Petersen wrote: > > Hi John, > Hi Martin, >>> So in this case I think that accessor functions are actually better >>> because they allow us to print a big fat warning when you twiddle >>> something you shouldn't post-initialization. So that's something I think >>> we could--and should--improve. >>> >> Sure, this is an alternative, but I would rather make it obvious when >> these parameters should be set so that this would not be required. > > I would like to have a mechanism in place that warns if you twiddle > things that break assumptions made at host registration time. Yes, something more robust would be good. That's not > a scenario the old registration interface was designed to handle. > > I am not sure I agree with your assertion that setting these masks in > the struct prior to scsi_add_host() makes this ordering requirement much > more obvious. It is not like you are passing in a list of parameters and > then receiving a separately instantiated immutable scsi_host object. You > are performing an operation on something you already have and own. > > That's why I commented that the current intersection between > compile-time static host template, dynamically discovered > pre-registration scsi_host parameters, and the registered runtime > scsi_host struct is somewhat messy. > > Btw. I have no attachment to the prot wrappers whatsoever. The reason > they exist is that the SCSI integrity support was optional. And > therefore we had stub functions so things could be compiled without any > of the integrity fields being present in the various SCSI structs. I never noticed stubs for setting/getting Scsi_host.prot_{capabilities,guard_type} So I > don't have any problem killing the wrappers except they may actually be > handy for regressions like this one where you could #error if the driver > writer violates the ordering requirement. > We set many Scsi_host parameters without such safeguarding, and I don't know what's special about these protection-related members. Thanks, John