Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4529843pxb; Tue, 25 Jan 2022 12:23:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAoB8zDGrtvRWgxrFbAgik+jz/Hw+6sjtoIeU6+uqDhX/3+Cs9f6FKb7hKiBhK60JwjFeL X-Received: by 2002:a17:902:9001:b0:149:f2ae:6491 with SMTP id a1-20020a170902900100b00149f2ae6491mr20451500plp.39.1643142179951; Tue, 25 Jan 2022 12:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643142179; cv=none; d=google.com; s=arc-20160816; b=mdRJ+716zFquB41vmb3TDQok7zC4ry+HAIHNSCbbJhjF1hXG/0n1lquvHqthkyXW6r ItCf1Ogk1tWFcvKAKIdTVxrLPz8+1G2e5uZDBnCbcCBUmXcNZV5uOir34HLRkxOFyQdZ Fb6K4a0wurtKOkzlmx1h3jfVtG2SwRRQSkY/FUrpwncIvgoL1LJjxbWirg9ZL3BHLWco RVAbbuKg/Db+KTbZG4mV6K9+znTZA6rtkdFvvdJ3SaV8P7sbXcsvV94WKRShmLbIwF4g q/i78eFQLVRZd3gbttY1FolZndgLssCjIs1rHCxjEYwtdpBdYE37y+9NJEYdLCRyFTp2 Uz/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=wweNqklN3Pljqz85ppU/sMbq8RxZXuqQKe62a6VzW1c=; b=iwBUqjJqfzINe6NzL9bpejk+6fdY8rOuSb6aZNu+uCg7zBf1dsdmxYxCEoz1zNDjrA MYfazO/0O59uUi8wrPqfFEuO18XmPwLYteu7pPuEn2a/7GJdznAydI1jt78HQ/4IgYPM O8dle9D0gN8mUS4Tfu+6KPFxg3HFErx4szXcxung26ksYqkIxuWDm7bAkMgIpA/r+XLw 2Tgz/zzqq9O+IC535i0glkLZOlPnkTbNhjXDLwjBj+Ojwy+C9EAGUjaehiJOF7VYjotG ZaXimjq/9RChR2EcVHPW+JjkK6Wys6zKYFLNrnToczYLfOMj+3xFJrD4BR72STyArVl9 OKVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si13885122pla.559.2022.01.25.12.22.48; Tue, 25 Jan 2022 12:22:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580098AbiAYOmO (ORCPT + 99 others); Tue, 25 Jan 2022 09:42:14 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4512 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237434AbiAYOjf (ORCPT ); Tue, 25 Jan 2022 09:39:35 -0500 Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JjqBh2kN6z689Mf; Tue, 25 Jan 2022 22:35:08 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 15:39:24 +0100 Received: from [10.47.95.36] (10.47.95.36) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 14:39:23 +0000 Subject: Re: [PATCH 05/16] scsi: libsas: Add struct sas_tmf_task To: Matthew Wilcox CC: , , , , , , , , , , , , , References: <1643110372-85470-1-git-send-email-john.garry@huawei.com> <1643110372-85470-6-git-send-email-john.garry@huawei.com> <6b31b15c-98d9-ee07-0092-cbcc5f5c71fe@huawei.com> From: John Garry Message-ID: <87dc535f-609f-040a-5c47-5b6bb5b17b59@huawei.com> Date: Tue, 25 Jan 2022 14:38:51 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.95.36] X-ClientProxiedBy: lhreml744-chm.china.huawei.com (10.201.108.194) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/01/2022 14:15, Matthew Wilcox wrote: >> Sure, but the pm8001 HW does has a 32b field, which is strange as the SAS >> spec defines a 16b field in the task management Function information unit >> "tag of task to be managed" field. > My point is that it's only safe because the pm8001 driver already limits > it to smaller than u16. > Seeing language like "should be enough" made > me think you'd just assumed that it would be. I can update that wording to be confident that u16 is enough. > Seeing a line like: > u32 tag = 0xdeadbeef, rc = 0, n_elem = 0; > made me think it might not be; perhaps 0xdeadbeef was being used as > a flag value somewhere in the driver. > > For example ... > > drivers/scsi/pm8001/pm8001_hwi.c: int rc, tag = 0xdeadbeef; > drivers/scsi/pm8001/pm8001_sas.c: u32 tag = 0xdeadbeef, rc = 0, n_elem = 0; > drivers/scsi/pm8001/pm8001_sas.c: u32 tag = 0xdeadbeef; > drivers/scsi/pm8001/pm80xx_hwi.c: if (ibutton0 == 0xdeadbeef && ibutton1 == 0xdeadbeef) { > drivers/scsi/pm8001/pm80xx_hwi.c: int rc, tag = 0xdeadbeef; > > That doesn't seem to be the case though; as far as I can tell the > tag value is never checked against 0xdeadbeef. > . Right, 0xdeadbeef is initially assigned just as a safety measure. Thanks, John