From patchwork Thu Jun 9 16:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 9167405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 505466048F for ; Thu, 9 Jun 2016 16:26:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40E2528342 for ; Thu, 9 Jun 2016 16:26:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3190428356; Thu, 9 Jun 2016 16:26:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B850A28342 for ; Thu, 9 Jun 2016 16:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752850AbcFIQ0M (ORCPT ); Thu, 9 Jun 2016 12:26:12 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.218]:20109 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932523AbcFIQ0J (ORCPT ); Thu, 9 Jun 2016 12:26:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1465489565; l=1147; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From; bh=Xr38RS6gsxbtufynjRqkH4Ioy02zNA7ETyKo0zQKP74=; b=PIQo/cAXHRNR+aiCrRBI3Rl2KqMUlK6WawKLlOI9Z5ZQsPLtiQg6lnQvpjFe8ypoq1E MKNfb4S8R8lYHnbtlF+BhpPujyw28xFV0tct183mdGdnRE8CqTLpKbJAv0Va+sBeM2AG9 XuAAWygYte/9sbvIo3LjEEHQNUJuYuAq/jY= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWtrWFmrD4pjkQ2b4qvS X-RZG-CLASS-ID: mo00 Received: from aepfle.de (charybdis-ext.suse.de [195.135.221.2]) by post.strato.de (RZmta 38.2 AUTH) with ESMTPA id Z0bf74s59GQ4Gcv; Thu, 9 Jun 2016 18:26:04 +0200 (CEST) From: Olaf Hering To: "K. Y. Srinivasan" , Haiyang Zhang , "James E.J. Bottomley" , "Martin K. Petersen" Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Olaf Hering Subject: [PATCH v3] storvsc: use small sg_tablesize on x86 Date: Thu, 9 Jun 2016 18:25:53 +0200 Message-Id: <20160609162553.10290-1-olaf@aepfle.de> X-Mailer: git-send-email 2.8.3 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reducing the sg_tablesize allows booting of 32bit kernels in VMs, after commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set the tablesize based on the information given by the host") [ 5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> 0x20 Signed-off-by: Olaf Hering --- As requested, use CONFIG_. For some reason IS_ENABLED(64_BIT) does not work. drivers/scsi/storvsc_drv.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 3ddcabb..ae42324 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1673,11 +1673,15 @@ static int storvsc_probe(struct hv_device *device, /* max cmd length */ host->max_cmd_len = STORVSC_MAX_CMD_LEN; +#ifdef CONFIG_64BIT /* * set the table size based on the info we got * from the host. */ host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT); +#else + host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT; +#endif /* Register the HBA and start the scsi bus scan */ ret = scsi_add_host(host, &device->device);