# Recompiled kernel -> nvidia and usb-storage messed up

## Natureshadow

Hi folks,

yesterday, I re-compiled my kernel to add a module I had disabled before. To make sure nothing else was changed in the config, I copied the current config back to the source tree before running menuconfig:

```
(in /usr/src/linux) zcat /proc/config.gz >.config
```

I then added the kernel option and recompiled:

```
make menuconfig

make && make modules_install

mount /boot

cp arch/x86_64/boot/bzImage /boot/vmlinuz

cp System.map /boot
```

I rebooted and recompiled modules from portage:

```
module-rebuild rebuild
```

Unfortunately, the nvidia diver stopped working. When X starts, all I get is a black screen. No relevant output in dmesg or in teh X server log. Works good with the nv driver.

Furthermore, I cannot use SD cards anymore. USB sticks and USB harddisks work fine, but no SD cards. Compact Flash cards also work. Dmesg output when inserting the card:

```
usb 6-3: new high speed USB device using ehci_hcd and address 4

usb 6-3: configuration #1 chosen from 1 choice

scsi3 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 4

usb-storage: waiting for device to settle before scanning

scsi 3:0:0:0: Direct-Access     Multi    Flash Reader     1.00 PQ: 0 ANSI: 0

sd 3:0:0:0: [sdb] Attached SCSI removable disk

sd 3:0:0:0: Attached scsi generic sg2 type 0

usb-storage: device scan complete
```

The device is recognized and SCSI takes action in creating the /dev/sdb device node. But the partition table is never read and /dev/sdb is not readable (no media found). With another card, dmesg complains that the partition table is unknown. Both cards have a standard DOS partition table and work in any other device.

Find my kernel config at http://nopaste.com/p/auKKfde6w .

Cheers and thanks in advance,

Nik

P.S.: The symlink /usr/src/linux is correctly set to /usr/src/linux-$(uname -r) of course  :Wink: 

----------

## pappy_mcfae

Before I analyze your .config, also please post the results of lspci -n and cat /proc/cpuinfo as well as your /etc/fstab file. 

Also, there is no need to run module-rebuild rebuild. Running make && make modules_install gets the job done. You might want to emerge nvidia-drivers again.

Blessed be!

Pappy

----------

## Natureshadow

 *pappy_mcfae wrote:*   

> Also, there is no need to run module-rebuild rebuild. Running make && make modules_install gets the job done. You might want to emerge nvidia-drivers again.

 

module-rebuild has nothing to do with the kernel tree. It automatically rebuilds modules from portage, like nvidia-drivers. There is good need to run it, if you are not keen in re-emerging several modules from portage by hand.

I will post the requested output later in, although I cannot see what the CPU specs have to do with SCSI problems ...

Cheers,

Nik

----------

## pappy_mcfae

Frankly, I see no advantage in using module-rebuild rebuild, except that perhaps it saves you one or two keystrokes over emerge nvidia-drivers. 

Blessed be!

Pappy

----------

## Natureshadow

1. It will re-emerge the exact same version I am currently using automatically

2. It is a lot shorter than

```
emerge =media-video/linux-uvc-0.1.0_pre250 =app-emulation/virtualbox-modules-1.6.6 =x11-drivers/nvidia-drivers-180.29
```

Anyway, I guess this was not my question.

lspci: http://dpaste.com/43282/

lspci -n: http://dpaste.com/43283/

/proc/cpuinfo: http://dpaste.com/43284/

-nik

----------

## pappy_mcfae

I see no evidence of an SD device on your system. If it's driven by the USB, then your problem is USB drivers work better compiled into the kernel. As modules, they will shut themselves off and cause other issues.

I do see; however, a not-so-well-setup kernel .config. If you want to be able to read DOS partitions, or VFAT, once again, compile it into the kernel. That setting shouldn't be messed with...at all, for any reason, and you have. If you want speed, turn off Group Scheduling and anything that pertains to it. It does nothing but slow systems down...for no good reason. You don't have an AHCI device. You should not mix ATA/ATAPI/MFM/RLL drivers and the libata drivers. That's an invitation to all kinds of problems. 

I hesitate to work with your kernel. I don't support initrd. If need be, I can do a basic setup, and leave the rest to you. It's your choice.

Blessed be!

Pappy

----------

## Natureshadow

Hi,

I am not so sure whether I am maybe mistaken about the support qulities in the Gentoo community as up to now, only questions that I never asked and are not relevant have been covered.

The device is only listed when a card is in the slot. And it worked with the exact same config until two days ago. I can read CF cards, USB sticks, external harddrives, all with VFAT filesystems on them. My USB works great.

This is not at all the first Gentoo box I set up. Maybe the kernel configuration is not perfect, but I never expected it to be. If you don't want to work with it, then don't.

I'm not reluctant to care about any useful hints, but please could we first solve this issue before we go into detail concerning other things?

Cheers,

Nik

----------

## pappy_mcfae

1) I took a look.

2) I am not getting paid for this.

3) I am not honor-bound to do any more than what I have done.

You are the one that made such a complex kernel. If it has bugs, that's not my fault. I ran down a list of failings. Have you fixed any of them? Probably not. Have you downloaded and looked at one of my seeds? Probably not. Neither of these things are my fault.

I do not support initrd, period. I have made that clear to many others. You run with initrd. I won't directly support that. Understand?

My apologies that you didn't feel I did enough for your liking. Life is like that sometimes.

Please note: Willingness to help is INVERSELY PROPORTIONAL to helpee attitude.

Blessed be!

Pappy

----------

## Natureshadow

OK, this is becoming stranger every day.

I now booted the old kernel in which SD cards definitely worked, and it doesn't work anymore either.

This is not a filesystem problem, in any case ...

-nik

----------

## Natureshadow

For another SD card, dmesg says:

```
usb 3-3: new high speed USB device using ehci_hcd and address 5

usb 3-3: configuration #1 chosen from 1 choice

scsi5 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 5

usb-storage: waiting for device to settle before scanning

scsi 5:0:0:0: Direct-Access     Multi    Flash Reader     1.00 PQ: 0 ANSI: 0

sd 5:0:0:0: [sdc] 3920896 512-byte hardware sectors (2007 MB)

sd 5:0:0:0: [sdc] Write Protect is off

sd 5:0:0:0: [sdc] Mode Sense: 03 00 00 00

sd 5:0:0:0: [sdc] Assuming drive cache: write through

sd 5:0:0:0: [sdc] 3920896 512-byte hardware sectors (2007 MB)

sd 5:0:0:0: [sdc] Write Protect is off

sd 5:0:0:0: [sdc] Mode Sense: 03 00 00 00

sd 5:0:0:0: [sdc] Assuming drive cache: write through

 sdc: unknown partition table

sd 5:0:0:0: [sdc] Attached SCSI removable disk

sd 5:0:0:0: Attached scsi generic sg3 type 0

usb-storage: device scan complete

```

I ran fdisk on it and it also complained about the partition table. I verified on other machines that it is valid, but still re-created it in fdisk. The problem still resides.

For some strange reason, the card's MBR ends with 88 55 instead of AA 55 (which would be the correct magic bytes for a valid MBR);

```
# dd if=/dev/sdc of=/root/parts bs=512 count=1

# hexdump /root/parts

0000000 0000 0000 0000 0000 0000 0000 0000 0000

*

00001b0 0000 0000 0000 0000 0000 0000 0000 0400

00001c0 0004 1c04 ccdc 00dd 0000 d101 0019 0000

00001d0 0000 0000 0000 0000 0000 0000 0000 0000

*

00001f0 0000 0000 0000 0000 0000 0000 0000 8855

0000200

```

I think there is something goging wrong in low-level SCSI when reading the card.

I jsut reconfigured linux 2.6.29 from scratch and booted it, same issues.

I thought of a hardware defect but several card readers produce the same results.

I might have been a bit shitty concerning pappy_mcfae, but in any case this is not related to anything he proposed (or at least I don't see how it can be related).

-nik

----------

## DirtyHairy

You might want to try booting up some other distros live CD (Ubuntu, Knoppix, anything) and see if it works there. If it doesn't I'd suspect a hardware issue either with your reader (but as you say, if different readers produce the same result, this is ruled out) or with your SD cards. If it does, I would suspect some misconfiguration, and you could try taking this other distros kernel config and see if you can nail down the problem.

----------

