From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 725D6C5ACAE for ; Thu, 12 Sep 2019 08:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 499EB208E4 for ; Thu, 12 Sep 2019 08:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730232AbfILIfd (ORCPT ); Thu, 12 Sep 2019 04:35:33 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:45693 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725940AbfILIfd (ORCPT ); Thu, 12 Sep 2019 04:35:33 -0400 X-UUID: 3dac9119a87e4e8da46e61abb8454e60-20190912 X-UUID: 3dac9119a87e4e8da46e61abb8454e60-20190912 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1103634065; Thu, 12 Sep 2019 16:35:30 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 12 Sep 2019 16:35:28 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 12 Sep 2019 16:35:28 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , Stanley Chu Subject: [PATCH v2] fixup null q->dev checking in both block and scsi layer Date: Thu, 12 Sep 2019 16:35:26 +0800 Message-ID: <1568277328-4597-1-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Some devices may skip blk_pm_runtime_init() and have null pointer in its request_queue->dev. For example, SCSI devices of UFS Well-Known LUNs. Currently the null pointer is checked by the user of blk_set_runtime_active(), i.e., scsi_dev_type_resume(). It is better to check it by blk_set_runtime_active() itself instead of by its users. v1 => v2: - Change if style in blk_set_runtime_active() (Jens) Stanley Chu (2): block: bypass blk_set_runtime_active for uninitialized q->dev scsi: core: remove dummy q->dev check block/blk-pm.c | 12 +++++++----- drivers/scsi/scsi_pm.c | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) -- 2.18.0